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

chrislit at crosswire.org chrislit at crosswire.org
Sat Apr 16 07:33:16 MST 2005


Author: chrislit
Date: 2005-04-16 07:33:16 -0700 (Sat, 16 Apr 2005)
New Revision: 1778

Modified:
   trunk/src/modules/filters/osiswebif.cpp
Log:
added basic <catchWord>, <rdg>, & <hi> support

Modified: trunk/src/modules/filters/osiswebif.cpp
===================================================================
--- trunk/src/modules/filters/osiswebif.cpp	2005-04-16 14:32:21 UTC (rev 1777)
+++ trunk/src/modules/filters/osiswebif.cpp	2005-04-16 14:33:16 UTC (rev 1778)
@@ -139,6 +139,7 @@
 				u->suspendTextPassThru = false;
 			}
 		}
+
 		// <title>
 		else if (!strcmp(tag.getName(), "title")) {
 			if ((!tag.isEndTag()) && (!tag.isEmpty())) {
@@ -149,6 +150,44 @@
 			}
 		}
 
+		// <catchWord> & <rdg> tags (italicize)
+		else if (!strcmp(tag.getName(), "rdg") || !strcmp(tag.getName(), "catchWord")) {
+			if ((!tag.isEndTag()) && (!tag.isEmpty())) {
+				if (!u->suspendTextPassThru)
+					buf += "<i>";
+			}
+			else if (tag.isEndTag()) {
+				if (!u->suspendTextPassThru)
+					buf += "</i>";
+			}
+		}
+
+                // <hi> text highlighting
+		else if (!strcmp(tag.getName(), "hi")) {
+			SWBuf type = tag.getAttribute("type");
+			if ((!tag.isEndTag()) && (!tag.isEmpty())) {
+				if (type == "b" || type == "x-b") {
+					if (!u->suspendTextPassThru)
+						buf += "<b>";
+					u->inBold = true;
+				}
+				else {	// all other types
+					if (!u->suspendTextPassThru)
+						buf += "<i>";
+				}
+			}
+			else if (tag.isEndTag()) {
+				if(u->inBold) {
+					if (!u->suspendTextPassThru)
+						buf += "</b>";
+					u->inBold = false;
+				}
+				else
+					if (!u->suspendTextPassThru)
+						 buf += "</i>";
+			}
+		}
+
 		// <q> quote
 		else if (!strcmp(tag.getName(), "q")) {
 			SWBuf type = tag.getAttribute("type");
@@ -186,7 +225,7 @@
 				SWBuf type = tag.getAttribute("type");
 				u->lastTransChange = type;
 
-// just do all transChange tags this way for now
+				// just do all transChange tags this way for now
 				if ((type == "added") || (type == "supplied"))
 					buf += "<i>";
 				else if (type == "tenseChange")



More information about the sword-cvs mailing list