[sword-svn] r3195 - in branches/sword-1-7-x: . src/modules/filters

greg.hellings at crosswire.org greg.hellings at crosswire.org
Wed Apr 23 20:03:26 MST 2014


Author: greg.hellings
Date: 2014-04-23 20:03:26 -0700 (Wed, 23 Apr 2014)
New Revision: 3195

Modified:
   branches/sword-1-7-x/
   branches/sword-1-7-x/src/modules/filters/thmlheadings.cpp
Log:
Merging r3191 - preverse compat for thml



Property changes on: branches/sword-1-7-x
___________________________________________________________________
Modified: svn:mergeinfo
   - /trunk:2989-2991,2997,3001-3004,3006,3010-3020,3026-3039,3045-3046,3048,3056,3058-3062,3067,3073,3077-3081,3085-3086,3091,3094,3097-3099,3102,3104,3106-3108,3110,3115,3118-3121,3126-3127,3131-3135,3140,3144,3151,3153-3155,3190
   + /trunk:2989-2991,2997,3001-3004,3006,3010-3020,3026-3039,3045-3046,3048,3056,3058-3062,3067,3073,3077-3081,3085-3086,3091,3094,3097-3099,3102,3104,3106-3108,3110,3115,3118-3121,3126-3127,3131-3135,3140,3144,3151,3153-3155,3190-3191

Modified: branches/sword-1-7-x/src/modules/filters/thmlheadings.cpp
===================================================================
--- branches/sword-1-7-x/src/modules/filters/thmlheadings.cpp	2014-04-24 03:02:47 UTC (rev 3194)
+++ branches/sword-1-7-x/src/modules/filters/thmlheadings.cpp	2014-04-24 03:03:26 UTC (rev 3195)
@@ -86,13 +86,22 @@
 				tag = token;
 				if (hide && tag.isEndTag()) {
 					if (module->isProcessEntryAttributes() && (option || (!preverse))) {
+						SWBuf heading;
+						SWBuf cls = startTag.getAttribute("class");
+						if (!cls.startsWith("fromEntryAttributes")) {
+							cls = SWBuf("fromEntryAttributes ") + cls;
+							startTag.setAttribute("class", cls);
+						}
+						heading += startTag;
+						heading += header;
+						heading += tag;
 						if (preverse) {
 							sprintf(buf, "%i", pvHeaderNum++);
-							module->getEntryAttributes()["Heading"]["Preverse"][buf] = header;
+							module->getEntryAttributes()["Heading"]["Preverse"][buf] = heading;
 						}
 						else {
 							sprintf(buf, "%i", headerNum++);
-							module->getEntryAttributes()["Heading"]["Interverse"][buf] = header;
+							module->getEntryAttributes()["Heading"]["Interverse"][buf] = heading;
 							if (option) {	// we want the tag in the text
 								text.append(header);
 							}
@@ -143,8 +152,17 @@
 					}
 */
 				}
-				else
+				else {
 					isheader = false;
+					SWBuf cls = tag.getAttribute("class");
+					if (cls.startsWith("fromEntryAttributes ")) {
+						cls <<  SWBuf("fromEntryAttributes ").size();
+						tag.setAttribute("class", cls);
+						token = tag;
+						token << 1;
+						token.setSize(token.size() - 1);
+					}
+				}
 			}
 
 			if (withinDiv && isheader) {




More information about the sword-cvs mailing list