[sword-cvs] sword/src/modules/filters osiswebif.cpp,1.4,1.5

sword@www.crosswire.org sword@www.crosswire.org
Fri, 21 Nov 2003 22:27:41 -0700


Update of /usr/local/cvsroot/sword/src/modules/filters
In directory www:/tmp/cvs-serv18754/src/modules/filters

Modified Files:
	osiswebif.cpp 
Log Message:
fixed some bugs


Index: osiswebif.cpp
===================================================================
RCS file: /usr/local/cvsroot/sword/src/modules/filters/osiswebif.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- osiswebif.cpp	18 Nov 2003 20:54:16 -0000	1.4
+++ osiswebif.cpp	22 Nov 2003 05:27:39 -0000	1.5
@@ -113,6 +113,33 @@
 			}
 		}
 
+		// <note> tag
+		else if (!strcmp(tag.getName(), "note")) {
+			if (!tag.isEndTag()) {
+				if (!tag.isEmpty()) {
+					SWBuf type = tag.getAttribute("type");
+
+					if (type != "strongsMarkup") {	// leave strong's markup notes out, in the future we'll probably have different option filters to turn different note types on or off
+						SWBuf footnoteNumber = tag.getAttribute("swordFootnote");
+						VerseKey *vkey;
+						// see if we have a VerseKey * or descendant
+						try {
+							vkey = SWDYNAMIC_CAST(VerseKey, u->key);
+						}
+						catch ( ... ) {	}
+						if (vkey) {
+							char ch = ((tag.getAttribute("type") && ((!strcmp(tag.getAttribute("type"), "crossReference")) || (!strcmp(tag.getAttribute("type"), "x-cross-ref")))) ? 'x':'n');
+//							buf.appendFormatted("<a href=\"noteID=%s.%c.%s\"><small><sup>*%c</sup></small></a> ", vkey->getText(), ch, footnoteNumber.c_str(), ch);
+						}
+					}
+					u->suspendTextPassThru = true;
+				}
+			}
+			if (tag.isEndTag()) {
+				u->suspendTextPassThru = false;
+			}
+		}
+
 		// <q> quote
 		else if (!strcmp(tag.getName(), "q")) {
 			SWBuf type = tag.getAttribute("type");
@@ -146,9 +173,9 @@
 
 		// <transChange>
 		else if (!strcmp(tag.getName(), "transChange")) {
-			SWBuf type = tag.getAttribute("type");
-			
 			if ((!tag.isEndTag()) && (!tag.isEmpty())) {
+				SWBuf type = tag.getAttribute("type");
+				u->lastTransChange = type;
 
 // just do all transChange tags this way for now
 				if ((type == "added") || (type == "supplied"))
@@ -157,6 +184,7 @@
 					buf += "*";
 			}
 			else if (tag.isEndTag()) {
+				SWBuf type = u->lastTransChange;
 				if ((type == "added") || (type == "supplied"))
 					buf += "</i>";
 			}