summaryrefslogtreecommitdiff
path: root/src/modules/filters/osisfootnotes.cpp
diff options
context:
space:
mode:
authorRoberto C. Sanchez <roberto@connexer.com>2014-05-12 08:21:30 -0400
committerRoberto C. Sanchez <roberto@connexer.com>2014-05-12 08:21:30 -0400
commit7a00574163029c0c2b649878c95d5acbd083564a (patch)
treec13cc5736025834df2874ed87ee8598070025ea6 /src/modules/filters/osisfootnotes.cpp
parentb745315323de9f27538edac9453205ca70e6186e (diff)
Imported Upstream version 1.7.2+dfsg
Diffstat (limited to 'src/modules/filters/osisfootnotes.cpp')
-rw-r--r--src/modules/filters/osisfootnotes.cpp29
1 files changed, 18 insertions, 11 deletions
diff --git a/src/modules/filters/osisfootnotes.cpp b/src/modules/filters/osisfootnotes.cpp
index 3d0d2d4..8008d5c 100644
--- a/src/modules/filters/osisfootnotes.cpp
+++ b/src/modules/filters/osisfootnotes.cpp
@@ -1,10 +1,11 @@
/******************************************************************************
*
- * osisfootnotes - SWFilter descendant to hide or show footnotes
- * in an OSIS module.
+ * osisfootnotes.cpp - SWFilter descendant to hide or show footnotes
+ * in an OSIS module
*
+ * $Id: osisfootnotes.cpp 2980 2013-09-14 21:51:47Z scribe $
*
- * Copyright 2009 CrossWire Bible Society (http://www.crosswire.org)
+ * Copyright 2003-2013 CrossWire Bible Society (http://www.crosswire.org)
* CrossWire Bible Society
* P. O. Box 2528
* Tempe, AZ 85280-2528
@@ -29,17 +30,23 @@
#include <utilxml.h>
#include <utilstr.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";
-const SWBuf choices[3] = {"Off", "On", ""};
-const StringList oValues(&choices[0], &choices[2]);
+ static const StringList *oValues() {
+ static const SWBuf choices[3] = {"Off", "On", ""};
+ static const StringList oVals(&choices[0], &choices[2]);
+ return &oVals;
+ }
+}
-OSISFootnotes::OSISFootnotes() : SWOptionFilter(oName, oTip, &oValues) {
- setOptionValue("Off");
+OSISFootnotes::OSISFootnotes() : SWOptionFilter(oName, oTip, oValues()) {
}
@@ -56,7 +63,7 @@ char OSISFootnotes::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;
@@ -122,7 +129,7 @@ char OSISFootnotes::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();
}
}