[sword-svn] r2973 - in trunk: bindings/corba/omniorbcpp include src/mgr src/modules/filters

scribe at crosswire.org scribe at crosswire.org
Tue Sep 10 04:53:43 MST 2013


Author: scribe
Date: 2013-09-10 04:53:43 -0700 (Tue, 10 Sep 2013)
New Revision: 2973

Modified:
   trunk/bindings/corba/omniorbcpp/testclient.cpp
   trunk/include/swbuf.h
   trunk/src/mgr/swmgr.cpp
   trunk/src/modules/filters/osisplain.cpp
Log:
added missing filters from extraFilters
Added additional overload for const unsigned char append to SWBuf
Added support for hi type overline to osisplain


Modified: trunk/bindings/corba/omniorbcpp/testclient.cpp
===================================================================
--- trunk/bindings/corba/omniorbcpp/testclient.cpp	2013-08-26 22:17:02 UTC (rev 2972)
+++ trunk/bindings/corba/omniorbcpp/testclient.cpp	2013-09-10 11:53:43 UTC (rev 2973)
@@ -78,6 +78,7 @@
 			std::cout << (*localeNames)[i] << "\n";
 		}
 */
+		std::cout << "filterText: " << mgr->filterText("OSISPlain", "this should be <abbr type=\"nomSac\"><hi rend=\"ol\">overlined</hi></abbr>") << "\n";
 		mgr->setDefaultLocale("de");
 		mgr->setJavascript(true);
 		mgr->setGlobalOption("Textual Variants", "Secondary Reading");

Modified: trunk/include/swbuf.h
===================================================================
--- trunk/include/swbuf.h	2013-08-26 22:17:02 UTC (rev 2972)
+++ trunk/include/swbuf.h	2013-09-10 11:53:43 UTC (rev 2973)
@@ -254,6 +254,12 @@
 		*end = 0;
 		return *this;
 	}
+	inline SWBuf &append(const unsigned char ch) {
+		assureMore(1);
+		*end++ = ch;
+		*end = 0;
+		return *this;
+	}
 
 	/**
 	* SWBuf::append - appends a wide charachter value to the current value of this SWBuf

Modified: trunk/src/mgr/swmgr.cpp
===================================================================
--- trunk/src/mgr/swmgr.cpp	2013-08-26 22:17:02 UTC (rev 2972)
+++ trunk/src/mgr/swmgr.cpp	2013-09-10 11:53:43 UTC (rev 2973)
@@ -267,15 +267,19 @@
 
 	gbfplain = new GBFPlain();
 	cleanupFilters.push_back(gbfplain);
+	extraFilters.insert(FilterMap::value_type("GBFPlain", gbfplain));
 
 	thmlplain = new ThMLPlain();
 	cleanupFilters.push_back(thmlplain);
+	extraFilters.insert(FilterMap::value_type("ThMLPlain", thmlplain));
 
 	osisplain = new OSISPlain();
 	cleanupFilters.push_back(osisplain);
+	extraFilters.insert(FilterMap::value_type("OSISPlain", osisplain));
 
 	teiplain = new TEIPlain();
 	cleanupFilters.push_back(teiplain);
+	extraFilters.insert(FilterMap::value_type("TEIPlain", teiplain));
 
 	// filters which aren't really used anywhere but which we want available for a "FilterName" -> filter mapping (e.g., filterText)
 	SWFilter *f = new RTFHTML();

Modified: trunk/src/modules/filters/osisplain.cpp
===================================================================
--- trunk/src/modules/filters/osisplain.cpp	2013-08-26 22:17:02 UTC (rev 2972)
+++ trunk/src/modules/filters/osisplain.cpp	2013-09-10 11:53:43 UTC (rev 2973)
@@ -35,6 +35,7 @@
 	XMLTag tag;
 	VerseKey *vk;
 	char testament;
+	SWBuf hiType;
 	MyUserData(const SWModule *module, const SWKey *key) : BasicFilterUserData(module, key) {}
 };
 }
@@ -202,6 +203,31 @@
 			end += buf.size() - u->lastTextNode.size();
 			toupperstr(end);
 		}
+		else if (!strncmp(token, "hi", 2)) {
+				if (strstr(token, "rend=\"ol\"")) {
+					u->hiType = "ol";
+				}
+				else u->hiType = "";
+				u->suspendTextPassThru = true;
+			}
+		else if (!strncmp(token, "/hi", 3)) {
+			if (u->hiType == "ol") {
+				const unsigned char *b = (const unsigned char *)u->lastTextNode.c_str();
+				while (*b) {
+					const unsigned char *o = b;
+					if (getUniCharFromUTF8(&b)) {
+						while (o != b) buf.append(*(o++));
+						buf.append("\u0305");
+					}
+				}
+			}
+			else {
+				buf.append("*");
+				buf.append(u->lastTextNode);
+				buf.append("*");
+			}
+			u->suspendTextPassThru = false;
+		}
 
                 // <milestone type="line"/>
                 else if (!strncmp(token, "milestone", 9)) {




More information about the sword-cvs mailing list