diff options
Diffstat (limited to 'src/modules/filters/gbfheadings.cpp')
-rw-r--r-- | src/modules/filters/gbfheadings.cpp | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/src/modules/filters/gbfheadings.cpp b/src/modules/filters/gbfheadings.cpp index 122445e..7e19ea1 100644 --- a/src/modules/filters/gbfheadings.cpp +++ b/src/modules/filters/gbfheadings.cpp @@ -1,9 +1,11 @@ /****************************************************************************** * - * gbfheadings - SWFilter descendant to hide or show headings - * in a GBF module. + * gbfheadings.cpp - SWFilter descendant to hide or show headings + * in a GBF module * - * Copyright 2009 CrossWire Bible Society (http://www.crosswire.org) + * $Id: gbfheadings.cpp 2980 2013-09-14 21:51:47Z scribe $ + * + * Copyright 2001-2013 CrossWire Bible Society (http://www.crosswire.org) * CrossWire Bible Society * P. O. Box 2528 * Tempe, AZ 85280-2528 @@ -19,20 +21,27 @@ * */ + #include <stdlib.h> #include <gbfheadings.h> + SWORD_NAMESPACE_START +namespace { -const char oName[] = "Headings"; -const char oTip[] = "Toggles Headings On and Off if they exist"; + static const char oName[] = "Headings"; + static const char oTip[] = "Toggles Headings 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]); -GBFHeadings::GBFHeadings() : SWOptionFilter(oName, oTip, &oValues) { - setOptionValue("Off"); +GBFHeadings::GBFHeadings() : SWOptionFilter(oName, oTip, oValues()) { } @@ -40,7 +49,7 @@ GBFHeadings::~GBFHeadings() { } -char GBFHeadings::processText (SWBuf &text, const SWKey *key, const SWModule *module) { +char GBFHeadings::processText(SWBuf &text, const SWKey *key, const SWModule *module) { if (!option) { // if we don't want headings char token[2048]; // cheese. Fix. int tokpos = 0; |