[sword-cvs] sword/src/modules/filters thmlheadings.cpp,1.7,1.8

sword@www.crosswire.org sword@www.crosswire.org
Sun, 1 Jun 2003 14:04:03 -0700


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

Modified Files:
	thmlheadings.cpp 
Log Message:
converted thmlheadings to utilxml

Index: thmlheadings.cpp
===================================================================
RCS file: /usr/local/cvsroot/sword/src/modules/filters/thmlheadings.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** thmlheadings.cpp	8 Mar 2003 23:58:24 -0000	1.7
--- thmlheadings.cpp	1 Jun 2003 21:04:01 -0000	1.8
***************
*** 9,12 ****
--- 9,16 ----
  #include <string.h>
  #include <thmlheadings.h>
+ #include <utilxml.h>
+ 
+ #include <iostream>
+ 
  #ifndef __GNUC__
  #else
***************
*** 60,75 ****
  			if (*from == '>') {	// process tokens
  				intoken = false;
! 				if (!strnicmp(token, "div class=\"sechead\"", 19)) {
! 					hide = true;
! 					continue;
! 				}
! 				
! 				if (!strnicmp(token, "div class=\"title\"", 17)) {
! 					hide = true;
! 					continue;
! 				}
! 				else if (hide && !strnicmp(token, "/div", 4)) {
! 					hide = false;
! 					continue;
  				}
  
--- 64,88 ----
  			if (*from == '>') {	// process tokens
  				intoken = false;
! 
! 				XMLTag tag(token);
! 
! 				if (!stricmp(tag.getName(), "div")) { //we only want a div tag
! 					//std::cout << tag.toString() << " " << tag.isEndTag() << std::endl;
! 
! 					if (tag.getAttribute("class") && !stricmp(tag.getAttribute("class"), "sechead")) {
! 						hide = true;
! 						continue;
! 					}
! 
! 					if (tag.getAttribute("class") && !stricmp(tag.getAttribute("class"), "title")) {
! 						hide = true;
! 						continue;
! 					}
! 
! 					if (hide && tag.isEndTag()) {
! 						hide = false;
! 						continue;
! 					}
! 
  				}
  
***************
*** 77,85 ****
  				if (!hide) {
  					text += '<';
! 					text.append(token);
  					text += '>';
  				}
  				continue;
  			}
  			if (intoken) { //copy token
  				token += *from;
--- 90,99 ----
  				if (!hide) {
  					text += '<';
! 					text += token;
  					text += '>';
  				}
  				continue;
  			}
+ 
  			if (intoken) { //copy token
  				token += *from;