[sword-cvs] sword/src/modules/filters gbfhtml.cpp,1.26,1.27 gbfhtmlhref.cpp,1.17,1.18 gbfwebif.cpp,1.3,1.4 osishtmlhref.cpp,1.11,1.12 osisplain.cpp,1.7,1.8 osisrtf.cpp,1.16,1.17 swbasicfilter.cpp,1.24,1.25 thmlhtml.cpp,1.27,1.28 thmlhtmlhref.cpp,1.34,1.35 thmlrtf.cpp,1.33,1.34 thmlwebif.cpp,1.5,1.6

sword@www.crosswire.org sword@www.crosswire.org
Tue, 29 Jul 2003 17:51:36 -0700


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

Modified Files:
	gbfhtml.cpp gbfhtmlhref.cpp gbfwebif.cpp osishtmlhref.cpp 
	osisplain.cpp osisrtf.cpp swbasicfilter.cpp thmlhtml.cpp 
	thmlhtmlhref.cpp thmlrtf.cpp thmlwebif.cpp 
Log Message:


Index: gbfhtml.cpp
===================================================================
RCS file: /usr/local/cvsroot/sword/src/modules/filters/gbfhtml.cpp,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -d -r1.26 -r1.27
--- gbfhtml.cpp	27 Jun 2003 01:41:07 -0000	1.26
+++ gbfhtml.cpp	30 Jul 2003 00:51:34 -0000	1.27
@@ -58,21 +58,22 @@
 }
 
 
