diff options
author | Teus Benschop <teusjannette@gmail.com> | 2018-10-28 11:51:26 +0100 |
---|---|---|
committer | Teus Benschop <teusjannette@gmail.com> | 2018-10-28 11:51:26 +0100 |
commit | 1d0ff54794b5edea7cdf1d2d66710a0fa885bcc5 (patch) | |
tree | 8ece5f9ef437fbb151f2b22ed0c6e1a714879c7c /src/modules/filters/osisrtf.cpp | |
parent | c7dbdc9161a7c460526b80fe01af49d714856126 (diff) |
New upstream version 1.8.1
Diffstat (limited to 'src/modules/filters/osisrtf.cpp')
-rw-r--r-- | src/modules/filters/osisrtf.cpp | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/src/modules/filters/osisrtf.cpp b/src/modules/filters/osisrtf.cpp index 7bc5639..522a0a8 100644 --- a/src/modules/filters/osisrtf.cpp +++ b/src/modules/filters/osisrtf.cpp @@ -2,7 +2,7 @@ * * osisrtf.cpp - OSIS to RTF filter * - * $Id: osisrtf.cpp 3156 2014-04-17 03:50:37Z greg.hellings $ * + * $Id: osisrtf.cpp 3548 2017-12-10 05:11:38Z scribe $ * * * Copyright 2003-2014 CrossWire Bible Society (http://www.crosswire.org) * CrossWire Bible Society @@ -36,7 +36,7 @@ namespace { class MyUserData : public BasicFilterUserData { public: bool osisQToTick; - bool BiblicalText; + bool isBiblicalText; bool inXRefNote; int suspendLevel; std::stack<char *> quoteStack; @@ -49,13 +49,14 @@ namespace { MyUserData::MyUserData(const SWModule *module, const SWKey *key) : BasicFilterUserData(module, key) { inXRefNote = false; - BiblicalText = false; + isBiblicalText = false; suspendLevel = 0; + osisQToTick = true; // default if (module) { version = module->getName(); - BiblicalText = (!strcmp(module->getType(), "Biblical Texts")); + isBiblicalText = (!strcmp(module->getType(), "Biblical Texts")); + osisQToTick = ((!module->getConfigEntry("OSISqToTick")) || (strcmp(module->getConfigEntry("OSISqToTick"), "false"))); } - osisQToTick = ((!module->getConfigEntry("OSISqToTick")) || (strcmp(module->getConfigEntry("OSISqToTick"), "false"))); } @@ -244,15 +245,9 @@ bool OSISRTF::handleToken(SWBuf &buf, const char *token, BasicFilterUserData *us && (type != "strongsMarkup") // deprecated ) { SWBuf footnoteNumber = tag.getAttribute("swordFootnote"); - VerseKey *vkey = NULL; - // see if we have a VerseKey * or descendant - SWTRY { - vkey = SWDYNAMIC_CAST(VerseKey, u->key); - } - SWCATCH ( ... ) { } - if (vkey) { + if (u->vkey) { char ch = ((!strcmp(type.c_str(), "crossReference")) || (!strcmp(type.c_str(), "x-cross-ref"))) ? 'x':'n'; - scratch.setFormatted("{\\super <a href=\"\">*%c%i.%s</a>} ", ch, vkey->getVerse(), footnoteNumber.c_str()); + scratch.setFormatted("{\\super <a href=\"\">*%c%i.%s</a>} ", ch, u->vkey->getVerse(), footnoteNumber.c_str()); outText(scratch.c_str(), buf, u); u->inXRefNote = (ch == 'x'); } |