[sword-svn] r3646 - trunk/src/modules/filters

scribe at crosswire.org scribe at crosswire.org
Sun Jun 9 20:46:13 MST 2019


Author: scribe
Date: 2019-06-09 20:46:13 -0700 (Sun, 09 Jun 2019)
New Revision: 3646

Modified:
   trunk/src/modules/filters/osisheadings.cpp
Log:
Fix to print preverse titles when processing headers thru SWModule::renderText(headerBuf)

Modified: trunk/src/modules/filters/osisheadings.cpp
===================================================================
--- trunk/src/modules/filters/osisheadings.cpp	2019-06-10 02:46:48 UTC (rev 3645)
+++ trunk/src/modules/filters/osisheadings.cpp	2019-06-10 03:46:13 UTC (rev 3646)
@@ -100,7 +100,7 @@
 
 					// do we want to put anything in EntryAttributes?
 					if (u->module->isProcessEntryAttributes() && (option || u->canonical || !preverse)) {
-						SWBuf buf; buf.appendFormatted("%i", u->headerNum++);
+						SWBuf hn; hn.appendFormatted("%i", u->headerNum++);
 						// 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
@@ -114,20 +114,21 @@
 							heading += tag;
 						}
 						else heading = u->heading;
-						u->module->getEntryAttributes()["Heading"][(preverse)?"Preverse":"Interverse"][buf] = heading;
+						u->module->getEntryAttributes()["Heading"][(preverse)?"Preverse":"Interverse"][hn] = heading;
 
 						StringList attributes = u->currentHeadingTag.getAttributeNames();
 						for (StringList::const_iterator it = attributes.begin(); it != attributes.end(); it++) {
-							u->module->getEntryAttributes()["Heading"][buf][it->c_str()] = u->currentHeadingTag.getAttribute(it->c_str());
+							u->module->getEntryAttributes()["Heading"][hn][it->c_str()] = u->currentHeadingTag.getAttribute(it->c_str());
 						}
 						// if any title in the heading was canonical, then set canonical=true.
 						// TODO: split composite headings with both canonical and non-canonical headings
 						// into two heading attributes with proper canonical value on each
-						if (u->canonical) u->module->getEntryAttributes()["Heading"][buf]["canonical"] = "true";
+						if (u->canonical) u->module->getEntryAttributes()["Heading"][hn]["canonical"] = "true";
 					}
 
 					// do we want the heading in the body?
-					if (!preverse && (option || u->canonical)) {
+					// if we're not processing entryAttributes, then it's not going anyplace else
+					if ((!preverse || !u->module->isProcessEntryAttributes())  && (option || u->canonical)) {
 						buf.append(u->currentHeadingTag);
 						buf.append(u->heading);
 						buf.append(tag);




More information about the sword-cvs mailing list