diff options
Diffstat (limited to 'src/modules/filters/osisstrongs.cpp')
-rw-r--r-- | src/modules/filters/osisstrongs.cpp | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/src/modules/filters/osisstrongs.cpp b/src/modules/filters/osisstrongs.cpp index 8c06b07..b937883 100644 --- a/src/modules/filters/osisstrongs.cpp +++ b/src/modules/filters/osisstrongs.cpp @@ -1,10 +1,11 @@ /****************************************************************************** * - * osisstrongs - SWFilter descendant to hide or show strongs number - * in a OSIS module. + * osisstrongs.cpp - SWFilter descendant to hide or show Strong's number + * in a OSIS module * + * $Id: osisstrongs.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 @@ -28,17 +29,23 @@ #include <versekey.h> #include <utilxml.h> + SWORD_NAMESPACE_START -const char oName[] = "Strong's Numbers"; -const char oTip[] = "Toggles Strong's Numbers On and Off if they exist"; +namespace { + + static const char oName[] = "Strong's Numbers"; + static const char oTip[] = "Toggles Strong's Numbers 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; + } +} -OSISStrongs::OSISStrongs() : SWOptionFilter(oName, oTip, &oValues) { - setOptionValue("Off"); +OSISStrongs::OSISStrongs() : SWOptionFilter(oName, oTip, oValues()) { } @@ -49,7 +56,6 @@ OSISStrongs::~OSISStrongs() { char OSISStrongs::processText(SWBuf &text, const SWKey *key, const SWModule *module) { SWBuf token; bool intoken = false; - bool lastspace = false; int wordNum = 1; char wordstr[5]; const char *wordStart = 0; @@ -151,7 +157,7 @@ char OSISStrongs::processText(SWBuf &text, const SWKey *key, const SWModule *mod if ((lClass == "x-Strongs") || (lClass == "strong") || (lClass == "Strong")) { if (isdigit(attrib[0])) { if (vkey) { - gh = vkey->Testament() ? 'H' : 'G'; + gh = vkey->getTestament() ? 'H' : 'G'; } } else { @@ -280,7 +286,6 @@ char OSISStrongs::processText(SWBuf &text, const SWKey *key, const SWModule *mod } else { text.append(*from); - lastspace = (*from == ' '); } } return 0; |