aboutsummaryrefslogtreecommitdiffstats
path: root/apps/windoze/CBuilder5/BibleCS/RxRichEditX.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'apps/windoze/CBuilder5/BibleCS/RxRichEditX.cpp')
-rw-r--r--apps/windoze/CBuilder5/BibleCS/RxRichEditX.cpp39
1 files changed, 32 insertions, 7 deletions
diff --git a/apps/windoze/CBuilder5/BibleCS/RxRichEditX.cpp b/apps/windoze/CBuilder5/BibleCS/RxRichEditX.cpp
index c23638f..1fa4976 100644
--- a/apps/windoze/CBuilder5/BibleCS/RxRichEditX.cpp
+++ b/apps/windoze/CBuilder5/BibleCS/RxRichEditX.cpp
@@ -452,7 +452,7 @@ void TRxRichEditX::fillWithVerses(SWModule *module, ListKey *verses, bool headin
SWKey *lastKey = 0;
bool first = true;
- while (verses->Count() && !module->Error() && newtext.Length() < 10000 ) {
+ while (verses->Count() && !module->Error() && newtext.Length() < 40000 ) {
SWKey *testKey = verses->GetElement();
VerseKey *element = SWDYNAMIC_CAST(VerseKey, testKey);
if (heading) {
@@ -475,17 +475,22 @@ void TRxRichEditX::fillWithVerses(SWModule *module, ListKey *verses, bool headin
strcpy(buf, module->KeyText());
toupperstr_utf8(buf);
int i;
+ char *start1 = buf;
+ char *start2 = buf2;
for (i = 0; i < strlen(buf); i++) {
- if ((buf[i] == buf2[i]) || (buf[i] != '0'))
+ if (*start1 == '0')
+ start1++;
+ if (*start2 == '0')
+ start2++;
+ if ((*start1 != '0') && (*start2 != '0')) if ((buf[i] == buf2[i]) || (buf[i] != '0'))
break;
}
- char *buf3 = buf+i;
- for (i = 0; i < strlen(buf2) && (i < strlen(buf3)); i++) {
- if ((buf3[i] != buf2[i]) &&
- (SW_toupper(buf3[i]) != SW_toupper(buf2[i])))
+ for (i = 0; i < strlen(start1) && (i < strlen(start2)); i++) {
+ if ((start1[i] != start2[i]) &&
+ (SW_toupper(start1[i]) != SW_toupper(start2[i])))
break;
}
- if (!i || i < (strlen(buf2)/2)) {
+ if (!i || i < (strlen(start1)/2)) {
delete [] buf2;
verses->Remove();
continue;
@@ -888,6 +893,26 @@ WideString __fastcall TRxRichEditX::WordAtCursor(void) {
break;
}
}
+ int start = 1;
+ int end = Result.Length();
+ if (end) {
+ if (strchr(",", Result[end]))
+ end--;
+ if (strchr(",", Result[start]))
+ start++;
+ // see if we're a verse number
+ if (isdigit(Result[start]) && (end > 3)) {
+ if (isalpha(Result[start+3])) {
+ start++;
+ if (isdigit(Result[start]))
+ start++;
+ if (isdigit(Result[start]))
+ start++;
+ }
+ }
+ Result = Result.SubString(start, end-(start-1));
+ }
+
return Result;
}