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

scribe at www.crosswire.org scribe at www.crosswire.org
Sat Dec 29 15:46:00 MST 2007


Author: scribe
Date: 2007-12-29 15:45:59 -0700 (Sat, 29 Dec 2007)
New Revision: 2126

Modified:
   trunk/src/modules/filters/thmlhtmlhref.cpp
   trunk/src/modules/filters/thmllemma.cpp
Log:
Applied charcoal's patch which add lemma support for thml


Modified: trunk/src/modules/filters/thmlhtmlhref.cpp
===================================================================
--- trunk/src/modules/filters/thmlhtmlhref.cpp	2007-11-24 20:18:18 UTC (rev 2125)
+++ trunk/src/modules/filters/thmlhtmlhref.cpp	2007-12-29 22:45:59 UTC (rev 2126)
@@ -171,6 +171,13 @@
 						URL::encode(value.c_str()).c_str(),
 						value.c_str());
 			}
+			else if (tag.getAttribute("type") && !strcmp(tag.getAttribute("type"), "lemma")) { //>
+				if(value.length())
+					// empty "type=" is deliberate.
+					buf.appendFormatted("<small><em>&lt;<a href=\"passagestudy.jsp?action=showStrongs&type=&value=%s\">%s</a>&gt;</em></small>", 
+						URL::encode(value.c_str()).c_str(),
+						value.c_str());
+			}
 			else if (tag.getAttribute("type") && !strcmp(tag.getAttribute("type"), "Strongs")) {
 				char ch = *value;
 				value<<1;

Modified: trunk/src/modules/filters/thmllemma.cpp
===================================================================
--- trunk/src/modules/filters/thmllemma.cpp	2007-11-24 20:18:18 UTC (rev 2125)
+++ trunk/src/modules/filters/thmllemma.cpp	2007-12-29 22:45:59 UTC (rev 2126)
@@ -7,7 +7,6 @@
 
 #include <stdlib.h>
 #include <thmllemma.h>
-#include <utilstr.h>
 
 SWORD_NAMESPACE_START
 
@@ -36,28 +35,28 @@
 		for (text = ""; *from; from++) {
 			if (*from == '<') {
 				intoken = true;
-                                token = "";
+				token = "";
 				continue;
 			}
-			else if (*from == '>') {	// process tokens
+			if (*from == '>') {	// process tokens
 				intoken = false;
-				if (!strnicmp(token.c_str(), "sync", 4) && strstr(token.c_str(), " type=\"lemma\"")) {	// Lemma
-					continue;
+				if (!strncmp(token.c_str(), "sync ", 5) && strstr(token.c_str(), "type=\"lemma\"")) {	// Lemma
+				  continue;
 				}
-				
+
 				// if not a lemma token, keep token in text
 				text += '<';
-                                text.append(token);
-      				text += '>';
+				text += token;
+				text += '>';
 				continue;
 			}
-			
+
 			if (intoken) {
 				token += *from;
 			}
-			else {
-                                text += *from;
-       			}
+			else	{
+				text += *from;
+			}
 		}
 	}
 	return 0;




More information about the sword-cvs mailing list