[sword-cvs] sword/src/modules/filters swbasicfilter.cpp,1.33,1.34

sword at www.crosswire.org sword at www.crosswire.org
Wed Jun 2 07:44:06 MST 2004


Committed by: joachim

Update of /cvs/core/sword/src/modules/filters
In directory www:/tmp/cvs-serv30622/src/modules/filters

Modified Files:
	swbasicfilter.cpp 
Log Message:
fixed a SWBasicFilter bug (joachim)

Index: swbasicfilter.cpp
===================================================================
RCS file: /cvs/core/sword/src/modules/filters/swbasicfilter.cpp,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -d -r1.33 -r1.34
--- swbasicfilter.cpp	24 Oct 2003 02:43:46 -0000	1.33
+++ swbasicfilter.cpp	2 Jun 2004 14:44:03 -0000	1.34
@@ -204,8 +204,8 @@
 
 
 char SWBasicFilter::processText(SWBuf &text, const SWKey *key, const SWModule *module) {
-        char *from;
-        char token[4096];
+	char *from;
+	char token[4096];
 	int tokpos = 0;
 	bool intoken = false;
 	bool inEsc = false;
@@ -263,10 +263,13 @@
 				if (escEndPos == (escEndLen - 1)) {
 					intoken = false;
 					userData->lastTextNode = lastTextNode;
-					if ((!handleEscapeString(text, token, userData)) && (passThruUnknownEsc)) {
-						text += escStart;
-						text += token;
-						text += escEnd;
+					
+					if (!userData->suspendTextPassThru)  { //if text through is disabled no tokens should pass, too
+						if ((!handleEscapeString(text, token, userData)) && (passThruUnknownEsc)) {
+							text += escStart;
+							text += token;
+							text += escEnd;
+						}
 					}
 					escEndPos = escStartPos = tokenEndPos = tokenStartPos = 0;
 					lastTextNode = "";
@@ -293,16 +296,18 @@
 		}
 
 		if (intoken) {
-			if (tokpos < 4090)
+			if (tokpos < 4090) {
 				token[tokpos++] = *from;
 				token[tokpos+2] = 0;
+			}
 		}
 		else {
-			if ((!userData->supressAdjacentWhitespace) || (*from != ' ')) {
-				if (!userData->suspendTextPassThru)
-					text += *from;
-				lastTextNode += *from;
-			}
+ 			if ((!userData->supressAdjacentWhitespace) || (*from != ' ')) {
+				if (!userData->suspendTextPassThru) {
+					text.append( *from );
+				}
+				lastTextNode.append( *from );
+ 			}
 			userData->supressAdjacentWhitespace = false;
 		}
 



More information about the sword-cvs mailing list