From 2816ff7ae11cc09934214a2aaeffa92a483e1618 Mon Sep 17 00:00:00 2001 From: danglassey Date: Wed, 30 Oct 2002 14:04:06 +0000 Subject: sync with crosswire 20021030-1400 --- ChangeLog | 13 +++++++++--- src/modules/filters/gbfhtmlhref.cpp | 6 +++--- src/modules/filters/gbfosis.cpp | 38 +++++++++++++++++++++++++++++++----- src/modules/filters/thmlhtmlhref.cpp | 24 ++++++++++++++++------- src/modules/filters/thmlosis.cpp | 14 +++++++++++++ 5 files changed, 77 insertions(+), 18 deletions(-) diff --git a/ChangeLog b/ChangeLog index b5386e1..8e4069e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,10 +1,17 @@ API ChangeLog (see the ChangeLog in each 'apps' directory for app specific changes + +29-Oct-2002 Troy A. Griffitts + Added SWModule *SWMgr::getModule(const char *modName); + Added Terry Biggs' patch to htmlref filters to + more consistently deal with strongs numbers + 23-Oct-2002 Daniel Glassey - some base work for installmgr on classes to + Some base work for installmgr on classes to manage mods.d + * Release 1.5.5 * 22-Oct-2002 Troy A. Griffitts @@ -477,7 +484,7 @@ Kolatzek. gbfhtml.cpp: Changed the HTML tag for new paragraph from

to
because it's bad HTML without a closing

tag. -23-Oct-2000 Joachim Ansorg +23-Oct-2000 Joachim Ansorg Changed the private section of versekey.h into a protected one because we need the change for current BibleTime! @@ -757,4 +764,4 @@ Kolatzek. Added chapmax and versemax information (canon.h) Made sword.cpp test program accept parameters: usage: sword ["Book CH:VS"] [number of verses to display] - enabled normalize function (try sword "Matthew 1:-7" 12) + Enabled normalize function (try sword "Matthew 1:-7" 12) diff --git a/src/modules/filters/gbfhtmlhref.cpp b/src/modules/filters/gbfhtmlhref.cpp index a49aad8..6232ff4 100644 --- a/src/modules/filters/gbfhtmlhref.cpp +++ b/src/modules/filters/gbfhtmlhref.cpp @@ -64,7 +64,7 @@ bool GBFHTMLHREF::handleToken(char **buf, const char *token, DualStringMap &user if (!substituteToken(buf, token)) { if (!strncmp(token, "WG", 2) || !strncmp(token, "WH", 2)) { // strong's numbers - pushString(buf, " <<(<(("); + newText = true; + lastspace = false; + handled = true; + } + else if (!strcmp(token, "Th")) { + pushString(&to, ""); + lastspace = false; + handled = true; + } // Italics assume transchange if (!strcmp(token, "FI")) { pushString(&to, ""); @@ -140,7 +152,7 @@ char GBFOSIS::ProcessText(char *text, int maxlen, const SWKey *key, const SWModu } // Paragraph break. For now use empty paragraph element if (!strcmp(token, "CM")) { - pushString(&to, "

"); + pushString(&to, ""); newText = true; lastspace = false; handled = true; @@ -176,6 +188,7 @@ char GBFOSIS::ProcessText(char *text, int maxlen, const SWKey *key, const SWModu // Strongs numbers else if (*token == 'W' && (token[1] == 'G' || token[1] == 'H')) { // Strongs + bool divineName = false; if (module->isProcessEntryAttributes()) { valto = val; for (unsigned int i = 1; ((token[i]) && (i < 150)); i++) @@ -200,11 +213,22 @@ char GBFOSIS::ProcessText(char *text, int maxlen, const SWKey *key, const SWModu to+=strlen(buf); } else { - sprintf(buf, "", val); + if (!strcmp(val, "H03068")) { //divineName + sprintf(buf, "", val); + divineName = true; + } + else sprintf(buf, "", val); + memmove(wordStart+strlen(buf), wordStart, (to-wordStart)+1); memcpy(wordStart, buf, strlen(buf)); to+=strlen(buf); - pushString(&to, ""); + + if (divineName) { + wordStart += 12; + pushString(&to, ""); + } + else pushString(&to, ""); + module->getEntryAttributes()["Word"][wordstr]["Strongs"] = val; lastspace = false; } @@ -298,8 +322,9 @@ char GBFOSIS::ProcessText(char *text, int maxlen, const SWKey *key, const SWModu char ref[254]; if (vkey->Verse()) sprintf(ref, "\t\t", vkey->getOSISRef()); - else if (vkey->Chapter()) + else if (vkey->Chapter()) { sprintf(ref, "\t

", vkey->getOSISRef()); + } else if (vkey->Book()) sprintf(ref, "\t
", vkey->getOSISRef()); else *ref = 0; @@ -334,9 +359,12 @@ char GBFOSIS::ProcessText(char *text, int maxlen, const SWKey *key, const SWModu } } - else if (vkey->Chapter()) + /* + else if (vkey->Chapter()) { sprintf(ref, "\t
", vkey->getOSISRef()); + } else sprintf(ref, "\t
", vkey->getOSISRef()); + */ } } *to++ = 0; diff --git a/src/modules/filters/thmlhtmlhref.cpp b/src/modules/filters/thmlhtmlhref.cpp index 8e02944..e6247f3 100644 --- a/src/modules/filters/thmlhtmlhref.cpp +++ b/src/modules/filters/thmlhtmlhref.cpp @@ -140,23 +140,32 @@ bool ThMLHTMLHREF::handleToken(char **buf, const char *token, DualStringMap &use if (!substituteToken(buf, token)) { // manually process if it wasn't a simple substitution if (!strncmp(token, "sync ", 5)) { - pushString(buf, " ( <"); + //scan for value and add it to the buffer for (tok = token + 5; *tok; tok++) { if (!strncmp(tok, "value=\"", 7)) { - tok += 7; + if(strstr(token,"type=\"morph\"")) + tok += 7; + else + tok += 8; for (;*tok != '\"'; tok++) *(*buf)++ = *tok; break; } } - pushString(buf, ""); + if(strstr(token,"type=\"morph\"")) + pushString(buf, ") "); + else + pushString(buf, "> "); } else if (!strncmp(token, "scripture ", 10)) { @@ -215,7 +224,7 @@ bool ThMLHTMLHREF::handleToken(char **buf, const char *token, DualStringMap &use userData["SecHead"] = "false"; } } - +/* else if (!strncmp(token, "sync type=\"Strongs\" value=\"T", 28)) { pushString(buf, ""); } +*/ else if (!strncmp(token, "img ", 4)) { const char *src = strstr(token, "src"); if (!src) // assert we have a src attribute diff --git a/src/modules/filters/thmlosis.cpp b/src/modules/filters/thmlosis.cpp index 3b50942..024c594 100644 --- a/src/modules/filters/thmlosis.cpp +++ b/src/modules/filters/thmlosis.cpp @@ -50,6 +50,7 @@ char ThMLOSIS::ProcessText(char *text, int maxlen, const SWKey *key, const SWMod bool suspendTextPassThru = false; bool keepToken = false; bool handled = false; + string divEnd = ""; len = strlen(text) + 1; // shift string to right of buffer if (len < maxlen) { @@ -93,6 +94,19 @@ char ThMLOSIS::ProcessText(char *text, int maxlen, const SWKey *key, const SWMod else break; } + // hebrew titles + if (!strcmp(token, "div class=\"sechead\"")) { + pushString(&to, ""); + divEnd = ""; + newText = true; + lastspace = false; + handled = true; + } + else if (!strcmp(token, "/div")) { + pushString(&to, divEnd.c_str()); + lastspace = false; + handled = true; + } // Scripture Reference if (!strncmp(token, "scripRef", 8)) { // pushString(buf, "