From 1c7f737c46ba105d541bb76f172015700b8d9091 Mon Sep 17 00:00:00 2001 From: visor Date: Thu, 17 Jan 2013 22:59:20 +0900 Subject: [PATCH] BOOTSTRAPHACK in wiki attribute. --- wiki/wikiattrib.cc | 14 ++++++++------ wiki/wikiattrib.h | 3 ++- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/wiki/wikiattrib.cc b/wiki/wikiattrib.cc index b6621f4..b29a7a3 100644 --- a/wiki/wikiattrib.cc +++ b/wiki/wikiattrib.cc @@ -19,7 +19,7 @@ bool WikiAttrib1::readAttrib1 (WikiMotorObjVec* cell, bool& rc) { if (paramID (key, vval, ferr)) { } else if (paramClass (key, vval, ferr)) { #ifdef BOOTSTRAPHACK - } else if (paramDataPrefix (key, vval, dataprefix, ferr)) { + } else if (paramDataPrefix (key, vval, ferr)) { #endif } else if (paramOnClickCheck (key)) { if (! checkScript (vval, onclick, ferr)) { @@ -235,11 +235,12 @@ void WikiAttrib1::output (MotorOutput* out) { wiki->outputID (out, id); wiki->outputClass (out, classlist); #ifdef BOOTSTRAPHACK - std::pair::const_iterator b, e; +// std::pair::const_iterator b, e; + std::vector::const_iterator b, e; b = datapre.begin (); e = datapre.end (); for (; b < e; b ++) { - wiki->outputName (out, b.first, b.second); + wiki->outputName (out, (*b).first.c_str (), (*b).first.size (), (*b).second); } #endif wiki->outputSubmitScript (out, CharConst ("onclick"), onclick, scriptcut); @@ -393,10 +394,11 @@ bool WikiAttrib1::paramOnChangeCheck (const ustring& name) { #ifdef BOOTSTRAPHACK bool WikiAttrib1::paramDataPrefix (const ustring& key, WikiMotorObjVec& vval, bool& ferr) { - if (match (CharConst ("data-"), key) && checkWikiID (key)) { +// if (match (CharConst ("data-"), key) && checkWikiID (key)) { + if (matchHead (key, CharConst ("data-")) && checkWikiID (key)) { ustring value (vval.textOut (wiki)); if (checkWikiID (value)) { - datapre.push_back (std::pair (key, value)); + datapre.push_back (std::pair (key, value)); ferr = false; } else { wiki->errorMsg.append (key).append (uEq).append (value).append (CharConst (": bad value\n")); @@ -404,7 +406,7 @@ bool WikiAttrib1::paramDataPrefix (const ustring& key, WikiMotorObjVec& vval, b } return true; } else { - return flase; + return false; } } #endif diff --git a/wiki/wikiattrib.h b/wiki/wikiattrib.h index ee5ca26..677216c 100644 --- a/wiki/wikiattrib.h +++ b/wiki/wikiattrib.h @@ -41,7 +41,8 @@ class WikiAttrib1 { bool fdefault; /* no output */ ustring script; /* no output */ #ifdef BOOTSTRAPHACK - typedef std::pair datapre; + typedef std::pair datapre_t; + std::vector datapre; #endif WikiAttrib1 (WikiFormat* _wiki, uint32_t _selector, bool _scriptcut, mode_t _mode /*= M_NORMAL*/) { -- 2.11.0