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

greg.hellings at crosswire.org greg.hellings at crosswire.org
Wed Apr 23 20:02:47 MST 2014


Author: greg.hellings
Date: 2014-04-23 20:02:47 -0700 (Wed, 23 Apr 2014)
New Revision: 3194

Modified:
   branches/sword-1-7-x/
   branches/sword-1-7-x/src/modules/filters/osisheadings.cpp
Log:
Merging r3190 - don't double-process titles



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
   + /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

Modified: branches/sword-1-7-x/src/modules/filters/osisheadings.cpp
===================================================================
--- branches/sword-1-7-x/src/modules/filters/osisheadings.cpp	2014-04-20 09:43:09 UTC (rev 3193)
+++ branches/sword-1-7-x/src/modules/filters/osisheadings.cpp	2014-04-24 03:02:47 UTC (rev 3194)
@@ -92,7 +92,6 @@
 			if (tag.isEndTag(u->sID)) {
 				if (!u->depth-- || u->sID) {
 					// see comment below about preverse div changed and needing to preserve the <title> container tag for old school pre-verse titles
-					if (u->currentHeadingName == "title") u->heading.append(tag);
 					// we've just finished a heading.  It's all stored up in u->heading
 					bool canonical = (SWBuf("true") == u->currentHeadingTag.getAttribute("canonical"));
 					bool preverse = (SWBuf("x-preverse") == u->currentHeadingTag.getAttribute("subType") || SWBuf("x-preverse") == u->currentHeadingTag.getAttribute("subtype"));
@@ -100,7 +99,20 @@
 					// do we want to put anything in EntryAttributes?
 					if (u->module->isProcessEntryAttributes() && (option || canonical || !preverse)) {
 						SWBuf buf; buf.appendFormatted("%i", u->headerNum++);
-						u->module->getEntryAttributes()["Heading"][(preverse)?"Preverse":"Interverse"][buf] = u->heading;
+						// leave the actual <title...> wrapper in if we're part of an old school preverse title
+						// because now frontend have to deal with preverse as a div which may or may not include <title> elements
+						// and they can't simply wrap all preverse material in <h1>, like they probably did previously
+						SWBuf heading;
+						if (u->currentHeadingName == "title") {
+							XMLTag wrapper = u->currentHeadingTag;
+							if (SWBuf("x-preverse") == wrapper.getAttribute("subType")) wrapper.setAttribute("subType", 0);
+							else if (SWBuf("x-preverse") == wrapper.getAttribute("subtype")) wrapper.setAttribute("subtype", 0);
+							heading = wrapper;
+							heading += u->heading;
+							heading += tag;
+						}
+						else heading = u->heading;
+						u->module->getEntryAttributes()["Heading"][(preverse)?"Preverse":"Interverse"][buf] = heading;
 
 						StringList attributes = u->currentHeadingTag.getAttributeNames();
 						for (StringList::const_iterator it = attributes.begin(); it != attributes.end(); it++) {
@@ -132,16 +144,7 @@
 
 		u->currentHeadingName = name;
 		u->currentHeadingTag = tag;
-		// leave the actual <title...> wrapper in if we're part of an old school preverse title
-		// because now frontend have to deal with preverse as a div which may or may not include <title> elements
-		// and they can't simply wrap all preverse material in <h1>, like they probably did previously
-		if (name == "title") {
-			XMLTag wrapper = tag;
-			if (SWBuf("x-preverse") == wrapper.getAttribute("subType")) wrapper.setAttribute("subType", 0);
-			else if (SWBuf("x-preverse") == wrapper.getAttribute("subtype")) wrapper.setAttribute("subtype", 0);
-			u->heading = wrapper;
-		}
-		else	u->heading = "";
+		u->heading = "";
 		u->sID = u->currentHeadingTag.getAttribute("sID");
 		u->depth = 0;
 		u->suspendTextPassThru = true;




More information about the sword-cvs mailing list