Changeset 19302 for gsdl/trunk/runtime-src/src/recpt/formattools.cpp
- Timestamp:
- 2009-05-01T09:48:50+12:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gsdl/trunk/runtime-src/src/recpt/formattools.cpp
r19298 r19302 32 32 #include <assert.h> 33 33 34 boolspanwrap = false;34 static bool metadata_spanwrap = false; 35 35 36 36 // a few function prototypes … … 583 583 formatlistptr->command = comEndHighlight; 584 584 585 else if (meta == "metadata-spanwrap") 586 formatlistptr->command = comMetadataSpanWrap; 587 588 else if (meta == "/metadata-spanwrap") 589 formatlistptr->command = comEndMetadataSpanWrap; 590 585 591 else if (meta == "Summary") 586 592 formatlistptr->command = comSummary; … … 903 909 else fresh_metatext = metainfo.values[i]; 904 910 905 if ( spanwrap) {911 if (metadata_spanwrap) { 906 912 fresh_metatext = "<span metaname=\"" + meta.metaname + "\" metapos=\"" + i + "\">" + fresh_metatext + "</span>"; 907 913 } … … 928 934 else fresh_metatext = metainfo.values[position]; 929 935 930 if ( spanwrap) {936 if (metadata_spanwrap) { 931 937 fresh_metatext = "<span metaname=\"" + meta.metaname + "\" metapos=\"" + position + "\">" + fresh_metatext + "</span>"; 932 938 } … … 1125 1131 ostream& logout) { 1126 1132 1127 text_t tmp;1128 1133 while (orptr != NULL) { 1129 1134 1130 tmp = format_string (collection,collectproto,docinfo, disp, orptr, 1131 options, logout); 1132 if (!tmp.empty()) return tmp; 1135 if (metadata_spanwrap) { 1136 // need to be a bit more careful about this 1137 // => test for it *without* spanwrap, and if defined, then 1138 // got back and generate it again, this time with spanwrap on 1139 1140 metadata_spanwrap = false; 1141 text_t test_tmp = format_string (collection,collectproto,docinfo, disp, orptr, 1142 options, logout); 1143 metadata_spanwrap = true; 1144 if (!test_tmp.empty()) { 1145 1146 return format_string (collection,collectproto,docinfo, disp, orptr, 1147 options, logout); 1148 } 1149 } 1150 else { 1151 text_t tmp = format_string (collection,collectproto,docinfo, disp, orptr, 1152 options, logout); 1153 if (!tmp.empty()) return tmp; 1154 } 1133 1155 1134 1156 orptr = orptr->nextptr; … … 1387 1409 if (decision.command == dMeta) { 1388 1410 1389 bool store_ spanwrap =spanwrap;1390 spanwrap = 0;1391 1392 // temporarily suspend spanwrap (if on) so can test if metadata item really exits or not1411 bool store_metadata_spanwrap = metadata_spanwrap; 1412 metadata_spanwrap = 0; 1413 1414 // temporarily suspend metadata-spanwrap (if on) so can test if metadata item really exits or not 1393 1415 bool metadata_exists 1394 1416 = (get_meta (collection,collectproto,docinfo,disp,decision.meta,options, 1395 1417 logout) != ""); 1396 1418 1397 spanwrap = store_spanwrap;1419 metadata_spanwrap = store_metadata_spanwrap; 1398 1420 1399 1421 if (metadata_exists) { … … 1594 1616 if (options["highlight"] == "1") return "</b>"; 1595 1617 break; 1618 case comMetadataSpanWrap: 1619 metadata_spanwrap=true; return ""; 1620 break; 1621 case comEndMetadataSpanWrap: 1622 metadata_spanwrap=false; return ""; 1623 break; 1596 1624 case comIf: 1597 1625 return get_if (collection, collectproto, docinfo, disp,
Note:
See TracChangeset
for help on using the changeset viewer.