[sword-svn] r2980 - in trunk: examples examples/classes examples/cmdline include src/keys src/mgr src/modules/common src/modules/filters src/modules/lexdict src/modules/lexdict/rawld src/modules/lexdict/rawld4 src/modules/lexdict/zld src/modules/texts/rawtext4 src/modules/texts/ztext src/utilfuns utilities

scribe at crosswire.org scribe at crosswire.org
Sat Sep 14 14:51:47 MST 2013


Author: scribe
Date: 2013-09-14 14:51:47 -0700 (Sat, 14 Sep 2013)
New Revision: 2980

Modified:
   trunk/examples/classes/ciphercng.cpp
   trunk/examples/classes/lastVerseInChapter.cpp
   trunk/examples/classes/showchapter.cpp
   trunk/examples/classes/swmgrex.cpp
   trunk/examples/classes/verseposition.cpp
   trunk/examples/classes/verseranges.cpp
   trunk/examples/cmdline/listoptions.cpp
   trunk/examples/cmdline/lookup.cpp
   trunk/examples/cmdline/outplain.cpp
   trunk/examples/cmdline/outrender.cpp
   trunk/examples/cmdline/search.cpp
   trunk/examples/cmdline/verserangeparse.cpp
   trunk/examples/simple.cpp
   trunk/include/curlftpt.h
   trunk/include/curlhttpt.h
   trunk/include/ftplibftpt.h
   trunk/include/osisvariants.h
   trunk/include/swbuf.h
   trunk/include/swoptfilter.h
   trunk/include/swversion.h
   trunk/include/thmlvariants.h
   trunk/include/utilxml.h
   trunk/include/zstr.h
   trunk/src/keys/treekeyidx.cpp
   trunk/src/mgr/curlftpt.cpp
   trunk/src/mgr/curlhttpt.cpp
   trunk/src/mgr/encfiltmgr.cpp
   trunk/src/mgr/ftplibftpt.cpp
   trunk/src/mgr/installmgr.cpp
   trunk/src/mgr/localemgr.cpp
   trunk/src/mgr/markupfiltmgr.cpp
   trunk/src/mgr/remotetrans.cpp
   trunk/src/mgr/stringmgr.cpp
   trunk/src/mgr/swcacher.cpp
   trunk/src/mgr/swconfig.cpp
   trunk/src/mgr/swfiltermgr.cpp
   trunk/src/mgr/swlocale.cpp
   trunk/src/mgr/swmgr.cpp
   trunk/src/mgr/swsearchable.cpp
   trunk/src/mgr/versificationmgr.cpp
   trunk/src/modules/common/zstr.cpp
   trunk/src/modules/filters/cipherfil.cpp
   trunk/src/modules/filters/gbffootnotes.cpp
   trunk/src/modules/filters/gbfheadings.cpp
   trunk/src/modules/filters/gbfmorph.cpp
   trunk/src/modules/filters/gbfosis.cpp
   trunk/src/modules/filters/gbfplain.cpp
   trunk/src/modules/filters/gbfredletterwords.cpp
   trunk/src/modules/filters/gbfstrongs.cpp
   trunk/src/modules/filters/gbfthml.cpp
   trunk/src/modules/filters/gbfwordjs.cpp
   trunk/src/modules/filters/latin1utf8.cpp
   trunk/src/modules/filters/osisenum.cpp
   trunk/src/modules/filters/osisfootnotes.cpp
   trunk/src/modules/filters/osisglosses.cpp
   trunk/src/modules/filters/osisheadings.cpp
   trunk/src/modules/filters/osislemma.cpp
   trunk/src/modules/filters/osismorph.cpp
   trunk/src/modules/filters/osismorphsegmentation.cpp
   trunk/src/modules/filters/osisplain.cpp
   trunk/src/modules/filters/osisredletterwords.cpp
   trunk/src/modules/filters/osisrtf.cpp
   trunk/src/modules/filters/osisscripref.cpp
   trunk/src/modules/filters/osisstrongs.cpp
   trunk/src/modules/filters/osisvariants.cpp
   trunk/src/modules/filters/osiswordjs.cpp
   trunk/src/modules/filters/osisxlit.cpp
   trunk/src/modules/filters/papyriplain.cpp
   trunk/src/modules/filters/scsuutf8.cpp
   trunk/src/modules/filters/swbasicfilter.cpp
   trunk/src/modules/filters/swoptfilter.cpp
   trunk/src/modules/filters/thmlfootnotes.cpp
   trunk/src/modules/filters/thmlheadings.cpp
   trunk/src/modules/filters/thmlhtml.cpp
   trunk/src/modules/filters/thmlhtmlhref.cpp
   trunk/src/modules/filters/thmllemma.cpp
   trunk/src/modules/filters/thmlmorph.cpp
   trunk/src/modules/filters/thmlscripref.cpp
   trunk/src/modules/filters/thmlstrongs.cpp
   trunk/src/modules/filters/thmlvariants.cpp
   trunk/src/modules/filters/thmlwebif.cpp
   trunk/src/modules/filters/thmlwordjs.cpp
   trunk/src/modules/filters/thmlxhtml.cpp
   trunk/src/modules/filters/utf16utf8.cpp
   trunk/src/modules/filters/utf8arabicpoints.cpp
   trunk/src/modules/filters/utf8bidireorder.cpp
   trunk/src/modules/filters/utf8cantillation.cpp
   trunk/src/modules/filters/utf8greekaccents.cpp
   trunk/src/modules/filters/utf8hebrewpoints.cpp
   trunk/src/modules/filters/utf8html.cpp
   trunk/src/modules/filters/utf8latin1.cpp
   trunk/src/modules/filters/utf8nfkd.cpp
   trunk/src/modules/filters/utf8utf16.cpp
   trunk/src/modules/lexdict/rawld/rawld.cpp
   trunk/src/modules/lexdict/rawld4/rawld4.cpp
   trunk/src/modules/lexdict/swld.cpp
   trunk/src/modules/lexdict/zld/zld.cpp
   trunk/src/modules/texts/rawtext4/rawtext4.cpp
   trunk/src/modules/texts/ztext/ztext.cpp
   trunk/src/utilfuns/roman.cpp
   trunk/src/utilfuns/swbuf.cpp
   trunk/src/utilfuns/swobject.cpp
   trunk/src/utilfuns/swunicod.cpp
   trunk/src/utilfuns/swversion.cpp
   trunk/src/utilfuns/url.cpp
   trunk/src/utilfuns/utilstr.cpp
   trunk/src/utilfuns/utilxml.cpp
   trunk/utilities/imp2gbs.cpp
Log:
Updated global initializations per Jaak's recommended patch
to prevent against global instantiation of an object in
one compile unit which might have its global initialization
called before the global initialization of the class' compile unit

Whitespace cleanups

Consistent use of anonymous namespaces and static link scope for file locals




Modified: trunk/examples/classes/ciphercng.cpp
===================================================================
--- trunk/examples/classes/ciphercng.cpp	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/examples/classes/ciphercng.cpp	2013-09-14 21:51:47 UTC (rev 2980)
@@ -33,6 +33,7 @@
 using namespace sword;
 using namespace std;
 
+
 int main(int argc, char **argv) {
 
 	if (argc != 2) {
@@ -64,5 +65,5 @@
 		manager.setCipherKey(argv[1], key.c_str());
 	}
 
-
+	return 0;
 }

Modified: trunk/examples/classes/lastVerseInChapter.cpp
===================================================================
--- trunk/examples/classes/lastVerseInChapter.cpp	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/examples/classes/lastVerseInChapter.cpp	2013-09-14 21:51:47 UTC (rev 2980)
@@ -29,9 +29,11 @@
 #include <versekey.h>
 #include <iostream>
 
+
 using namespace sword;
 using namespace std;
 
+
 int main(int argc, char **argv) {
 
 	SWMgr library;
@@ -48,5 +50,7 @@
 			cout << text << endl;
 		}
 	}
+
 	return 0;
 }
+

Modified: trunk/examples/classes/showchapter.cpp
===================================================================
--- trunk/examples/classes/showchapter.cpp	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/examples/classes/showchapter.cpp	2013-09-14 21:51:47 UTC (rev 2980)
@@ -25,9 +25,11 @@
 #include <versekey.h>
 #include <iostream>
 
+
 using namespace sword;
 using namespace std;
 
+
 int main(int argc, char **argv) {
 
 	SWMgr library;
@@ -42,15 +44,14 @@
 	int curBook = key->getBook();
 
 	for (key->setVerse(1);
-		(key->getBook()    == curBook)    &&
-		(key->getChapter() == curChapter) &&
-		!kjv->popError();
-		(*kjv)++) {
+				(key->getBook()    == curBook)    &&
+				(key->getChapter() == curChapter) &&
+				!kjv->popError();
+				(*kjv)++) {
 		if (key->getVerse() == curVerse) cout << "* ";
 		cout << key->getVerse() << " " << kjv->stripText() << "\n";
-
-	/* ... lots of hacking based on current key ... */
 	}
 
 	return 0;
 }
+

Modified: trunk/examples/classes/swmgrex.cpp
===================================================================
--- trunk/examples/classes/swmgrex.cpp	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/examples/classes/swmgrex.cpp	2013-09-14 21:51:47 UTC (rev 2980)
@@ -33,10 +33,13 @@
 #include <swmgr.h>
 #include <swmodule.h>
 
+
 using namespace sword;
 using namespace std;
 
+
 int main(int argc, char **argv) {
+
 	SWMgr manager;		// create a default manager that looks in the current directory for mods.conf
 
 	cout << "\nInstalled Modules:\n\n";
@@ -70,4 +73,6 @@
 	mod->display();				// instead of casting mod to const char * to get its contents, we'll call the default display method that writes to stdout;
 	cout << " (" << mod->getName() << ")\n\n";
 
+	return 0;
+
 }

Modified: trunk/examples/classes/verseposition.cpp
===================================================================
--- trunk/examples/classes/verseposition.cpp	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/examples/classes/verseposition.cpp	2013-09-14 21:51:47 UTC (rev 2980)
@@ -25,9 +25,11 @@
 #include <swmodule.h>
 #include <versekey.h>
 
+
 using namespace sword;
 using namespace std;
 
+
 int main(int argc, char **argv) {
 
         const char *modName = "HunKar";
@@ -44,5 +46,6 @@
         book->setPosition(TOP);
 
         cout << *key << endl;
+
         return 0;
 }

Modified: trunk/examples/classes/verseranges.cpp
===================================================================
--- trunk/examples/classes/verseranges.cpp	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/examples/classes/verseranges.cpp	2013-09-14 21:51:47 UTC (rev 2980)
@@ -20,15 +20,18 @@
  * General Public License for more details.
  *
  */
+
 #include <iostream>
 
 #include <swmgr.h>
 #include <swmodule.h>
 #include <versekey.h>
 
+
 using namespace sword;
 using namespace std;
 
+
 int main(int argc, char **argv) {
 
 	cout << "\n";
@@ -121,3 +124,4 @@
 
 	return 0;
 }
+

Modified: trunk/examples/cmdline/listoptions.cpp
===================================================================
--- trunk/examples/cmdline/listoptions.cpp	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/examples/cmdline/listoptions.cpp	2013-09-14 21:51:47 UTC (rev 2980)
@@ -23,13 +23,16 @@
  * General Public License for more details.
  *
  */
+
 #include <iostream>
 #include <swmgr.h>
 
+
 using sword::SWMgr;
 using sword::StringList;
 using std::cout;
 
+
 int main(int argc, char **argv)
 {
 	SWMgr library;
@@ -42,5 +45,8 @@
 			cout << "\t" << *it2 << "\n";
 		}
 	}
+
 	return 0;
+
 }
+

Modified: trunk/examples/cmdline/lookup.cpp
===================================================================
--- trunk/examples/cmdline/lookup.cpp	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/examples/cmdline/lookup.cpp	2013-09-14 21:51:47 UTC (rev 2980)
@@ -30,6 +30,7 @@
 #include <markupfiltmgr.h>
 #include <versekey.h>
 
+
 using sword::SWMgr;
 using sword::MarkupFilterMgr;
 using sword::SWModule;
@@ -43,6 +44,7 @@
 using sword::VerseKey;
 using sword::FilterList;
 
+
 int main(int argc, char **argv)
 {
 	
@@ -110,5 +112,7 @@
 		}
 	}
 	std::cout << std::endl;
+
 	return 0;
 }
+

Modified: trunk/examples/cmdline/outplain.cpp
===================================================================
--- trunk/examples/cmdline/outplain.cpp	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/examples/cmdline/outplain.cpp	2013-09-14 21:51:47 UTC (rev 2980)
@@ -45,10 +45,13 @@
 #include <versekey.h>
 #include <markupfiltmgr.h>
 
+
 using namespace sword;
 using namespace std;
 
+
 int main(int argc, char **argv) {
+
 	SWMgr manager(new MarkupFilterMgr(sword::FMT_HTMLHREF, sword::ENC_UTF16));
 
 	const char *bookName = (argc > 1) ? argv[1] : "WLC";
@@ -65,4 +68,6 @@
 		else    cout << book.getKeyText();
 		cout << "\n" << book.stripText() << "\n\n";
 	}
+
+	return 0;
 }

Modified: trunk/examples/cmdline/outrender.cpp
===================================================================
--- trunk/examples/cmdline/outrender.cpp	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/examples/cmdline/outrender.cpp	2013-09-14 21:51:47 UTC (rev 2980)
@@ -30,24 +30,37 @@
 #include <versekey.h>
 #include <markupfiltmgr.h>
 
+
 using namespace sword;
 using namespace std;
 
+
 int main(int argc, char **argv) {
+
 	SWMgr manager(new MarkupFilterMgr(sword::FMT_HTMLHREF, sword::ENC_UTF16));
 
 	const char *bookName = (argc > 1) ? argv[1] : "WLC";
+
 	SWModule *b = manager.getModule(bookName);
 	if (!b) return -1;
+
 	SWModule &book = *b;
 	book.setProcessEntryAttributes(false);
 	VerseKey *vk = SWDYNAMIC_CAST(VerseKey, book.getKey());
+
+	// find the first non-zero entry
 	for (book = TOP; !book.popError() && !book.getRawEntryBuf().size(); book++);
 	if (!book.getRawEntryBuf().size()) return -2; 	// empty module
+
 	for (;!book.popError(); book++) {
+
 		cout << "$$$";
 		if (vk) cout << vk->getOSISRef();
 		else    cout << book.getKeyText();
+
 		cout << "\n" << book.renderText() << "\n\n";
 	}
+
+	return 0;
 }
+

Modified: trunk/examples/cmdline/search.cpp
===================================================================
--- trunk/examples/cmdline/search.cpp	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/examples/cmdline/search.cpp	2013-09-14 21:51:47 UTC (rev 2980)
@@ -43,6 +43,7 @@
  *			-3  - entryAttrib (eg. Word//Lemma/G1234/)
  *			-4  - Lucene
  */
+
 char SEARCH_TYPE=-2;
 
 char printed = 0;
@@ -124,4 +125,6 @@
 		listkey++;
 	}
 
+	return 0;
+
 }

Modified: trunk/examples/cmdline/verserangeparse.cpp
===================================================================
--- trunk/examples/cmdline/verserangeparse.cpp	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/examples/cmdline/verserangeparse.cpp	2013-09-14 21:51:47 UTC (rev 2980)
@@ -1,8 +1,7 @@
 /******************************************************************************
  *
- *  verserangeparse.cpp -	This example shows:
- *				How to parse a verse reference
- *				How to persist a custom range key in a book
+ *  verserangeparse.cpp -	This example shows
+ *				how to parse a verse reference
  *
  * $Id$
  *
@@ -47,42 +46,29 @@
 	ListKey result;
 
 	result = parser.parseVerseList(range, parser, true);
+
 	// let's iterate the key and display
 	for (result = TOP; !result.popError(); result++) {
 		cout << result << "\n";
 	}
 	cout << endl;
 
-	// Now if we'd like persist this key for use inside of a book...
-	result.setPersist(true);
+	// Now let's output a module with the entries from the result
 	
-	// Let's get a book;
+	// we'll initialize our library of books
 	SWMgr library(new MarkupFilterMgr(FMT_PLAIN));	// render plain without fancy markup
+
+	// Let's get a book;
 	SWModule *book = library.getModule("KJV");
 
-	// and set our limited key inside
-	book->setKey(result);
+	// couldn't find our test module
+	if (!book) return -1;
 
 	// now let's iterate the book and display
-	for ((*book) = TOP; !book->popError(); (*book)++) {
+	for (result = TOP; !result.popError(); result++) {
+		book->setKey(result);
 		cout << "*** " << book->getKeyText() << ": " << book->renderText() << "\n";
 	}
 
-	// Since we've told our result key to persist in book, we can reuse our
-	// setup by simply resetting result, e.g.
-	//
-	// result = parser.ParseVerseList(someNewRange, parser, true);
-	//
-	// Now an iteration of book will give us our new range.
-	//
-	// To stop persistence of our custom key, we'll need to set our book's key
-	// to something simple:
-	// 
-	// book->setKey("gen.1.1");
-	// 
-	// Resetting our book object's key to something not persistent will revert our book object to using its default key for positioning
-	//
-	//
-
 	return 0;
 }

Modified: trunk/examples/simple.cpp
===================================================================
--- trunk/examples/simple.cpp	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/examples/simple.cpp	2013-09-14 21:51:47 UTC (rev 2980)
@@ -38,9 +38,11 @@
 #include <swmodule.h>
 #include <iostream>
 
+
 using namespace sword;
 using std::cout;
 
+
 int main(int argc, char **argv) {
 	SWMgr library;
 	SWModule *darby = library.getModule("Darby");
@@ -49,3 +51,4 @@
 
 	return 0;
 }
+

Modified: trunk/include/curlftpt.h
===================================================================
--- trunk/include/curlftpt.h	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/include/curlftpt.h	2013-09-14 21:51:47 UTC (rev 2980)
@@ -30,14 +30,7 @@
 
 class CURL;
 
-// initialize/cleanup SYSTEMWIDE library with life of this static.
-class CURLFTPTransport_init {
-public:
-	CURLFTPTransport_init();
-	~CURLFTPTransport_init();
-};
 
-
 class SWDLLEXPORT CURLFTPTransport : public RemoteTransport {
 	CURL *session;
 

Modified: trunk/include/curlhttpt.h
===================================================================
--- trunk/include/curlhttpt.h	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/include/curlhttpt.h	2013-09-14 21:51:47 UTC (rev 2980)
@@ -30,14 +30,7 @@
 
 class CURL;
 
-// initialize/cleanup SYSTEMWIDE library with life of this static.
-class CURLHTTPTransport_init {
-public:
-	CURLHTTPTransport_init();
-	~CURLHTTPTransport_init();
-};
 
-
 class SWDLLEXPORT CURLHTTPTransport : public RemoteTransport {
 	CURL *session;
 

Modified: trunk/include/ftplibftpt.h
===================================================================
--- trunk/include/ftplibftpt.h	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/include/ftplibftpt.h	2013-09-14 21:51:47 UTC (rev 2980)
@@ -32,14 +32,6 @@
 SWORD_NAMESPACE_START
 
 
-// initialize/cleanup SYSTEMWIDE library with life of this static.
-class FTPLibFTPTransport_init {
-public:
-	FTPLibFTPTransport_init();
-	~FTPLibFTPTransport_init();
-};
-
-
 class SWDLLEXPORT FTPLibFTPTransport : public RemoteTransport {
 	netbuf *ftpConnection;
 

Modified: trunk/include/osisvariants.h
===================================================================
--- trunk/include/osisvariants.h	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/include/osisvariants.h	2013-09-14 21:51:47 UTC (rev 2980)
@@ -31,25 +31,11 @@
 /** This Filter shows/hides textual variants
  */
 class SWDLLEXPORT OSISVariants : public SWOptionFilter {
-	char option;
 
-	static const char primary[];
-	static const char secondary[];
-	static const char all[];
-
-	static const char optName[];
-	static const char optTip[];
-	StringList options;
-
 public:
 	OSISVariants();
 	virtual ~OSISVariants();
 	virtual char processText(SWBuf &text, const SWKey *key = 0, const SWModule *module = 0);
-	virtual const char *getOptionName() { return optName; }
-	virtual const char *getOptionTip() { return optTip; }
-	virtual void setOptionValue(const char *ival);
-	virtual const char *getOptionValue();
-	virtual StringList getOptionValues() { return options; }
 };
 
 SWORD_NAMESPACE_END

Modified: trunk/include/swbuf.h
===================================================================
--- trunk/include/swbuf.h	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/include/swbuf.h	2013-09-14 21:51:47 UTC (rev 2980)
@@ -48,8 +48,6 @@
 	char *endAlloc;
 	char fillByte;
 	unsigned long allocSize;
