summaryrefslogtreecommitdiff
path: root/src/modules/filters/thmlfootnotes.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/filters/thmlfootnotes.cpp')
-rw-r--r--src/modules/filters/thmlfootnotes.cpp30
1 files changed, 19 insertions, 11 deletions
diff --git a/src/modules/filters/thmlfootnotes.cpp b/src/modules/filters/thmlfootnotes.cpp
index e75311a..566551f 100644
--- a/src/modules/filters/thmlfootnotes.cpp
+++ b/src/modules/filters/thmlfootnotes.cpp
@@ -1,10 +1,11 @@
/******************************************************************************
*
- * thmlfootnotes - SWFilter descendant to hide or show footnotes
- * in a ThML module.
+ * thmlfootnotes.cpp - SWFilter descendant to hide or show footnotes
+ * in a ThML module
*
+ * $Id: thmlfootnotes.cpp 2980 2013-09-14 21:51:47Z scribe $
*
- * Copyright 2009 CrossWire Bible Society (http://www.crosswire.org)
+ * Copyright 2001-2013 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
* P. O. Box 2528
* Tempe, AZ 85280-2528
@@ -30,16 +31,23 @@
#include <versekey.h>
#include <utilxml.h>
+
SWORD_NAMESPACE_START
-const char oName[] = "Footnotes";
-const char oTip[] = "Toggles Footnotes On and Off if they exist";
+namespace {
+
+ static const char oName[] = "Footnotes";
+ static const char oTip[] = "Toggles Footnotes On and Off if they exist";
+
+ static const StringList *oValues() {
+ static const SWBuf choices[3] = {"Off", "On", ""};
+ static const StringList oVals(&choices[0], &choices[2]);
+ return &oVals;
+ }
+}
-const SWBuf choices[3] = {"Off", "On", ""};
-const StringList oValues(&choices[0], &choices[2]);
-ThMLFootnotes::ThMLFootnotes() : SWOptionFilter(oName, oTip, &oValues) {
- setOptionValue("Off");
+ThMLFootnotes::ThMLFootnotes() : SWOptionFilter(oName, oTip, oValues()) {
}
@@ -56,7 +64,7 @@ char ThMLFootnotes::processText(SWBuf &text, const SWKey *key, const SWModule *m
SWBuf refs = "";
int footnoteNum = 1;
char buf[254];
- SWKey *p = (module) ? module->CreateKey() : (key) ? key->clone() : new VerseKey();
+ SWKey *p = (module) ? module->createKey() : (key) ? key->clone() : new VerseKey();
VerseKey *parser = SWDYNAMIC_CAST(VerseKey, p);
if (!parser) {
delete p;
@@ -101,7 +109,7 @@ char ThMLFootnotes::processText(SWBuf &text, const SWKey *key, const SWModule *m
startTag.setAttribute("swordFootnote", buf);
if ((startTag.getAttribute("type")) && (!strcmp(startTag.getAttribute("type"), "crossReference"))) {
if (!refs.length())
- refs = parser->ParseVerseList(tagText.c_str(), *parser, true).getRangeText();
+ refs = parser->parseVerseList(tagText.c_str(), *parser, true).getRangeText();
module->getEntryAttributes()["Footnote"][buf]["refList"] = refs.c_str();
}
}