[sword-cvs] sword/src/modules/filters thmlvariants.cpp,1.6,1.7

sword@www.crosswire.org sword@www.crosswire.org
Sat, 5 Apr 2003 01:51:10 -0700


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

Modified Files:
	thmlvariants.cpp 
Log Message:
corrected small mis-ordering error
trimmed commented code


Index: thmlvariants.cpp
===================================================================
RCS file: /usr/local/cvsroot/sword/src/modules/filters/thmlvariants.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** thmlvariants.cpp	8 Mar 2003 23:58:24 -0000	1.6
--- thmlvariants.cpp	5 Apr 2003 08:51:08 -0000	1.7
***************
*** 81,90 ****
                                    	continue;
  				}
- 				else if (!strncmp(token.c_str(), "/div", 4)) {
- 					hide = false;
-                                 	continue;
- 				}
- 
- 				// if not a footnote token, keep token in text
  				if (!hide) {
  					text += '<';
--- 81,84 ----
***************
*** 92,140 ****
  					text += '>';
  				}
! 				continue;
! 			}
! 			if (intoken) {
! 				token += *from;
! 			}
! 			else if (!hide) {
! 				text += *from;
! 			}
! 		}
! 
! 	}
! 	
! 	//the above code should work, it combines this part in it. (jansorg)
! 	
! /*	else if (option == 1) { //we want variant only
! 		bool intoken = false;
! 		bool hide = false;
! 
! 		SWBuf token;
! 		SWBuf orig = text;
! 		const char *from = orig.c_str();
! 
! 		for (text = ""; *from; from++) {
! 			if (*from == '<') {
! 				intoken = true;
! 				token = "";
! 				continue;
! 			}
! 			else if (*from == '>') {	// process tokens
! 				intoken = false;
! 				if (!strncmp(token.c_str(), "div type=\"variant\" class=\"1\"", 28)) {
! 				  hide = true;
!                                   continue;
! 				}
! 				else if (!strncmp(token.c_str(), "/div", 4)) {
! 				  hide = false;
!                                   continue;
  				}
  
- 				// if not a footnote token, keep token in text
- 				if (!hide) {
- 					text += '<';
- 					text.append( token );
- 					text += '>';
- 				}
  				continue;
  			}
--- 86,94 ----
  					text += '>';
  				}
!                                 if (!strncmp(token.c_str(), "/div", 4)) {
! 					hide = false;
!                                 	continue;
  				}
  
  				continue;
  			}
***************
*** 146,151 ****
  			}
  		}
  	}
- */
  
  	return 0;
--- 100,105 ----
  			}
  		}
+ 
  	}
  
  	return 0;