diff options
author | Roberto C. Sanchez <roberto@connexer.com> | 2014-05-12 08:21:30 -0400 |
---|---|---|
committer | Roberto C. Sanchez <roberto@connexer.com> | 2014-05-12 08:21:30 -0400 |
commit | 7a00574163029c0c2b649878c95d5acbd083564a (patch) | |
tree | c13cc5736025834df2874ed87ee8598070025ea6 /src/modules/filters/osisrtf.cpp | |
parent | b745315323de9f27538edac9453205ca70e6186e (diff) |
Imported Upstream version 1.7.2+dfsg
Diffstat (limited to 'src/modules/filters/osisrtf.cpp')
-rw-r--r-- | src/modules/filters/osisrtf.cpp | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/src/modules/filters/osisrtf.cpp b/src/modules/filters/osisrtf.cpp index b8cf30c..291aa08 100644 --- a/src/modules/filters/osisrtf.cpp +++ b/src/modules/filters/osisrtf.cpp @@ -1,11 +1,10 @@ /*************************************************************************** - * osisrtf.cpp - OSIS to RTF filter - * ------------------- - * begin : 2003-02-15 - * copyright : 2003 by CrossWire Bible Society * + * osisrtf.cpp - OSIS to RTF filter * - * Copyright 2009 CrossWire Bible Society (http://www.crosswire.org) + * $Id: osisrtf.cpp 3005 2014-01-09 04:06:11Z greg.hellings $ * + * + * Copyright 2003-2013 CrossWire Bible Society (http://www.crosswire.org) * CrossWire Bible Society * P. O. Box 2528 * Tempe, AZ 85280-2528 @@ -53,8 +52,8 @@ namespace { BiblicalText = false; suspendLevel = 0; if (module) { - version = module->Name(); - BiblicalText = (!strcmp(module->Type(), "Biblical Texts")); + version = module->getName(); + BiblicalText = (!strcmp(module->getType(), "Biblical Texts")); } osisQToTick = ((!module->getConfigEntry("OSISqToTick")) || (strcmp(module->getConfigEntry("OSISqToTick"), "false"))); } @@ -68,9 +67,11 @@ namespace { delete [] tagData; } } -static inline void outText(const char *t, SWBuf &o, BasicFilterUserData *u) { if (!u->suspendTextPassThru) o += t; else u->lastSuspendSegment += t; } -static inline void outText(char t, SWBuf &o, BasicFilterUserData *u) { if (!u->suspendTextPassThru) o += t; else u->lastSuspendSegment += t; } -}; + + static inline void outText(const char *t, SWBuf &o, BasicFilterUserData *u) { if (!u->suspendTextPassThru) o += t; else u->lastSuspendSegment += t; } + static inline void outText(char t, SWBuf &o, BasicFilterUserData *u) { if (!u->suspendTextPassThru) o += t; else u->lastSuspendSegment += t; } + +} OSISRTF::OSISRTF() { @@ -251,7 +252,7 @@ bool OSISRTF::handleToken(SWBuf &buf, const char *token, BasicFilterUserData *us SWCATCH ( ... ) { } if (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->Verse(), footnoteNumber.c_str()); + scratch.setFormatted("{\\super <a href=\"\">*%c%i.%s</a>} ", ch, vkey->getVerse(), footnoteNumber.c_str()); outText(scratch.c_str(), buf, u); u->inXRefNote = (ch == 'x'); } @@ -325,7 +326,7 @@ bool OSISRTF::handleToken(SWBuf &buf, const char *token, BasicFilterUserData *us } // <milestone type="line"/> or <lb.../> - else if ((!strcmp(tag.getName(), "lb")) || ((!strcmp(tag.getName(), "milestone")) && (tag.getAttribute("type")) && (!strcmp(tag.getAttribute("type"), "line")))) { + else if ((!strcmp(tag.getName(), "lb") && (!tag.getAttribute("type") || strcmp(tag.getAttribute("type"), "x-optional"))) || ((!strcmp(tag.getName(), "milestone")) && (tag.getAttribute("type")) && (!strcmp(tag.getAttribute("type"), "line")))) { outText("{\\par}", buf, u); userData->supressAdjacentWhitespace = true; } |