[sword-svn] r1948 - trunk/utilities

dmsmith at crosswire.org dmsmith at crosswire.org
Fri Jul 21 16:02:16 MST 2006


Author: dmsmith
Date: 2006-07-21 16:02:09 -0700 (Fri, 21 Jul 2006)
New Revision: 1948

Modified:
   trunk/utilities/osis2mod.cpp
Log:
fixed a bug in osis2mod that duplicated a chapter title in the verse

Modified: trunk/utilities/osis2mod.cpp
===================================================================
--- trunk/utilities/osis2mod.cpp	2006-07-16 02:01:52 UTC (rev 1947)
+++ trunk/utilities/osis2mod.cpp	2006-07-21 23:02:09 UTC (rev 1948)
@@ -82,7 +82,7 @@
 
 void writeEntry(VerseKey &key, SWBuf &text, bool force = false) {
 	static SWBuf activeVerseText;
-        char keyOsisID[255];
+	char keyOsisID[255];
 	strcpy(keyOsisID, key.getOSISRef());
 
 	// set keyOsisID to anything that an osisID cannot be.
@@ -219,7 +219,6 @@
 //		cout << "text:           " << text.c_str() << endl;
 		inTitle = false;
 		titleDepth = 0;
-//		cout << "pop " << tagStack.top()->getName() << endl;
 		tagStack.pop();
 		return false; // don't add </title> to the text itself
 	}
@@ -314,6 +313,9 @@
 							cout << "Warning: Bug in code. Could not find title." << endl;
 						}
 					}
+					else {
+						text = "";
+					}
 
 					if (heading.length()) {
 //						cout << "CHAPTER HEADING "<< heading.c_str() << endl;
@@ -379,7 +381,7 @@
 			exit(1);
 		}
 
-		XMLTag *topToken = 0;
+		XMLTag* topToken = 0;
 		if (!token->isEmpty()) {
 			topToken = tagStack.top();
 			tagDepth = tagStack.size();
@@ -467,7 +469,6 @@
 			}
 			// Or is it the end of a book
 			else if (tagDepth == bookDepth && (!strcmp(tokenName, "div"))) {
-//				cout << "Saw an end div: " << *topToken << endl;
 				bookDepth = 0;
 				chapterDepth = 0;
 				verseDepth = 0;
@@ -483,9 +484,6 @@
 					!strcmp(tokenName, "lb") ||
 					!strcmp(tokenName, "lg")
 					) {
-//				if (topToken) {
-//					cout << "start token " << *topToken << endl;
-//				}
 				text.append(*token);
 				writeEntry(*currentVerse, text);
 				text = "";



More information about the sword-cvs mailing list