[sword-svn] r3338 - trunk/src/modules/filters
refdoc at crosswire.org
refdoc at crosswire.org
Thu Mar 12 13:04:06 MST 2015
Author: refdoc
Date: 2015-03-12 13:04:06 -0700 (Thu, 12 Mar 2015)
New Revision: 3338
Modified:
trunk/src/modules/filters/osisosis.cpp
Log:
ensured that u->module is never called without prior checking. removed adding of <verse> tag
Modified: trunk/src/modules/filters/osisosis.cpp
===================================================================
--- trunk/src/modules/filters/osisosis.cpp 2015-03-12 18:21:57 UTC (rev 3337)
+++ trunk/src/modules/filters/osisosis.cpp 2015-03-12 20:04:06 UTC (rev 3338)
@@ -58,39 +58,28 @@
char status = SWBasicFilter::processText(text, key, module);
VerseKey *vkey = SWDYNAMIC_CAST(VerseKey, key);
if (vkey) {
- SWBuf ref = "";
if (vkey->getVerse()) {
- ref.appendFormatted("\t\t<verse osisID=\"%s\">", vkey->getOSISRef());
- }
+ VerseKey *tmp = (VerseKey *)vkey->clone();
+ *tmp = *vkey;
+ tmp->setAutoNormalize(false);
+ tmp->setIntros(true);
- if (ref.length() > 0) {
-
- text = ref + text;
-
- if (vkey->getVerse()) {
- VerseKey *tmp = (VerseKey *)vkey->clone();
- *tmp = *vkey;
- tmp->setAutoNormalize(false);
- tmp->setIntros(true);
-
- text += "</verse>";
-
+ *tmp = MAXVERSE;
+ if (*vkey == *tmp) {
+ tmp->setVerse(0);
+// sprintf(ref, "\t</div>");
+// pushString(&to, ref);
+ *tmp = MAXCHAPTER;
*tmp = MAXVERSE;
if (*vkey == *tmp) {
+ tmp->setChapter(0);
tmp->setVerse(0);
// sprintf(ref, "\t</div>");
// pushString(&to, ref);
- *tmp = MAXCHAPTER;
- *tmp = MAXVERSE;
- if (*vkey == *tmp) {
- tmp->setChapter(0);
- tmp->setVerse(0);
-// sprintf(ref, "\t</div>");
-// pushString(&to, ref);
- }
}
- delete tmp;
}
+ delete tmp;
+ }
//
// else if (vkey->Chapter()) {
@@ -98,7 +87,7 @@
// }
// else sprintf(ref, "\t<div type=\"book\" osisID=\"%s\">", vkey->getOSISRef());
//
- }
+
}
return status;
}
@@ -149,8 +138,6 @@
else if (!strcmp(tag.getName(), "note")) {
if (!tag.isEndTag()) {
SWBuf type = tag.getAttribute("type");
- SWBuf footnoteNumber = tag.getAttribute("swordFootnote");
- SWBuf footnoteBody = u->module->getEntryAttributes()["Footnote"][footnoteNumber]["body"];
bool strongsMarkup = (type == "x-strongsMarkup" || type == "strongsMarkup"); // the latter is deprecated
if (strongsMarkup) {
More information about the sword-cvs
mailing list