[sword-cvs] sword/src/modules/filters thmlrtf.cpp,1.26,1.27

sword@www.crosswire.org sword@www.crosswire.org
Mon, 24 Feb 2003 21:12:49 -0700


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

Modified Files:
	thmlrtf.cpp 
Log Message:
no message

Index: thmlrtf.cpp
===================================================================
RCS file: /usr/local/cvsroot/sword/src/modules/filters/thmlrtf.cpp,v
retrieving revision 1.26
retrieving revision 1.27
diff -C2 -d -r1.26 -r1.27
*** thmlrtf.cpp	22 Feb 2003 07:25:20 -0000	1.26
--- thmlrtf.cpp	25 Feb 2003 04:12:47 -0000	1.27
***************
*** 150,216 ****
  }
  
! bool ThMLRTF::handleToken(char **buf, const char *token, DualStringMap &userData) {
  	if (!substituteToken(buf, token)) {
  	// manually process if it wasn't a simple substitution
  		if (!strncmp(token, "sync type=\"Strongs\" value=\"", 27)) {
!                         if (token[27] == 'H' || token[27] == 'G' || token[27] == 'A') {
!         			pushString(buf, " {\\fs15 <");
!                                 for (unsigned int i = 28; token[i] != '\"'; i++)
!                 		        *(*buf)++ = token[i];
! 				pushString(buf, ">}");
! 				    }
! 				    else if (token[27] == 'T') {
! 						  pushString(buf, " {\\fs15 (");
  				for (unsigned int i = 28; token[i] != '\"'; i++)
! 					*(*buf)++ = token[i];
! 				pushString(buf, ")}");
! 				    }
  		}
  		else if (!strncmp(token, "sync type=\"morph\" ", 18)) {
! 			pushString(buf, " {\\fs15 (");
  			for (const char *tok = token + 5; *tok; tok++) {
  				if (!strncmp(tok, "value=\"", 7)) {
  					tok += 7;
  					for (;*tok != '\"'; tok++)
! 						*(*buf)++ = *tok;
  					break;
  				}
  			}
  
! 			pushString(buf, ")}");
  		}
  		else if (!strncmp(token, "sync type=\"lemma\" value=\"", 25)) {
! 			pushString(buf, "{\\fs15 (");
  			for (unsigned int i = 25; token[i] != '\"'; i++)
! 				*(*buf)++ = token[i];
! 			pushString(buf, ")}");
  		}
  		else if (!strncmp(token, "scripRef", 8)) {
! //			pushString(buf, "{\\cf2 #");
! 			pushString(buf, "<a href=\"\">");
  		}
  		else if (!strncmp(token, "/scripRef", 9)) {
! 			pushString(buf, "</a>");
  		}
  		else if (!strncmp(token, "div", 3)) {
! 			*(*buf)++ = '{';
  			if (!strncmp(token, "div class=\"title\"", 17)) {
! 				pushString(buf, "\\par\\i1\\b1 ");
  				userData["sechead"] = "true";
  			}
  			else if (!strncmp(token, "div class=\"sechead\"", 19)) {
! 				pushString(buf, "\\par\\i1\\b1 ");
  				userData["sechead"] = "true";
  			}
  		}
  		else if (!strncmp(token, "/div", 4)) {
! 			*(*buf)++ = '}';
  			if (userData["sechead"] == "true") {
! 				pushString(buf, "\\par ");
  				userData["sechead"] == "false";
  			}
  		}
  		else if (!strncmp(token, "note", 4)) {
! 			pushString(buf, " {\\i1\\fs15 (");
  		}
  
--- 150,216 ----
  }
  
! bool ThMLRTF::handleToken(SWBuf &buf, const char *token, DualStringMap &userData) {
  	if (!substituteToken(buf, token)) {
  	// manually process if it wasn't a simple substitution
  		if (!strncmp(token, "sync type=\"Strongs\" value=\"", 27)) {
! 			if (token[27] == 'H' || token[27] == 'G' || token[27] == 'A') {
! 				buf += " {\\fs15 <";
  				for (unsigned int i = 28; token[i] != '\"'; i++)
! 					buf += token[i];
! 				buf += ">}";
! 			}
! 			else if (token[27] == 'T') {
! 				buf += " {\\fs15 (";
! 				for (unsigned int i = 28; token[i] != '\"'; i++)
! 					buf += token[i];
! 				buf += ")}";
! 			}
  		}
  		else if (!strncmp(token, "sync type=\"morph\" ", 18)) {
! 			buf += " {\\fs15 (";
  			for (const char *tok = token + 5; *tok; tok++) {
  				if (!strncmp(tok, "value=\"", 7)) {
  					tok += 7;
  					for (;*tok != '\"'; tok++)
! 						buf += *tok;
  					break;
  				}
  			}
  
! 			buf += ")}";
  		}
  		else if (!strncmp(token, "sync type=\"lemma\" value=\"", 25)) {
! 			buf += "{\\fs15 (";
  			for (unsigned int i = 25; token[i] != '\"'; i++)
! 				buf += token[i];
! 			buf += ")}";
  		}
  		else if (!strncmp(token, "scripRef", 8)) {
! //			buf += "{\\cf2 #";
! 			buf += "<a href=\"\">";
  		}
  		else if (!strncmp(token, "/scripRef", 9)) {
! 			buf += "</a>";
  		}
  		else if (!strncmp(token, "div", 3)) {
! 			buf += '{';
  			if (!strncmp(token, "div class=\"title\"", 17)) {
! 				buf += "\\par\\i1\\b1 ";
  				userData["sechead"] = "true";
  			}
  			else if (!strncmp(token, "div class=\"sechead\"", 19)) {
! 				buf += "\\par\\i1\\b1 ";
  				userData["sechead"] = "true";
  			}
  		}
  		else if (!strncmp(token, "/div", 4)) {
! 			buf += '}';
  			if (userData["sechead"] == "true") {
! 				buf += "\\par ";
  				userData["sechead"] == "false";
  			}
  		}
  		else if (!strncmp(token, "note", 4)) {
! 			buf += " {\\i1\\fs15 (";
  		}