[sword-cvs] sword/src/modules/filters osisheadings.cpp,1.12,1.13

sword@www.crosswire.org sword@www.crosswire.org
Sat, 28 Feb 2004 13:14:32 -0700


Update of /cvs/core/sword/src/modules/filters
In directory www:/tmp/cvs-serv6163/src/modules/filters

Modified Files:
	osisheadings.cpp 
Log Message:


Index: osisheadings.cpp
===================================================================
RCS file: /cvs/core/sword/src/modules/filters/osisheadings.cpp,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- osisheadings.cpp	24 Jan 2004 18:42:40 -0000	1.12
+++ osisheadings.cpp	28 Feb 2004 20:14:29 -0000	1.13
@@ -40,6 +40,7 @@
 	int headerNum   = 0;
 	int pvHeaderNum = 0;
 	char buf[254];
+	XMLTag startTag;
 
 	SWBuf orig = text;
 	const char *from = orig.c_str();
@@ -62,6 +63,9 @@
 					continue;
 				}
 				if (!tag.isEndTag()) {
+					if (!tag.isEmpty()) {
+						startTag = tag;
+					}
 					hide = true;
 					header = "";
 					if (option) {	// we want the tag in the text
@@ -73,7 +77,8 @@
 				}
 				if (hide && tag.isEndTag()) {
 
-					if (module->isProcessEntryAttributes() && option) {
+					SWBuf subType = startTag.getAttribute("subType");
+					if (module->isProcessEntryAttributes() && ((option) || (subType != "x-Section"))) {
 						if (preverse) {
 							sprintf(buf, "%i", pvHeaderNum++);
 							module->getEntryAttributes()["Heading"]["Preverse"][buf] = header;
@@ -84,6 +89,10 @@
 							if (option) {	// we want the tag in the text
 								text.append(header);
 							}
+						}
+						StringList attributes = startTag.getAttributeNames();
+						for (StringList::iterator it = attributes.begin(); it != attributes.end(); it++) {
+							module->getEntryAttributes()["Heading"][buf][it->c_str()] = startTag.getAttribute(it->c_str());
 						}
 					}
 					hide = false;