[sword-svn] r2906 - in trunk: include src/modules/filters

chrislit at crosswire.org chrislit at crosswire.org
Wed Jul 17 15:34:43 MST 2013


Author: chrislit
Date: 2013-07-17 15:34:43 -0700 (Wed, 17 Jul 2013)
New Revision: 2906

Modified:
   trunk/include/utf8transliterator.h
   trunk/src/modules/filters/utf8transliterator.cpp
Log:
disabled all the code for loading ICU transliterators from files and building them on the fly; hopefully this gets rid of the ICU errors folks have been complaining about

Modified: trunk/include/utf8transliterator.h
===================================================================
--- trunk/include/utf8transliterator.h	2013-07-17 12:18:15 UTC (rev 2905)
+++ trunk/include/utf8transliterator.h	2013-07-17 22:34:43 UTC (rev 2906)
@@ -56,10 +56,6 @@
 typedef std::map<const UnicodeString, SWTransData> SWTransMap;
 typedef std::pair<UnicodeString, SWTransData> SWTransPair;
 
-// Chris, please add more javadoc-style documentation in this header file
-// so that the information will show up in the doxygen-generated
-// api-docs.
-
 /** This Filter uses ICU for transliteration
 */
 class SWDLLEXPORT UTF8Transliterator : public SWOptionFilter {
@@ -71,17 +67,20 @@
 
 	static const char optName[];
 	static const char optTip[];
+	StringList options;
+
+#ifdef ICU_CUSTOM_RESOURCE_BUILDING
 	static const char SW_RB_RULE_BASED_IDS[];
 	static const char SW_RB_RULE[];
 	static const char SW_RESDATA[];
-	StringList options;
 	static SWTransMap transMap;
 	UErrorCode utf8status;
 
 	void Load(UErrorCode &status);
-	void registerTrans(const UnicodeString& ID, const UnicodeString& resource, UTransDirection dir, UErrorCode &status);
-	bool addTrans(const char* newTrans, SWBuf* transList);
+	void registerTrans(const UnicodeString& ID, const UnicodeString& resource, UTransDirection dir, UErrorCode &status);	
 	bool checkTrans(const UnicodeString& ID, UErrorCode &status);
+#endif
+	bool addTrans(const char* newTrans, SWBuf* transList);
 	Transliterator *createTrans(const UnicodeString& ID, UTransDirection dir, UErrorCode &status);
 
 public:

Modified: trunk/src/modules/filters/utf8transliterator.cpp
===================================================================
--- trunk/src/modules/filters/utf8transliterator.cpp	2013-07-17 12:18:15 UTC (rev 2905)
+++ trunk/src/modules/filters/utf8transliterator.cpp	2013-07-17 22:34:43 UTC (rev 2906)
@@ -42,54 +42,57 @@
 const char UTF8Transliterator::optionstring[NUMTARGETSCRIPTS][16] = {
         "Off",
         "Latin",
-	//        "IPA",
-	//        "Basic Latin",
-	//        "SBL",
-	//        "TC",
-	//        "Beta",
-	//        "BGreek",
-	//        "SERA",
-	//        "Hugoye",
-	//        "UNGEGN",
-	//        "ISO",
-	//        "ALA-LC",
-	//        "BGN",
-	//        "Greek",
-	//        "Hebrew",
-	//        "Cyrillic",
-	//        "Arabic",
-	//        "Syriac",
-	//        "Katakana",
-	//        "Hiragana",
-	//        "Hangul",
-	//        "Devanagari",
-	//        "Tamil",
-	//        "Bengali",
-	//        "Gurmukhi",
-	//        "Gujarati",
-	//        "Oriya",
-	//        "Telugu",
-	//        "Kannada",
-	//        "Malayalam",
-	//        "Thai",
-	//        "Georgian",
-	//        "Armenian",
-	//        "Ethiopic",
-	//        "Gothic",
-	//        "Ugaritic",
-	//        "Coptic",
-	//        "Linear B",
-	//        "Cypriot",
-	//        "Runic",
-	//        "Ogham",
-	//        "Thaana",
-	//        "Glagolitic",
-       	//        "Cherokee",
+        /*
+        "IPA",
+        "Basic Latin",
+        "SBL",
+        "TC",
+        "Beta",
+        "BGreek",
+        "SERA",
+        "Hugoye",
+        "UNGEGN",
+        "ISO",
+        "ALA-LC",
+        "BGN",
+        "Greek",
+        "Hebrew",
+        "Cyrillic",
+        "Arabic",
+        "Syriac",
+        "Katakana",
+        "Hiragana",
+        "Hangul",
+        "Devanagari",
+        "Tamil",
+        "Bengali",
+        "Gurmukhi",
+        "Gujarati",
+        "Oriya",
+        "Telugu",
+        "Kannada",
+        "Malayalam",
+        "Thai",
+        "Georgian",
+        "Armenian",
+        "Ethiopic",
+        "Gothic",
+        "Ugaritic",
+        "Coptic",
+        "Linear B",
+        "Cypriot",
+        "Runic",
+        "Ogham",
+        "Thaana",
+        "Glagolitic",
+        "Cherokee",
+        */
 };
 
 const char UTF8Transliterator::optName[] = "Transliteration";
 const char UTF8Transliterator::optTip[] = "Transliterates between scripts";
 
+#ifdef ICU_CUSTOM_RESOURCE_BUILDING
 SWTransMap UTF8Transliterator::transMap;
 
 #ifndef _ICUSWORD_
@@ -129,8 +132,8 @@
 }
 
 #endif // _ICUSWORD_
+#endif // ICU_CUSTOM_RESOURCE_BUILDING
 
-
 UTF8Transliterator::UTF8Transliterator() {
 	option = 0;
         unsigned long i;
@@ -147,7 +150,7 @@
 UTF8Transliterator::~UTF8Transliterator() {
 }
 
-
+#ifdef ICU_CUSTOM_RESOURCE_BUILDING
 void UTF8Transliterator::Load(UErrorCode &status)
 {
 #ifndef _ICUSWORD_
@@ -300,23 +303,29 @@
 return true;
 #endif // _ICUSWORD_
 }
+#endif // ICU_CUSTOM_RESOURCE_BUILDING
 
 bool UTF8Transliterator::addTrans(const char* newTrans, SWBuf* transList) {
+#ifdef ICU_CUSTOM_RESOURCE_BUILDING
 #ifdef _ICUSWORD_
-        UErrorCode status;
+	UErrorCode status;
 	if (checkTrans(UnicodeString(newTrans), status)) {
 #endif
+#endif // ICU_CUSTOM_RESOURCE_BUILDING
 		*transList += newTrans;
-                *transList += ";";
-                return true;
+		*transList += ";";
+		return true;
+#ifdef ICU_CUSTOM_RESOURCE_BUILDING
 #ifdef _ICUSWORD_
-        }
-        else {
-        	return false;
-        }
+	}
+	else {
+    	return false;
+	}
 #endif
+#endif // ICU_CUSTOM_RESOURCE_BUILDING
 }
 
+
 Transliterator * UTF8Transliterator::createTrans(const UnicodeString& ID, UTransDirection dir, UErrorCode &status )
 {
 	Transliterator *trans = Transliterator::createInstance(ID,UTRANS_FORWARD,status);




More information about the sword-cvs mailing list