-	static char *nullStr;
-	static char junkBuf[JUNKBUFSIZE];
 
 	inline void assureMore(size_t pastEnd) {
 		if (size_t(endAlloc-end) < pastEnd) {
@@ -82,6 +80,8 @@
 
 public:
 
+	static char *nullStr;
+
 	/******************************************************************************
 	* SWBuf Constructor - Creates an empty SWBuf object
 	*
@@ -144,7 +144,7 @@
 	*	@param pos The position of the requested character.
 	* @return The character at the specified position
 	*/
-	inline char &charAt(unsigned long pos) { return ((pos <= (unsigned long)(end - buf)) ? buf[pos] : ((*junkBuf=0),*junkBuf)); }
+	inline char &charAt(unsigned long pos) { return ((pos <= (unsigned long)(end - buf)) ? buf[pos] : (*nullStr)); }
 
 	/** 
 	* @return size() and length() return only the number of characters of the string.

Modified: trunk/include/swoptfilter.h
===================================================================
--- trunk/include/swoptfilter.h	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/include/swoptfilter.h	2013-09-14 21:51:47 UTC (rev 2980)
@@ -44,6 +44,7 @@
 	const char *optTip;
 	const StringList *optValues;
 	bool option;
+	bool isBooleanVal;
 public:
 
 	SWOptionFilter();
@@ -51,6 +52,12 @@
 	virtual ~SWOptionFilter();
 
 
+	/** many options are simple Off/On boolean type, and frontends may wish to show these
+	 * with checkmarks or the like to the end user.  This is a convenience method
+	 * to allow a frontend to check if this filter has only Off/On values
+	 */
+	bool isBoolean() { return isBooleanVal; }
+
 	/** gets the name of the option of this filter
 	 * @return option name
 	 */

Modified: trunk/include/swversion.h
===================================================================
--- trunk/include/swversion.h	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/include/swversion.h	2013-09-14 21:51:47 UTC (rev 2980)
@@ -24,11 +24,11 @@
 #ifndef SWVERSION_H
 #define SWVERSION_H
 
-#define SWORD_VERSION_NUM 106903000
-#define SWORD_VERSION_STR "1.6.903"
+#define SWORD_VERSION_NUM 106904000
+#define SWORD_VERSION_STR "1.6.904"
 #define SWORD_VERSION_MAJOR 1
 #define SWORD_VERSION_MINOR 6
-#define SWORD_VERSION_MICRO 903
+#define SWORD_VERSION_MICRO 904
 #define SWORD_VERSION_NANO 0
 
 #include <defs.h>

Modified: trunk/include/thmlvariants.h
===================================================================
--- trunk/include/thmlvariants.h	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/include/thmlvariants.h	2013-09-14 21:51:47 UTC (rev 2980)
@@ -30,25 +30,10 @@
 /** This Filter shows/hides textual variants
  */
 class SWDLLEXPORT ThMLVariants : public SWOptionFilter {
-	char option;
-
-	static const char primary[];
-	static const char secondary[];
-	static const char all[];
-
-	static const char optName[];
-	static const char optTip[];
-	StringList options;
-
 public:
 	ThMLVariants();
 	virtual ~ThMLVariants();
 	virtual char processText(SWBuf &text, const SWKey *key = 0, const SWModule *module = 0);
-	virtual const char *getOptionName() { return optName; }
-	virtual const char *getOptionTip() { return optTip; }
-	virtual void setOptionValue(const char *ival);
-	virtual const char *getOptionValue();
-	virtual StringList getOptionValues() { return options; }
 };
 
 SWORD_NAMESPACE_END

Modified: trunk/include/utilxml.h
===================================================================
--- trunk/include/utilxml.h	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/include/utilxml.h	2013-09-14 21:51:47 UTC (rev 2980)
@@ -47,7 +47,6 @@
 	
 	void parse() const;
 	const char *getPart(const char *buf, int partNum = 0, char partSplit = '|') const;
-	static const char *nullstr;
 	
 public:
 	XMLTag(const char *tagString = 0);
@@ -55,7 +54,7 @@
 	~XMLTag();
 
 	void setText(const char *tagString);
-	inline const char *getName() const { return (name)?name:nullstr; }
+	inline const char *getName() const { return (name) ? name : SWBuf::nullStr; }
 
 	inline bool isEmpty() const {
 		if (!parsed)

Modified: trunk/include/zstr.h
===================================================================
--- trunk/include/zstr.h	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/include/zstr.h	2013-09-14 21:51:47 UTC (rev 2980)
@@ -62,7 +62,6 @@
 	void getKeyFromIdxOffset(long ioffset, char **buf) const;
 
 public:
-	char nl;
 	zStr(const char *ipath, int fileMode = -1, long blockCount = 100, SWCompress *icomp = 0, bool caseSensitive = false);
 	virtual ~zStr();
 	signed char findKeyIndex(const char *ikey, long *idxoff, long away = 0) const;

Modified: trunk/src/keys/treekeyidx.cpp
===================================================================
--- trunk/src/keys/treekeyidx.cpp	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/src/keys/treekeyidx.cpp	2013-09-14 21:51:47 UTC (rev 2980)
@@ -33,7 +33,6 @@
 
 SWORD_NAMESPACE_START
 
-static const char nl = '\n';
 static const char *classes[] = {"TreeKeyIdx", "TreeKey", "SWKey", "SWObject", 0};
 SWClass TreeKeyIdx::classdef(classes);
 

Modified: trunk/src/mgr/curlftpt.cpp
===================================================================
--- trunk/src/mgr/curlftpt.cpp	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/src/mgr/curlftpt.cpp	2013-09-14 21:51:47 UTC (rev 2980)
@@ -29,96 +29,100 @@
 
 #include <swlog.h>
 
+
 SWORD_NAMESPACE_START
 
+namespace {
 
-struct FtpFile {
-  const char *filename;
-  FILE *stream;
-  SWBuf *destBuf;
-};
+	struct FtpFile {
+		const char *filename;
+		FILE *stream;
+		SWBuf *destBuf;
+	};
 
 
-int my_fwrite(void *buffer, size_t size, size_t nmemb, void *stream);
-int my_fprogress(void *clientp, double dltotal, double dlnow, double ultotal, double ulnow);
+	// initialize/cleanup SYSTEMWIDE library with life of this static.
+	static class CURLFTPTransport_init {
+	public:
+		CURLFTPTransport_init() {
+			curl_global_init(CURL_GLOBAL_DEFAULT);  // curl_easy_init automatically calls it if needed
+		}
 
-static CURLFTPTransport_init _CURLFTPTransport_init;
+		~CURLFTPTransport_init() {
+			curl_global_cleanup();
+		}
+	} _curlFTPTransport_init;
 
-CURLFTPTransport_init::CURLFTPTransport_init() {
-	curl_global_init(CURL_GLOBAL_DEFAULT);  // curl_easy_init automatically calls it if needed
-}
 
-CURLFTPTransport_init::~CURLFTPTransport_init() {
-	curl_global_cleanup();
-}
-
-int my_fwrite(void *buffer, size_t size, size_t nmemb, void *stream) {
-	struct FtpFile *out=(struct FtpFile *)stream;
-	if (out && !out->stream && !out->destBuf) {
-		/* open file for writing */
-		out->stream=fopen(out->filename, "wb");
-		if (!out->stream)
-			return -1; /* failure, can't open file to write */
+	static int my_fwrite(void *buffer, size_t size, size_t nmemb, void *stream) {
+		struct FtpFile *out=(struct FtpFile *)stream;
+		if (out && !out->stream && !out->destBuf) {
+			/* open file for writing */
+			out->stream=fopen(out->filename, "wb");
+			if (!out->stream)
+				return -1; /* failure, can't open file to write */
+		}
+		if (out->destBuf) {
+			int s = out->destBuf->size();
+			out->destBuf->size(s+(size*nmemb));
+			memcpy(out->destBuf->getRawData()+s, buffer, size*nmemb);
+			return nmemb;
+		}
+		return fwrite(buffer, size, nmemb, out->stream);
 	}
-	if (out->destBuf) {
-		int s = out->destBuf->size();
-		out->destBuf->size(s+(size*nmemb));
-		memcpy(out->destBuf->getRawData()+s, buffer, size*nmemb);
-		return nmemb;
-	}
-	return fwrite(buffer, size, nmemb, out->stream);
-}
 
 
-struct MyProgressData {
-	StatusReporter *sr;
-	bool *term;
-};
+	struct MyProgressData {
+		StatusReporter *sr;
+		bool *term;
+	};
 
 
-int my_fprogress(void *clientp, double dltotal, double dlnow, double ultotal, double ulnow) {
-	if (clientp) {
-		MyProgressData *pd = (MyProgressData *)clientp;
-SWLog::getSystemLog()->logDebug("CURLFTPTransport report progress: totalSize: %ld; xfered: %ld\n", (long)dltotal, (long)dlnow);
-		if (pd->sr) {
-			if (dltotal < 0) dltotal = 0;
-			if (dlnow < 0) dlnow = 0;
-			if (dlnow > dltotal) dlnow = dltotal;
-			pd->sr->update(dltotal, dlnow);
+	static int my_fprogress(void *clientp, double dltotal, double dlnow, double ultotal, double ulnow) {
+		if (clientp) {
+			MyProgressData *pd = (MyProgressData *)clientp;
+			SWLog::getSystemLog()->logDebug("CURLFTPTransport report progress: totalSize: %ld; xfered: %ld\n", (long)dltotal, (long)dlnow);
+			if (pd->sr) {
+				if (dltotal < 0) dltotal = 0;
+				if (dlnow < 0) dlnow = 0;
+				if (dlnow > dltotal) dlnow = dltotal;
+				pd->sr->update(dltotal, dlnow);
+			}
+			if (*(pd->term)) return 1;
 		}
-		if (*(pd->term)) return 1;
+		return 0;
 	}
-	return 0;
-}
 
 
-static int my_trace(CURL *handle, curl_infotype type, unsigned char *data, size_t size, void *userp) {
-	SWBuf header;
-	(void)userp; /* prevent compiler warning */
-	(void)handle; /* prevent compiler warning */
+	static int my_trace(CURL *handle, curl_infotype type, unsigned char *data, size_t size, void *userp) {
+		SWBuf header;
+		(void)userp; /* prevent compiler warning */
+		(void)handle; /* prevent compiler warning */
 
-	switch (type) {
-	case CURLINFO_TEXT: header = "TEXT"; break;
-	case CURLINFO_HEADER_OUT: header = "=> Send header"; break;
-	case CURLINFO_HEADER_IN: header = "<= Recv header"; break;
-	
-	// these we don't want to log (HUGE)
-	case CURLINFO_DATA_OUT: header = "=> Send data";
-	case CURLINFO_SSL_DATA_OUT: header = "=> Send SSL data";
-	case CURLINFO_DATA_IN: header = "<= Recv data"; 
-	case CURLINFO_SSL_DATA_IN: header = "<= Recv SSL data";
-	default: /* in case a new one is introduced to shock us */
+		switch (type) {
+		case CURLINFO_TEXT: header = "TEXT"; break;
+		case CURLINFO_HEADER_OUT: header = "=> Send header"; break;
+		case CURLINFO_HEADER_IN: header = "<= Recv header"; break;
+		
+		// these we don't want to log (HUGE)
+		case CURLINFO_DATA_OUT: header = "=> Send data";
+		case CURLINFO_SSL_DATA_OUT: header = "=> Send SSL data";
+		case CURLINFO_DATA_IN: header = "<= Recv data"; 
+		case CURLINFO_SSL_DATA_IN: header = "<= Recv SSL data";
+		default: /* in case a new one is introduced to shock us */
+			return 0;
+		}
+		
+		if (size > 120) size = 120;
+		SWBuf text;
+		text.size(size);
+		memcpy(text.getRawData(), data, size);
+		SWLog::getSystemLog()->logDebug("CURLFTPTransport: %s: %s", header.c_str(), text.c_str());
 		return 0;
 	}
-	
-	if (size > 120) size = 120;
-	SWBuf text;
-	text.size(size);
-	memcpy(text.getRawData(), data, size);
-	SWLog::getSystemLog()->logDebug("CURLFTPTransport: %s: %s", header.c_str(), text.c_str());
-	return 0;
 }
 
+
 CURLFTPTransport::CURLFTPTransport(const char *host, StatusReporter *sr) : RemoteTransport(host, sr) {
 	session = (CURL *)curl_easy_init();
 }

Modified: trunk/src/mgr/curlhttpt.cpp
===================================================================
--- trunk/src/mgr/curlhttpt.cpp	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/src/mgr/curlhttpt.cpp	2013-09-14 21:51:47 UTC (rev 2980)
@@ -34,86 +34,76 @@
 
 using std::vector;
 
+
 SWORD_NAMESPACE_START
 
+namespace {
 
-struct FtpFile {
-  const char *filename;
-  FILE *stream;
-  SWBuf *destBuf;
-};
+	struct FtpFile {
+		const char *filename;
+		FILE *stream;
+		SWBuf *destBuf;
+	};
 
 
-int my_httpfwrite(void *buffer, size_t size, size_t nmemb, void *stream);
-int my_httpfprogress(void *clientp, double dltotal, double dlnow, double ultotal, double ulnow);
-
-static CURLHTTPTransport_init _CURLHTTPTransport_init;
-
-CURLHTTPTransport_init::CURLHTTPTransport_init() {
-	//curl_global_init(CURL_GLOBAL_DEFAULT);  // curl_easy_init automatically calls it if needed
-}
-
-CURLHTTPTransport_init::~CURLHTTPTransport_init() {
-// CURLFTPT d-tor cleans this up
-//	curl_global_cleanup();
-}
-
-int my_httpfwrite(void *buffer, size_t size, size_t nmemb, void *stream) {
-	struct FtpFile *out=(struct FtpFile *)stream;
-	if (out && !out->stream && !out->destBuf) {
-		/* open file for writing */
-		out->stream=fopen(out->filename, "wb");
-		if (!out->stream)
-			return -1; /* failure, can't open file to write */
+	static int my_httpfwrite(void *buffer, size_t size, size_t nmemb, void *stream) {
+		struct FtpFile *out=(struct FtpFile *)stream;
+		if (out && !out->stream && !out->destBuf) {
+			/* open file for writing */
+			out->stream=fopen(out->filename, "wb");
+			if (!out->stream)
+				return -1; /* failure, can't open file to write */
+		}
+		if (out->destBuf) {
+			int s = out->destBuf->size();
+			out->destBuf->size(s+(size*nmemb));
+			memcpy(out->destBuf->getRawData()+s, buffer, size*nmemb);
+			return nmemb;
+		}
+		return fwrite(buffer, size, nmemb, out->stream);
 	}
-	if (out->destBuf) {
-		int s = out->destBuf->size();
-		out->destBuf->size(s+(size*nmemb));
-		memcpy(out->destBuf->getRawData()+s, buffer, size*nmemb);
-		return nmemb;
-	}
-	return fwrite(buffer, size, nmemb, out->stream);
-}
 
 
-int my_httpfprogress(void *clientp, double dltotal, double dlnow, double ultotal, double ulnow) {
-	if (clientp) {
-		if (dltotal < 0) dltotal = 0;
-		if (dlnow < 0) dlnow = 0;
-		if (dlnow > dltotal) dlnow = dltotal;
-		((StatusReporter *)clientp)->update(dltotal, dlnow);
+	static int my_httpfprogress(void *clientp, double dltotal, double dlnow, double ultotal, double ulnow) {
+		if (clientp) {
+			if (dltotal < 0) dltotal = 0;
+			if (dlnow < 0) dlnow = 0;
+			if (dlnow > dltotal) dlnow = dltotal;
+			((StatusReporter *)clientp)->update(dltotal, dlnow);
+		}
+		return 0;
 	}
-	return 0;
-}
 
 
-static int myhttp_trace(CURL *handle, curl_infotype type, unsigned char *data, size_t size, void *userp) {
-	SWBuf header;
-	(void)userp; /* prevent compiler warning */
-	(void)handle; /* prevent compiler warning */
+	static int myhttp_trace(CURL *handle, curl_infotype type, unsigned char *data, size_t size, void *userp) {
+		SWBuf header;
+		(void)userp; /* prevent compiler warning */
+		(void)handle; /* prevent compiler warning */
 
-	switch (type) {
-	case CURLINFO_TEXT: header = "TEXT"; break;
-	case CURLINFO_HEADER_OUT: header = "=> Send header"; break;
-	case CURLINFO_HEADER_IN: header = "<= Recv header"; break;
+		switch (type) {
+		case CURLINFO_TEXT: header = "TEXT"; break;
+		case CURLINFO_HEADER_OUT: header = "=> Send header"; break;
+		case CURLINFO_HEADER_IN: header = "<= Recv header"; break;
 
-	// these we don't want to log (HUGE)
-	case CURLINFO_DATA_OUT: header = "=> Send data";
-	case CURLINFO_SSL_DATA_OUT: header = "=> Send SSL data";
-	case CURLINFO_DATA_IN: header = "<= Recv data";
-	case CURLINFO_SSL_DATA_IN: header = "<= Recv SSL data";
-	default: /* in case a new one is introduced to shock us */
+		// these we don't want to log (HUGE)
+		case CURLINFO_DATA_OUT: header = "=> Send data";
+		case CURLINFO_SSL_DATA_OUT: header = "=> Send SSL data";
+		case CURLINFO_DATA_IN: header = "<= Recv data";
+		case CURLINFO_SSL_DATA_IN: header = "<= Recv SSL data";
+		default: /* in case a new one is introduced to shock us */
+			return 0;
+		}
+
+		if (size > 120) size = 120;
+		SWBuf text;
+		text.size(size);
+		memcpy(text.getRawData(), data, size);
+		SWLog::getSystemLog()->logDebug("CURLHTTPTransport: %s: %s", header.c_str(), text.c_str());
 		return 0;
 	}
-
-	if (size > 120) size = 120;
-	SWBuf text;
-	text.size(size);
-	memcpy(text.getRawData(), data, size);
-	SWLog::getSystemLog()->logDebug("CURLHTTPTransport: %s: %s", header.c_str(), text.c_str());
-	return 0;
 }
 
+
 CURLHTTPTransport::CURLHTTPTransport(const char *host, StatusReporter *sr) : RemoteTransport(host, sr) {
 	session = (CURL *)curl_easy_init();
 }

Modified: trunk/src/mgr/encfiltmgr.cpp
===================================================================
--- trunk/src/mgr/encfiltmgr.cpp	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/src/mgr/encfiltmgr.cpp	2013-09-14 21:51:47 UTC (rev 2980)
@@ -36,53 +36,45 @@
 
 #include <swmgr.h>
 
+
 SWORD_NAMESPACE_START
 
+
 /******************************************************************************
  * EncodingFilterMgr Constructor - initializes instance of EncodingFilterMgr
  *
  * ENT:
  *      enc - Encoding format to emit
  */
+EncodingFilterMgr::EncodingFilterMgr(char enc)
+		: SWFilterMgr() {
 
-EncodingFilterMgr::EncodingFilterMgr (char enc)
-		   : SWFilterMgr() {
+	scsuutf8   = new SCSUUTF8();
+	latin1utf8 = new Latin1UTF8();
 
-        scsuutf8 = new SCSUUTF8();
-        latin1utf8 = new Latin1UTF8();
+	encoding = enc;
 
-        encoding = enc;
-
-        switch (encoding) {
-        case ENC_LATIN1:
-                targetenc = new UTF8Latin1();
-                break;
-        case ENC_UTF16:
-                targetenc = new UTF8UTF16();
-                break;
-        case ENC_RTF:
-                targetenc = new UnicodeRTF();
-                break;
-        case ENC_HTML:
-                targetenc = new UTF8HTML();
-                break;
-        default: // i.e. case ENC_UTF8
-                targetenc = NULL;
-        }
+	switch (encoding) {
+		case ENC_LATIN1: targetenc = new UTF8Latin1(); break;
+		case ENC_UTF16:  targetenc = new UTF8UTF16();  break;
+		case ENC_RTF:    targetenc = new UnicodeRTF(); break;
+		case ENC_HTML:   targetenc = new UTF8HTML();   break;
+		default: // i.e. case ENC_UTF8
+			targetenc = NULL;
+	}
 }
 
+
 /******************************************************************************
  * EncodingFilterMgr Destructor - Cleans up instance of EncodingFilterMgr
  */
 EncodingFilterMgr::~EncodingFilterMgr() {
-        if (scsuutf8)
-                delete scsuutf8;
-        if (latin1utf8)
-                delete latin1utf8;
-        if (targetenc)
-                delete targetenc;
+	delete scsuutf8;
+	delete latin1utf8;
+	delete targetenc;
 }
 
+
 void EncodingFilterMgr::AddRawFilters(SWModule *module, ConfigEntMap &section) {
 
 	ConfigEntMap::iterator entry;
@@ -96,11 +88,13 @@
 	}
 }
 
+
 void EncodingFilterMgr::AddEncodingFilters(SWModule *module, ConfigEntMap &section) {
-        if (targetenc)
-                module->addEncodingFilter(targetenc);
+	if (targetenc)
+		module->addEncodingFilter(targetenc);
 }
 
+
 /******************************************************************************
  * EncodingFilterMgr::Encoding	- sets/gets encoding
  *
@@ -109,49 +103,41 @@
  * RET: encoding
  */
 char EncodingFilterMgr::Encoding(char enc) {
-        if (enc && enc != encoding) {
-                encoding = enc;
-                SWFilter * oldfilter = targetenc;
-                
-                switch (encoding) {
-                case ENC_LATIN1:
-                        targetenc = new UTF8Latin1();
-                        break;
-                case ENC_UTF16:
-                        targetenc = new UTF8UTF16();
-                        break;
-                case ENC_RTF:
-                        targetenc = new UnicodeRTF();
-                        break;
-                case ENC_HTML:
-                        targetenc = new UTF8HTML();
-                        break;
-                default: // i.e. case ENC_UTF8
-                        targetenc = NULL;
-                }
+	if (enc && enc != encoding) {
+		encoding = enc;
+		SWFilter *oldfilter = targetenc;
 
-                ModMap::const_iterator module;
+		switch (encoding) {
+			case ENC_LATIN1: targetenc = new UTF8Latin1(); break;
+			case ENC_UTF16:  targetenc = new UTF8UTF16();  break;
+			case ENC_RTF:    targetenc = new UnicodeRTF(); break;
+			case ENC_HTML:   targetenc = new UTF8HTML();   break;
+			default: // i.e. case ENC_UTF8
+				targetenc = NULL;
+		}
 
-                if (oldfilter != targetenc) {
-                        if (oldfilter) {
-                                if (!targetenc) {
-                                        for (module = getParentMgr()->Modules.begin(); module != getParentMgr()->Modules.end(); module++)
-                                                module->second->removeRenderFilter(oldfilter);
-                                }
-                                else {
-                                        for (module = getParentMgr()->Modules.begin(); module != getParentMgr()->Modules.end(); module++)
-                                                module->second->replaceRenderFilter(oldfilter, targetenc);
-                                }
-                                delete oldfilter;
-                        }
-                        else if (targetenc) {
-                                for (module = getParentMgr()->Modules.begin(); module != getParentMgr()->Modules.end(); module++)
-                                        module->second->addRenderFilter(targetenc);
-                        }
-                }
+		ModMap::const_iterator module;
 
-        }
-        return encoding;
+		if (oldfilter != targetenc) {
+			if (oldfilter) {
+				if (!targetenc) {
+					for (module = getParentMgr()->Modules.begin(); module != getParentMgr()->Modules.end(); module++)
+						module->second->removeRenderFilter(oldfilter);
+					}
+				else {
+					for (module = getParentMgr()->Modules.begin(); module != getParentMgr()->Modules.end(); module++)
+						module->second->replaceRenderFilter(oldfilter, targetenc);
+				}
+				delete oldfilter;
+			}
+			else if (targetenc) {
+				for (module = getParentMgr()->Modules.begin(); module != getParentMgr()->Modules.end(); module++)
+					module->second->addRenderFilter(targetenc);
+			}
+		}
+	}
+	return encoding;
 }
 
+
 SWORD_NAMESPACE_END

Modified: trunk/src/mgr/ftplibftpt.cpp
===================================================================
--- trunk/src/mgr/ftplibftpt.cpp	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/src/mgr/ftplibftpt.cpp	2013-09-14 21:51:47 UTC (rev 2980)
@@ -34,57 +34,57 @@
 
 namespace {
 
-struct MyProgressData {
-	StatusReporter *sr;
-	long totalSize;
-	bool *term;
-};
+	static struct MyProgressData {
+		StatusReporter *sr;
+		long totalSize;
+		bool *term;
+	};
 
-int my_swbufwriter(netbuf *nControl, void *buffer, size_t size, void *swbuf) {
-	SWBuf &output = *(SWBuf *)swbuf;
-	int s = output.size();
-	output.size(s+size);
-	memcpy(output.getRawData()+s, buffer, size);
-	return size;
-}
+	static int my_swbufwriter(netbuf *nControl, void *buffer, size_t size, void *swbuf) {
+		SWBuf &output = *(SWBuf *)swbuf;
+		int s = output.size();
+		output.size(s+size);
+		memcpy(output.getRawData()+s, buffer, size);
+		return size;
+	}
 
 #if defined(__GNUC__)
 #pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
 #endif
 
-int my_fprogress(netbuf *nControl, int xfered, void *arg) {
-	if (arg) {
-		MyProgressData *pd = (MyProgressData *)arg;
-SWLog::getSystemLog()->logDebug("FTPLibFTPTransport report progress: totalSize: %ld; xfered: %d\n", pd->totalSize, xfered);
-		if (pd->sr) {
-			pd->sr->statusUpdate(pd->totalSize, xfered);
+	static int my_fprogress(netbuf *nControl, int xfered, void *arg) {
+		if (arg) {
+			MyProgressData *pd = (MyProgressData *)arg;
+	SWLog::getSystemLog()->logDebug("FTPLibFTPTransport report progress: totalSize: %ld; xfered: %d\n", pd->totalSize, xfered);
+			if (pd->sr) {
+				pd->sr->statusUpdate(pd->totalSize, xfered);
+			}
+			if (*(pd->term)) return 0;
 		}
-		if (*(pd->term)) return 0;
+		return 1;
 	}
-	return 1;
-}
 
 #if defined(__GNUC__)
 #pragma GCC diagnostic pop
 #endif
 
-}
 
+	// initialize/cleanup SYSTEMWIDE library with life of this static.
+	static class FTPLibFTPTransport_init {
+	public:
+		FTPLibFTPTransport_init() {
+			FtpInit();
+		}
 
+		~FTPLibFTPTransport_init() {
+		}
 
-static FTPLibFTPTransport_init _FTPLibFTPTransport_init;
+	} _ftpLibFTPTransport_init;
 
-
-
-FTPLibFTPTransport_init::FTPLibFTPTransport_init() {
-	FtpInit();
 }
 
-FTPLibFTPTransport_init::~FTPLibFTPTransport_init() {
-}
 
-
 FTPLibFTPTransport::FTPLibFTPTransport(const char *host, StatusReporter *sr) : RemoteTransport(host, sr) {
 
 	ftpConnection = 0;

Modified: trunk/src/mgr/installmgr.cpp
===================================================================
--- trunk/src/mgr/installmgr.cpp	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/src/mgr/installmgr.cpp	2013-09-14 21:51:47 UTC (rev 2980)
@@ -20,8 +20,6 @@
  *
  */
 
-
-
 #ifndef EXCLUDEZLIB
 extern "C" {
 #include <untgz.h>
@@ -51,24 +49,27 @@
 #endif
 
 #include <iostream>
+
+
+using std::map;
+
+
 SWORD_NAMESPACE_START
 
 namespace {
 
-void removeTrailingSlash(SWBuf &buf) {
-	int len = buf.size();
-	if ((buf[len-1] == '/')
-	 || (buf[len-1] == '\\'))
-		buf.size(len-1);
-}
+	static void removeTrailingSlash(SWBuf &buf) {
+		int len = buf.size();
+		if ((buf[len-1] == '/')
+		 || (buf[len-1] == '\\'))
+			buf.size(len-1);
+	}
 
-const char *masterRepoList = "masterRepoList.conf";
+	static const char *masterRepoList = "masterRepoList.conf";
 
-};
+}
 
 
-using std::map;
-
 const int InstallMgr::MODSTAT_OLDER            = 0x001;
 const int InstallMgr::MODSTAT_SAMEVERSION      = 0x002;
 const int InstallMgr::MODSTAT_UPDATED          = 0x004;
@@ -76,6 +77,7 @@
 const int InstallMgr::MODSTAT_CIPHERED         = 0x010;
 const int InstallMgr::MODSTAT_CIPHERKEYPRESENT = 0x020;
 
+
 // override this method and provide your own custom RemoteTransport subclass
 // here we try a couple defaults if sword was compiled with support for them.
 // see these classes for examples of how to make your own
@@ -87,6 +89,7 @@
 #endif
 }
 
+
 RemoteTransport *InstallMgr::createHTTPTransport(const char *host, StatusReporter *statusReporter) {
 #ifdef CURLAVAILABLE
 	return new CURLHTTPTransport(host, statusReporter);
@@ -96,7 +99,6 @@
 }
 
 
-
 InstallMgr::InstallMgr(const char *privatePath, StatusReporter *sr, SWBuf u, SWBuf p) {
 	userDisclaimerConfirmed = false;
 	statusReporter = sr;
@@ -125,6 +127,7 @@
 	clearSources();
 }
 
+
 void InstallMgr::clearSources() {
 	for (InstallSourceMap::iterator it = sources.begin(); it != sources.end(); ++it) {
 		delete it->second;
@@ -132,6 +135,7 @@
 	sources.clear();
 }
 
+
 void InstallMgr::readInstallConf() {
 
 	if (installConf) delete installConf;
@@ -546,6 +550,7 @@
 	return 1;
 }
 
+
 int InstallMgr::refreshRemoteSource(InstallSource *is) {
 
 	// assert user disclaimer has been confirmed
@@ -583,6 +588,7 @@
 	return defaultMods.count(modName);
 }
 
+
 /************************************************************************
  * getModuleStatus - compare the modules of two SWMgrs and return a 
  * 	vector describing the status of each.  See MODSTAT_*

Modified: trunk/src/mgr/localemgr.cpp
===================================================================
--- trunk/src/mgr/localemgr.cpp	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/src/mgr/localemgr.cpp	2013-09-14 21:51:47 UTC (rev 2980)
@@ -40,8 +40,10 @@
 
 SWORD_NAMESPACE_START
 
+
 LocaleMgr *LocaleMgr::systemLocaleMgr = 0;
 
+
 class __staticsystemLocaleMgr {
 public:
 	__staticsystemLocaleMgr() { }
@@ -275,4 +277,6 @@
 	delete [] tmplang;
 }
 
+
 SWORD_NAMESPACE_END
+

Modified: trunk/src/mgr/markupfiltmgr.cpp
===================================================================
--- trunk/src/mgr/markupfiltmgr.cpp	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/src/mgr/markupfiltmgr.cpp	2013-09-14 21:51:47 UTC (rev 2980)
@@ -54,8 +54,10 @@
 
 #include <swmgr.h>
 
+
 SWORD_NAMESPACE_START
 
+
 /******************************************************************************
  * MarkupFilterMgr Constructor - initializes instance of MarkupFilterMgr
  *
@@ -64,12 +66,12 @@
  *      mark - Markup format to emit
  */
 
-MarkupFilterMgr::MarkupFilterMgr (char mark, char enc)
-		   : EncodingFilterMgr(enc) {
+MarkupFilterMgr::MarkupFilterMgr(char mark, char enc)
+		: EncodingFilterMgr(enc) {
 
-        markup = mark;
+	markup = mark;
 
-        CreateFilters(markup);
+	CreateFilters(markup);
 }
 
 
@@ -78,18 +80,14 @@
  */
 
 MarkupFilterMgr::~MarkupFilterMgr() {
-        if (fromthml)
-                delete (fromthml);
-        if (fromgbf)
-                delete (fromgbf);
-        if (fromplain)
-                delete (fromplain);
-        if (fromosis)
-                delete (fromosis);
-        if (fromtei)
-                delete (fromtei);
+	delete fromthml;
+	delete fromgbf;
+	delete fromplain;
+	delete fromosis;
+	delete fromtei;
 }
 
+
 /******************************************************************************
  * MarkupFilterMgr::Markup	- sets/gets markup
  *
@@ -98,211 +96,224 @@
  * RET: markup
  */
 char MarkupFilterMgr::Markup(char mark) {
-        if (mark && mark != markup) {
-                markup = mark;
-                ModMap::const_iterator module;
+	if (mark && mark != markup) {
+		markup = mark;
+		ModMap::const_iterator module;
 
-                SWFilter * oldplain = fromplain;
-                SWFilter * oldthml = fromthml;
-                SWFilter * oldgbf = fromgbf;
-                SWFilter * oldosis = fromosis;
-                SWFilter * oldtei = fromtei;
+		SWFilter *oldplain = fromplain;
+		SWFilter *oldthml  = fromthml;
+		SWFilter *oldgbf   = fromgbf;
+		SWFilter *oldosis  = fromosis;
+		SWFilter *oldtei   = fromtei;
 
-                CreateFilters(markup);
+		CreateFilters(markup);
 
-                for (module = getParentMgr()->Modules.begin(); module != getParentMgr()->Modules.end(); module++)
-                        switch (module->second->getMarkup()) {
-                        case FMT_THML:
-                                if (oldthml != fromthml) {
-                                        if (oldthml) {
-                                                if (!fromthml) {
-                                                        module->second->removeRenderFilter(oldthml);
-                                                }
-                                                else {
-                                                        module->second->replaceRenderFilter(oldthml, fromthml);
-                                                }
-                                        }
-                                        else if (fromthml) {
-                                                module->second->addRenderFilter(fromthml);
-                                        }
-                                }
-                                break;
-                        case FMT_GBF:
-                                if (oldgbf != fromgbf) {
-                                        if (oldgbf) {
-                                                if (!fromgbf) {
-                                                        module->second->removeRenderFilter(oldgbf);
-                                                }
-                                                else {
-                                                        module->second->replaceRenderFilter(oldgbf, fromgbf);
-                                                }
-                                        }
-                                        else if (fromgbf) {
-                                                module->second->addRenderFilter(fromgbf);
-                                        }
-                                        break;
-                                }
-                        case FMT_PLAIN:
-                                if (oldplain != fromplain) {
-                                        if (oldplain) {
-                                                if (!fromplain) {
-                                                        module->second->removeRenderFilter(oldplain);
-                                                }
-                                                else {
-                                                        module->second->replaceRenderFilter(oldplain, fromplain);
-                                                }
-                                        }
-                                        else if (fromplain) {
-                                                module->second->addRenderFilter(fromplain);
-                                        }
-                                        break;
-                                }
-                        case FMT_OSIS:
-                                if (oldosis != fromosis) {
-                                        if (oldosis) {
-                                                if (!fromosis) {
-                                                        module->second->removeRenderFilter(oldosis);
-                                                }
-                                                else {
-                                                        module->second->replaceRenderFilter(oldosis, fromosis);
-                                                }
-                                        }
-                                        else if (fromosis) {
-                                                module->second->addRenderFilter(fromosis);
-                                        }
-                                        break;
-                                }
-                        case FMT_TEI:
-                                if (oldtei != fromtei) {
-                                        if (oldtei) {
-                                                if (!fromtei) {
-                                                        module->second->removeRenderFilter(oldtei);
-                                                }
-                                                else {
-                                                        module->second->replaceRenderFilter(oldtei, fromtei);
-                                                }
-                                        }
-                                        else if (fromtei) {
-                                                module->second->addRenderFilter(fromtei);
-                                        }
-                                        break;
-                                }
-                        }
+		for (module = getParentMgr()->Modules.begin(); module != getParentMgr()->Modules.end(); ++module) {
+			switch (module->second->getMarkup()) {
+			case FMT_THML:
+				if (oldthml != fromthml) {
+					if (oldthml) {
+						if (!fromthml) {
+							module->second->removeRenderFilter(oldthml);
+						}
+						else {
+							module->second->replaceRenderFilter(oldthml, fromthml);
+						}
+					}
+					else if (fromthml) {
+						module->second->addRenderFilter(fromthml);
+					}
+				}
+				break;
 
-                if (oldthml)
-                        delete oldthml;
-                if (oldgbf)
-                        delete oldgbf;
-                if (oldplain)
-                        delete oldplain;
-                if (oldosis)
-                        delete oldosis;
-                if (oldtei)
-                        delete oldtei;
-        }
-        return markup;
+			case FMT_GBF:
+				if (oldgbf != fromgbf) {
+					if (oldgbf) {
+						if (!fromgbf) {
+							module->second->removeRenderFilter(oldgbf);
+						}
+						else {
+							module->second->replaceRenderFilter(oldgbf, fromgbf);
+						}
+					}
+					else if (fromgbf) {
+						module->second->addRenderFilter(fromgbf);
+					}
+				}
+				break;
+
+			case FMT_PLAIN:
+				if (oldplain != fromplain) {
+					if (oldplain) {
+						if (!fromplain) {
+							module->second->removeRenderFilter(oldplain);
+						}
+						else {
+							module->second->replaceRenderFilter(oldplain, fromplain);
+						}
+					}
+					else if (fromplain) {
+						module->second->addRenderFilter(fromplain);
+					}
+				}
+				break;
+
+			case FMT_OSIS:
+				if (oldosis != fromosis) {
+					if (oldosis) {
+						if (!fromosis) {
+							module->second->removeRenderFilter(oldosis);
+						}
+						else {
+							module->second->replaceRenderFilter(oldosis, fromosis);
+						}
+					}
+					else if (fromosis) {
+						module->second->addRenderFilter(fromosis);
+					}
+				}
+				break;
+
+			case FMT_TEI:
+				if (oldtei != fromtei) {
+					if (oldtei) {
+						if (!fromtei) {
+							module->second->removeRenderFilter(oldtei);
+						}
+						else {
+							module->second->replaceRenderFilter(oldtei, fromtei);
+						}
+					}
+					else if (fromtei) {
+						module->second->addRenderFilter(fromtei);
+					}
+				}
+				break;
+			}
+		}
+
+		delete oldthml;
+		delete oldgbf;
+		delete oldplain;
+		delete oldosis;
+		delete oldtei;
+	}
+	return markup;
 }
 
+
 void MarkupFilterMgr::AddRenderFilters(SWModule *module, ConfigEntMap &section) {
-        switch (module->getMarkup()) {
-        case FMT_THML:
-                if (fromthml)
-                        module->addRenderFilter(fromthml);
-                break;
-        case FMT_GBF:
-                if (fromgbf)
-                        module->addRenderFilter(fromgbf);
-                break;
-        case FMT_PLAIN:
-                if (fromplain)
-                        module->addRenderFilter(fromplain);
-                break;
-        case FMT_OSIS:
-                if (fromosis)
-                        module->addRenderFilter(fromosis);
-                break;
-        case FMT_TEI:
-                if (fromtei)
-                        module->addRenderFilter(fromtei);
-                break;
-        }
+	switch (module->getMarkup()) {
+	case FMT_THML:
+		if (fromthml)
+			module->addRenderFilter(fromthml);
+		break;
+	case FMT_GBF:
+		if (fromgbf)
+			module->addRenderFilter(fromgbf);
+		break;
+	case FMT_PLAIN:
+		if (fromplain)
+			module->addRenderFilter(fromplain);
+		break;
+	case FMT_OSIS:
+		if (fromosis)
+			module->addRenderFilter(fromosis);
+		break;
+	case FMT_TEI:
+		if (fromtei)
+			module->addRenderFilter(fromtei);
+		break;
+	}
 }
 
+
 void MarkupFilterMgr::CreateFilters(char markup) {
 
-                switch (markup) {
-                case FMT_PLAIN:
-                        fromplain = NULL;
-                        fromthml = new ThMLPlain();
-                        fromgbf = new GBFPlain();
-                        fromosis = new OSISPlain();
-                        fromtei = new TEIPlain();
-                        break;
-                case FMT_THML:
-                        fromplain = NULL;
-                        fromthml = NULL;
-                        fromgbf = new GBFThML();
-                        fromosis = NULL;
-                        fromtei = NULL;
-                        break;
-                case FMT_GBF:
-                        fromplain = NULL;
-                        fromthml = new ThMLGBF();
-                        fromgbf = NULL;
-                        fromosis = NULL;
-                        fromtei = NULL;
-                        break;
-                case FMT_HTML:
-                        fromplain = NULL;
-                        fromthml = new ThMLHTML();
-                        fromgbf = new GBFHTML();
-                        fromosis = NULL;
-                        fromtei = NULL;
-                        break;
-                case FMT_HTMLHREF:
-                        fromplain = NULL;
-                        fromthml = new ThMLHTMLHREF();
-                        fromgbf = new GBFHTMLHREF();
-                        fromosis = new OSISHTMLHREF();
-                        fromtei = new TEIHTMLHREF();
-                        break;
-                case FMT_RTF:
-                        fromplain = NULL;
-                        fromthml = new ThMLRTF();
-                        fromgbf = new GBFRTF();
-                        fromosis = new OSISRTF();
-                        fromtei = new TEIRTF();
-                        break;
-                case FMT_OSIS:
-                        fromplain = NULL;
-                        fromthml = new ThMLOSIS();
-                        fromgbf = new GBFOSIS();
-                        fromosis = new OSISOSIS();
-                        fromtei = NULL;
-                        break;
-                case FMT_WEBIF:
-                        fromplain = NULL;
-                        fromthml = new ThMLWEBIF();
-                        fromgbf = new GBFWEBIF();
-                        fromosis = new OSISWEBIF();
-                        fromtei = NULL;
-                        break;
-                case FMT_TEI:
-                        fromplain = NULL;
-                        fromthml = NULL;
-                        fromgbf = NULL;
-                        fromosis = NULL;
-                        fromtei = NULL;
-                        break;
-                case FMT_XHTML:
-                        fromplain = NULL;
-                        fromthml = new ThMLXHTML();
-                        fromgbf = new GBFXHTML();
-                        fromosis = new OSISXHTML();
-                        fromtei = new TEIXHTML();
-                        break;
-                }
+	switch (markup) {
+	case FMT_PLAIN:
+		fromplain = NULL;
+		fromthml  = new ThMLPlain();
+		fromgbf   = new GBFPlain();
+		fromosis  = new OSISPlain();
+		fromtei   = new TEIPlain();
+		break;
 
+	case FMT_THML:
+		fromplain = NULL;
+		fromthml  = NULL;
+		fromgbf   = new GBFThML();
+		fromosis  = NULL;
+		fromtei   = NULL;
+		break;
+
+	case FMT_GBF:
+		fromplain = NULL;
+		fromthml  = new ThMLGBF();
+		fromgbf   = NULL;
+		fromosis  = NULL;
+		fromtei   = NULL;
+		break;
+
+	case FMT_HTML:
+		fromplain = NULL;
+		fromthml  = new ThMLHTML();
+		fromgbf   = new GBFHTML();
+		fromosis  = NULL;
+		fromtei   = NULL;
+		break;
+
+	case FMT_HTMLHREF:
+		fromplain = NULL;
+		fromthml  = new ThMLHTMLHREF();
+		fromgbf   = new GBFHTMLHREF();
+		fromosis  = new OSISHTMLHREF();
+		fromtei   = new TEIHTMLHREF();
+		break;
+
+	case FMT_RTF:
+		fromplain = NULL;
+		fromthml  = new ThMLRTF();
+		fromgbf   = new GBFRTF();
+		fromosis  = new OSISRTF();
+		fromtei   = new TEIRTF();
+		break;
+
+	case FMT_OSIS:
+		fromplain = NULL;
+		fromthml  = new ThMLOSIS();
+		fromgbf   = new GBFOSIS();
+		fromosis  = new OSISOSIS();
+		fromtei   = NULL;
+		break;
+
+	case FMT_WEBIF:
+		fromplain = NULL;
+		fromthml  = new ThMLWEBIF();
+		fromgbf   = new GBFWEBIF();
+		fromosis  = new OSISWEBIF();
+		fromtei   = NULL;
+		break;
+
+	case FMT_TEI:
+		fromplain = NULL;
+		fromthml  = NULL;
+		fromgbf   = NULL;
+		fromosis  = NULL;
+		fromtei   = NULL;
+		break;
+
+	case FMT_XHTML:
+		fromplain = NULL;
+		fromthml  = new ThMLXHTML();
+		fromgbf   = new GBFXHTML();
+		fromosis  = new OSISXHTML();
+		fromtei   = new TEIXHTML();
+		break;
+	}
+
 }
 
+
 SWORD_NAMESPACE_END
+

Modified: trunk/src/mgr/remotetrans.cpp
===================================================================
--- trunk/src/mgr/remotetrans.cpp	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/src/mgr/remotetrans.cpp	2013-09-14 21:51:47 UTC (rev 2980)
@@ -20,9 +20,6 @@
  *
  */
 
-
- 
-
 #include <remotetrans.h>
 #include <filemgr.h>
 
@@ -30,10 +27,12 @@
 #include <dirent.h>
 #include <swlog.h>
 
+
 extern "C" {
 #include <ftpparse.h>
 }
 
+
 using std::vector;
 
 
@@ -42,12 +41,12 @@
 
 namespace {
 
-void removeTrailingSlash(SWBuf &buf) {
-	int len = buf.size();
-	if ((buf[len-1] == '/')
-	 || (buf[len-1] == '\\'))
-		buf.size(len-1);
-}
+	void removeTrailingSlash(SWBuf &buf) {
+		int len = buf.size();
+		if ((buf[len-1] == '/')
+		 || (buf[len-1] == '\\'))
+			buf.size(len-1);
+	}
 
 };
 
@@ -55,6 +54,7 @@
 void StatusReporter::preStatus(long totalBytes, long completedBytes, const char *message) {
 }
 
+
 void StatusReporter::statusUpdate(double dtTotal, double dlNow) {
 }
 
@@ -191,6 +191,7 @@
 	return retVal;
 }
 
+
 #if defined(__GNUC__)
 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
 #endif
@@ -198,5 +199,6 @@
 	statusUpdate(totalBytes, completedBytes);
 }
 
+
 SWORD_NAMESPACE_END
 

Modified: trunk/src/mgr/stringmgr.cpp
===================================================================
--- trunk/src/mgr/stringmgr.cpp	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/src/mgr/stringmgr.cpp	2013-09-14 21:51:47 UTC (rev 2980)
@@ -39,8 +39,10 @@
 
 #endif
 
+
 SWORD_NAMESPACE_START
 
+
 StringMgr *StringMgr::systemStringMgr = 0;
 
 class __staticsystemStringMgr {
@@ -49,70 +51,74 @@
 	~__staticsystemStringMgr() { if (StringMgr::systemStringMgr) delete StringMgr::systemStringMgr; StringMgr::systemStringMgr = 0; }
 } _staticsystemStringMgr;
 
-/**
- * Determine whether the string contains a valid unicode sequence. The following table give the pattern of a valid UTF-8 character.
- * Unicode Range            1st       2nd       3rd       4th       5th       6th
- * U-00000000 - U-0000007F  0nnnnnnn
- * U-00000080 - U-000007FF  110nnnnn  10nnnnnn
- * U-00000800 - U-0000FFFF  1110nnnn  10nnnnnn  10nnnnnn
- * U-00010000 - U-001FFFFF  11110nnn  10nnnnnn  10nnnnnn  10nnnnnn
- * U-00200000 - U-03FFFFFF  111110nn  10nnnnnn  10nnnnnn  10nnnnnn  10nnnnnn
- * U-04000000 - U-7FFFFFFF  1111110n  10nnnnnn  10nnnnnn  10nnnnnn  10nnnnnn  10nnnnnn
- * Note:
- *   The latest UTF-8 RFC allows for a max of 4 bytes. Earlier allowed 6.
- *   The number of bits of the leading byte before the first 0 is the total number of bytes
- *   The "n" are the bits of the unicode codepoint.
- *
- * This routine does not check to see if the code point is in the range. It could.
- *
- * @param txt the text to check
- * @return  1 if all high order characters form a valid unicode sequence
- *         -1 if there are no high order characters
- *          0 if there are high order characters that do not form a valid unicode sequence
- * @author DM Smith [dmsmith555 at yahoo dot com]
- */
-int isValidUTF8(unsigned char *txt) {
-	unsigned int  countUTF8 = 0;
-#if 0
-	unsigned char parts     = 0;
 
+namespace {
 
-	unsigned char *p = txt;
-	while (*p) {
-		// Is the high order bit set?
-		if (*p & 0x80) {
-			// then count the number of high order bits that are set
-			// this determines the number of following bytes need to have high order bits set
-			unsigned char i = *p;
-			for (parts = 0; i & 0x80; parts++) {
-				i <<= 1;
-			}
+	/**
+	 * Determine whether the string contains a valid unicode sequence. The following table give the pattern of a valid UTF-8 character.
+	 * Unicode Range            1st       2nd       3rd       4th       5th       6th
+	 * U-00000000 - U-0000007F  0nnnnnnn
+	 * U-00000080 - U-000007FF  110nnnnn  10nnnnnn
+	 * U-00000800 - U-0000FFFF  1110nnnn  10nnnnnn  10nnnnnn
+	 * U-00010000 - U-001FFFFF  11110nnn  10nnnnnn  10nnnnnn  10nnnnnn
+	 * U-00200000 - U-03FFFFFF  111110nn  10nnnnnn  10nnnnnn  10nnnnnn  10nnnnnn
+	 * U-04000000 - U-7FFFFFFF  1111110n  10nnnnnn  10nnnnnn  10nnnnnn  10nnnnnn  10nnnnnn
+	 * Note:
+	 *   The latest UTF-8 RFC allows for a max of 4 bytes. Earlier allowed 6.
+	 *   The number of bits of the leading byte before the first 0 is the total number of bytes
+	 *   The "n" are the bits of the unicode codepoint.
+	 *
+	 * This routine does not check to see if the code point is in the range. It could.
+	 *
+	 * @param txt the text to check
+	 * @return  1 if all high order characters form a valid unicode sequence
+	 *         -1 if there are no high order characters
+	 *          0 if there are high order characters that do not form a valid unicode sequence
+	 * @author DM Smith [dmsmith555 at yahoo dot com]
+	 */
+	int isValidUTF8(unsigned char *txt) {
+		unsigned int  countUTF8 = 0;
+	#if 0
+		unsigned char parts     = 0;
 
 
-			// The pattern 10nnnnnn is not a unicode character
-			if (parts == 1) {
-				return 0;
-			}
-			else {
-				while (--parts && ++*p) {
-					// The pattern of each following character must be: 10nnnnnn
-					if (0xc0 & *p != 0x80) {
-						return  0;
-					}
+		unsigned char *p = txt;
+		while (*p) {
+			// Is the high order bit set?
+			if (*p & 0x80) {
+				// then count the number of high order bits that are set
+				// this determines the number of following bytes need to have high order bits set
+				unsigned char i = *p;
+				for (parts = 0; i & 0x80; parts++) {
+					i <<= 1;
 				}
 
-				// Oops, we've run out of bytes too soon: Cannot be UTF-8
-				if (parts) {
+
+				// The pattern 10nnnnnn is not a unicode character
+				if (parts == 1) {
 					return 0;
 				}
+				else {
+					while (--parts && ++*p) {
+						// The pattern of each following character must be: 10nnnnnn
+						if (0xc0 & *p != 0x80) {
+							return  0;
+						}
+					}
+
+					// Oops, we've run out of bytes too soon: Cannot be UTF-8
+					if (parts) {
+						return 0;
+					}
+				}
+				countUTF8++;
 			}
-			countUTF8++;
 		}
+
+		// At this point it is either UTF-8 or ascii
+	#endif
+		return countUTF8 ? 1 : -1;
 	}
-
-	// At this point it is either UTF-8 or ascii
-#endif
-	return countUTF8 ? 1 : -1;
 }
 
 

Modified: trunk/src/mgr/swcacher.cpp
===================================================================
--- trunk/src/mgr/swcacher.cpp	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/src/mgr/swcacher.cpp	2013-09-14 21:51:47 UTC (rev 2980)
@@ -24,6 +24,7 @@
 
 #include <swcacher.h>
 
+
 SWORD_NAMESPACE_START
 
 
@@ -46,4 +47,6 @@
 	return 0;
 }
 
+
 SWORD_NAMESPACE_END
+

Modified: trunk/src/mgr/swconfig.cpp
===================================================================
--- trunk/src/mgr/swconfig.cpp	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/src/mgr/swconfig.cpp	2013-09-14 21:51:47 UTC (rev 2980)
@@ -29,9 +29,11 @@
 
 SWORD_NAMESPACE_START
 
+
 SWConfig::SWConfig() {
 }
 
+
 SWConfig::SWConfig(const char * ifilename) {
 	filename = ifilename;
 	Load();
@@ -41,6 +43,7 @@
 SWConfig::~SWConfig() {
 }
 
+
 void SWConfig::Load() {
 
 	if (!filename.size()) return;	// assert we have a filename
@@ -165,4 +168,6 @@
     return Sections[section];
 }
 
+
 SWORD_NAMESPACE_END
+

Modified: trunk/src/mgr/swfiltermgr.cpp
===================================================================
--- trunk/src/mgr/swfiltermgr.cpp	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/src/mgr/swfiltermgr.cpp	2013-09-14 21:51:47 UTC (rev 2980)
@@ -23,6 +23,7 @@
 
 #include <swfiltermgr.h>
 
+
 SWORD_NAMESPACE_START
 
 
@@ -91,4 +92,6 @@
 void SWFilterMgr::AddRawFilters(SWModule * module, ConfigEntMap & section) {
 }
 
+
 SWORD_NAMESPACE_END
+

Modified: trunk/src/mgr/swlocale.cpp
===================================================================
--- trunk/src/mgr/swlocale.cpp	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/src/mgr/swlocale.cpp	2013-09-14 21:51:47 UTC (rev 2980)
@@ -28,13 +28,19 @@
 #include <versekey.h>
 #include <versificationmgr.h>
 
+
 SWORD_NAMESPACE_START
 
-typedef std::map < SWBuf, SWBuf, std::less < SWBuf > >LookupMap;
 
+namespace {
+	typedef std::map < SWBuf, SWBuf, std::less < SWBuf > >LookupMap;
+}
+
+
 const char *SWLocale::DEFAULT_LOCALE_NAME="en";
 
-// I have bridge patterns, but this hides swconfig and map from lots o stuff
+
+// I hate bridge patterns, but this hides swconfig and map from lots o stuff
 class SWLocale::Private {
 public:
 	LookupMap lookupTable;
@@ -145,10 +151,12 @@
 	return description;
 }
 
+
 const char *SWLocale::getEncoding() {
 	return encoding;
 }
 
+
 void SWLocale::augment(SWLocale &addFrom) {
 	*localeSource += *addFrom.localeSource;
 }
@@ -185,3 +193,4 @@
 
 
 SWORD_NAMESPACE_END
+

Modified: trunk/src/mgr/swmgr.cpp
===================================================================
--- trunk/src/mgr/swmgr.cpp	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/src/mgr/swmgr.cpp	2013-09-14 21:51:47 UTC (rev 2980)
@@ -101,8 +101,10 @@
 #include <utf8transliterator.h>
 #endif
 
+
 SWORD_NAMESPACE_START
 
+
 #ifdef _ICU_
 bool SWMgr::isICU = true;
 #else
@@ -116,12 +118,14 @@
 const char *SWMgr::globalConfPath = "/etc/sword.conf:/usr/local/etc/sword.conf";
 #endif
 
+
 const char *SWMgr::MODTYPE_BIBLES = "Biblical Texts";
 const char *SWMgr::MODTYPE_COMMENTARIES = "Commentaries";
 const char *SWMgr::MODTYPE_LEXDICTS = "Lexicons / Dictionaries";
 const char *SWMgr::MODTYPE_GENBOOKS = "Generic Books";
 const char *SWMgr::MODTYPE_DAILYDEVOS = "Daily Devotional";
 
+
 void SWMgr::init() {
 	SWOptionFilter *tmpFilter = 0;
 	configPath  = 0;
@@ -857,6 +861,7 @@
 	return ret;
 }
 
+
 SWModule *SWMgr::createModule(const char *name, const char *driver, ConfigEntMap &section)
 {
 	SWBuf description, datapath, misc1;
@@ -1089,7 +1094,7 @@
 
 
 char SWMgr::filterText(const char *filterName, SWBuf &text, const SWKey *key, const SWModule *module)
- {
+{
 	char retVal = -1;
 	// why didn't we use find here?
 	for (OptionFilterMap::iterator it = optionFilters.begin(); it != optionFilters.end(); it++) {
@@ -1448,4 +1453,6 @@
 	return -1;
 }
 
+
 SWORD_NAMESPACE_END
+

Modified: trunk/src/mgr/swsearchable.cpp
===================================================================
--- trunk/src/mgr/swsearchable.cpp	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/src/mgr/swsearchable.cpp	2013-09-14 21:51:47 UTC (rev 2980)
@@ -24,10 +24,13 @@
 #include <swsearchable.h>
 #include <listkey.h>
 
+
 SWORD_NAMESPACE_START
 
+
 void SWSearchable::nullPercent(char percent, void *percentUserData) {}
 
+
 SWSearchable::SWSearchable() {
 }
 
@@ -35,7 +38,8 @@
 SWSearchable::~SWSearchable() {
 }
 
-	// special search framework
+
+// special search framework
 signed char SWSearchable::createSearchFramework(void (*percent)(char, void *), void *percentUserData) {
 	return 0;
 }
@@ -51,4 +55,6 @@
 	return retVal;
 }
 
+
 SWORD_NAMESPACE_END
+

Modified: trunk/src/mgr/versificationmgr.cpp
===================================================================
--- trunk/src/mgr/versificationmgr.cpp	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/src/mgr/versificationmgr.cpp	2013-09-14 21:51:47 UTC (rev 2980)
@@ -51,6 +51,7 @@
 using std::distance;
 using std::lower_bound;
 
+
 SWORD_NAMESPACE_START
 
 
@@ -120,6 +121,7 @@
 	}
 };
 
+
 struct BookOffsetLess {
 	bool operator() (const VersificationMgr::Book &o1, const VersificationMgr::Book &o2) const { return o1.p->offsetPrecomputed[0] < o2.p->offsetPrecomputed[0]; }
 	bool operator() (const long &o1, const VersificationMgr::Book &o2) const { return o1 < o2.p->offsetPrecomputed[0]; }
@@ -127,10 +129,12 @@
 	bool operator() (const long &o1, const long &o2) const { return o1 < o2; }
 };
 
+
 void VersificationMgr::Book::init() {
 	p = new Private();
 }
 
+
 void VersificationMgr::System::init() {
 	p = new Private();
 	BMAX[0] = 0;
@@ -148,6 +152,7 @@
 	ntStartOffset = other.ntStartOffset;
 }
 
+
 VersificationMgr::System &VersificationMgr::System::operator =(const System &other) {
 	name = other.name;
 	BMAX[0] = other.BMAX[0];
@@ -162,6 +167,7 @@
 	delete p;
 }
 
+
 const VersificationMgr::Book *VersificationMgr::System::getBook(int number) const {
 	return (number < (signed int)p->books.size()) ? &(p->books[number]) : 0;
 }
@@ -225,6 +231,7 @@
 	(*p) = *(other.p);
 }
 
+
 VersificationMgr::Book& VersificationMgr::Book::operator =(const Book &other) {
 	longName = other.longName;
 	osisName = other.osisName;
@@ -386,3 +393,4 @@
 
 
 SWORD_NAMESPACE_END
+

Modified: trunk/src/modules/common/zstr.cpp
===================================================================
--- trunk/src/modules/common/zstr.cpp	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/src/modules/common/zstr.cpp	2013-09-14 21:51:47 UTC (rev 2980)
@@ -60,7 +60,6 @@
 {
 	SWBuf buf;
 
-	nl = '\n';
 	lastoff = -1;
 	path = 0;
 	stdstr(&path, ipath);
@@ -433,12 +432,13 @@
 
 void zStr::setText(const char *ikey, const char *buf, long len) {
 
+	static const char nl[] = {13, 10};
+
 	__u32 start, outstart;
 	__u32 size, outsize;
 	__s32 endoff;
 	long idxoff = 0;
 	__s32 shiftSize;
-	static const char nl[] = {13, 10};
 	char *tmpbuf = 0;
 	char *key = 0;
 	char *dbKey = 0;
@@ -586,6 +586,9 @@
 
 
 void zStr::flushCache() const {
+
+	static const char nl[] = {13, 10};
+
 	if (cacheBlock) {
 		if (cacheDirty) {
 			__u32 start = 0;

Modified: trunk/src/modules/filters/cipherfil.cpp
===================================================================
--- trunk/src/modules/filters/cipherfil.cpp	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/src/modules/filters/cipherfil.cpp	2013-09-14 21:51:47 UTC (rev 2980)
@@ -27,8 +27,10 @@
 #include <swcipher.h>
 #include <swbuf.h>
 
+
 SWORD_NAMESPACE_START
 
+
 CipherFilter::CipherFilter(const char *key) {
 	cipher = new SWCipher((unsigned char *)key);
 }
@@ -61,4 +63,6 @@
 	return 0;
 }
 
+
 SWORD_NAMESPACE_END
+

Modified: trunk/src/modules/filters/gbffootnotes.cpp
===================================================================
--- trunk/src/modules/filters/gbffootnotes.cpp	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/src/modules/filters/gbffootnotes.cpp	2013-09-14 21:51:47 UTC (rev 2980)
@@ -30,17 +30,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 {
 
-const SWBuf choices[3] = {"Off", "On", ""};
-const StringList oValues(&choices[0], &choices[2]);
+	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;
+	}
+}
 
-GBFFootnotes::GBFFootnotes() : SWOptionFilter(oName, oTip, &oValues) {
-	setOptionValue("Off");
+
+GBFFootnotes::GBFFootnotes() : SWOptionFilter(oName, oTip, oValues()) {
 }
 
 

Modified: trunk/src/modules/filters/gbfheadings.cpp
===================================================================
--- trunk/src/modules/filters/gbfheadings.cpp	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/src/modules/filters/gbfheadings.cpp	2013-09-14 21:51:47 UTC (rev 2980)
@@ -21,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";
 
-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;
+	}
+}
 
-GBFHeadings::GBFHeadings() : SWOptionFilter(oName, oTip, &oValues) {
-	setOptionValue("Off");
+
+GBFHeadings::GBFHeadings() : SWOptionFilter(oName, oTip, oValues()) {
 }
 
 
@@ -42,7 +49,7 @@
 }
 
 
-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;

Modified: trunk/src/modules/filters/gbfmorph.cpp
===================================================================
--- trunk/src/modules/filters/gbfmorph.cpp	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/src/modules/filters/gbfmorph.cpp	2013-09-14 21:51:47 UTC (rev 2980)
@@ -24,19 +24,26 @@
 #include <stdlib.h>
 #include <gbfmorph.h>
 
+
 SWORD_NAMESPACE_START
 
-const char oName[] = "Morphological Tags";
-const char oTip[] = "Toggles Morphological Tags On and Off if they exist";
+namespace {
 
-const SWBuf choices[3] = {"Off", "On", ""};
-const StringList oValues(&choices[0], &choices[2]);
+	static const char oName[] = "Morphological Tags";
+	static const char oTip[]  = "Toggles Morphological Tags On and Off if they exist";
 
-GBFMorph::GBFMorph() : SWOptionFilter(oName, oTip, &oValues) {
-	setOptionValue("Off");
+	static const StringList *oValues() {
+		static const SWBuf choices[3] = {"Off", "On", ""};
+		static const StringList oVals(&choices[0], &choices[2]);
+		return &oVals;
+	}
 }
 
 
+GBFMorph::GBFMorph() : SWOptionFilter(oName, oTip, oValues()) {
+}
+
+
 GBFMorph::~GBFMorph() {
 }
 

Modified: trunk/src/modules/filters/gbfosis.cpp
===================================================================
--- trunk/src/modules/filters/gbfosis.cpp	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/src/modules/filters/gbfosis.cpp	2013-09-14 21:51:47 UTC (rev 2980)
@@ -29,8 +29,10 @@
 #include <swlog.h>
 #include <stdarg.h>
 
+
 SWORD_NAMESPACE_START
 
+
 GBFOSIS::GBFOSIS() {
 }
 

Modified: trunk/src/modules/filters/gbfplain.cpp
===================================================================
--- trunk/src/modules/filters/gbfplain.cpp	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/src/modules/filters/gbfplain.cpp	2013-09-14 21:51:47 UTC (rev 2980)
@@ -25,8 +25,10 @@
 #include <gbfplain.h>
 #include <swbuf.h>
 
+
 SWORD_NAMESPACE_START
 
+
 GBFPlain::GBFPlain() {
 }
 
@@ -110,4 +112,6 @@
 	return 0;
 }
 
+
 SWORD_NAMESPACE_END
+

Modified: trunk/src/modules/filters/gbfredletterwords.cpp
===================================================================
--- trunk/src/modules/filters/gbfredletterwords.cpp	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/src/modules/filters/gbfredletterwords.cpp	2013-09-14 21:51:47 UTC (rev 2980)
@@ -26,19 +26,26 @@
 #include <swmodule.h>
 #include <ctype.h>
 
+
 SWORD_NAMESPACE_START
 
-const char oName[] = "Words of Christ in Red";
-const char oTip[] = "Toggles Red Coloring for Words of Christ On and Off if they are marked";
+namespace {
 
-const SWBuf choices[3] = {"Off", "On", ""};
-const StringList oValues(&choices[0], &choices[2]);
+	static const char oName[] = "Words of Christ in Red";
+	static const char oTip[]  = "Toggles Red Coloring for Words of Christ On and Off if they are marked";
 
-GBFRedLetterWords::GBFRedLetterWords() : SWOptionFilter(oName, oTip, &oValues) {
-	setOptionValue("Off");
+	static const StringList *oValues() {
+		static const SWBuf choices[3] = {"Off", "On", ""};
+		static const StringList oVals(&choices[0], &choices[2]);
+		return &oVals;
+	}
 }
 
 
+GBFRedLetterWords::GBFRedLetterWords() : SWOptionFilter(oName, oTip, oValues()) {
+}
+
+
 GBFRedLetterWords::~GBFRedLetterWords() {
 }
 

Modified: trunk/src/modules/filters/gbfstrongs.cpp
===================================================================
--- trunk/src/modules/filters/gbfstrongs.cpp	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/src/modules/filters/gbfstrongs.cpp	2013-09-14 21:51:47 UTC (rev 2980)
@@ -27,19 +27,26 @@
 #include <swmodule.h>
 #include <ctype.h>
 
+
 SWORD_NAMESPACE_START
 
-const char oName[] = "Strong's Numbers";
-const char oTip[] = "Toggles Strong's Numbers On and Off if they exist";
+namespace {
 
-const SWBuf choices[3] = {"Off", "On", ""};
-const StringList oValues(&choices[0], &choices[2]);
+	static const char oName[] = "Strong's Numbers";
+	static const char oTip[]  = "Toggles Strong's Numbers On and Off if they exist";
 
-GBFStrongs::GBFStrongs() : SWOptionFilter(oName, oTip, &oValues) {
-	setOptionValue("Off");
+	static const StringList *oValues() {
+		static const SWBuf choices[3] = {"Off", "On", ""};
+		static const StringList oVals(&choices[0], &choices[2]);
+		return &oVals;
+	}
 }
 
 
+GBFStrongs::GBFStrongs() : SWOptionFilter(oName, oTip, oValues()) {
+}
+
+
 GBFStrongs::~GBFStrongs() {
 }
 

Modified: trunk/src/modules/filters/gbfthml.cpp
===================================================================
--- trunk/src/modules/filters/gbfthml.cpp	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/src/modules/filters/gbfthml.cpp	2013-09-14 21:51:47 UTC (rev 2980)
@@ -24,8 +24,10 @@
 #include <gbfthml.h>
 #include <swbuf.h>
 
+
 SWORD_NAMESPACE_START
 
+
 GBFThML::GBFThML()
 {
 }
@@ -218,5 +220,4 @@
 }
 
 
-
 SWORD_NAMESPACE_END

Modified: trunk/src/modules/filters/gbfwordjs.cpp
===================================================================
--- trunk/src/modules/filters/gbfwordjs.cpp	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/src/modules/filters/gbfwordjs.cpp	2013-09-14 21:51:47 UTC (rev 2980)
@@ -28,18 +28,24 @@
 #include <utilstr.h>
 #include <versekey.h>
 
+
 SWORD_NAMESPACE_START
 
-const char oName[] = "Word Javascript";
-const char oTip[] = "Toggles Word Javascript data";
+namespace {
 
-const SWBuf choices[3] = {"Off", "On", ""};
-const StringList oValues(&choices[0], &choices[2]);
+	static const char oName[] = "Word Javascript";
+	static const char oTip[]  = "Toggles Word Javascript data";
 
+	static const StringList *oValues() {
+		static const SWBuf choices[3] = {"Off", "On", ""};
+		static const StringList oVals(&choices[0], &choices[2]);
+		return &oVals;
+	}
+}
 
-GBFWordJS::GBFWordJS() : SWOptionFilter(oName, oTip, &oValues) {
-	setOptionValue("Off");
 
+GBFWordJS::GBFWordJS() : SWOptionFilter(oName, oTip, oValues()) {
+
      defaultGreekLex   = 0;
      defaultHebLex     = 0;
      defaultGreekParse = 0;

Modified: trunk/src/modules/filters/latin1utf8.cpp
===================================================================
--- trunk/src/modules/filters/latin1utf8.cpp	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/src/modules/filters/latin1utf8.cpp	2013-09-14 21:51:47 UTC (rev 2980)
@@ -26,8 +26,10 @@
 #include <latin1utf8.h>
 #include <swmodule.h>
 
+
 SWORD_NAMESPACE_START
 
+
 Latin1UTF8::Latin1UTF8() {
 }
 
@@ -36,7 +38,7 @@
 {
     const unsigned char *from;
 
-	 if ((unsigned long)key < 2)	// hack, we're en(1)/de(0)ciphering
+	if ((unsigned long)key < 2)	// hack, we're en(1)/de(0)ciphering
 		return (char)-1;
 
 	SWBuf orig = text;
@@ -186,4 +188,5 @@
 	return 0;
 }
 
+
 SWORD_NAMESPACE_END

Modified: trunk/src/modules/filters/osisenum.cpp
===================================================================
--- trunk/src/modules/filters/osisenum.cpp	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/src/modules/filters/osisenum.cpp	2013-09-14 21:51:47 UTC (rev 2980)
@@ -25,19 +25,26 @@
 #include <osisenum.h>
 #include <utilxml.h>
 
+
 SWORD_NAMESPACE_START
 
-const char oName[] = "Enumerations";
-const char oTip[] = "Toggles Enumerations On and Off if they exist";
+namespace {
 
-const SWBuf choices[3] = {"Off", "On", ""};
-const StringList oValues(&choices[0], &choices[2]);
+	static const char oName[] = "Enumerations";
+	static const char oTip[]  = "Toggles Enumerations On and Off if they exist";
 
-OSISEnum::OSISEnum() : SWOptionFilter(oName, oTip, &oValues) {
-	setOptionValue("Off");
+	static const StringList *oValues() {
+		static const SWBuf choices[3] = {"Off", "On", ""};
+		static const StringList oVals(&choices[0], &choices[2]);
+		return &oVals;
+	}
 }
 
 
+OSISEnum::OSISEnum() : SWOptionFilter(oName, oTip, oValues()) {
+}
+
+
 OSISEnum::~OSISEnum() {
 }
 

Modified: trunk/src/modules/filters/osisfootnotes.cpp
===================================================================
--- trunk/src/modules/filters/osisfootnotes.cpp	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/src/modules/filters/osisfootnotes.cpp	2013-09-14 21:51:47 UTC (rev 2980)
@@ -30,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 {
 
-const SWBuf choices[3] = {"Off", "On", ""};
-const StringList oValues(&choices[0], &choices[2]);
+	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;
+	}
+}
 
-OSISFootnotes::OSISFootnotes() : SWOptionFilter(oName, oTip, &oValues) {
-	setOptionValue("Off");
+
+OSISFootnotes::OSISFootnotes() : SWOptionFilter(oName, oTip, oValues()) {
 }
 
 

Modified: trunk/src/modules/filters/osisglosses.cpp
===================================================================
--- trunk/src/modules/filters/osisglosses.cpp	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/src/modules/filters/osisglosses.cpp	2013-09-14 21:51:47 UTC (rev 2980)
@@ -25,19 +25,26 @@
 #include <osisglosses.h>
 #include <utilxml.h>
 
+
 SWORD_NAMESPACE_START
 
-const char oName[] = "Glosses";
-const char oTip[] = "Toggles Glosses On and Off if they exist";
+namespace {
 
-const SWBuf choices[3] = {"Off", "On", ""};
-const StringList oValues(&choices[0], &choices[2]);
+	static const char oName[] = "Glosses";
+	static const char oTip[]  = "Toggles Glosses On and Off if they exist";
 
-OSISGlosses::OSISGlosses() : SWOptionFilter(oName, oTip, &oValues) {
-	setOptionValue("Off");
+	static const StringList *oValues() {
+		static const SWBuf choices[3] = {"Off", "On", ""};
+		static const StringList oVals(&choices[0], &choices[2]);
+		return &oVals;
+	}
 }
 
 
+OSISGlosses::OSISGlosses() : SWOptionFilter(oName, oTip, oValues()) {
+}
+
+
 OSISGlosses::~OSISGlosses() {
 }
 

Modified: trunk/src/modules/filters/osisheadings.cpp
===================================================================
--- trunk/src/modules/filters/osisheadings.cpp	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/src/modules/filters/osisheadings.cpp	2013-09-14 21:51:47 UTC (rev 2980)
@@ -28,16 +28,21 @@
 #include <utilxml.h>
 #include <utilstr.h>
 
+
 SWORD_NAMESPACE_START
 
-const char oName[] = "Headings";
-const char oTip[] = "Toggles Headings On and Off if they exist";
+namespace {
 
-const SWBuf choices[3] = {"Off", "On", ""};
-const StringList oValues(&choices[0], &choices[2]);
+	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;
+	}
 
-namespace {
+
 	class MyUserData : public BasicFilterUserData {
 	public:
 		SWBuf currentHeadingName;
@@ -59,7 +64,7 @@
 			headerNum = 0;
 		}
 	};
-};
+}
 
 
 BasicFilterUserData *OSISHeadings::createUserData(const SWModule *module, const SWKey *key) {
@@ -67,8 +72,7 @@
 }
 
 
-OSISHeadings::OSISHeadings() : SWOptionFilter(oName, oTip, &oValues) {
-	setOptionValue("Off");
+OSISHeadings::OSISHeadings() : SWOptionFilter(oName, oTip, oValues()) {
 	setPassThruUnknownToken(true);
 }
 

Modified: trunk/src/modules/filters/osislemma.cpp
===================================================================
--- trunk/src/modules/filters/osislemma.cpp	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/src/modules/filters/osislemma.cpp	2013-09-14 21:51:47 UTC (rev 2980)
@@ -25,19 +25,26 @@
 #include <osislemma.h>
 #include <utilxml.h>
 
+
 SWORD_NAMESPACE_START
 
-const char oName[] = "Lemmas";
-const char oTip[] = "Toggles Lemmas On and Off if they exist";
+namespace {
 
-const SWBuf choices[3] = {"Off", "On", ""};
-const StringList oValues(&choices[0], &choices[2]);
+	static const char oName[] = "Lemmas";
+	static const char oTip[]  = "Toggles Lemmas On and Off if they exist";
 
-OSISLemma::OSISLemma() : SWOptionFilter(oName, oTip, &oValues) {
-	setOptionValue("Off");
+	static const StringList *oValues() {
+		static const SWBuf choices[3] = {"Off", "On", ""};
+		static const StringList oVals(&choices[0], &choices[2]);
+		return &oVals;
+	}
 }
 
 
+OSISLemma::OSISLemma() : SWOptionFilter(oName, oTip, oValues()) {
+}
+
+
 OSISLemma::~OSISLemma() {
 }
 

Modified: trunk/src/modules/filters/osismorph.cpp
===================================================================
--- trunk/src/modules/filters/osismorph.cpp	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/src/modules/filters/osismorph.cpp	2013-09-14 21:51:47 UTC (rev 2980)
@@ -26,17 +26,23 @@
 
 SWORD_NAMESPACE_START
 
-const char oName[] = "Morphological Tags";
-const char oTip[] = "Toggles Morphological Tags On and Off if they exist";
+namespace {
 
-const SWBuf choices[3] = {"Off", "On", ""};
-const StringList oValues(&choices[0], &choices[2]);
+	static const char oName[] = "Morphological Tags";
+	static const char oTip[]  = "Toggles Morphological Tags On and Off if they exist";
 
-OSISMorph::OSISMorph() : SWOptionFilter(oName, oTip, &oValues) {
-	setOptionValue("Off");
+	static const StringList *oValues() {
+		static const SWBuf choices[3] = {"Off", "On", ""};
+		static const StringList oVals(&choices[0], &choices[2]);
+		return &oVals;
+	}
+
 }
 
+OSISMorph::OSISMorph() : SWOptionFilter(oName, oTip, oValues()) {
+}
 
+
 OSISMorph::~OSISMorph() {
 }
 

Modified: trunk/src/modules/filters/osismorphsegmentation.cpp
===================================================================
--- trunk/src/modules/filters/osismorphsegmentation.cpp	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/src/modules/filters/osismorphsegmentation.cpp	2013-09-14 21:51:47 UTC (rev 2980)
@@ -28,19 +28,26 @@
 #include <swmodule.h>
 #include <swbuf.h>
 
+
 SWORD_NAMESPACE_START
 
-const char oName[] = "Morpheme Segmentation";
-const char oTip[] = "Toggles Morpheme Segmentation On and Off, when present";
+namespace {
 
-const SWBuf choices[3] = {"Off", "On", ""};
-const StringList oValues(&choices[0], &choices[2]);
+	static const char oName[] = "Morpheme Segmentation";
+	static const char oTip[]  = "Toggles Morpheme Segmentation On and Off, when present";
 
-OSISMorphSegmentation::OSISMorphSegmentation() : SWOptionFilter(oName, oTip, &oValues) {
-	setOptionValue("Off");
+	static const StringList *oValues() {
+		static const SWBuf choices[3] = {"Off", "On", ""};
+		static const StringList oVals(&choices[0], &choices[2]);
+		return &oVals;
+	}
 }
 
 
+OSISMorphSegmentation::OSISMorphSegmentation() : SWOptionFilter(oName, oTip, oValues()) {
+}
+
+
 OSISMorphSegmentation::~OSISMorphSegmentation() {}
 
 

Modified: trunk/src/modules/filters/osisplain.cpp
===================================================================
--- trunk/src/modules/filters/osisplain.cpp	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/src/modules/filters/osisplain.cpp	2013-09-14 21:51:47 UTC (rev 2980)
@@ -28,18 +28,21 @@
 
 SWORD_NAMESPACE_START
 
+
 namespace {
-class MyUserData : public BasicFilterUserData {
-public:
-	SWBuf w;
-	XMLTag tag;
-	VerseKey *vk;
-	char testament;
-	SWBuf hiType;
-	MyUserData(const SWModule *module, const SWKey *key) : BasicFilterUserData(module, key) {}
-};
+
+	class MyUserData : public BasicFilterUserData {
+	public:
+		SWBuf w;
+		XMLTag tag;
+		VerseKey *vk;
+		char testament;
+		SWBuf hiType;
+		MyUserData(const SWModule *module, const SWKey *key) : BasicFilterUserData(module, key) {}
+	};
 }
 
+
 OSISPlain::OSISPlain() {
 	setTokenStart("<");
 	setTokenEnd(">");

Modified: trunk/src/modules/filters/osisredletterwords.cpp
===================================================================
--- trunk/src/modules/filters/osisredletterwords.cpp	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/src/modules/filters/osisredletterwords.cpp	2013-09-14 21:51:47 UTC (rev 2980)
@@ -28,17 +28,23 @@
 
 SWORD_NAMESPACE_START
 
-const char oName[] = "Words of Christ in Red";
-const char oTip[] = "Toggles Red Coloring for Words of Christ On and Off if they are marked";
+namespace {
 
-const SWBuf choices[3] = {"Off", "On", ""};
-const StringList oValues(&choices[0], &choices[2]);
+	static const char oName[] = "Words of Christ in Red";
+	static const char oTip[]  = "Toggles Red Coloring for Words of Christ On and Off if they are marked";
 
-OSISRedLetterWords::OSISRedLetterWords() : SWOptionFilter(oName, oTip, &oValues) {
-	setOptionValue("On");
+	static const StringList *oValues() {
+		static const SWBuf choices[3] = {"On", "Off", ""};
+		static const StringList oVals(&choices[0], &choices[2]);
+		return &oVals;
+	}
 }
 
 
+OSISRedLetterWords::OSISRedLetterWords() : SWOptionFilter(oName, oTip, oValues()) {
+}
+
+
 OSISRedLetterWords::~OSISRedLetterWords() {
 }
 

Modified: trunk/src/modules/filters/osisrtf.cpp
===================================================================
--- trunk/src/modules/filters/osisrtf.cpp	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/src/modules/filters/osisrtf.cpp	2013-09-14 21:51:47 UTC (rev 2980)
@@ -67,11 +67,13 @@
 			delete [] tagData;
 		}
 	}
-static inline void outText(const char *t, SWBuf &o, BasicFilterUserData *u) { if (!u->suspendTextPassThru) o += t; else u->lastSuspendSegment += t; }
-static inline void outText(char t, SWBuf &o, BasicFilterUserData *u) { if (!u->suspendTextPassThru) o += t; else u->lastSuspendSegment += t; }
-};
 
+	static inline void outText(const char *t, SWBuf &o, BasicFilterUserData *u) { if (!u->suspendTextPassThru) o += t; else u->lastSuspendSegment += t; }
+	static inline void outText(char t, SWBuf &o, BasicFilterUserData *u) { if (!u->suspendTextPassThru) o += t; else u->lastSuspendSegment += t; }
 
+}
+
+
 OSISRTF::OSISRTF() {
 	setTokenStart("<");
 	setTokenEnd(">");

Modified: trunk/src/modules/filters/osisscripref.cpp
===================================================================
--- trunk/src/modules/filters/osisscripref.cpp	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/src/modules/filters/osisscripref.cpp	2013-09-14 21:51:47 UTC (rev 2980)
@@ -26,19 +26,26 @@
 #include <swmodule.h>
 #include <utilxml.h>
 
+
 SWORD_NAMESPACE_START
 
-const char oName[] = "Cross-references";
-const char oTip[] = "Toggles Scripture Cross-references On and Off if they exist";
+namespace {
 
-const SWBuf choices[3] = {"Off", "On", ""};
-const StringList oValues(&choices[0], &choices[2]);
+	static const char oName[] = "Cross-references";
+	static const char oTip[]  = "Toggles Scripture Cross-references On and Off if they exist";
 
-OSISScripref::OSISScripref() : SWOptionFilter(oName, oTip, &oValues) {
-	setOptionValue("On");
+	static const StringList *oValues() {
+		static const SWBuf choices[3] = {"On", "Off", ""};
+		static const StringList oVals(&choices[0], &choices[2]);
+		return &oVals;
+	}
 }
 
 
+OSISScripref::OSISScripref() : SWOptionFilter(oName, oTip, oValues()) {
+}
+
+
 OSISScripref::~OSISScripref() {
 }
 

Modified: trunk/src/modules/filters/osisstrongs.cpp
===================================================================
--- trunk/src/modules/filters/osisstrongs.cpp	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/src/modules/filters/osisstrongs.cpp	2013-09-14 21:51:47 UTC (rev 2980)
@@ -29,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 {
 
-const SWBuf choices[3] = {"Off", "On", ""};
-const StringList oValues(&choices[0], &choices[2]);
+	static const char oName[] = "Strong's Numbers";
+	static const char oTip[]  = "Toggles Strong's Numbers 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;
+	}
+}
 
-OSISStrongs::OSISStrongs() : SWOptionFilter(oName, oTip, &oValues) {
-	setOptionValue("Off");
+
+OSISStrongs::OSISStrongs() : SWOptionFilter(oName, oTip, oValues()) {
 }
 
 

Modified: trunk/src/modules/filters/osisvariants.cpp
===================================================================
--- trunk/src/modules/filters/osisvariants.cpp	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/src/modules/filters/osisvariants.cpp	2013-09-14 21:51:47 UTC (rev 2980)
@@ -26,50 +26,39 @@
 #include <utilstr.h>
 #include <utilxml.h>
 
+
 SWORD_NAMESPACE_START
 
-const char OSISVariants::primary[] = "Primary Reading";
-const char OSISVariants::secondary[] = "Secondary Reading";
-const char OSISVariants::all[] = "All Readings";
+namespace {
 
-const char OSISVariants::optName[] = "Textual Variants";
-const char OSISVariants::optTip[] = "Switch between Textual Variants modes";
+	static const char oName[] = "Textual Variants";
+	static const char oTip[]  = "Switch between Textual Variants modes";
+	static const char *choices[4] = { "Primary Reading", "Secondary Reading", "All Readings", "" };
 
-
-OSISVariants::OSISVariants() {
-	option = 0;
-	options.push_back(primary);
-	options.push_back(secondary);
-	options.push_back(all);
+	static const StringList *oValues() {
+		static const StringList oVals(&choices[0], &choices[3]);
+		return &oVals;
+	}
 }
 
 
-OSISVariants::~OSISVariants() {
+OSISVariants::OSISVariants() : SWOptionFilter(oName, oTip, oValues()) {
 }
 
-void OSISVariants::setOptionValue(const char *ival)
-{
-	if (!stricmp(ival, primary)) option = 0;
-        else if (!stricmp(ival, secondary)) option = 1;
-        else option = 2;
-}
 
-const char *OSISVariants::getOptionValue()
-{
-    if (option == 0) {
-	        return primary;
-	}
-	else if (option == 1) {
-	        return secondary;
-	}
-	else {
-	        return all;
-	}
+OSISVariants::~OSISVariants() {
 }
 
+
 char OSISVariants::processText(SWBuf &text, const SWKey *key, const SWModule *module)
 {
-        if (option == 0 || option == 1) { //we want primary or variant only
+
+	int option = 0;
+	if      (optionValue == choices[0]) option = 0;
+	else if (optionValue == choices[1]) option = 1;
+	else                                option = 2;
+
+	if (option == 0 || option == 1) { //we want primary or variant only
 		bool intoken = false;
 		bool hide = false;
 		bool invar = false;
@@ -129,8 +118,4 @@
 }
 
 
-
-
-
-
 SWORD_NAMESPACE_END

Modified: trunk/src/modules/filters/osiswordjs.cpp
===================================================================
--- trunk/src/modules/filters/osiswordjs.cpp	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/src/modules/filters/osiswordjs.cpp	2013-09-14 21:51:47 UTC (rev 2980)
@@ -30,18 +30,24 @@
 #include <versekey.h>
 #include <stdio.h>
 
+
 SWORD_NAMESPACE_START
 
-const char oName[] = "Word Javascript";
-const char oTip[] = "Toggles Word Javascript data";
+namespace {
 
-const SWBuf choices[3] = {"Off", "On", ""};
-const StringList oValues(&choices[0], &choices[2]);
+	static const char oName[] = "Word Javascript";
+	static const char oTip[]  = "Toggles Word Javascript data";
 
+	static const StringList *oValues() {
+		static const SWBuf choices[3] = {"Off", "On", ""};
+		static const StringList oVals(&choices[0], &choices[2]);
+		return &oVals;
+	}
+}
 
-OSISWordJS::OSISWordJS() : SWOptionFilter(oName, oTip, &oValues) {
-	setOptionValue("Off");
 
+OSISWordJS::OSISWordJS() : SWOptionFilter(oName, oTip, oValues()) {
+
      defaultGreekLex   = 0;
      defaultHebLex     = 0;
      defaultGreekParse = 0;

Modified: trunk/src/modules/filters/osisxlit.cpp
===================================================================
--- trunk/src/modules/filters/osisxlit.cpp	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/src/modules/filters/osisxlit.cpp	2013-09-14 21:51:47 UTC (rev 2980)
@@ -25,19 +25,26 @@
 #include <osisxlit.h>
 #include <utilxml.h>
 
+
 SWORD_NAMESPACE_START
 
-const char oName[] = "Transliterated Forms";
-const char oTip[] = "Toggles transliterated forms On and Off if they exist";
+namespace {
 
-const SWBuf choices[3] = {"Off", "On", ""};
-const StringList oValues(&choices[0], &choices[2]);
+	static const char oName[] = "Transliterated Forms";
+	static const char oTip[]  = "Toggles transliterated forms On and Off if they exist";
 
-OSISXlit::OSISXlit() : SWOptionFilter(oName, oTip, &oValues) {
-	setOptionValue("Off");
+	static const StringList *oValues() {
+		static const SWBuf choices[3] = {"Off", "On", ""};
+		static const StringList oVals(&choices[0], &choices[2]);
+		return &oVals;
+	}
 }
 
 
+OSISXlit::OSISXlit() : SWOptionFilter(oName, oTip, oValues()) {
+}
+
+
 OSISXlit::~OSISXlit() {
 }
 

Modified: trunk/src/modules/filters/papyriplain.cpp
===================================================================
--- trunk/src/modules/filters/papyriplain.cpp	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/src/modules/filters/papyriplain.cpp	2013-09-14 21:51:47 UTC (rev 2980)
@@ -25,6 +25,7 @@
 
 SWORD_NAMESPACE_START
 
+
 PapyriPlain::PapyriPlain() {
 }
 

Modified: trunk/src/modules/filters/scsuutf8.cpp
===================================================================
--- trunk/src/modules/filters/scsuutf8.cpp	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/src/modules/filters/scsuutf8.cpp	2013-09-14 21:51:47 UTC (rev 2980)
@@ -38,8 +38,10 @@
 
 #include <scsuutf8.h>
 
+
 SWORD_NAMESPACE_START
 
+
 SCSUUTF8::SCSUUTF8() {
 }
 
@@ -77,6 +79,7 @@
   return text;
 }
 
+
 char SCSUUTF8::processText(SWBuf &text, const SWKey *key, const SWModule *module) {
 /*
   unsigned char *to, *from;
@@ -239,4 +242,5 @@
   return 0;
 }
 
+
 SWORD_NAMESPACE_END

Modified: trunk/src/modules/filters/swbasicfilter.cpp
===================================================================
--- trunk/src/modules/filters/swbasicfilter.cpp	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/src/modules/filters/swbasicfilter.cpp	2013-09-14 21:51:47 UTC (rev 2980)
@@ -34,9 +34,11 @@
 
 SWORD_NAMESPACE_START
 
+
 typedef std::map<SWBuf, SWBuf> DualStringMap;
 typedef std::set<SWBuf> StringSet;
 
+
 // I hate bridge patterns but this isolates std::map from a ton of filters
 class SWBasicFilter::Private {
 public:
@@ -45,11 +47,13 @@
 	StringSet escPassSet;
 };
 
+
 const char SWBasicFilter::INITIALIZE = 1;
 const char SWBasicFilter::PRECHAR    = 2;
 const char SWBasicFilter::POSTCHAR   = 4;
 const char SWBasicFilter::FINALIZE   = 8;
 
+
 SWBasicFilter::SWBasicFilter() {
 
 	p = new Private;
@@ -99,6 +103,7 @@
 	passThruUnknownEsc = val;
 }
 
+
 void SWBasicFilter::setPassThruNumericEscapeString(bool val) {
 	passThruUnknownEsc = val;
 }
@@ -133,6 +138,7 @@
 	}
 }
 
+
 void SWBasicFilter::addAllowedEscapeString(const char *findString) {
 	char *buf = 0;
 
@@ -145,12 +151,14 @@
 	else p->escPassSet.insert(StringSet::value_type(findString));
 }
 
+
 void SWBasicFilter::removeAllowedEscapeString(const char *findString) {
 	if (p->escPassSet.find(findString) != p->escPassSet.end()) {
 		p->escPassSet.erase( p->escPassSet.find(findString) );
 	}
 }
 
+
 void SWBasicFilter::addEscapeStringSubstitute(const char *findString, const char *replaceString) {
 	char *buf = 0;
 
@@ -163,12 +171,14 @@
 	else p->escSubMap.insert(DualStringMap::value_type(findString, replaceString));
 }
 
+
 void SWBasicFilter::removeEscapeStringSubstitute(const char *findString) {
 	if (p->escSubMap.find(findString) != p->escSubMap.end()) {
 		p->escSubMap.erase( p->escSubMap.find(findString) );
 	}
 }
 
+
 bool SWBasicFilter::substituteToken(SWBuf &buf, const char *token) {
 	DualStringMap::iterator it;
 
@@ -188,12 +198,14 @@
 	return false;
 }
 
+
 void SWBasicFilter::appendEscapeString(SWBuf &buf, const char *escString) {
 	buf += escStart;
 	buf += escString;
 	buf += escEnd;
 }
 
+
 bool SWBasicFilter::passAllowedEscapeString(SWBuf &buf, const char *escString) {
 	StringSet::iterator it;
 
@@ -214,6 +226,7 @@
 	return false;
 }
 
+
 bool SWBasicFilter::handleNumericEscapeString(SWBuf &buf, const char *escString) {
 	if (passThruNumericEsc) {
 		appendEscapeString(buf, escString);
@@ -222,6 +235,7 @@
 	return false;
 }
 
+
 bool SWBasicFilter::substituteEscapeString(SWBuf &buf, const char *escString) {
 	DualStringMap::iterator it;
 
@@ -404,4 +418,5 @@
 	return 0;
 }
 
+
 SWORD_NAMESPACE_END

Modified: trunk/src/modules/filters/swoptfilter.cpp
===================================================================
--- trunk/src/modules/filters/swoptfilter.cpp	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/src/modules/filters/swoptfilter.cpp	2013-09-14 21:51:47 UTC (rev 2980)
@@ -35,10 +35,13 @@
 	optValues = &empty;
 }
 
+
 SWOptionFilter::SWOptionFilter(const char *oName, const char *oTip, const StringList *oValues) {
 	optName   = oName;
 	optTip    = oTip;
 	optValues = oValues;
+	if (optValues->begin() != optValues->end()) setOptionValue(*(optValues->begin()));
+	isBooleanVal = optValues->size() == 2 && (optionValue == "On" || optionValue == "Off");
 }
 
 

Modified: trunk/src/modules/filters/thmlfootnotes.cpp
===================================================================
--- trunk/src/modules/filters/thmlfootnotes.cpp	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/src/modules/filters/thmlfootnotes.cpp	2013-09-14 21:51:47 UTC (rev 2980)
@@ -31,19 +31,26 @@
 #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 {
 
-const SWBuf choices[3] = {"Off", "On", ""};
-const StringList oValues(&choices[0], &choices[2]);
+	static const char oName[] = "Footnotes";
+	static const char oTip[]  = "Toggles Footnotes On and Off if they exist";
 
-ThMLFootnotes::ThMLFootnotes() : SWOptionFilter(oName, oTip, &oValues) {
-	setOptionValue("Off");
+	static const StringList *oValues() {
+		static const SWBuf choices[3] = {"Off", "On", ""};
+		static const StringList oVals(&choices[0], &choices[2]);
+		return &oVals;
+	}
 }
 
 
+ThMLFootnotes::ThMLFootnotes() : SWOptionFilter(oName, oTip, oValues()) {
+}
+
+
 ThMLFootnotes::~ThMLFootnotes() {
 }
 

Modified: trunk/src/modules/filters/thmlheadings.cpp
===================================================================
--- trunk/src/modules/filters/thmlheadings.cpp	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/src/modules/filters/thmlheadings.cpp	2013-09-14 21:51:47 UTC (rev 2980)
@@ -29,19 +29,26 @@
 #include <swmodule.h>
 #include <stdio.h>
 
+
 SWORD_NAMESPACE_START
 
-const char oName[] = "Headings";
-const char oTip[] = "Toggles Headings On and Off if they exist";
+namespace {
 
-const SWBuf choices[3] = {"Off", "On", ""};
-const StringList oValues(&choices[0], &choices[2]);
+	static const char oName[] = "Headings";
+	static const char oTip[]  = "Toggles Headings On and Off if they exist";
 
-ThMLHeadings::ThMLHeadings() : SWOptionFilter(oName, oTip, &oValues) {
-	setOptionValue("Off");
+	static const StringList *oValues() {
+		static const SWBuf choices[3] = {"Off", "On", ""};
+		static const StringList oVals(&choices[0], &choices[2]);
+		return &oVals;
+	}
 }
 
 
+ThMLHeadings::ThMLHeadings() : SWOptionFilter(oName, oTip, oValues()) {
+}
+
+
 ThMLHeadings::~ThMLHeadings() {
 }
 

Modified: trunk/src/modules/filters/thmlhtml.cpp
===================================================================
--- trunk/src/modules/filters/thmlhtml.cpp	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/src/modules/filters/thmlhtml.cpp	2013-09-14 21:51:47 UTC (rev 2980)
@@ -25,8 +25,10 @@
 #include <swmodule.h>
 #include <utilxml.h>
 
+
 SWORD_NAMESPACE_START
 
+
 ThMLHTML::ThMLHTML() {
 	setTokenStart("<");
 	setTokenEnd(">");

Modified: trunk/src/modules/filters/thmlhtmlhref.cpp
===================================================================
--- trunk/src/modules/filters/thmlhtmlhref.cpp	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/src/modules/filters/thmlhtmlhref.cpp	2013-09-14 21:51:47 UTC (rev 2980)
@@ -28,6 +28,7 @@
 #include <versekey.h>
 #include <url.h>
 
+
 SWORD_NAMESPACE_START
  
 

Modified: trunk/src/modules/filters/thmllemma.cpp
===================================================================
--- trunk/src/modules/filters/thmllemma.cpp	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/src/modules/filters/thmllemma.cpp	2013-09-14 21:51:47 UTC (rev 2980)
@@ -24,19 +24,26 @@
 #include <stdlib.h>
 #include <thmllemma.h>
 
+
 SWORD_NAMESPACE_START
 
-const char oName[] = "Lemmas";
-const char oTip[] = "Toggles Lemmas On and Off if they exist";
+namespace {
 
-const SWBuf choices[3] = {"Off", "On", ""};
-const StringList oValues(&choices[0], &choices[2]);
+	static const char oName[] = "Lemmas";
+	static const char oTip[]  = "Toggles Lemmas On and Off if they exist";
 
-ThMLLemma::ThMLLemma() : SWOptionFilter(oName, oTip, &oValues) {
-	setOptionValue("Off");
+	static const StringList *oValues() {
+		static const SWBuf choices[3] = {"Off", "On", ""};
+		static const StringList oVals(&choices[0], &choices[2]);
+		return &oVals;
+	}
 }
 
 
+ThMLLemma::ThMLLemma() : SWOptionFilter(oName, oTip, oValues()) {
+}
+
+
 ThMLLemma::~ThMLLemma() {
 }
 

Modified: trunk/src/modules/filters/thmlmorph.cpp
===================================================================
--- trunk/src/modules/filters/thmlmorph.cpp	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/src/modules/filters/thmlmorph.cpp	2013-09-14 21:51:47 UTC (rev 2980)
@@ -26,17 +26,23 @@
 
 SWORD_NAMESPACE_START
 
-const char oName[] = "Morphological Tags";
-const char oTip[] = "Toggles Morphological Tags On and Off if they exist";
+namespace {
 
-const SWBuf choices[3] = {"Off", "On", ""};
-const StringList oValues(&choices[0], &choices[2]);
+	static const char oName[] = "Morphological Tags";
+	static const char oTip[]  = "Toggles Morphological Tags On and Off if they exist";
 
-ThMLMorph::ThMLMorph() : SWOptionFilter(oName, oTip, &oValues) {
-	setOptionValue("Off");
+	static const StringList *oValues() {
+		static const SWBuf choices[3] = {"Off", "On", ""};
+		static const StringList oVals(&choices[0], &choices[2]);
+		return &oVals;
+	}
 }
 
 
+ThMLMorph::ThMLMorph() : SWOptionFilter(oName, oTip, oValues()) {
+}
+
+
 ThMLMorph::~ThMLMorph() {
 }
 

Modified: trunk/src/modules/filters/thmlscripref.cpp
===================================================================
--- trunk/src/modules/filters/thmlscripref.cpp	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/src/modules/filters/thmlscripref.cpp	2013-09-14 21:51:47 UTC (rev 2980)
@@ -28,19 +28,26 @@
 #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 {
 
-const SWBuf choices[3] = {"Off", "On", ""};
-const StringList oValues(&choices[0], &choices[2]);
+	static const char oName[] = "Cross-references";
+	static const char oTip[]  = "Toggles Scripture Cross-references On and Off if they exist";
 
-ThMLScripref::ThMLScripref() : SWOptionFilter(oName, oTip, &oValues) {
-	setOptionValue("On");
+	static const StringList *oValues() {
+		static const SWBuf choices[3] = {"On", "Off", ""};
+		static const StringList oVals(&choices[0], &choices[2]);
+		return &oVals;
+	}
 }
 
 
+ThMLScripref::ThMLScripref() : SWOptionFilter(oName, oTip, oValues()) {
+}
+
+
 ThMLScripref::~ThMLScripref() {
 }
 

Modified: trunk/src/modules/filters/thmlstrongs.cpp
===================================================================
--- trunk/src/modules/filters/thmlstrongs.cpp	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/src/modules/filters/thmlstrongs.cpp	2013-09-14 21:51:47 UTC (rev 2980)
@@ -28,19 +28,26 @@
 #include <utilstr.h>
 #include <ctype.h>
 
+
 SWORD_NAMESPACE_START
 
-const char oName[] = "Strong's Numbers";
-const char oTip[] = "Toggles Strong's Numbers On and Off if they exist";
+namespace {
 
-const SWBuf choices[3] = {"Off", "On", ""};
-const StringList oValues(&choices[0], &choices[2]);
+	static const char oName[] = "Strong's Numbers";
+	static const char oTip[]  = "Toggles Strong's Numbers On and Off if they exist";
 
-ThMLStrongs::ThMLStrongs() : SWOptionFilter(oName, oTip, &oValues) {
-	setOptionValue("Off");
+	static const StringList *oValues() {
+		static const SWBuf choices[3] = {"Off", "On", ""};
+		static const StringList oVals(&choices[0], &choices[2]);
+		return &oVals;
+	}
 }
 
 
+ThMLStrongs::ThMLStrongs() : SWOptionFilter(oName, oTip, oValues()) {
+}
+
+
 ThMLStrongs::~ThMLStrongs() {
 }
 

Modified: trunk/src/modules/filters/thmlvariants.cpp
===================================================================
--- trunk/src/modules/filters/thmlvariants.cpp	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/src/modules/filters/thmlvariants.cpp	2013-09-14 21:51:47 UTC (rev 2980)
@@ -25,50 +25,39 @@
 #include <thmlvariants.h>
 #include <utilstr.h>
 
+
 SWORD_NAMESPACE_START
 
-const char ThMLVariants::primary[] = "Primary Reading";
-const char ThMLVariants::secondary[] = "Secondary Reading";
-const char ThMLVariants::all[] = "All Readings";
+namespace {
 
-const char ThMLVariants::optName[] = "Textual Variants";
-const char ThMLVariants::optTip[] = "Switch between Textual Variants modes";
+	static const char oName[] = "Textual Variants";
+	static const char oTip[]  = "Switch between Textual Variants modes";
+	static const char *choices[4] = { "Primary Reading", "Secondary Reading", "All Readings", "" };
 
-
-ThMLVariants::ThMLVariants() {
-	option = false;
-	options.push_back(primary);
-	options.push_back(secondary);
-	options.push_back(all);
+	static const StringList *oValues() {
+		static const StringList oVals(&choices[0], &choices[3]);
+		return &oVals;
+	}
 }
 
 
-ThMLVariants::~ThMLVariants() {
+ThMLVariants::ThMLVariants() : SWOptionFilter(oName, oTip, oValues()) {
 }
 
-void ThMLVariants::setOptionValue(const char *ival)
-{
-	if (!stricmp(ival, primary)) option = 0;
-        else if (!stricmp(ival, secondary)) option = 1;
-        else option = 2;
-}
 
-const char *ThMLVariants::getOptionValue()
-{
-        if (option == 0) {
-	        return primary;
-	}
-	else if (option == 1) {
-	        return secondary;
-	}
-	else {
-	        return all;
-	}
+ThMLVariants::~ThMLVariants() {
 }
 
+
 char ThMLVariants::processText(SWBuf &text, const SWKey *key, const SWModule *module)
 {
-        if ( option == 0 || option == 1) { //we want primary or variant only
+
+	int option = 0;
+	if      (optionValue == choices[0]) option = 0;
+	else if (optionValue == choices[1]) option = 1;
+	else                                option = 2;
+
+	if (option == 0 || option == 1) { //we want primary or variant only
 		bool intoken = false;
 		bool hide = false;
 		bool invar = false;
@@ -128,7 +117,4 @@
 
 
 
-
-
-
 SWORD_NAMESPACE_END

Modified: trunk/src/modules/filters/thmlwebif.cpp
===================================================================
--- trunk/src/modules/filters/thmlwebif.cpp	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/src/modules/filters/thmlwebif.cpp	2013-09-14 21:51:47 UTC (rev 2980)
@@ -29,9 +29,11 @@
 
 SWORD_NAMESPACE_START
 
+
 ThMLWEBIF::ThMLWEBIF() : baseURL(""), passageStudyURL(baseURL + "passagestudy.jsp") {
 }
 
+
 bool ThMLWEBIF::handleToken(SWBuf &buf, const char *token, BasicFilterUserData *userData) {
 
 	if (!substituteToken(buf, token)) { // manually process if it wasn't a simple substitution

Modified: trunk/src/modules/filters/thmlwordjs.cpp
===================================================================
--- trunk/src/modules/filters/thmlwordjs.cpp	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/src/modules/filters/thmlwordjs.cpp	2013-09-14 21:51:47 UTC (rev 2980)
@@ -29,18 +29,24 @@
 #include <utilstr.h>
 #include <versekey.h>
 
+
 SWORD_NAMESPACE_START
 
-const char oName[] = "Word Javascript";
-const char oTip[] = "Toggles Word Javascript data";
+namespace {
 
-const SWBuf choices[3] = {"Off", "On", ""};
-const StringList oValues(&choices[0], &choices[2]);
+	static const char oName[] = "Word Javascript";
+	static const char oTip[]  = "Toggles Word Javascript data";
 
+	static const StringList *oValues() {
+		static const SWBuf choices[3] = {"Off", "On", ""};
+		static const StringList oVals(&choices[0], &choices[2]);
+		return &oVals;
+	}
+}
 
-ThMLWordJS::ThMLWordJS() : SWOptionFilter(oName, oTip, &oValues) {
-	setOptionValue("Off");
 
+ThMLWordJS::ThMLWordJS() : SWOptionFilter(oName, oTip, oValues()) {
+
      defaultGreekLex   = 0;
      defaultHebLex     = 0;
      defaultGreekParse = 0;

Modified: trunk/src/modules/filters/thmlxhtml.cpp
===================================================================
--- trunk/src/modules/filters/thmlxhtml.cpp	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/src/modules/filters/thmlxhtml.cpp	2013-09-14 21:51:47 UTC (rev 2980)
@@ -30,11 +30,13 @@
 
 SWORD_NAMESPACE_START
  
+
 const char *ThMLXHTML::getHeader() const {
 	return "\
 	";
 }
 
+
 ThMLXHTML::MyUserData::MyUserData(const SWModule *module, const SWKey *key) : BasicFilterUserData(module, key) {
 	if (module) {
 		version = module->getName();

Modified: trunk/src/modules/filters/utf16utf8.cpp
===================================================================
--- trunk/src/modules/filters/utf16utf8.cpp	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/src/modules/filters/utf16utf8.cpp	2013-09-14 21:51:47 UTC (rev 2980)
@@ -27,8 +27,10 @@
 #include <utf16utf8.h>
 #include <swbuf.h>
 
+
 SWORD_NAMESPACE_START
 
+
 UTF16UTF8::UTF16UTF8() {
 }
 
@@ -102,6 +104,4 @@
 }
 
 
-
-
 SWORD_NAMESPACE_END

Modified: trunk/src/modules/filters/utf8arabicpoints.cpp
===================================================================
--- trunk/src/modules/filters/utf8arabicpoints.cpp	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/src/modules/filters/utf8arabicpoints.cpp	2013-09-14 21:51:47 UTC (rev 2980)
@@ -26,96 +26,103 @@
 #include <stdio.h>
 #include <utf8arabicpoints.h>
 
+
 SWORD_NAMESPACE_START
 
-const char oName[] = "Arabic Vowel Points";
-const char oTip[] = "Toggles Arabic Vowel Points";
+namespace {
 
-const SWBuf choices[3] = {"On", "Off", ""};
-const StringList oValues(&choices[0], &choices[2]);
+	static const char oName[] = "Arabic Vowel Points";
+	static const char oTip[]  = "Toggles Arabic Vowel Points";
 
-UTF8ArabicPoints::UTF8ArabicPoints() : SWOptionFilter(oName, oTip, &oValues) {
-	setOptionValue("On");
-}
+	static const StringList *oValues() {
+		static const SWBuf choices[3] = {"On", "Off", ""};
+		static const StringList oVals(&choices[0], &choices[2]);
+		return &oVals;
+	}
 
-UTF8ArabicPoints::~UTF8ArabicPoints(){};
 
-namespace {
-char *nextMark(const char* from, int* mark_size)
-{
-	// Arabic vowel points currently targeted for elimination:
-	// Table entries excerpted from
-	// http://www.utf8-chartable.de/unicode-utf8-table.pl.
-	// Code   UTF-8     Description
-	// point
-	// -----  --------- -----------
-	// U+064B d9 8b     ARABIC FATHATAN
-	// U+064C d9 8c     ARABIC DAMMATAN
-	// U+064D d9 8d     ARABIC KASRATAN
-	// U+064E d9 8e     ARABIC FATHA
-	// U+064F d9 8f     ARABIC DAMMA
-	// U+0650 d9 90     ARABIC KASRA
-	// U+0651 d9 91     ARABIC SHADDA
-	// U+0652 d9 92     ARABIC SUKUN
-	// U+0653 d9 93     ARABIC MADDAH ABOVE
-	// U+0654 d9 94     ARABIC HAMZA ABOVE
-	// U+0655 d9 95     ARABIC HAMZA BELOW
-	//
-	// U+FC5E ef b1 9e  ARABIC LIGATURE SHADDA WITH DAMMATAN ISOLATED FORM
-	// U+FC5F ef b1 9f  ARABIC LIGATURE SHADDA WITH KASRATAN ISOLATED FORM
-	// U+FC60 ef b1 a0  ARABIC LIGATURE SHADDA WITH FATHA ISOLATED FORM
-	// U+FC61 ef b1 a1  ARABIC LIGATURE SHADDA WITH DAMMA ISOLATED FORM
-	// U+FC62 ef b1 a2  ARABIC LIGATURE SHADDA WITH KASRA ISOLATED FORM
-	// U+FC63 ef b1 a3  ARABIC LIGATURE SHADDA WITH SUPERSCRIPT ALEF ISOLATED FORM
-	//
-	// U+FE70 ef b9 b0  ARABIC FATHATAN ISOLATED FORM
-	// U+FE71 ef b9 b1  ARABIC TATWEEL WITH FATHATAN ABOVE
-	// U+FE72 ef b9 b2  ARABIC DAMMATAN ISOLATED FORM
-	// U+FE73 ef b9 b3  ARABIC TAIL FRAGMENT
-	// U+FE74 ef b9 b4  ARABIC KASRATAN ISOLATED FORM
-	// U+FE75 ef b9 b5	 ???
-	// U+FE76 ef b9 b6  ARABIC FATHA ISOLATED FORM
-	// U+FE77 ef b9 b7  ARABIC FATHA MEDIAL FORM
-	// U+FE78 ef b9 b8  ARABIC DAMMA ISOLATED FORM
-	// U+FE79 ef b9 b9  ARABIC DAMMA MEDIAL FORM
-	// U+FE7A ef b9 ba  ARABIC KASRA ISOLATED FORM
-	// U+FE7B ef b9 bb  ARABIC KASRA MEDIAL FORM
-	// U+FE7C ef b9 bc  ARABIC SHADDA ISOLATED FORM
-	// U+FE7D ef b9 bd  ARABIC SHADDA MEDIAL FORM
-	// U+FE7E ef b9 be  ARABIC SUKUN ISOLATED FORM
-	// U+FE7F ef b9 bf  ARABIC SUKUN MEDIAL FORM
+	static char *nextMark(const char* from, int* mark_size) {
+		// Arabic vowel points currently targeted for elimination:
+		// Table entries excerpted from
+		// http://www.utf8-chartable.de/unicode-utf8-table.pl.
+		// Code   UTF-8     Description
+		// point
+		// -----  --------- -----------
+		// U+064B d9 8b     ARABIC FATHATAN
+		// U+064C d9 8c     ARABIC DAMMATAN
+		// U+064D d9 8d     ARABIC KASRATAN
+		// U+064E d9 8e     ARABIC FATHA
+		// U+064F d9 8f     ARABIC DAMMA
+		// U+0650 d9 90     ARABIC KASRA
+		// U+0651 d9 91     ARABIC SHADDA
+		// U+0652 d9 92     ARABIC SUKUN
+		// U+0653 d9 93     ARABIC MADDAH ABOVE
+		// U+0654 d9 94     ARABIC HAMZA ABOVE
+		// U+0655 d9 95     ARABIC HAMZA BELOW
+		//
+		// U+FC5E ef b1 9e  ARABIC LIGATURE SHADDA WITH DAMMATAN ISOLATED FORM
+		// U+FC5F ef b1 9f  ARABIC LIGATURE SHADDA WITH KASRATAN ISOLATED FORM
+		// U+FC60 ef b1 a0  ARABIC LIGATURE SHADDA WITH FATHA ISOLATED FORM
+		// U+FC61 ef b1 a1  ARABIC LIGATURE SHADDA WITH DAMMA ISOLATED FORM
+		// U+FC62 ef b1 a2  ARABIC LIGATURE SHADDA WITH KASRA ISOLATED FORM
+		// U+FC63 ef b1 a3  ARABIC LIGATURE SHADDA WITH SUPERSCRIPT ALEF ISOLATED FORM
+		//
+		// U+FE70 ef b9 b0  ARABIC FATHATAN ISOLATED FORM
+		// U+FE71 ef b9 b1  ARABIC TATWEEL WITH FATHATAN ABOVE
+		// U+FE72 ef b9 b2  ARABIC DAMMATAN ISOLATED FORM
+		// U+FE73 ef b9 b3  ARABIC TAIL FRAGMENT
+		// U+FE74 ef b9 b4  ARABIC KASRATAN ISOLATED FORM
+		// U+FE75 ef b9 b5	 ???
+		// U+FE76 ef b9 b6  ARABIC FATHA ISOLATED FORM
+		// U+FE77 ef b9 b7  ARABIC FATHA MEDIAL FORM
+		// U+FE78 ef b9 b8  ARABIC DAMMA ISOLATED FORM
+		// U+FE79 ef b9 b9  ARABIC DAMMA MEDIAL FORM
+		// U+FE7A ef b9 ba  ARABIC KASRA ISOLATED FORM
+		// U+FE7B ef b9 bb  ARABIC KASRA MEDIAL FORM
+		// U+FE7C ef b9 bc  ARABIC SHADDA ISOLATED FORM
+		// U+FE7D ef b9 bd  ARABIC SHADDA MEDIAL FORM
+		// U+FE7E ef b9 be  ARABIC SUKUN ISOLATED FORM
+		// U+FE7F ef b9 bf  ARABIC SUKUN MEDIAL FORM
 
-	unsigned char* byte = (unsigned char*) from;
-	for (; *byte; ++byte) {
-		if (byte[0] == 0xD9) {
-			if (byte[1] >= 0x8B && byte[1] <= 0x95) {
-			  *mark_size = 2;
-			  break;
+		unsigned char* byte = (unsigned char*) from;
+		for (; *byte; ++byte) {
+			if (byte[0] == 0xD9) {
+				if (byte[1] >= 0x8B && byte[1] <= 0x95) {
+				  *mark_size = 2;
+				  break;
+				}
+			  continue;
 			}
-            continue;
+			if (byte[0] == 0xEF) {
+				if (byte[1] == 0xB1) {
+				 if (byte[2] >= 0x9E && byte[2] <= 0xA3) {
+					*mark_size = 3;
+					break;
+				 }
+				 continue;
+			  }
+				if (byte[1] == 0xB9) {
+				 if (byte[2] >= 0xB0 && byte[2] <= 0xBF) {
+					*mark_size = 3;
+					break;
+				 }
+				 continue;
+			  }
+			}
 		}
-		if (byte[0] == 0xEF) {
-			if (byte[1] == 0xB1) {
-                if (byte[2] >= 0x9E && byte[2] <= 0xA3) {
-                    *mark_size = 3;
-                    break;
-                }
-                continue;
-            }
-			if (byte[1] == 0xB9) {
-                if (byte[2] >= 0xB0 && byte[2] <= 0xBF) {
-                    *mark_size = 3;
-                    break;
-                }
-                continue;
-            }
-		}
+		return (char*)byte;
 	}
-	return (char*)byte;
 }
+
+
+UTF8ArabicPoints::UTF8ArabicPoints() : SWOptionFilter(oName, oTip, oValues()) {
 }
 
 
+UTF8ArabicPoints::~UTF8ArabicPoints(){};
+
+
+
 char UTF8ArabicPoints::processText(SWBuf &text, const SWKey *, const SWModule *) {
     // A non-zero/true option setting means that setOptionValue("On")
     // was called which apparently means that Arabic Vowel Marks are ENABLED,

Modified: trunk/src/modules/filters/utf8bidireorder.cpp
===================================================================
--- trunk/src/modules/filters/utf8bidireorder.cpp	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/src/modules/filters/utf8bidireorder.cpp	2013-09-14 21:51:47 UTC (rev 2980)
@@ -31,18 +31,22 @@
 #include <utf8bidireorder.h>
 #include <swbuf.h>
 
+
 SWORD_NAMESPACE_START
 
+
 UTF8BiDiReorder::UTF8BiDiReorder() : err(U_ZERO_ERROR) {
 
         conv = ucnv_open("UTF-8", &err);
 
 }
 
+
 UTF8BiDiReorder::~UTF8BiDiReorder() {
         ucnv_close(conv);
 }
 
+
 char UTF8BiDiReorder::processText(SWBuf &text, const SWKey *key, const SWModule *module)
 {
         UChar *ustr, *ustr2;
@@ -74,5 +78,6 @@
 	return 0;
 }
 
+
 SWORD_NAMESPACE_END
 #endif

Modified: trunk/src/modules/filters/utf8cantillation.cpp
===================================================================
--- trunk/src/modules/filters/utf8cantillation.cpp	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/src/modules/filters/utf8cantillation.cpp	2013-09-14 21:51:47 UTC (rev 2980)
@@ -25,19 +25,26 @@
 #include <stdio.h>
 #include <utf8cantillation.h>
 
+
 SWORD_NAMESPACE_START
 
-const char oName[] = "Hebrew Cantillation";
-const char oTip[] = "Toggles Hebrew Cantillation Marks";
+namespace {
 
-const SWBuf choices[3] = {"On", "Off", ""};
-const StringList oValues(&choices[0], &choices[2]);
+	static const char oName[] = "Hebrew Cantillation";
+	static const char oTip[]  = "Toggles Hebrew Cantillation Marks";
 
-UTF8Cantillation::UTF8Cantillation() : SWOptionFilter(oName, oTip, &oValues) {
-	setOptionValue("Off");
+	static const StringList *oValues() {
+		static const SWBuf choices[3] = {"Off", "On", ""};
+		static const StringList oVals(&choices[0], &choices[2]);
+		return &oVals;
+	}
 }
 
 
+UTF8Cantillation::UTF8Cantillation() : SWOptionFilter(oName, oTip, oValues()) {
+}
+
+
 UTF8Cantillation::~UTF8Cantillation(){};
 
 

Modified: trunk/src/modules/filters/utf8greekaccents.cpp
===================================================================
--- trunk/src/modules/filters/utf8greekaccents.cpp	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/src/modules/filters/utf8greekaccents.cpp	2013-09-14 21:51:47 UTC (rev 2980)
@@ -31,21 +31,29 @@
 sword::UTF8NFKD decompose;
 #endif
 
+
 SWORD_NAMESPACE_START
 
-const char oName[] = "Greek Accents";
-const char oTip[] = "Toggles Greek Accents";
+namespace {
 
-const SWBuf choices[3] = {"On", "Off", ""};
-const StringList oValues(&choices[0], &choices[2]);
+	static const char oName[] = "Greek Accents";
+	static const char oTip[]  = "Toggles Greek Accents";
 
-UTF8GreekAccents::UTF8GreekAccents() : SWOptionFilter(oName, oTip, &oValues) {
-	setOptionValue("On");
+	static const StringList *oValues() {
+		static const SWBuf choices[3] = {"On", "Off", ""};
+		static const StringList oVals(&choices[0], &choices[2]);
+		return &oVals;
+	}
 }
 
-UTF8GreekAccents::~UTF8GreekAccents(){};
 
+UTF8GreekAccents::UTF8GreekAccents() : SWOptionFilter(oName, oTip, oValues()) {
+}
 
+
+UTF8GreekAccents::~UTF8GreekAccents() {};
+
+
 char UTF8GreekAccents::processText(SWBuf &text, const SWKey *key, const SWModule *module) {
 
 	if (!option) { //we don't want greek accents

Modified: trunk/src/modules/filters/utf8hebrewpoints.cpp
===================================================================
--- trunk/src/modules/filters/utf8hebrewpoints.cpp	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/src/modules/filters/utf8hebrewpoints.cpp	2013-09-14 21:51:47 UTC (rev 2980)
@@ -25,18 +25,26 @@
 #include <stdio.h>
 #include <utf8hebrewpoints.h>
 
+
 SWORD_NAMESPACE_START
 
-const char oName[] = "Hebrew Vowel Points";
-const char oTip[] = "Toggles Hebrew Vowel Points";
+namespace {
 
-const SWBuf choices[3] = {"On", "Off", ""};
-const StringList oValues(&choices[0], &choices[2]);
+	static const char oName[] = "Hebrew Vowel Points";
+	static const char oTip[]  = "Toggles Hebrew Vowel Points";
 
-UTF8HebrewPoints::UTF8HebrewPoints() : SWOptionFilter(oName, oTip, &oValues) {
-	setOptionValue("On");
+	static const StringList *oValues() {
+		static const SWBuf choices[3] = {"On", "Off", ""};
+		static const StringList oVals(&choices[0], &choices[2]);
+		return &oVals;
+	}
 }
 
+
+UTF8HebrewPoints::UTF8HebrewPoints() : SWOptionFilter(oName, oTip, oValues()) {
+}
+
+
 UTF8HebrewPoints::~UTF8HebrewPoints(){};
 
 
@@ -57,4 +65,5 @@
 	return 0;
 }
 
+
 SWORD_NAMESPACE_END

Modified: trunk/src/modules/filters/utf8html.cpp
===================================================================
--- trunk/src/modules/filters/utf8html.cpp	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/src/modules/filters/utf8html.cpp	2013-09-14 21:51:47 UTC (rev 2980)
@@ -26,8 +26,10 @@
 #include <utf8html.h>
 #include <swbuf.h>
 
+
 SWORD_NAMESPACE_START
 
+
 UTF8HTML::UTF8HTML() {
 }
 
@@ -80,4 +82,6 @@
 	return 0;
 }
 
+
 SWORD_NAMESPACE_END
+

Modified: trunk/src/modules/filters/utf8latin1.cpp
===================================================================
--- trunk/src/modules/filters/utf8latin1.cpp	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/src/modules/filters/utf8latin1.cpp	2013-09-14 21:51:47 UTC (rev 2980)
@@ -26,8 +26,10 @@
 #include <utf8latin1.h>
 #include <swbuf.h>
 
+
 SWORD_NAMESPACE_START
 
+
 UTF8Latin1::UTF8Latin1(char rchar) : replacementChar(rchar) {
 }
 
@@ -85,5 +87,6 @@
   return 0;
 }
 
+
 SWORD_NAMESPACE_END
 

Modified: trunk/src/modules/filters/utf8nfkd.cpp
===================================================================
--- trunk/src/modules/filters/utf8nfkd.cpp	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/src/modules/filters/utf8nfkd.cpp	2013-09-14 21:51:47 UTC (rev 2980)
@@ -30,16 +30,20 @@
 #include <utf8nfkd.h>
 #include <swbuf.h>
 
+
 SWORD_NAMESPACE_START
 
+
 UTF8NFKD::UTF8NFKD() {
         conv = ucnv_open("UTF-8", &err);
 }
 
+
 UTF8NFKD::~UTF8NFKD() {
          ucnv_close(conv);
 }
 
+
 char UTF8NFKD::processText(SWBuf &text, const SWKey *key, const SWModule *module)
 {
 	if ((unsigned long)key < 2)	// hack, we're en(1)/de(0)ciphering
@@ -65,5 +69,6 @@
 	return 0;
 }
 
+
 SWORD_NAMESPACE_END
 #endif

Modified: trunk/src/modules/filters/utf8utf16.cpp
===================================================================
--- trunk/src/modules/filters/utf8utf16.cpp	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/src/modules/filters/utf8utf16.cpp	2013-09-14 21:51:47 UTC (rev 2980)
@@ -28,8 +28,10 @@
 #include <utilstr.h>
 #include <swbuf.h>
 
+
 SWORD_NAMESPACE_START
 
+
 UTF8UTF16::UTF8UTF16() {
 }
 

Modified: trunk/src/modules/lexdict/rawld/rawld.cpp
===================================================================
--- trunk/src/modules/lexdict/rawld/rawld.cpp	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/src/modules/lexdict/rawld/rawld.cpp	2013-09-14 21:51:47 UTC (rev 2980)
@@ -30,8 +30,10 @@
 
 #include <stdio.h>
 
+
 SWORD_NAMESPACE_START
 
+
  /******************************************************************************
  * RawLD Constructor - Initializes data for instance of RawLD
  *
@@ -194,4 +196,6 @@
 	return key;
 }
 
+
 SWORD_NAMESPACE_END
+

Modified: trunk/src/modules/lexdict/rawld4/rawld4.cpp
===================================================================
--- trunk/src/modules/lexdict/rawld4/rawld4.cpp	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/src/modules/lexdict/rawld4/rawld4.cpp	2013-09-14 21:51:47 UTC (rev 2980)
@@ -30,8 +30,10 @@
 
 #include <stdio.h>
 
+
 SWORD_NAMESPACE_START
 
+
  /******************************************************************************
  * RawLD Constructor - Initializes data for instance of RawLD
  *
@@ -162,11 +164,13 @@
 	doSetText(*key, "");
 }
 
+
 long RawLD4::getEntryCount() const {
 	if (idxfd < 0) return 0;
 	return idxfd->seek(0, SEEK_END) / IDXENTRYSIZE;
 }
 
+
 long RawLD4::getEntryForKey(const char *key) const {
 	__u32 start, offset;
 	__u32 size;
@@ -183,10 +187,13 @@
 	return offset / IDXENTRYSIZE;
 }
 
+
 char *RawLD4::getKeyForEntry(long entry) const {
 	char *key = 0;
 	getIDXBuf(entry * IDXENTRYSIZE, &key);
 	return key;
 }
 
+
 SWORD_NAMESPACE_END
+

Modified: trunk/src/modules/lexdict/swld.cpp
===================================================================
--- trunk/src/modules/lexdict/swld.cpp	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/src/modules/lexdict/swld.cpp	2013-09-14 21:51:47 UTC (rev 2980)
@@ -27,8 +27,10 @@
 #include <strkey.h>
 #include <swkey.h>
 
+
 SWORD_NAMESPACE_START
 
+
 /******************************************************************************
  * SWLD Constructor - Initializes data for instance of SWLD
  *
@@ -97,6 +99,7 @@
 	getRawEntryBuf();
 }
 
+
 bool SWLD::hasEntry(const SWKey *key) const {
 	const char *key_str = *key;
 	char *buf = new char [ strlen(key_str) + 6 ];
@@ -110,6 +113,7 @@
 	return retVal;
 }
 
+
 /******************************************************************************
  * SWLD::strongsPad	- Pads a key if (it-1) is 100% digits to 5 places
  *						allows for final to be alpha, e.g. '123B'
@@ -162,3 +166,4 @@
 
 
 SWORD_NAMESPACE_END
+

Modified: trunk/src/modules/lexdict/zld/zld.cpp
===================================================================
--- trunk/src/modules/lexdict/zld/zld.cpp	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/src/modules/lexdict/zld/zld.cpp	2013-09-14 21:51:47 UTC (rev 2980)
@@ -30,8 +30,10 @@
 
 #include <stdio.h>
 
+
 SWORD_NAMESPACE_START
 
+
  /******************************************************************************
  * RawLD Constructor - Initializes data for instance of RawLD
  *
@@ -194,3 +196,4 @@
 
 
 SWORD_NAMESPACE_END
+

Modified: trunk/src/modules/texts/rawtext4/rawtext4.cpp
===================================================================
--- trunk/src/modules/texts/rawtext4/rawtext4.cpp	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/src/modules/texts/rawtext4/rawtext4.cpp	2013-09-14 21:51:47 UTC (rev 2980)
@@ -33,24 +33,8 @@
 #include <versekey.h>
 #include <stringmgr.h>
 
-#include <regex.h>	// GNU
-#include <map>
-#include <list>
-#include <algorithm>
-
-#ifndef USELUCENE
-using std::map;
-using std::list;
-using std::find;
-#endif
-
 SWORD_NAMESPACE_START
 
-#ifndef USELUCENE
-typedef  map < SWBuf, list<long> > strlist;
-typedef list<long> longlist;
-#endif
-
 /******************************************************************************
  * RawText4 Constructor - Initializes data for instance of RawText4
  *

Modified: trunk/src/modules/texts/ztext/ztext.cpp
===================================================================
--- trunk/src/modules/texts/ztext/ztext.cpp	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/src/modules/texts/ztext/ztext.cpp	2013-09-14 21:51:47 UTC (rev 2980)
@@ -30,9 +30,6 @@
 
 #include <ztext.h>
 
-#include <regex.h>	// GNU
-
-
 SWORD_NAMESPACE_START
 
 /******************************************************************************

Modified: trunk/src/utilfuns/roman.cpp
===================================================================
--- trunk/src/utilfuns/roman.cpp	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/src/utilfuns/roman.cpp	2013-09-14 21:51:47 UTC (rev 2980)
@@ -24,8 +24,10 @@
 #include <string.h>
 #include <roman.h>
 
+
 SWORD_NAMESPACE_START
 
+
 char isroman (const char *str, int maxchars) {
 	char *ch = (char*)str;
 	for (; *ch && (!maxchars || (ch-str) <= maxchars); ch++)
@@ -85,4 +87,6 @@
 	return n;
 }
 
+
 SWORD_NAMESPACE_END
+

Modified: trunk/src/utilfuns/swbuf.cpp
===================================================================
--- trunk/src/utilfuns/swbuf.cpp	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/src/utilfuns/swbuf.cpp	2013-09-14 21:51:47 UTC (rev 2980)
@@ -26,10 +26,11 @@
 #include <stdarg.h>
 #include <stdio.h>
 
+
 SWORD_NAMESPACE_START
 
+
 char *SWBuf::nullStr = (char *)"";
-char SWBuf::junkBuf[JUNKBUFSIZE];
 
 /******************************************************************************
 * SWBuf Constructor - Creates an empty SWBuf object or an SWBuf initialized
@@ -82,6 +83,7 @@
 
 	va_start(argptr, format);
 #ifdef NO_VSNPRINTF
+	static char junkBuf[JUNKBUFSIZE];
 	int len = vsprintf(junkBuf, format, argptr)+1;
 #else
 	int len = vsnprintf(0, 0, format, argptr)+1;
@@ -131,6 +133,7 @@
 
 	va_start(argptr, format);
 #ifdef NO_VSNPRINTF
+	static char junkBuf[JUNKBUFSIZE];
 	int len = vsprintf(junkBuf, format, argptr)+1;
 #else
 	int len = vsnprintf(0, 0, format, argptr)+1;

Modified: trunk/src/utilfuns/swobject.cpp
===================================================================
--- trunk/src/utilfuns/swobject.cpp	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/src/utilfuns/swobject.cpp	2013-09-14 21:51:47 UTC (rev 2980)
@@ -30,8 +30,10 @@
 #include <string.h>
 #endif
 
+
 SWORD_NAMESPACE_START
 
+
 bool SWClass::isAssignableFrom(const char *className) const {
 	for (int i = 0; descends[i]; i++) {
 #ifndef __CYGWIN__
@@ -44,4 +46,6 @@
 	return false;
 }
 
+
 SWORD_NAMESPACE_END
+

Modified: trunk/src/utilfuns/swunicod.cpp
===================================================================
--- trunk/src/utilfuns/swunicod.cpp	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/src/utilfuns/swunicod.cpp	2013-09-14 21:51:47 UTC (rev 2980)
@@ -21,122 +21,131 @@
  */
 
 #include "swunicod.h"
+
+
 SWORD_NAMESPACE_START
-unsigned char* UTF32to8 (unsigned long utf32, unsigned char * utf8) {
-  unsigned int i;
-  for (i = 0; i < 6; i++) utf8[i] = 0;
 
-  if (utf32 < 0x80) {
-    utf8[0] = (char)utf32;
-  }
-  else if (utf32 < 0x800) {
-    i = utf32 & 0x3f;
-    utf8[1] = 0x80 | i;
-    utf32 >>= 6;
-   
-    i = utf32 & 0x1f;
-    utf8[0] = 0xc0 | i;
-  }
-  else if (utf32 < 0x10000) {
-    i = utf32 & 0x3f;
-    utf8[2] = 0x80 | i;
-    utf32 >>= 6;
 
-    i = utf32 & 0x3f;
-    utf8[1] = 0x80 | i;
-    utf32 >>= 6;
-   
-    i = utf32 & 0x0f;
-    utf8[0] = 0xe0 | i;
-  }
-  else if (utf32 < 0x200000) {
-    i = utf32 & 0x3f;
-    utf8[3] = 0x80 | i;
-    utf32 >>= 6;
+unsigned char *UTF32to8(unsigned long utf32, unsigned char *utf8) {
+	unsigned int i;
+	for (i = 0; i < 6; i++) utf8[i] = 0;
 
-    i = utf32 & 0x3f;
-    utf8[2] = 0x80 | i;
-    utf32 >>= 6;
+	if (utf32 < 0x80) {
+		utf8[0] = (char)utf32;
+	}
+	else if (utf32 < 0x800) {
+		i = utf32 & 0x3f;
+		utf8[1] = 0x80 | i;
+		utf32 >>= 6;
 
-    i = utf32 & 0x3f;
-    utf8[1] = 0x80 | i;
-    utf32 >>= 6;
-   
-    i = utf32 & 0x07;
-    utf8[0] = 0xf0 | i;
-  }
-  else if (utf32 < 0x4000000) {
-    i = utf32 & 0x3f;
-    utf8[4] = 0x80 | i;
-    utf32 >>= 6;
+		i = utf32 & 0x1f;
+		utf8[0] = 0xc0 | i;
+	}
+	else if (utf32 < 0x10000) {
+		i = utf32 & 0x3f;
+		utf8[2] = 0x80 | i;
+		utf32 >>= 6;
 
-    i = utf32 & 0x3f;
-    utf8[3] = 0x80 | i;
-    utf32 >>= 6;
+		i = utf32 & 0x3f;
+		utf8[1] = 0x80 | i;
+		utf32 >>= 6;
 
-    i = utf32 & 0x3f;
-    utf8[2] = 0x80 | i;
-    utf32 >>= 6;
+		i = utf32 & 0x0f;
+		utf8[0] = 0xe0 | i;
+	}
+	else if (utf32 < 0x200000) {
+		i = utf32 & 0x3f;
+		utf8[3] = 0x80 | i;
+		utf32 >>= 6;
 
-    i = utf32 & 0x3f;
-    utf8[1] = 0x80 | i;
-    utf32 >>= 6;
-   
-    i = utf32 & 0x03;
-    utf8[0] = 0xf8 | i;
-  }
-  else if (utf32 < 0x80000000) {
-    i = utf32 & 0x3f;
-    utf8[5] = 0x80 | i;
-    utf32 >>= 6;
+		i = utf32 & 0x3f;
+		utf8[2] = 0x80 | i;
+		utf32 >>= 6;
 
-    i = utf32 & 0x3f;
-    utf8[4] = 0x80 | i;
-    utf32 >>= 6;
+		i = utf32 & 0x3f;
+		utf8[1] = 0x80 | i;
+		utf32 >>= 6;
 
-    i = utf32 & 0x3f;
-    utf8[3] = 0x80 | i;
-    utf32 >>= 6;
+		i = utf32 & 0x07;
+		utf8[0] = 0xf0 | i;
+	}
+	else if (utf32 < 0x4000000) {
+		i = utf32 & 0x3f;
+		utf8[4] = 0x80 | i;
+		utf32 >>= 6;
 
-    i = utf32 & 0x3f;
-    utf8[2] = 0x80 | i;
-    utf32 >>= 6;
+		i = utf32 & 0x3f;
+		utf8[3] = 0x80 | i;
+		utf32 >>= 6;
 
-    i = utf32 & 0x3f;
-    utf8[1] = 0x80 | i;
-    utf32 >>= 6;
-   
-    i = utf32 & 0x01;
-    utf8[0] = 0xfc | i;
-  }
-  return utf8;
+		i = utf32 & 0x3f;
+		utf8[2] = 0x80 | i;
+		utf32 >>= 6;
+
+		i = utf32 & 0x3f;
+		utf8[1] = 0x80 | i;
+		utf32 >>= 6;
+
+		i = utf32 & 0x03;
+		utf8[0] = 0xf8 | i;
+	}
+	else if (utf32 < 0x80000000) {
+		i = utf32 & 0x3f;
+		utf8[5] = 0x80 | i;
+		utf32 >>= 6;
+
+		i = utf32 & 0x3f;
+		utf8[4] = 0x80 | i;
+		utf32 >>= 6;
+
+		i = utf32 & 0x3f;
+		utf8[3] = 0x80 | i;
+		utf32 >>= 6;
+
+		i = utf32 & 0x3f;
+		utf8[2] = 0x80 | i;
+		utf32 >>= 6;
+
+		i = utf32 & 0x3f;
+		utf8[1] = 0x80 | i;
+		utf32 >>= 6;
+
+		i = utf32 & 0x01;
+		utf8[0] = 0xfc | i;
+	}
+
+	return utf8;
 }
 
-unsigned long UTF8to32 (unsigned char * utf8) {
 
-  unsigned char i = utf8[0];
-  unsigned char count;
-  unsigned long utf32 = 0;
+unsigned long UTF8to32(unsigned char *utf8) {
 
-  for (count = 0; i & 0x80; count++) i <<= 1;
-  if (!count) {
-    return utf8[0];
-  }
-  else if (count == 1) {
-    return 0xffff;
-  }
-  else {
-    count--;
-    utf32 = i >> count;
-    for (i = 1; i <= count; i++) {
-      if ((0xc0 & utf8[i]) != 0x80) {
-	return  0xffff;
-      }
-      utf32 <<= 6;
-      utf32 |= (utf8[i] & 0x3f);
-    }
-  }
-  return utf32;
+	unsigned char i = utf8[0];
+	unsigned char count;
+	unsigned long utf32 = 0;
+
+	for (count = 0; i & 0x80; count++) i <<= 1;
+	if (!count) {
+		return utf8[0];
+	}
+	else if (count == 1) {
+		return 0xffff;
+	}
+	else {
+		count--;
+		utf32 = i >> count;
+		for (i = 1; i <= count; i++) {
+			if ((0xc0 & utf8[i]) != 0x80) {
+				return  0xffff;
+			}
+			utf32 <<= 6;
+			utf32 |= (utf8[i] & 0x3f);
+		}
+	}
+
+	return utf32;
 }
 
+
 SWORD_NAMESPACE_END
+

Modified: trunk/src/utilfuns/swversion.cpp
===================================================================
--- trunk/src/utilfuns/swversion.cpp	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/src/utilfuns/swversion.cpp	2013-09-14 21:51:47 UTC (rev 2980)
@@ -25,10 +25,13 @@
 #include <stdlib.h>
 #include <string.h>
 
+
 SWORD_NAMESPACE_START
 
+
 SWVersion SWVersion::currentVersion( SWORD_VERSION_STR );
 
+
 /******************************************************************************
  * SWVersion c-tor - Constructs a new SWVersion
  *
@@ -100,4 +103,6 @@
 	return buf;
 }
 
+
 SWORD_NAMESPACE_END
+

Modified: trunk/src/utilfuns/url.cpp
===================================================================
--- trunk/src/utilfuns/url.cpp	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/src/utilfuns/url.cpp	2013-09-14 21:51:47 UTC (rev 2980)
@@ -20,7 +20,6 @@
  *
  */
 
-//Sword includes
 #include <url.h>
 #include <swlog.h>
 
@@ -30,10 +29,12 @@
 #include <stdio.h>
 #include <iostream>
 
+
 SWORD_NAMESPACE_START
 
+
 namespace {
-	typedef std::map< unsigned char, SWBuf > DataMap;
+	typedef std::map<unsigned char, SWBuf> DataMap;
     	DataMap m;
 	static class __init {
 		public:
@@ -53,10 +54,11 @@
 	} ___init;
 }
 
+
 /**
  * Constructors/Destructors
  */
-URL::URL(const char* url)  
+URL::URL(const char *url)  
 	: 	url(""),
 		protocol(""),
 		hostname(""),
@@ -68,27 +70,32 @@
 	}
 }
 
-const char* URL::getProtocol() const {
+
+const char *URL::getProtocol() const {
 	return protocol.c_str();
 }
 
-const char* URL::getHostName () const {
+
+const char *URL::getHostName () const {
 	return hostname.c_str();
 }
 
-const char* URL::getPath() const {
+
+const char *URL::getPath() const {
 	return path.c_str();
 }
 
+
 const URL::ParameterMap &URL::getParameters() const {
 	return parameterMap;
 }
 
+
 /**
  * Returns the value of an URL parameter. For the URL "http://www.crosswire.org/index.jsp?page=test&amp;user=nobody" the value of the parameter "page" would be "test".
  * If the parameter is not set an empty string is returned.
  */
-const char* URL::getParameterValue(const char* name) const {
+const char *URL::getParameterValue(const char *name) const {
 	static SWBuf emptyStr("");
 
 	ParameterMap::const_iterator it = parameterMap.find(name);
@@ -107,22 +114,22 @@
  * Parse the URL into the protocol, the hostname, the path and the paramters with their values
  * 
  */
-void URL::parse () {
+void URL::parse() {
 	/* format example		protocol://hostname/path/path/path.pl?param1=value1&amp;param2=value2
-	 * we include the script name in the path, so the path would be /path/path/path.pl in this example
-	 *  &amp; could also be &
-	 */
+	* we include the script name in the path, so the path would be /path/path/path.pl in this example
+	*  &amp; could also be &
+	*/
+
+	//1. Init
+	const char *urlPtr = url.c_str();
 	 
-	 //1. Init
-	 const char* urlPtr = url.c_str();
-	 	 
-	 protocol = "";
-	 hostname = "";
-	 path = "";
-	 parameterMap.clear();
+	protocol = "";
+	hostname = "";
+	path     = "";
+	parameterMap.clear();
 	 
 	 // 2. Get the protocol, which is from the begining to the first ://
-	 const char* end = strchr( urlPtr, ':' );
+	const char *end = strchr( urlPtr, ':' );
 	if (end) { //protocol was found
 	 	protocol.append(urlPtr, end-urlPtr);
 	 	urlPtr = end + 1;
@@ -190,7 +197,7 @@
 			paramValue = "";
 			
 			//search for the equal sign to find the value part
-			const char* valueStart = strchr(end, '=');		
+			const char *valueStart = strchr(end, '=');		
 			if (valueStart) {
 				const char* valueEnd = strstr(valueStart, "&amp;") ? strstr(valueStart, "&amp;") : strstr(valueStart, "&"); //try to find a new paramter part
 				
@@ -236,6 +243,7 @@
 	return url;
 }
 
+
 const SWBuf URL::decode(const char *encoded) {
 	/*static*/ SWBuf text;
 	text = encoded;	
@@ -276,4 +284,6 @@
 	return text;
 }
 
+
 SWORD_NAMESPACE_END
+

Modified: trunk/src/utilfuns/utilstr.cpp
===================================================================
--- trunk/src/utilfuns/utilstr.cpp	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/src/utilfuns/utilstr.cpp	2013-09-14 21:51:47 UTC (rev 2980)
@@ -31,44 +31,42 @@
 
 SWORD_NAMESPACE_START
 
-const unsigned char SW_toupper_array[256] =
-        {
-                0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
-                0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
-                0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
-                0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
-                0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27,
-                0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
-                0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
-                0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
-                0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
-                0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f,
-                0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57,
-                0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f,
-                0x60, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
-                0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f,
-                0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57,
-                0x58, 0x59, 0x5a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f,
-                0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
-                0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f,
-                0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97,
-                0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f,
-                0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7,
-                0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf,
-                0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7,
-                0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf,
-                0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7,
-                0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf,
-                0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7,
-                0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf,
-                0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7,
-                0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf,
-                0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xf7,
-                0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xff
-        };
+const unsigned char SW_toupper_array[256] = {
+	0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
+	0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
+	0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
+	0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
+	0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27,
+	0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
+	0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
+	0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
+	0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
+	0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f,
+	0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57,
+	0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f,
+	0x60, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
+	0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f,
+	0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57,
+	0x58, 0x59, 0x5a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f,
+	0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
+	0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f,
+	0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97,
+	0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f,
+	0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7,
+	0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf,
+	0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7,
+	0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf,
+	0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7,
+	0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf,
+	0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7,
+	0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf,
+	0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7,
+	0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf,
+	0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xf7,
+	0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xff
+};
 
 
-
 /******************************************************************************
  * stdstr - clones a string
  *

Modified: trunk/src/utilfuns/utilxml.cpp
===================================================================
--- trunk/src/utilfuns/utilxml.cpp	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/src/utilfuns/utilxml.cpp	2013-09-14 21:51:47 UTC (rev 2980)
@@ -25,9 +25,10 @@
 #include <ctype.h>
 #include <utilstr.h>
 
+
 SWORD_NAMESPACE_START
 
-const char *XMLTag::nullstr = "";
+
 void XMLTag::parse() const {
 	int i;
 	int start;
@@ -123,6 +124,7 @@
 	setText(tagString);
 }
 
+
 XMLTag::XMLTag(const XMLTag& t) : attributes(t.attributes)  {
 	parsed = t.parsed;
 	empty = t.empty;
@@ -139,6 +141,7 @@
 	}
 }
 
+
 void XMLTag::setText(const char *tagString) {
 	parsed = false;
 	empty  = false;
@@ -175,6 +178,7 @@
 	}
 }
 
+
 XMLTag::~XMLTag() {
 	if (buf)
 		delete [] buf;
@@ -182,6 +186,7 @@
 		delete [] name;
 }
 
+
 const StringList XMLTag::getAttributeNames() const {
 	StringList retVal;
 
@@ -278,6 +283,7 @@
 	return attribValue;
 }
 
+
 const char *XMLTag::toString() const {
 	SWBuf tag = "<";
 	if (!parsed)
@@ -320,4 +326,6 @@
 	return endTag;
 }
 
+
 SWORD_NAMESPACE_END
+

Modified: trunk/utilities/imp2gbs.cpp
===================================================================
--- trunk/utilities/imp2gbs.cpp	2013-09-10 14:44:26 UTC (rev 2979)
+++ trunk/utilities/imp2gbs.cpp	2013-09-14 21:51:47 UTC (rev 2980)
@@ -59,7 +59,7 @@
 bool  augMod      = false;
 bool  augEnt      = true;
 int   lexLevels   = 0;
-UTF8GreekAccents *greekAccentsFilter = 0;
+UTF8GreekAccents greekAccentsFilter;
 
 
 void usage(const char *app) {
@@ -132,7 +132,7 @@
 
 
 	if (greekFilter) {
-		greekAccentsFilter->processText(keyBuffer);
+		greekAccentsFilter.processText(keyBuffer);
 	}
 
 	if (toUpper) {
@@ -220,9 +220,7 @@
 
 
 int main(int argc, char **argv) {
-	UTF8GreekAccents gaf;
-	greekAccentsFilter = &gaf;
-	greekAccentsFilter->setOptionValue("Off");		// off = accents off
+	greekAccentsFilter.setOptionValue("Off");		// off = accents off
 	parseParams(argc, argv);
   
 	// Let's see if we can open our input file




More information about the sword-cvs mailing list