[sword-svn] r1692 - in trunk/src/modules: filters lexdict/rawld
lexdict/rawld4
scribe at crosswire.org
scribe at crosswire.org
Mon Jan 10 01:50:48 MST 2005
Author: scribe
Date: 2005-01-10 01:50:47 -0700 (Mon, 10 Jan 2005)
New Revision: 1692
Modified:
trunk/src/modules/filters/thmlrtf.cpp
trunk/src/modules/lexdict/rawld/rawld.cpp
trunk/src/modules/lexdict/rawld4/rawld4.cpp
Log:
Fix bug with uninitialized UserData members
Added support for 123[a-z] formatted strongs numbers
Modified: trunk/src/modules/filters/thmlrtf.cpp
===================================================================
--- trunk/src/modules/filters/thmlrtf.cpp 2005-01-04 04:15:19 UTC (rev 1691)
+++ trunk/src/modules/filters/thmlrtf.cpp 2005-01-10 08:50:47 UTC (rev 1692)
@@ -174,6 +174,8 @@
ThMLRTF::MyUserData::MyUserData(const SWModule *module, const SWKey *key) : BasicFilterUserData(module, key) {
+ this->SecHead = false;
+ XMLTag startTag = "";
if (module) {
version = module->Name();
BiblicalText = (!strcmp(module->Type(), "Biblical Texts"));
Modified: trunk/src/modules/lexdict/rawld/rawld.cpp
===================================================================
--- trunk/src/modules/lexdict/rawld/rawld.cpp 2005-01-04 04:15:19 UTC (rev 1691)
+++ trunk/src/modules/lexdict/rawld/rawld.cpp 2005-01-10 08:50:47 UTC (rev 1692)
@@ -44,25 +44,37 @@
/******************************************************************************
- * RawLD::strongsPad - Pads a key if it is 100% digits to 5 places
+ * RawLD::strongsPad - Pads a key if (it-1) is 100% digits to 5 places
+ * allows for final to be alpha, e.g. '123B'
*
* ENT: buf - buffer to check and pad
*/
void RawLD::strongsPad(char *buf)
{
- const char *check;
+ char *check;
int size = 0;
int len = strlen(buf);
- if ((len < 5) && (len > 0)) {
- for (check = buf; *check; check++) {
+ char subLet = 0;
+ if ((len < 6) && (len > 0)) {
+ for (check = buf; *(check+1); check++) {
if (!isdigit(*check))
break;
else size++;
}
- if ((size == len) && size)
+ if ((size == (len-1)) && size) {
+ if (isalpha(*check)) {
+ subLet = toupper(*check);
+ *check = 0;
+ }
sprintf(buf, "%.5d", atoi(buf));
+ if (subLet) {
+ check = buf+(strlen(buf));
+ *check = subLet;
+ *(check+1) = 0;
+ }
+ }
}
}
Modified: trunk/src/modules/lexdict/rawld4/rawld4.cpp
===================================================================
--- trunk/src/modules/lexdict/rawld4/rawld4.cpp 2005-01-04 04:15:19 UTC (rev 1691)
+++ trunk/src/modules/lexdict/rawld4/rawld4.cpp 2005-01-10 08:50:47 UTC (rev 1692)
@@ -44,25 +44,37 @@
/******************************************************************************
- * RawLD4::strongsPad - Pads a key if it is 100% digits to 5 places
+ * RawLD4::strongsPad - Pads a key if (it-1) is 100% digits to 5 places
+ * allows for final to be alpha, e.g. '123B'
*
* ENT: buf - buffer to check and pad
*/
-void RawLD4::strongsPad(char *buf)
+void RawLD::strongsPad(char *buf)
{
- const char *check;
- long size = 0;
+ char *check;
+ int size = 0;
int len = strlen(buf);
- if ((len < 5) && (len > 0)) {
- for (check = buf; *check; check++) {
+ char subLet = 0;
+ if ((len < 6) && (len > 0)) {
+ for (check = buf; *(check+1); check++) {
if (!isdigit(*check))
break;
else size++;
}
- if ((size == len) && size)
+ if ((size == (len-1)) && size) {
+ if (isalpha(*check)) {
+ subLet = toupper(*check);
+ *check = 0;
+ }
sprintf(buf, "%.5d", atoi(buf));
+ if (subLet) {
+ check = buf+(strlen(buf));
+ *check = subLet;
+ *(check+1) = 0;
+ }
+ }
}
}
More information about the sword-cvs
mailing list