-bool GBFHTML::handleToken(SWBuf &buf, const char *token, DualStringMap &userData) {
+bool GBFHTML::handleToken(SWBuf &buf, const char *token, UserData *userData) {
 	const char *tok;
 	char val[128];
 	char *valto;
 	const char *num;
+	MyUserData *u = (MyUserData *)userData;
 
 	if (!substituteToken(buf, token)) {		
 		// deal with OSIS note tags.  Just hide till OSISRTF		
 		if (!strncmp(token, "note ", 5)) {
 			// let's stop text from going to output
-			userData["suspendTextPassThru"] = "true";
+			u->suspendTextPassThru = true;
 		}
 		
 		else if (!strncmp(token, "/note", 5)) {
-			userData["suspendTextPassThru"] = "false";
+			u->suspendTextPassThru = false;
 		}		
 
 		else if (!strncmp(token, "w", 1)) {
@@ -134,12 +135,12 @@
 
 		else if (!strncmp(token, "RB", 2)) {
 			buf += "<i>";
-			userData["hasFootnotePreTag"] = "true";
+			u->hasFootnotePreTag = true;
 		}
 
 		else if (!strncmp(token, "RF", 2)) {
-			if(userData["hasFootnotePreTag"] == "true") {
-				userData["hasFootnotePreTag"] = "false";
+			if (u->hasFootnotePreTag) {
+				u->hasFootnotePreTag = false;
 				buf += "</i> ";
 			}
 			buf += "<font color=\"#800000\"><small> (";

Index: gbfhtmlhref.cpp
===================================================================
RCS file: /usr/local/cvsroot/sword/src/modules/filters/gbfhtmlhref.cpp,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- gbfhtmlhref.cpp	10 May 2003 20:21:52 -0000	1.17
+++ gbfhtmlhref.cpp	30 Jul 2003 00:51:34 -0000	1.18
@@ -58,21 +58,22 @@
 }
 
 
-bool GBFHTMLHREF::handleToken(SWBuf &buf, const char *token, DualStringMap &userData) {
+bool GBFHTMLHREF::handleToken(SWBuf &buf, const char *token, UserData *userData) {
 	const char *tok;
 	char val[128];
 	char *valto;
 	const char *num;
+	MyUserData *u = (MyUserData *)userData;
 
 	if (!substituteToken(buf, token)) {		
 		// deal with OSIS note tags.  Just hide till OSISRTF		
 		if (!strncmp(token, "note ", 5)) {
 			// let's stop text from going to output
-			userData["suspendTextPassThru"] = "true";
+			u->suspendTextPassThru = true;
 		}
 		
 		else if (!strncmp(token, "/note", 5)) {
-			userData["suspendTextPassThru"] = "false";
+			u->suspendTextPassThru = false;
 		}		
 
 		else if (!strncmp(token, "w", 1)) {
@@ -171,12 +172,12 @@
 
 		else if (!strncmp(token, "RB", 2)) {
 			buf += "<i> ";
-			userData["hasFootnotePreTag"] = "true";
+			u->hasFootnotePreTag = true;
 		}
 
 		else if (!strncmp(token, "RF", 2)) {
-			if(userData["hasFootnotePreTag"] == "true") {
-				userData["hasFootnotePreTag"] = "false";
+			if (u->hasFootnotePreTag) {
+				u->hasFootnotePreTag = false;
 				buf += "</i> ";
 			}
 			buf += "<font color=\"#800000\"><small> (";

Index: gbfwebif.cpp
===================================================================
RCS file: /usr/local/cvsroot/sword/src/modules/filters/gbfwebif.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- gbfwebif.cpp	27 Jun 2003 01:41:07 -0000	1.3
+++ gbfwebif.cpp	30 Jul 2003 00:51:34 -0000	1.4
@@ -25,7 +25,7 @@
 //all is done in GBFHTMLHREF since it inherits form this class
 }
 
-bool GBFWEBIF::handleToken(SWBuf &buf, const char *token, DualStringMap &userData) {
+bool GBFWEBIF::handleToken(SWBuf &buf, const char *token, UserData *userData) {
 	const char *tok;
 	char val[128];
 	char *valto;

Index: osishtmlhref.cpp
===================================================================
RCS file: /usr/local/cvsroot/sword/src/modules/filters/osishtmlhref.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- osishtmlhref.cpp	27 Jul 2003 00:02:44 -0000	1.11
+++ osishtmlhref.cpp	30 Jul 2003 00:51:34 -0000	1.12
@@ -22,6 +22,12 @@
 
 SWORD_NAMESPACE_START
 
+
+OSISHTMLHref::MyUserData::MyUserData(const SWModule *module, const SWKey *key) : UserData(module, key) {
+	osisQToTick = ((!module->getConfigEntry("OSISqToTick")) || (strcmp(module->getConfigEntry("OSISqToTick"), "false")));
+}
+
+
 OSISHTMLHref::OSISHTMLHref()
 {
         setTokenStart("<");
@@ -41,11 +47,11 @@
         setTokenCaseSensitive(true);
 }
 
-bool OSISHTMLHref::handleToken(SWBuf &buf, const char *token, DualStringMap &userData) {
+bool OSISHTMLHref::handleToken(SWBuf &buf, const char *token, UserData *userData) {
   // manually process if it wasn't a simple substitution
 	if (!substituteToken(buf, token)) {
+		MyUserData *u = (MyUserData *)userData;
 		XMLTag tag(token);
-		bool osisQToTick = ((!module->getConfigEntry("OSISqToTick")) || (strcmp(module->getConfigEntry("OSISqToTick"), "false")));
 
 		//printf("token = %s\n",token);
 		// <w> tag
@@ -53,7 +59,7 @@
 
 			// start <w> tag
 			if ((!tag.isEmpty()) && (!tag.isEndTag())) {
-				userData["w"] = token;
+				u->w = token;
 			}
 
 			// end or empty <w> tag
@@ -63,8 +69,8 @@
 				bool show = true;	// to handle unplaced article in kjv2003-- temporary till combined
 
 				if (endTag) {
-					tag = userData["w"].c_str();
-					lastText = userData["lastTextNode"].c_str();
+					tag = u->w.c_str();
+					lastText = u->lastTextNode.c_str();
 				}
 				else lastText = "stuff";
 
@@ -124,7 +130,7 @@
 		// <note> tag
 		else if (!strcmp(tag.getName(), "note")) {
 			if (!tag.isEmpty() && !tag.isEndTag()) {
-				SWBuf footnoteNum = userData["fn"];
+				SWBuf footnoteNum = u->fn;
 				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
@@ -132,7 +138,7 @@
 					VerseKey *vkey;
 					// see if we have a VerseKey * or descendant
 					try {
-						vkey = SWDYNAMIC_CAST(VerseKey, this->key);
+						vkey = SWDYNAMIC_CAST(VerseKey, userData->key);
 					}
 					catch ( ... ) {	}
 					if (vkey) {
@@ -140,13 +146,13 @@
 						    buf.appendFormatted("<a href=\"noteID=%s.%c.%i\"><small><sup>*%c</sup></small></a> ", vkey->getText(), ch, footnoteNumber, ch);
 						SWBuf tmp;
 						tmp.appendFormatted("%i", ++footnoteNumber);
-						userData["fn"] = tmp.c_str();
+						u->fn = tmp.c_str();
 					}
 				}
-				userData["suspendTextPassThru"] = "true";
+				u->suspendTextPassThru = true;
 			}
 			if (tag.isEndTag()) {
-				userData["suspendTextPassThru"] = "false";
+				u->suspendTextPassThru = false;
 			}
 		}
 		// <p> paragraph tag
@@ -208,15 +214,15 @@
 			if ((!tag.isEndTag()) && (!tag.isEmpty())) {
 				if (type == "b" || type == "x-b") {
 					buf += "<b> ";
-					userData["inBold"] = "true";
+					u->inBold = true;
 				}
 				else	// all other types
 					buf += "<i> ";
 			}
 			else if (tag.isEndTag()) {
-				if(userData["inBold"] == "true") {
+				if(u->inBold) {
 					buf += "</b>";
-					userData["inBold"] = "false";
+					u->inBold = false;
 				}
 				else
 				      buf += "</i>";
@@ -237,7 +243,7 @@
 				/*buf += "{";*/
 
 				//alternate " and '
-				if(osisQToTick)
+				if (u->osisQToTick)
 					buf += (level % 2) ? '\"' : '\'';
 				
 				if (who == "Jesus") {
@@ -246,13 +252,13 @@
 			}
 			else if (tag.isEndTag()) {
 				//alternate " and '
-				if(osisQToTick)
+				if (u->osisQToTick)
 					buf += (level % 2) ? '\"' : '\'';
 				//buf += "</font>";
 			}
 			else {	// empty quote marker
 				//alternate " and '
-				if(osisQToTick)
+				if (u->osisQToTick)
 					buf += (level % 2) ? '\"' : '\'';
 			}
 		}

Index: osisplain.cpp
===================================================================
RCS file: /usr/local/cvsroot/sword/src/modules/filters/osisplain.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- osisplain.cpp	27 Jul 2003 00:02:44 -0000	1.7
+++ osisplain.cpp	30 Jul 2003 00:51:34 -0000	1.8
@@ -46,8 +46,7 @@
         setTokenCaseSensitive(true);
 }
 
-char OSISPlain::processText(SWBuf &text, const SWKey *key, const SWModule *module)
-{
+char OSISPlain::processText(SWBuf &text, const SWKey *key, const SWModule *module) {
         SWBasicFilter::processText(text, key, module);  //handle tokens as usual
 	const char *from;
 	SWBuf orig = text;
@@ -67,24 +66,26 @@
         return 0;
 }
 
-bool OSISPlain::handleToken(SWBuf &buf, const char *token, DualStringMap &userData) {
+
+bool OSISPlain::handleToken(SWBuf &buf, const char *token, UserData *userData) {
         // manually process if it wasn't a simple substitution
 	if (!substituteToken(buf, token)) {
+		MyUserData *u = (MyUserData *)userData;
                 XMLTag tag(token);
 		if (((*token == 'w') && (token[1] == ' ')) ||
 		((*token == '/') && (token[1] == 'w') && (!token[2]))) {
 			bool start = false;
 			if (*token == 'w') {
 				if (token[strlen(token)-1] != '/') {
-					userData["w"] = token;
+					u->w = token;
 					return true;
 				}
 				start = true;
 			}
-			tag = (start) ? token : userData["w"].c_str();
+			tag = (start) ? token : u->w.c_str();
 			bool show = true;	// to handle unplaced article in kjv2003-- temporary till combined
 
-			SWBuf lastText = (start) ? "stuff" : userData["lastTextNode"].c_str();
+			SWBuf lastText = (start) ? "stuff" : u->lastTextNode.c_str();
 
 			const char *attrib;
 			const char *val;
@@ -138,12 +139,12 @@
 				if (!strstr(token, "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
 					buf += " (";
 				}
-				else	userData["suspendTextPassThru"] = "true";
+				else	u->suspendTextPassThru = true;
 			}
 		else if (!strncmp(token, "/note", 5)) {
-			if (userData["suspendTextPassThru"] == "false")
+			if (!u->suspendTextPassThru)
 				buf += ")";
-			else	userData["suspendTextPassThru"] = "false";
+			else	u->suspendTextPassThru = false;
 		}
 
 		// <p> paragraph tag

Index: osisrtf.cpp
===================================================================
RCS file: /usr/local/cvsroot/sword/src/modules/filters/osisrtf.cpp,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- osisrtf.cpp	27 Jul 2003 00:02:44 -0000	1.16
+++ osisrtf.cpp	30 Jul 2003 00:51:34 -0000	1.17
@@ -22,6 +22,12 @@
 
 SWORD_NAMESPACE_START
 
+
+OSISRTF::MyUserData::MyUserData(const SWModule *module, const SWKey *key) : UserData(module, key) {
+	osisQToTick = ((!module->getConfigEntry("OSISqToTick")) || (strcmp(module->getConfigEntry("OSISqToTick"), "false")));
+}
+
+
 OSISRTF::OSISRTF() {
 	setTokenStart("<");
 	setTokenEnd(">");
@@ -36,39 +42,32 @@
 	addEscapeStringSubstitute("lt", "<");
 	addEscapeStringSubstitute("gt", ">");
 	addEscapeStringSubstitute("quot", "\"");
-
+	setStageProcessing(POSTCHAR);		// just at bottom of for loop
         addTokenSubstitute("lg", "\\par ");
         addTokenSubstitute("/lg", "\\par ");
-
 	setTokenCaseSensitive(true);
 }
 
-char OSISRTF::processText(SWBuf &text, const SWKey *key, const SWModule *module)
-{
-        SWBasicFilter::processText(text, key, module);  //handle tokens as usual
-	const char *from;
-	SWBuf orig = text;
-	from = orig.c_str();
-	for (text = ""; *from; from++) {  //loop to remove extra spaces
-                if ((strchr(" \t\n\r", *from))) {
-                        while (*(from+1) && (strchr(" \t\n\r", *(from+1)))) {
-                                from++;
-                        }
-                        text += " ";
-                }
-                else {
-                        text += *from;
-                }
-        }
-        text += (char)0;
-        return 0;
+
+bool OSISRTF::processStage(char stage, SWBuf &text, const char *&from, UserData *userData) {
+	switch (stage) {
+	POSTCHAR:
+		if ((strchr(" \t\n\r", *from))) {
+			while (*(from+1) && (strchr(" \t\n\r", *(from+1)))) {
+				from++;
+			}
+			text += " ";
+			from++;
+		}
+	}
 }
 
-bool OSISRTF::handleToken(SWBuf &buf, const char *token, DualStringMap &userData) {
+
+bool OSISRTF::handleToken(SWBuf &buf, const char *token, UserData *userData) {
   // manually process if it wasn't a simple substitution
 	if (!substituteToken(buf, token)) {
+		MyUserData *u = (MyUserData *)userData;
 		XMLTag tag(token);
-		bool osisQToTick = ((!module->getConfigEntry("OSISqToTick")) || (strcmp(module->getConfigEntry("OSISqToTick"), "false")));
 
 		// <w> tag
 		if (!strcmp(tag.getName(), "w")) {
@@ -76,7 +75,7 @@
 			// start <w> tag
 			if ((!tag.isEmpty()) && (!tag.isEndTag())) {
 				buf += "{";
-				userData["w"] = token;
+				u->w = token;
 			}
 
 			// end or empty <w> tag
@@ -86,8 +85,8 @@
 				bool show = true;	// to handle unplaced article in kjv2003-- temporary till combined
 
 				if (endTag) {
-					tag = userData["w"].c_str();
-					lastText = userData["lastTextNode"].c_str();
+					tag = u->w.c_str();
+					lastText = u->lastTextNode.c_str();
 				}
 				else lastText = "stuff";
 
@@ -158,18 +157,18 @@
 						VerseKey *vkey;
 						// see if we have a VerseKey * or descendant
 						try {
-							vkey = SWDYNAMIC_CAST(VerseKey, this->key);
+							vkey = SWDYNAMIC_CAST(VerseKey, u->key);
 						}
 						catch ( ... ) {	}
 						if (vkey) {
 							buf.appendFormatted("{\\super <a href=\"\">*%c%i.%s</a>} ", ((tag.getAttribute("type") && ((!strcmp(tag.getAttribute("type"), "crossReference")) || (!strcmp(tag.getAttribute("type"), "x-cross-ref")))) ? 'x':'n'), vkey->Verse(), footnoteNumber.c_str());
 						}
 					}
-					userData["suspendTextPassThru"] = "true";
+					u->suspendTextPassThru = true;
 				}
 			}
 			if (tag.isEndTag()) {
-				userData["suspendTextPassThru"] = "false";
+				u->suspendTextPassThru = false;
 			}
 		}
 
@@ -249,7 +248,7 @@
 				buf += "{";
 
 				//alternate " and '
-				if (osisQToTick)
+				if (u->osisQToTick)
 					buf += (level % 2) ? '\"' : '\'';
 
 				if (who == "Jesus")
@@ -257,13 +256,13 @@
 			}
 			else if (tag.isEndTag()) {
 				//alternate " and '
-				if (osisQToTick)
+				if (u->osisQToTick)
 					buf += (level % 2) ? '\"' : '\'';
 				buf += "}";
 			}
 			else {	// empty quote marker
 				//alternate " and '
-				if (osisQToTick)
+				if (u->osisQToTick)
 					buf += (level % 2) ? '\"' : '\'';
 			}
 		}

Index: swbasicfilter.cpp
===================================================================
RCS file: /usr/local/cvsroot/sword/src/modules/filters/swbasicfilter.cpp,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- swbasicfilter.cpp	12 Jul 2003 22:58:48 -0000	1.24
+++ swbasicfilter.cpp	30 Jul 2003 00:51:34 -0000	1.25
@@ -29,11 +29,17 @@
 
 SWORD_NAMESPACE_START
 
+const char SWBasicFilter::INITIALIZE = 1;
+const char SWBasicFilter::PRECHAR    = 2;
+const char SWBasicFilter::POSTCHAR   = 4;
+const char SWBasicFilter::FINALIZE   = 8;
+
 SWBasicFilter::SWBasicFilter() {
-	tokenStart = 0;
-	tokenEnd = 0;
-	escStart = 0;
-	escEnd = 0;
+	processStages = 0;
+	tokenStart    = 0;
+	tokenEnd      = 0;
+	escStart      = 0;
+	escEnd        = 0;
 
 	setTokenStart("<");
 	setTokenEnd(">");
@@ -41,9 +47,9 @@
 	setEscapeEnd(";");
 
 	escStringCaseSensitive = false;
-	tokenCaseSensitive = false;
-	passThruUnknownToken = false;
-	passThruUnknownEsc = false;
+	tokenCaseSensitive     = false;
+	passThruUnknownToken   = false;
+	passThruUnknownEsc     = false;
 }
 
 
@@ -163,55 +169,50 @@
 }
 
 
-bool SWBasicFilter::handleToken(SWBuf &buf, const char *token, DualStringMap &userData) {
+bool SWBasicFilter::handleToken(SWBuf &buf, const char *token, UserData *userData) {
 	return substituteToken(buf, token);
 }
 
 
-bool SWBasicFilter::handleEscapeString(SWBuf &buf, const char *escString, DualStringMap &userData) {
+bool SWBasicFilter::handleEscapeString(SWBuf &buf, const char *escString, UserData *userData) {
 	return substituteEscapeString(buf, escString);
 }
 
 
 void SWBasicFilter::setEscapeStart(const char *escStart) {
 	stdstr(&(this->escStart), escStart);
+	escStartLen = strlen(escStart);
 }
 
 
 void SWBasicFilter::setEscapeEnd(const char *escEnd) {
 	stdstr(&(this->escEnd), escEnd);
+	escEndLen   = strlen(escEnd);
 }
 
 
 void SWBasicFilter::setTokenStart(const char *tokenStart) {
 	stdstr(&(this->tokenStart), tokenStart);
+	tokenStartLen = strlen(tokenStart);
 }
 
 
 void SWBasicFilter::setTokenEnd(const char *tokenEnd) {
 	stdstr(&(this->tokenEnd), tokenEnd);
+	tokenEndLen   = strlen(tokenEnd);
 }
 
 
 char SWBasicFilter::processText(SWBuf &text, const SWKey *key, const SWModule *module) {
-	this->key = key;
-	this->module = module;
         const char *from;
         char token[4096];
 	int tokpos = 0;
-	bool intoken 	= false;
+	bool intoken = false;
 	bool inEsc = false;
-	char escStartLen = strlen(escStart);
-	char escEndLen   = strlen(escEnd);
 	char escStartPos = 0, escEndPos = 0;
-	char tokenStartLen = strlen(tokenStart);
-	char tokenEndLen   = strlen(tokenEnd);
 	char tokenStartPos = 0, tokenEndPos = 0;
-	DualStringMap userData;
 	SWBuf lastTextNode;
-
-	bool suspendTextPassThru = false;
-	userData["suspendTextPassThru"] = "false";
+	UserData *userData = createUserData(module, key);
 
 	SWBuf orig = text;
 	from = orig.c_str();
@@ -246,7 +247,7 @@
 			if (*from == escEnd[escEndPos]) {
 				if (escEndPos == (escEndLen - 1)) {
 					intoken = false;
-					userData["lastTextNode"] = lastTextNode;
+					userData->lastTextNode = lastTextNode;
 					if ((!handleEscapeString(text, token, userData)) && (passThruUnknownEsc)) {
 						text += escStart;
 						text += token;
@@ -254,7 +255,6 @@
 					}
 					escEndPos = escStartPos = tokenEndPos = tokenStartPos = 0;
 					lastTextNode = "";
-					suspendTextPassThru = (!userData["suspendTextPassThru"].compare("true"));
 					continue;
 				}
 			}
@@ -264,7 +264,7 @@
 			if (*from == tokenEnd[tokenEndPos]) {
 				if (tokenEndPos == (tokenEndLen - 1)) {
 					intoken = false;
-					userData["lastTextNode"] = lastTextNode;
+					userData->lastTextNode = lastTextNode;
 					if ((!handleToken(text, token, userData)) && (passThruUnknownToken)) {
 						text += tokenStart;
 						text += token;
@@ -272,7 +272,6 @@
 					}
 					escEndPos = escStartPos = tokenEndPos = tokenStartPos = 0;
 					lastTextNode = "";
-					suspendTextPassThru = (!userData["suspendTextPassThru"].compare("true"));
 					continue;
 				}
 			}
@@ -284,11 +283,12 @@
 				token[tokpos+2] = 0;
 		}
 		else {
-			if (!suspendTextPassThru)
+			if (!userData->suspendTextPassThru)
 				text += *from;
 			lastTextNode += *from;
 		}
 	}
+	delete userData;
 	return 0;
 }
 

Index: thmlhtml.cpp
===================================================================
RCS file: /usr/local/cvsroot/sword/src/modules/filters/thmlhtml.cpp,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- thmlhtml.cpp	27 Jun 2003 01:41:07 -0000	1.27
+++ thmlhtml.cpp	30 Jul 2003 00:51:34 -0000	1.28
@@ -134,8 +134,9 @@
 }
 
 
-bool ThMLHTML::handleToken(SWBuf &buf, const char *token, DualStringMap &userData) {
+bool ThMLHTML::handleToken(SWBuf &buf, const char *token, UserData *userData) {
 	if (!substituteToken(buf, token)) { // manually process if it wasn't a simple substitution
+		MyUserData *u = (MyUserData *)userData;
 		XMLTag tag(token);
 		if (!strcmp(tag.getName(), "sync")) {
 			if (tag.getAttribute("type") && tag.getAttribute("value") && !strcmp(tag.getAttribute("type"), "Strongs")) {
@@ -166,17 +167,17 @@
 			}
 		}
 		else if (!strcmp(tag.getName(), "div")) {
-			if (tag.isEndTag() && (userData["SecHead"] == "true")) {
+			if (tag.isEndTag() && (u->SecHead)) {
 				buf += "</i></b><br />";
-				userData["SecHead"] = "false";
+				u->SecHead = false;
 			}
 			else if (tag.getAttribute("class")) {
 				if (!strcmp(tag.getAttribute("class"), "sechead")) {
-					userData["SecHead"] = "true";
+					u->SecHead = true;
 					buf += "<br /><b><i>";
 				}
 				else if (!strcmp(tag.getAttribute("class"), "title")) {
-					userData["SecHead"] = "true";
+					u->SecHead = true;
 					buf += "<br /><b><i>";
 				}
 			}
@@ -197,7 +198,7 @@
 					buf += '"';
 					if (*(c+1) == '/') {
 						buf += "file:";
-						buf += module->getConfigEntry("AbsoluteDataPath");
+						buf += userData->module->getConfigEntry("AbsoluteDataPath");
 						if (buf[buf.length()-2] == '/')
 							c++;		// skip '/'
 					}

Index: thmlhtmlhref.cpp
===================================================================
RCS file: /usr/local/cvsroot/sword/src/modules/filters/thmlhtmlhref.cpp,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -d -r1.34 -r1.35
--- thmlhtmlhref.cpp	27 Jun 2003 01:41:07 -0000	1.34
+++ thmlhtmlhref.cpp	30 Jul 2003 00:51:34 -0000	1.35
@@ -135,9 +135,10 @@
 }
 
 
-bool ThMLHTMLHREF::handleToken(SWBuf &buf, const char *token, DualStringMap &userData) {
+bool ThMLHTMLHREF::handleToken(SWBuf &buf, const char *token, UserData *userData) {
 	const char *tok;
 	if (!substituteToken(buf, token)) { // manually process if it wasn't a simple substitution
+		MyUserData *u = (MyUserData *)userData;
 		XMLTag tag(token);
 		if (tag.getName() && !strcmp(tag.getName(), "sync")) {
 			if( tag.getAttribute("type") && !strcmp(tag.getAttribute("type"), "morph")) { //&gt;
@@ -167,29 +168,29 @@
 				buf += "</a>&gt; </em></small>";
 		}
 		else if (tag.getName() && !strcmp(tag.getName(), "scripture")) {
-			userData["inscriptRef"] = "true";
+			u->inscriptRef = true;
 			buf += "<i>";
 		}
 		else if (tag.getName() && !strcmp(tag.getName(), "scripRef")) {
 			if (tag.isEndTag()) {
-				if (userData["inscriptRef"] == "true") { // like  "<scripRef passage="John 3:16">John 3:16</scripRef>"
-					userData["inscriptRef"] = "false";
+				if (u->inscriptRef) { // like  "<scripRef passage="John 3:16">John 3:16</scripRef>"
+					u->inscriptRef = false;
 					buf += "</a>";
 				}
 				else { // end of scripRef like "<scripRef>John 3:16</scripRef>"
 					buf += "<a href=\"passage=";
-					buf += userData["lastTextNode"].c_str();
+					buf += u->lastTextNode.c_str();
 					buf += "\">";
 
-					buf += userData["lastTextNode"].c_str();
+					buf += u->lastTextNode.c_str();
 					buf += "</a>";
 
 					// let's let text resume to output again
-					userData["suspendTextPassThru"] = "false";
+					u->suspendTextPassThru = false;
 				}
 			}
 			else if (tag.getAttribute("passage")) { //passage given
-				userData["inscriptRef"] = "true";
+				u->inscriptRef = true;
 
 				buf += "<a href=\"";
 				if (const char* version = tag.getAttribute("version")) {
@@ -204,23 +205,23 @@
 				buf += "\">";
 			}
 			else { //no passage or version given
-				userData["inscriptRef"] = "false";
+				u->inscriptRef = false;
 				// let's stop text from going to output
-				userData["suspendTextPassThru"] = "true";
+				u->suspendTextPassThru = true;
 			}
 		}
 		else if (tag.getName() && !strcmp(tag.getName(), "div")) {
-			if (tag.isEndTag() && userData["SecHead"] == "true") {
+			if (tag.isEndTag() && u->SecHead) {
 				buf += "</i></b><br />";
-				userData["SecHead"] = "false";
+				u->SecHead = false;
 			}
 			else if (tag.getAttribute("class")) {
 				if (!stricmp(tag.getAttribute("class"), "sechead")) {
-					userData["SecHead"] = "true";
+					u->SecHead = true;
 					buf += "<br /><b><i>";
 				}
 				else if (!stricmp(tag.getAttribute("class"), "title")) {
-					userData["SecHead"] = "true";
+					u->SecHead = true;
 					buf += "<br /><b><i>";
 				}
 			}
@@ -254,7 +255,7 @@
 					buf += '"';
 					if (*(c+1) == '/') {
 						buf += "file:";
-						buf += module->getConfigEntry("AbsoluteDataPath");
+						buf += userData->module->getConfigEntry("AbsoluteDataPath");
 						if (buf[buf.length()-2] == '/')
 							c++;		// skip '/'
 					}

Index: thmlrtf.cpp
===================================================================
RCS file: /usr/local/cvsroot/sword/src/modules/filters/thmlrtf.cpp,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -d -r1.33 -r1.34
--- thmlrtf.cpp	26 Jul 2003 23:11:06 -0000	1.33
+++ thmlrtf.cpp	30 Jul 2003 00:51:34 -0000	1.34
@@ -170,7 +170,8 @@
         return 0;
 }
 
-bool ThMLRTF::handleToken(SWBuf &buf, const char *token, DualStringMap &userData) {
+bool ThMLRTF::handleToken(SWBuf &buf, const char *token, UserData *userData) {
+	MyUserData *u = (MyUserData *)userData;
 	if (!substituteToken(buf, token)) {
 	// manually process if it wasn't a simple substitution
 		if (!strncmp(token, "sync type=\"Strongs\" value=\"", 27)) {
@@ -217,17 +218,17 @@
 			buf += '{';
 			if (!strncmp(token, "div class=\"title\"", 17)) {
 				buf += "\\par\\i1\\b1 ";
-				userData["sechead"] = "true";
+				u->sechead = true;
 			}
 			else if (!strncmp(token, "div class=\"sechead\"", 19)) {
 				buf += "\\par\\i1\\b1 ";
-				userData["sechead"] = "true";
+				u->sechead = true;
 			}
 		}
 		else if (!strncmp(token, "/div", 4)) {
-			if (userData["sechead"] == "true") {
+			if (u->sechead) {
 				buf += "\\par ";
-				userData["sechead"] = "false";
+				u->sechead = false;
 			}
 			buf += '}';
 		}
@@ -239,9 +240,9 @@
 			if (!src)		// assert we have a src attribute
 				return false;
 
-                        char* filepath = new char[strlen(module->getConfigEntry("AbsoluteDataPath")) + strlen(token)];
+                        char* filepath = new char[strlen(u->module->getConfigEntry("AbsoluteDataPath")) + strlen(token)];
                         *filepath = 0;
-                        strcpy(filepath, module->getConfigEntry("AbsoluteDataPath"));
+                        strcpy(filepath, userData->module->getConfigEntry("AbsoluteDataPath"));
                         unsigned long i = strlen(filepath);
                         const char *c;
 			for (c = (src + 5); *c != '"'; c++) {

Index: thmlwebif.cpp
===================================================================
RCS file: /usr/local/cvsroot/sword/src/modules/filters/thmlwebif.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- thmlwebif.cpp	27 Jun 2003 01:41:08 -0000	1.5
+++ thmlwebif.cpp	30 Jul 2003 00:51:34 -0000	1.6
@@ -26,10 +26,11 @@
   //all's done in ThMLHTMLHREF
 }
 
-bool ThMLWEBIF::handleToken(SWBuf &buf, const char *token, DualStringMap &userData) {
+bool ThMLWEBIF::handleToken(SWBuf &buf, const char *token, UserData *userData) {
 	const char *tok;
 
 	if (!substituteToken(buf, token)) { // manually process if it wasn't a simple substitution
+		MyUserData *u = (MyUserData *)userData;
 		XMLTag tag(token);
 		SWBuf url;
 		if (!strcmp(tag.getName(), "sync")) {
@@ -61,29 +62,29 @@
 		}
 		else if (!strcmp(tag.getName(), "scripRef")) {
 			if (tag.isEndTag()) {
-				if (userData["inscriptRef"] == "true") { // like  "<scripRef passage="John 3:16">John 3:16</scripRef>"
-					userData["inscriptRef"] = "false";
+				if (u->inscriptRef) { // like  "<scripRef passage="John 3:16">John 3:16</scripRef>"
+					u->inscriptRef = false;
 					buf += "</a>";
 				}
 				else { // end of scripRef like "<scripRef>John 3:16</scripRef>"
-					url = userData["lastTextNode"];
+					url = u->lastTextNode;
 					buf.appendFormatted("<a href=\"%s?key=%s\">", passageStudyURL.c_str(), encodeURL(url).c_str());
-					buf += userData["lastTextNode"].c_str();
+					buf += u->lastTextNode.c_str();
 					buf += "</a>";
 
 					// let's let text resume to output again
-					userData["suspendTextPassThru"] = "false";
+					u->suspendTextPassThru = false;
 				}
 			}
 			else if (tag.getAttribute("passage")) { //passage given
-				userData["inscriptRef"] = "true";
+				u->inscriptRef = true;
 
 				buf.appendFormatted("<a href=\"%s?key=%s\">", passageStudyURL.c_str(), encodeURL(tag.getAttribute("passage")).c_str());
 			}
 			else { //no passage given
-				userData["inscriptRef"] = "false";
+				u->inscriptRef = false;
 				// let's stop text from going to output
-				userData["suspendTextPassThru"] = "true";
+				u->suspendTextPassThru = true;
 			}
 		}
 		else {