bool ferr = false;
if (cell->size () == 0) {
- if (fwhole)
+// if (fwhole)
+ if (mode == M_ATTRIB || mode == M_ATTRIB_TEXT)
return true;
else
return false;
wiki->paramTargetBody (key, vval.textOut (wiki), target, ferr);
} else if (readAttribMore (key, vval, ferr)) {
} else {
- if (fwhole) {
+// if (fwhole) {
+ if (mode == M_ATTRIB) {
wiki->errorMsg.append (cell->dump ()).append (CharConst (": bad attribute.\n"));
rc = false;
}
} else if ((selector & SEL_SCRIPT2) && checkScript (*cell, script, ferr)) {
} else if (readAttribMore2 (key, *cell, ferr)) {
} else {
- if (fwhole) {
+// if (fwhole) {
+ if (mode == M_ATTRIB) {
wiki->errorMsg.append (cell->dump ()).append (CharConst (": bad attribute.\n"));
rc = false;
}
WikiMotorObjVec cell;
v2 = WikiMotorObjVecPtr (new WikiMotorObjVec);
- if (vec->splitChar (':', cell, *v2) || fwhole) {
+// if (vec->splitChar (':', cell, *v2) || fwhole) {
+ if (vec->splitChar (':', cell, *v2) || mode == M_ATTRIB || mode == M_ATTRIB_TEXT) {
if (! readAttrib1 (&cell, rc))
return rc;
vec = v2;
if (b < e) {
WikiMotorObjVec* cell = b->get ();
- bool bf = fwhole;
- fwhole = false;
+// bool bf = fwhole;
+// fwhole = false;
+ mode_t bm = mode;
+
+ mode = M_NORMAL;
if (! readAttrib1 (cell, rc)) {
name = cell->textOut (wiki);
}
- fwhole = bf;
+// fwhole = bf;
+ mode = bm;
b ++;
}
while (b < e) {
static const uint32_t SEL_DEFAULT2 = 0x0080;
static const uint32_t SEL_MULTIPLE2 = 0x0100;
static const uint32_t SEL_SCRIPT2 = 0x0200;
+ typedef enum {
+ M_NORMAL,
+ M_ATTRIB,
+ M_ATTRIB_TEXT,
+ } mode_t;
uint32_t selector;
- bool fwhole;
+// bool fwhole;
+ mode_t mode;
WikiFormat* wiki;
bool ferr;
ustring id;
bool fdefault; /* no output */
ustring script; /* no output */
- WikiAttrib1 (WikiFormat* _wiki, uint32_t _selector, bool _fwhole = false) {
+// WikiAttrib1 (WikiFormat* _wiki, uint32_t _selector, bool _fwhole = false) {
+ WikiAttrib1 (WikiFormat* _wiki, uint32_t _selector, mode_t _mode = M_NORMAL) {
wiki = _wiki;
selector = _selector;
- fwhole = _fwhole;
+// fwhole = _fwhole;
+ mode = _mode;
// elsize = 0;
fdefault = false;
fmultiple = false;
bool fnowhite;
bool fturn;
- WikiAttribTable (WikiFormat* _wiki, selector_t _selector2, bool _inheader): WikiAttrib1 (_wiki, SEL_ID, _inheader) {
+// WikiAttribTable (WikiFormat* _wiki, selector_t _selector2, bool _inheader): WikiAttrib1 (_wiki, SEL_ID, _inheader) {
+ WikiAttribTable (WikiFormat* _wiki, selector_t _selector2, mode_t _mode): WikiAttrib1 (_wiki, SEL_ID, _mode) {
selector2 = _selector2;
init ();
};
ustring height;
ustring alt;
- WikiAttribImg (WikiFormat* _wiki): WikiAttrib1 (_wiki, SEL_ID, true) {};
+// WikiAttribImg (WikiFormat* _wiki): WikiAttrib1 (_wiki, SEL_ID, true) {};
+ WikiAttribImg (WikiFormat* _wiki): WikiAttrib1 (_wiki, SEL_ID, M_ATTRIB) {};
virtual ~WikiAttribImg () {};
private:
virtual bool readAttribMore (const ustring& key, WikiMotorObjVec& vval, bool& ferr);
W_OFF, W_SOFT, W_HARD,
} pwrap;
-// WikiAttribInput (WikiFormat* _wiki, uint32_t _sel2): WikiAttrib1 (_wiki, SEL_ID, true) {
- WikiAttribInput (WikiFormat* _wiki, uint32_t _sel2): WikiAttrib1 (_wiki, SEL_MULTIPLE2, true) {
+// WikiAttribInput (WikiFormat* _wiki, uint32_t _sel2): WikiAttrib1 (_wiki, SEL_MULTIPLE2, true) {
+ WikiAttribInput (WikiFormat* _wiki, uint32_t _sel2): WikiAttrib1 (_wiki, SEL_MULTIPLE2, M_ATTRIB) {
selector2 = _sel2;
elsize = 0;
pdefault = false;
public:
ustring name;
- WikiAttribButton (WikiFormat* _wiki): WikiAttrib1 (_wiki, SEL_SCRIPT2, true) {};
+// WikiAttribButton (WikiFormat* _wiki): WikiAttrib1 (_wiki, SEL_SCRIPT2, true) {};
+ WikiAttribButton (WikiFormat* _wiki): WikiAttrib1 (_wiki, SEL_SCRIPT2, M_ATTRIB) {};
virtual ~WikiAttribButton () {};
virtual bool readAttrib (WikiMotorObjVecVec::const_iterator& b, const WikiMotorObjVecVec::const_iterator& e);
};
objvv.pop_back ();
attrib.shiftAttrib (objvv[0]);
- cell = new TableCell (wiki, false);
+// cell = new TableCell (wiki, false);
+ cell = new TableCell (wiki, WikiAttrib1::M_NORMAL);
cell->cellBody (objvv[0].get (), this, 0);
captionHtml = cell->html;
delete cell;
for (i = 1; i < objvv.size (); i ++) {
- cell = new TableCell (wiki, true);
+// cell = new TableCell (wiki, true);
+ cell = new TableCell (wiki, WikiAttrib1::M_ATTRIB);
cell->cellattrib.shiftAttrib (objvv[i]);
defaultList.push_back (cell);
}
}
WikiBlockTable::TableCell* WikiBlockTable::newCell (int idx) {
- TableCell* ans = new TableCell (wiki, false);
+// TableCell* ans = new TableCell (wiki, false);
+ TableCell* ans = new TableCell (wiki, WikiAttrib1::M_NORMAL);
if (idx < defaultList.size ())
ans->cellattrib.copyFrom (defaultList[idx].cellattrib);
}
WikiBlockTable::TableCell* WikiBlockTable::newCell (WikiAttribTable& rowattrib) {
- TableCell* ans = new TableCell (wiki, false);
+// TableCell* ans = new TableCell (wiki, false);
+ TableCell* ans = new TableCell (wiki, WikiAttrib1::M_NORMAL);
ans->cellattrib.copyFrom (rowattrib);
return ans;
int colspan;
bool spanmatch;
- TableCell (WikiFormat* _wiki, bool inheader): cellattrib (_wiki, WikiAttribTable::SEL_TD, inheader) {
+// TableCell (WikiFormat* _wiki, bool inheader): cellattrib (_wiki, WikiAttribTable::SEL_TD, inheader) {
+ TableCell (WikiFormat* _wiki, WikiAttrib1::mode_t _mode): cellattrib (_wiki, WikiAttribTable::SEL_TD, _mode) {
fcolspan = false;
frowspan = false;
rowspan = 1;
public:
WikiAttribTable rowattrib;
- CellList_t (WikiFormat* _wiki): rowattrib (_wiki, WikiAttribTable::SEL_TR, true) {};
+// CellList_t (WikiFormat* _wiki): rowattrib (_wiki, WikiAttribTable::SEL_TR, true) {};
+ CellList_t (WikiFormat* _wiki): rowattrib (_wiki, WikiAttribTable::SEL_TR, WikiAttrib1::M_ATTRIB) {};
virtual ~CellList_t () {};
};
typedef boost::ptr_vector<CellList_t> TableAry_t;
TableAry_t ary;
ustring captionHtml;
- WikiBlockTable (WikiFormat* _wiki): WikiBlock (BlockTable, _wiki), attrib (_wiki, WikiAttribTable::SEL_TABLE, false), defaultList (_wiki) {
+// WikiBlockTable (WikiFormat* _wiki): WikiBlock (BlockTable, _wiki), attrib (_wiki, WikiAttribTable::SEL_TABLE, true), defaultList (_wiki) {
+ WikiBlockTable (WikiFormat* _wiki): WikiBlock (BlockTable, _wiki), attrib (_wiki, WikiAttribTable::SEL_TABLE, WikiAttrib1::M_ATTRIB_TEXT), defaultList (_wiki) {
n = 0;
cont = false;
ccont = 0;
public:
WikiAttrib1 attrib;
- WikiBlockDiv (WikiFormat* w): WikiBlockComplex (BlockDiv, w), attrib (w, WikiAttrib1::SEL_CLASS2, true) {};
+// WikiBlockDiv (WikiFormat* w): WikiBlockComplex (BlockDiv, w), attrib (w, WikiAttrib1::SEL_CLASS2, true) {};
+ WikiBlockDiv (WikiFormat* w): WikiBlockComplex (BlockDiv, w), attrib (w, WikiAttrib1::SEL_CLASS2, WikiAttrib1::M_ATTRIB) {};
virtual ~WikiBlockDiv () {};
virtual bool nextLine (uiterator b, uiterator e);
bool fscript;
bool qfileform;
- WikiBlockForm (WikiFormat* w): WikiBlockComplex (BlockForm, w), attrib (w, WikiAttrib1::SEL_TARGET, true) {
+// WikiBlockForm (WikiFormat* w): WikiBlockComplex (BlockForm, w), attrib (w, WikiAttrib1::SEL_TARGET, true) {
+ WikiBlockForm (WikiFormat* w): WikiBlockComplex (BlockForm, w), attrib (w, WikiAttrib1::SEL_TARGET, WikiAttrib1::M_ATTRIB) {
method = M_NONE;
fscript = false;
qfileform = false;
static bool wl_http_sub (bool newwin, WikiMotorObjVecVec* args, WikiMotorObjVec* arg2, WikiMotorObjVec& out, WikiFormat* wiki) {
ustring url;
bool fscript = false;
- WikiAttrib1 attrib (wiki, WikiAttrib1::SEL_TARGET | WikiAttrib1::SEL_TARGET2, true);
+// WikiAttrib1 attrib (wiki, WikiAttrib1::SEL_TARGET | WikiAttrib1::SEL_TARGET2, true);
+ WikiAttrib1 attrib (wiki, WikiAttrib1::SEL_TARGET | WikiAttrib1::SEL_TARGET2, WikiAttrib1::M_ATTRIB);
WikiMotorObjVecVec::const_iterator b = args->begin ();
WikiMotorObjVecVec::const_iterator e = args->end ();
MotorOutputString html;
bool wl_span (WikiMotorObjVecVec* args, WikiMotorObjVec* arg2, WikiMotorObjVec& out, WikiFormat* wiki) {
WikiMotorObjVecVec::const_iterator b = args->begin ();
WikiMotorObjVecVec::const_iterator e = args->end ();
- WikiAttrib1 attrib (wiki, WikiAttrib1::SEL_CLASS2, true);
+// WikiAttrib1 attrib (wiki, WikiAttrib1::SEL_CLASS2, true);
+ WikiAttrib1 attrib (wiki, WikiAttrib1::SEL_CLASS2, WikiAttrib1::M_ATTRIB);
MotorOutputString html;
if (! attrib.readAttrib (b, e))