[sword-svn] r2692 - trunk/utilities

dmsmith at crosswire.org dmsmith at crosswire.org
Sat Mar 24 15:21:11 MST 2012


Author: dmsmith
Date: 2012-03-24 15:21:11 -0700 (Sat, 24 Mar 2012)
New Revision: 2692

Modified:
   trunk/utilities/osis2mod.cpp
Log:
Allow div in header of osis document. From John Zaitseff

Modified: trunk/utilities/osis2mod.cpp
===================================================================
--- trunk/utilities/osis2mod.cpp	2012-03-06 22:28:28 UTC (rev 2691)
+++ trunk/utilities/osis2mod.cpp	2012-03-24 22:21:11 UTC (rev 2692)
@@ -603,6 +603,7 @@
 
 	// Flag used to indicate where useful text begins
 	static bool               firstDiv        = false;
+	static bool               headerEnded     = false;
 
 	// Retain the sID of book, chapter and verse (commentary) divs so that we can find them again.
 	// This relies on transformBSP.
@@ -643,9 +644,9 @@
 			}
 		}
 
-		// throw away everything up to the first div
+		// throw away everything up to the first div (that is outside the header)
 		if (!firstDiv) {
-			if (tokenName == "div") {
+			if (headerEnded && (tokenName == "div")) {
 				if (debug & DEBUG_OTHER) {
 					cout << "DEBUG(FOUND): Found first div and pitching prior material: " << text << endl;
 				}
@@ -962,8 +963,16 @@
 			}
 		}
 
-		// We haven't seen the first div so there is nothing to do.
+		// We haven't seen the first div outside the header so there is little to do.
 		if (!firstDiv) {
+			if (tokenName == "header") {
+				headerEnded = true;
+
+				if (debug & DEBUG_OTHER) {
+					cout << "DEBUG(FOUND): End of header found" << endl;
+				}
+			}
+
 			// Collect the content so it can be used to suggest the module's conf.
 			return false;
 		}
@@ -1339,7 +1348,7 @@
 	unsigned char curChar = '\0';
 
 	while (infile.good()) {
-		
+
 		int possibleChar = infile.get();
 
 		// skip the character if it is bad. infile.good() will catch the problem




More information about the sword-cvs mailing list