summaryrefslogtreecommitdiff
path: root/src/modules/filters/osisosis.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/filters/osisosis.cpp')
-rw-r--r--src/modules/filters/osisosis.cpp68
1 files changed, 38 insertions, 30 deletions
diff --git a/src/modules/filters/osisosis.cpp b/src/modules/filters/osisosis.cpp
index 7da6089..82a6bfc 100644
--- a/src/modules/filters/osisosis.cpp
+++ b/src/modules/filters/osisosis.cpp
@@ -1,17 +1,24 @@
/***************************************************************************
- osisosis.cpp - internal OSIS to public OSIS filter
- -------------------
- begin : 2004-03-13
- copyright : 2003 by CrossWire Bible Society
- ***************************************************************************/
-
-/***************************************************************************
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation version 2 of the License.
- * *
- ***************************************************************************/
+ * osisosis.cpp - internal OSIS to public OSIS filter
+ * -------------------
+ * begin : 2004-03-13
+ * copyright : 2003 by CrossWire Bible Society
+ *
+ * Copyright 2009 CrossWire Bible Society (http://www.crosswire.org)
+ * CrossWire Bible Society
+ * P. O. Box 2528
+ * Tempe, AZ 85280-2528
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation version 2.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ */
#include <stdlib.h>
#include <osisosis.h>
@@ -55,33 +62,34 @@ char OSISOSIS::processText(SWBuf &text, const SWKey *key, const SWModule *module
if (vkey->Verse()) {
ref.appendFormatted("\t\t<verse osisID=\"%s\">", vkey->getOSISRef());
}
-
+
if (ref.length() > 0) {
-
+
text = ref + text;
-
+
if (vkey->Verse()) {
- VerseKey tmp;
- tmp = *vkey;
- tmp.AutoNormalize(0);
- tmp.Headings(1);
-
+ VerseKey *tmp = (VerseKey *)vkey->clone();
+ *tmp = *vkey;
+ tmp->AutoNormalize(0);
+ tmp->Headings(1);
+
text += "</verse>";
-
- tmp = MAXVERSE;
- if (*vkey == tmp) {
- tmp.Verse(0);
+
+ *tmp = MAXVERSE;
+ if (*vkey == *tmp) {
+ tmp->Verse(0);
// sprintf(ref, "\t</div>");
// pushString(&to, ref);
- tmp = MAXCHAPTER;
- tmp = MAXVERSE;
- if (*vkey == tmp) {
- tmp.Chapter(0);
- tmp.Verse(0);
+ *tmp = MAXCHAPTER;
+ *tmp = MAXVERSE;
+ if (*vkey == *tmp) {
+ tmp->Chapter(0);
+ tmp->Verse(0);
// sprintf(ref, "\t</div>");
// pushString(&to, ref);
}
}
+ delete tmp;
}
//