[sword-svn] r504 - branches/BCB5
scribe at crosswire.org
scribe at crosswire.org
Sat Oct 3 15:11:09 MST 2009
Author: scribe
Date: 2009-10-03 15:11:09 -0700 (Sat, 03 Oct 2009)
New Revision: 504
Modified:
branches/BCB5/mainfrm.cpp
branches/BCB5/mainfrm.h
Log:
Fixed a navigation bug.
Modified: branches/BCB5/mainfrm.cpp
===================================================================
--- branches/BCB5/mainfrm.cpp 2009-07-04 02:37:27 UTC (rev 503)
+++ branches/BCB5/mainfrm.cpp 2009-10-03 22:11:09 UTC (rev 504)
@@ -53,16 +53,14 @@
char RTFVerseKeyDisp::Display(SWModule &imodule) {
SWKey *k = imodule.getKey();
VerseKey *vk = SWDYNAMIC_CAST(VerseKey, k);
- if (last != vk) {
+ VerseKey *last = Form1->getActiveVerseKey(false);
+ if (vk != last) {
if (last) vk->positionFrom(*last);
Form1->fillVKeySelector(vk);
- last = vk;
}
return RTFDisp::Display(imodule);
}
-VerseKey *RTFVerseKeyDisp::last = 0;
-
/*
inline AnsiString& operator=(AnsiString& dest, const string& src) {
dest = src.c_str();
@@ -463,12 +461,14 @@
}
-VerseKey *TForm1::getActiveVerseKey() {
+VerseKey *TForm1::getActiveVerseKey(bool checkFocusChange) {
static VerseKey *retVal = 0;
- SWModule *module = getFocusedModule();
- SWKey *key = module->getKey();
- VerseKey *vk = SWDYNAMIC_CAST(VerseKey, key);
- if (vk) retVal = vk;
+ if (checkFocusChange) {
+ SWModule *module = getFocusedModule();
+ SWKey *key = module->getKey();
+ VerseKey *vk = SWDYNAMIC_CAST(VerseKey, key);
+ if (vk) retVal = vk;
+ }
return retVal;
}
@@ -643,7 +643,7 @@
hasNonCap = true;
}
}
-
+
for (int i = 1; i <= len; i++) {
if (hasDigit && !hasAlpha) { // number
if (isdigit(src[i])) retVal += (WideString)src[i];
Modified: branches/BCB5/mainfrm.h
===================================================================
--- branches/BCB5/mainfrm.h 2009-07-04 02:37:27 UTC (rev 503)
+++ branches/BCB5/mainfrm.h 2009-10-03 22:11:09 UTC (rev 504)
@@ -106,7 +106,6 @@
class RTFVerseKeyDisp : public RTFDisp {
SWDispRTF *edit;
- static VerseKey *last;
public:
RTFVerseKeyDisp(SWDispRTF *iedit) : RTFDisp(iedit) {}
RTFVerseKeyDisp() {}
@@ -431,7 +430,7 @@
SWModule *getActiveModule(TRxRichEdit *rtf = 0);
void updateModuleOptions(TMenuItem *parentItem, int staticMenuItemsCount = 1);
SWModule *getFocusedModule();
- VerseKey *getActiveVerseKey();
+ VerseKey *getActiveVerseKey(bool checkFocusChange = true);
void fillVKeySelector(VerseKey *vk);
};
More information about the sword-cvs
mailing list