diff options
Diffstat (limited to 'apps/windoze/CBuilder5/BibleCS/RxRichEditX.cpp')
-rw-r--r-- | apps/windoze/CBuilder5/BibleCS/RxRichEditX.cpp | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/apps/windoze/CBuilder5/BibleCS/RxRichEditX.cpp b/apps/windoze/CBuilder5/BibleCS/RxRichEditX.cpp index 94fdf62..b10ed36 100644 --- a/apps/windoze/CBuilder5/BibleCS/RxRichEditX.cpp +++ b/apps/windoze/CBuilder5/BibleCS/RxRichEditX.cpp @@ -444,6 +444,7 @@ void TRxRichEditX::fillWithVerses(SWModule *module, ListKey *verses, bool headin } verses->Persist(1); + (*verses) = TOP; SWKey *saveKey = (*module); if (!saveKey->Persist()) saveKey = 0; @@ -451,7 +452,7 @@ void TRxRichEditX::fillWithVerses(SWModule *module, ListKey *verses, bool headin SWKey *lastKey = 0; bool first = true; - while (!module->Error() && newtext.Length() < 10000 ) { + while (verses->Count() && !module->Error() && newtext.Length() < 10000 ) { SWKey *testKey = verses->GetElement(); VerseKey *element = SWDYNAMIC_CAST(VerseKey, testKey); if (heading) { @@ -467,11 +468,25 @@ void TRxRichEditX::fillWithVerses(SWModule *module, ListKey *verses, bool headin } } else { + char *buf2 = 0; + stdstr(&buf2, (const char *)*verses); + module->getRawEntry(); + strcpy(buf, module->KeyText()); + int i; + for (i = 0; i < strlen(buf2); i++) { + if (buf[i] != buf2[i]) + break; + } + if (!i || i < (strlen(buf2)/2)) { + delete [] buf2; + verses->Remove(); + continue; + } + delete [] buf2; if (!first) newtext += "\\par\\par "; newtext += RTFHeadingPre; - - strcpy(buf, module->KeyText()); + SWKey *key = *module; // VerseKey locales are not yet UTF8, so don't try to convert them. if (!SWDYNAMIC_CAST(VerseKey, key)) @@ -626,6 +641,7 @@ void TRxRichEditX::getDisplayPrefs(DISP_ATTRIBS *attribs, SWModule *module /*, c void TRxRichEditX::recalcAppearance() { + static UnicodeRTF filter; char buf[4096]; getDisplayPrefs(&dispAttribs, module /*, type.c_str()*/); @@ -650,10 +666,13 @@ void TRxRichEditX::recalcAppearance() { (int)(fontBase * 8)); RTFTrailer = buf; - const char *chap = _tr("Chapter"); + char chapBuf[1024]; + strcpy(chapBuf, _tr("Chapter")); + filter.ProcessText(chapBuf, 1022, *module, module); + sprintf(buf, "\\pard \\qc\\nowidctlpar{\\f1\\cf7\\fs%d\\b %s ", - (int)(fontBase * 10), chap); + (int)(fontBase * 10), chapBuf); RTFChapterMarkPre = buf; sprintf(buf, |