[sword-svn] r2308 - trunk/utilities/diatheke
benpmorgan at crosswire.org
benpmorgan at crosswire.org
Wed Apr 8 19:08:09 MST 2009
Author: benpmorgan
Date: 2009-04-08 19:08:09 -0700 (Wed, 08 Apr 2009)
New Revision: 2308
Modified:
trunk/utilities/diatheke/corediatheke.cpp
trunk/utilities/diatheke/diathekemgr.cpp
Log:
Add preliminary genbook support and fix shaping not to be always applied in
ICU builds
Modified: trunk/utilities/diatheke/corediatheke.cpp
===================================================================
--- trunk/utilities/diatheke/corediatheke.cpp 2009-04-09 01:32:53 UTC (rev 2307)
+++ trunk/utilities/diatheke/corediatheke.cpp 2009-04-09 02:08:09 UTC (rev 2308)
@@ -91,11 +91,24 @@
*output << endl;
}
}
+ if (types) *output << "Generic books:\n";
+ for (it = manager.Modules.begin(); it != manager.Modules.end(); it++) {
+ target = it->second;
+ if (!strcmp(target->Type(), "Generic Books")) {
+ if (names) *output << target->Name();
+ if (names && descriptions) *output << " : ";
+ if (descriptions) *output << target->Description();
+ *output << endl;
+ }
+ }
+
}
}
void doquery(unsigned long maxverses = -1, unsigned char outputformat = FMT_PLAIN, unsigned char outputencoding = ENC_UTF8, unsigned long optionfilters = 0, unsigned char searchtype = ST_NONE, const char *range = 0, const char *text = 0, const char *locale = 0, const char *ref = 0, ostream* output = &cout, const char *script = 0, signed short variants = 0) {
- static DiathekeMgr manager;
+ static DiathekeMgr manager(NULL, NULL, false, outputencoding, outputformat,
+ ((OP_BIDI & optionfilters) == OP_BIDI),
+ ((OP_ARSHAPE & optionfilters) == OP_ARSHAPE));
ModMap::iterator it;
ListKey listkey;
@@ -129,11 +142,6 @@
}
target = (*it).second;
- manager.Markup(outputformat);
- manager.Encoding(outputencoding);
- manager.bidi = ((OP_BIDI & optionfilters) == OP_BIDI);
- manager.shape = ((OP_ARSHAPE & optionfilters) == OP_ARSHAPE);
-
if ((sit = manager.config->Sections.find((*it).second->Name())) != manager.config->Sections.end()) {
if ((eit = (*sit).second.find("SourceType")) != (*sit).second.end()) {
if (!::stricmp((char *)(*eit).second.c_str(), "GBF"))
@@ -180,6 +188,8 @@
querytype = QT_COMM;
else if (!strcmp(target->Type(), "Lexicons / Dictionaries"))
querytype = QT_LD;
+ else if (!strcmp(target->Type(), "Generic Books"))
+ querytype = QT_LD;
if (optionfilters & OP_FOOTNOTES)
manager.setGlobalOption("Footnotes","On");
@@ -244,6 +254,8 @@
querytype = QT_BIBLE;
else if (!strcmp(target->Type(), "Lexicons / Dictionaries"))
querytype = QT_LD;
+ else if (!strcmp(target->Type(), "Generic Books"))
+ querytype = QT_LD;
//do search stuff
char st = 1 - searchtype;
Modified: trunk/utilities/diatheke/diathekemgr.cpp
===================================================================
--- trunk/utilities/diatheke/diathekemgr.cpp 2009-04-09 01:32:53 UTC (rev 2307)
+++ trunk/utilities/diatheke/diathekemgr.cpp 2009-04-09 02:08:09 UTC (rev 2308)
@@ -78,7 +78,9 @@
rtl = ((entry = section.find("Direction")) != section.end()) ? ((*entry).second == "RtoL") : false;
#ifdef _ICU_
- module->AddRenderFilter(arshaping);
+ if (shape) {
+ module->AddRenderFilter(arshaping);
+ }
if (bidi && rtl) {
module->AddRenderFilter(bidireorder);
}
More information about the sword-cvs
mailing list