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/teirtf.cpp | |
parent | c7dbdc9161a7c460526b80fe01af49d714856126 (diff) |
New upstream version 1.8.1
Diffstat (limited to 'src/modules/filters/teirtf.cpp')
-rw-r--r-- | src/modules/filters/teirtf.cpp | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/src/modules/filters/teirtf.cpp b/src/modules/filters/teirtf.cpp index 1213221..0871270 100644 --- a/src/modules/filters/teirtf.cpp +++ b/src/modules/filters/teirtf.cpp @@ -2,7 +2,7 @@ * * teirtf.cpp - TEI to RTF filter * - * $Id: teirtf.cpp 3160 2014-04-17 04:02:17Z greg.hellings $ + * $Id: teirtf.cpp 3548 2017-12-10 05:11:38Z scribe $ * * Copyright 2006-2013 CrossWire Bible Society (http://www.crosswire.org) * CrossWire Bible Society @@ -31,11 +31,11 @@ SWORD_NAMESPACE_START TEIRTF::MyUserData::MyUserData(const SWModule *module, const SWKey *key) : BasicFilterUserData(module, key) { - BiblicalText = false; + isBiblicalText = false; inOsisRef = false; if (module) { version = module->getName(); - BiblicalText = (!strcmp(module->getType(), "Biblical Texts")); + isBiblicalText = (!strcmp(module->getType(), "Biblical Texts")); } } @@ -170,13 +170,7 @@ bool TEIRTF::handleToken(SWBuf &buf, const char *token, BasicFilterUserData *use SWBuf type = tag.getAttribute("type"); SWBuf footnoteNumber = tag.getAttribute("swordFootnote"); - VerseKey *vkey = 0; - // see if we have a VerseKey * or descendant - SWTRY { - vkey = SWDYNAMIC_CAST(VerseKey, u->key); - } - SWCATCH ( ... ) { } - if (vkey) { + if (u->vkey) { buf.appendFormatted("{\\super <a href=\"\">*%s</a>} ", footnoteNumber.c_str()); } u->suspendTextPassThru = true; @@ -205,6 +199,22 @@ bool TEIRTF::handleToken(SWBuf &buf, const char *token, BasicFilterUserData *use } } + else if (!strcmp(tag.getName(), "graphic")) { + const char *src = tag.getAttribute("url"); + if (!src) // assert we have a src attribute + return false; + + char* filepath = new char[strlen(u->module->getConfigEntry("AbsoluteDataPath")) + strlen(token)]; + *filepath = 0; + strcpy(filepath, userData->module->getConfigEntry("AbsoluteDataPath")); + strcat(filepath, src); + +// we do this because BibleCS looks for this EXACT format for an image tag + buf += "<img src=\""; + buf += filepath; + buf += "\" />"; + delete [] filepath; + } else { return false; // we still didn't handle token |