[sword-svn] r1845 - in trunk: bindings/corba/orbitcpp examples/cmdline src/mgr

scribe at crosswire.org scribe at crosswire.org
Thu Aug 4 05:15:12 MST 2005


Author: scribe
Date: 2005-08-04 05:15:12 -0700 (Thu, 04 Aug 2005)
New Revision: 1845

Modified:
   trunk/bindings/corba/orbitcpp/swordorb-impl.cpp
   trunk/bindings/corba/orbitcpp/testclient.cpp
   trunk/examples/cmdline/search.cpp
   trunk/src/mgr/swmgr.cpp
Log:
Fixed filterText to correctly user "Option Name" instead of "FilterName"


Modified: trunk/bindings/corba/orbitcpp/swordorb-impl.cpp
===================================================================
--- trunk/bindings/corba/orbitcpp/swordorb-impl.cpp	2005-08-04 01:12:33 UTC (rev 1844)
+++ trunk/bindings/corba/orbitcpp/swordorb-impl.cpp	2005-08-04 12:15:12 UTC (rev 1845)
@@ -112,8 +112,9 @@
 
 char *SWMgr_impl::filterText(const char *filterName, const char *text) throw(CORBA::SystemException) {
 	SWBuf buf = text;
-	SWBuf retVal = delegate->filterText(filterName, buf);
-	return CORBA::string_dup((char *)retVal.c_str());
+	delegate->setGlobalOption("Greek Accents", "Off");
+	char errStatus = delegate->filterText(filterName, buf);
+	return CORBA::string_dup((char *)buf.c_str());
 }
 
 char *SWModule_impl::getCategory() throw(CORBA::SystemException) {

Modified: trunk/bindings/corba/orbitcpp/testclient.cpp
===================================================================
--- trunk/bindings/corba/orbitcpp/testclient.cpp	2005-08-04 01:12:33 UTC (rev 1844)
+++ trunk/bindings/corba/orbitcpp/testclient.cpp	2005-08-04 12:15:12 UTC (rev 1845)
@@ -66,6 +66,8 @@
 		}
 */
 
+		mgr->setGlobalOption("Greek Accents", "Off");
+		std::cout << "\nFiltered text: " << mgr->filterText("Greek Accents", "ὁ θεὸς") << "\n";
 
 		
 	} catch(const CORBA::Exception& ex) {

Modified: trunk/examples/cmdline/search.cpp
===================================================================
--- trunk/examples/cmdline/search.cpp	2005-08-04 01:12:33 UTC (rev 1844)
+++ trunk/examples/cmdline/search.cpp	2005-08-04 12:15:12 UTC (rev 1845)
@@ -73,7 +73,7 @@
 	 *			-3  - entryAttrib (eg. Word//Strongs/G1234/)
 	 *			-4  - Lucene
    */
-	listkey = target->Search(searchTerm.c_str(), -1, /*SEARCHFLAG_MATCHWHOLEENTRY*/ REG_ICASE, 0, 0, &percentUpdate, &lineLen);
+	listkey = target->Search(searchTerm.c_str(), -4, /*SEARCHFLAG_MATCHWHOLEENTRY*/ REG_ICASE, 0, 0, &percentUpdate, &lineLen);
 	std::cout << "\n";
 	while (!listkey.Error()) {
 		std::cout << (const char *)listkey << std::endl;

Modified: trunk/src/mgr/swmgr.cpp
===================================================================
--- trunk/src/mgr/swmgr.cpp	2005-08-04 01:12:33 UTC (rev 1844)
+++ trunk/src/mgr/swmgr.cpp	2005-08-04 12:15:12 UTC (rev 1845)
@@ -859,9 +859,11 @@
 char SWMgr::filterText(const char *filterName, SWBuf &text, const SWKey *key, const SWModule *module)
  {
 	char retVal = -1;
-	FilterMap::iterator it = optionFilters.find(filterName);
-	if (it != optionFilters.end()) {
-		retVal = it->second->processText(text, key, module);	// add filter to module
+	for (FilterMap::iterator it = optionFilters.begin(); it != optionFilters.end(); it++) {
+		if ((*it).second->getOptionName()) {
+			if (!stricmp(filterName, (*it).second->getOptionName()))
+				retVal = it->second->processText(text, key, module);	// add filter to module
+		}
 	}
 	return retVal;
 }



More information about the sword-cvs mailing list