[sword-cvs] sword/utilities osis2mod.cpp,1.7,1.8
sword@www.crosswire.org
sword@www.crosswire.org
Fri, 23 Jan 2004 20:11:52 -0700
Update of /cvs/core/sword/utilities
In directory www:/tmp/cvs-serv21720/utilities
Modified Files:
osis2mod.cpp
Log Message:
no message
Index: osis2mod.cpp
===================================================================
RCS file: /cvs/core/sword/utilities/osis2mod.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- osis2mod.cpp 21 Nov 2003 06:13:15 -0000 1.7
+++ osis2mod.cpp 24 Jan 2004 03:11:50 -0000 1.8
@@ -107,16 +107,16 @@
static SWBuf lastTitle = "";
static int titleOffset = -1;
- if ((!strcmp(token.getName(), "title")) && (!token.isEndTag())) {
+ if ((tag.getName()) && (!strcmp(token.getName(), "title")) && (!token.isEndTag())) {
titleOffset = text.length();
return false;
}
- if ((!strcmp(token.getName(), "title")) && (token.isEndTag())) {
+ if ((tag.getName()) && (!strcmp(token.getName(), "title")) && (token.isEndTag())) {
lastTitle = (text.c_str() + titleOffset);
lastTitle += token;
return false;
}
- if (((!strcmp(token.getName(), "div")) && (!token.isEndTag()) && (token.getAttribute("osisID"))) && (!strcmp(token.getAttribute("type"), "book"))) {
+ if (((tag.getName()) && (!strcmp(token.getName(), "div")) && (!token.isEndTag()) && (token.getAttribute("osisID"))) && (!strcmp(token.getAttribute("type"), "book"))) {
if (inHeader) { // this one should never happen, but just in case
// cout << "HEADING ";
writeEntry(*currentVerse, text);
@@ -130,7 +130,7 @@
lastTitle = "";
text = "";
}
- else if ((((!strcmp(token.getName(), "div")) && (!token.isEndTag()) && (token.getAttribute("osisID"))) && (!strcmp(token.getAttribute("type"), "chapter"))) || ((!strcmp(token.getName(), "chapter")) && (!token.isEndTag()) && (token.getAttribute("osisID")))) {
+ else if ((((tag.getName()) && (!strcmp(token.getName(), "div")) && (!token.isEndTag()) && (token.getAttribute("osisID"))) && (!strcmp(token.getAttribute("type"), "chapter"))) || ((!strcmp(token.getName(), "chapter")) && (!token.isEndTag()) && (token.getAttribute("osisID")))) {
if (inHeader) {
// cout << "HEADING ";
writeEntry(*currentVerse, text);
@@ -144,7 +144,7 @@
lastTitle = "";
text = "";
}
- if ((!strcmp(token.getName(), "verse")) && (!token.isEndTag())) {
+ if ((tag.getName()) && (!strcmp(token.getName(), "verse")) && (!token.isEndTag())) {
if (inHeader) {
// cout << "HEADING ";
writeEntry(*currentVerse, text);
@@ -155,7 +155,7 @@
text = "";
return true;
}
- if ((!strcmp(token.getName(), "verse")) && (token.isEndTag())) {
+ if ((tag.getName()) && (!strcmp(token.getName(), "verse")) && (token.isEndTag())) {
if (lastTitle.length()) {
SWBuf titleHead = lastTitle;
char *end = strchr(lastTitle.getRawData(), '>');