diff options
Diffstat (limited to 'src/modules/filters/thmlscripref.cpp')
-rw-r--r-- | src/modules/filters/thmlscripref.cpp | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/src/modules/filters/thmlscripref.cpp b/src/modules/filters/thmlscripref.cpp index e46d679..1ea4a40 100644 --- a/src/modules/filters/thmlscripref.cpp +++ b/src/modules/filters/thmlscripref.cpp @@ -1,10 +1,11 @@ /****************************************************************************** * - * thmlscripref - SWFilter descendant to hide or show scripture - * referebces in a ThML module. + * thmlscripref.cpp - SWFilter descendant to hide or show scripture + * referebces in a ThML module * + * $Id: thmlscripref.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 @@ -27,16 +28,23 @@ #include <versekey.h> #include <swmodule.h> + SWORD_NAMESPACE_START -const char oName[] = "Cross-references"; -const char oTip[] = "Toggles Scripture Cross-references On and Off if they exist"; +namespace { + + static const char oName[] = "Cross-references"; + static const char oTip[] = "Toggles Scripture Cross-references On and Off if they exist"; + + static const StringList *oValues() { + static const SWBuf choices[3] = {"On", "Off", ""}; + static const StringList oVals(&choices[0], &choices[2]); + return &oVals; + } +} -const SWBuf choices[3] = {"Off", "On", ""}; -const StringList oValues(&choices[0], &choices[2]); -ThMLScripref::ThMLScripref() : SWOptionFilter(oName, oTip, &oValues) { - setOptionValue("On"); +ThMLScripref::ThMLScripref() : SWOptionFilter(oName, oTip, oValues()) { } @@ -53,7 +61,7 @@ char ThMLScripref::processText(SWBuf &text, const SWKey *key, const SWModule *mo 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; @@ -98,8 +106,8 @@ char ThMLScripref::processText(SWBuf &text, const SWKey *key, const SWModule *mo startTag.setAttribute("swordFootnote", buf); SWBuf passage = startTag.getAttribute("passage"); if (passage.length()) - refs = parser->ParseVerseList(passage.c_str(), *parser, true).getRangeText(); - else refs = parser->ParseVerseList(tagText.c_str(), *parser, true).getRangeText(); + refs = parser->parseVerseList(passage.c_str(), *parser, true).getRangeText(); + else refs = parser->parseVerseList(tagText.c_str(), *parser, true).getRangeText(); module->getEntryAttributes()["Footnote"][buf]["refList"] = refs.c_str(); } hide = false; |