[sword-svn] r80 - in trunk/src: . gui simplegui

dtrotzjr at www.crosswire.org dtrotzjr at www.crosswire.org
Fri Dec 28 00:20:10 MST 2007


Author: dtrotzjr
Date: 2007-12-28 00:20:09 -0700 (Fri, 28 Dec 2007)
New Revision: 80

Modified:
   trunk/src/SwRd.vcb
   trunk/src/SwRd.vco
   trunk/src/gui/SwordIndex.cpp
   trunk/src/gui/SwordIndex.h
   trunk/src/gui/Utils.cpp
   trunk/src/gui/Utils.h
   trunk/src/simplegui/simplegui.vcp
Log:
Fixed - Bug where we were improperly caching the book number in SwordIndex, but not always updating it when the VerseKey reference was changed. Removed variable 'book' from SwordIndex altogether.

Modified: trunk/src/SwRd.vcb
===================================================================
(Binary files differ)

Modified: trunk/src/SwRd.vco
===================================================================
(Binary files differ)

Modified: trunk/src/gui/SwordIndex.cpp
===================================================================
--- trunk/src/gui/SwordIndex.cpp	2007-12-24 12:44:55 UTC (rev 79)
+++ trunk/src/gui/SwordIndex.cpp	2007-12-28 07:20:09 UTC (rev 80)
@@ -43,7 +43,7 @@
 		verse->Persist(1);
 		mark=new sword::VerseKey("Gen 1:1");
 		mark->Persist(1);
-		book=1;
+		//book=1;
 		setModule(texts->begin()->second);
 	}
 	else
@@ -112,7 +112,7 @@
 }
 
 void SwordIndex::setBook(int book) {
-	this->book=book;
+	//this->book=book;
 	if (book<=otBookCount()) {
 		verse->Testament(1);
 		verse->Book((char)book);
@@ -137,7 +137,7 @@
 }
 
 int SwordIndex::chapCount() {
-	return getBook(book).chapmax;
+	return getBook(verse->Testament() == 1 ? verse->Book() : otBookCount() + verse->Book() /*book*/).chapmax;
 }
 
 void SwordIndex::setChap(int chap) {
@@ -148,8 +148,9 @@
 	return verse->Chapter();
 }
 
+
 int SwordIndex::verseCount() {
-	return getBook(book).versemax[verse->Chapter()-1];
+	return getBook(verse->Testament() == 1 ? verse->Book() : otBookCount() + verse->Book() /*book*/).versemax[verse->Chapter()-1];
 }
 
 void SwordIndex::setVerse(int verse) {

Modified: trunk/src/gui/SwordIndex.h
===================================================================
--- trunk/src/gui/SwordIndex.h	2007-12-24 12:44:55 UTC (rev 79)
+++ trunk/src/gui/SwordIndex.h	2007-12-28 07:20:09 UTC (rev 80)
@@ -53,7 +53,7 @@
 
 	sword::VerseKey* mark;
 
-	int book;
+	//int book;
 
 	TCHAR** bookNames;
 public:
@@ -94,7 +94,7 @@
 	static int bookCount() {return 66;};
 
 	void setBook(int book);
-	int getBook() const {return book;};
+	int getBook() const {return (verse->Testament() == 1 ? verse->Book() : otBookCount() + verse->Book() /*book*/) - 1;};
 
 	int chapCount();
 	int maxChapCount() {return 150;};

Modified: trunk/src/gui/Utils.cpp
===================================================================
--- trunk/src/gui/Utils.cpp	2007-12-24 12:44:55 UTC (rev 79)
+++ trunk/src/gui/Utils.cpp	2007-12-28 07:20:09 UTC (rev 80)
@@ -56,4 +56,22 @@
 
 bool inPortraitMode(){
 	return GetSystemMetrics(SM_CXSCREEN) <= GetSystemMetrics(SM_CYSCREEN);
-}
\ No newline at end of file
+}
+
+void LOGIT(const char *msg)
+{
+#ifdef __DEBUG__
+  FILE *fp2 = fopen("\\Storage Card\\Program Files\\sword\\init_log.txt", "a");
+  fprintf(fp2, msg);
+  fclose(fp2);
+#endif // __DEBUG__
+}
+
+void LOGIT(const char *msg, int i)
+{
+#ifdef __DEBUG__
+  FILE *fp2 = fopen("\\Storage Card\\Program Files\\sword\\init_log.txt", "a");
+  fprintf(fp2, msg, i);
+  fclose(fp2);
+#endif // __DEBUG__
+}

Modified: trunk/src/gui/Utils.h
===================================================================
--- trunk/src/gui/Utils.h	2007-12-24 12:44:55 UTC (rev 79)
+++ trunk/src/gui/Utils.h	2007-12-28 07:20:09 UTC (rev 80)
@@ -27,4 +27,7 @@
 
 bool inPortraitMode();
 
+void LOGIT(const char *msg, int i);
+void LOGIT(const char *msg);
+
 #endif

Modified: trunk/src/simplegui/simplegui.vcp
===================================================================
--- trunk/src/simplegui/simplegui.vcp	2007-12-24 12:44:55 UTC (rev 79)
+++ trunk/src/simplegui/simplegui.vcp	2007-12-28 07:20:09 UTC (rev 80)
@@ -188,7 +188,6 @@
 	"..\gui\Utils.h"\
 	{$(INCLUDE)}"aygshell.h"\
 	{$(INCLUDE)}"sipapi.h"\
-	{$(INCLUDE)}"vibrate.h"\
 	
 
 !ELSEIF  "$(CFG)" == "simplegui - Win32 (WCE ARM) Debug"
@@ -262,6 +261,7 @@
 	"..\..\..\sword\include\versekey.h"\
 	"..\..\..\sword\include\ztext.h"\
 	"..\..\..\sword\include\zverse.h"\
+	"..\Dll1\winceSword\include\swordce.h"\
 	"..\gui\ApplicationInterface.h"\
 	"..\gui\Main.h"\
 	"..\gui\Navigator.h"\
@@ -272,7 +272,6 @@
 	{$(INCLUDE)}"aygshell.h"\
 	{$(INCLUDE)}"htmlctrl.h"\
 	{$(INCLUDE)}"sipapi.h"\
-	{$(INCLUDE)}"vibrate.h"\
 	
 
 !ELSEIF  "$(CFG)" == "simplegui - Win32 (WCE ARM) Debug"
@@ -723,7 +722,6 @@
 	"..\gui\Utils.h"\
 	{$(INCLUDE)}"aygshell.h"\
 	{$(INCLUDE)}"sipapi.h"\
-	{$(INCLUDE)}"vibrate.h"\
 	
 
 !ELSEIF  "$(CFG)" == "simplegui - Win32 (WCE ARM) Debug"
@@ -1008,6 +1006,8 @@
 	"..\gui\TextControl.h"\
 	"..\gui\Utils.h"\
 	"..\gui\VerseTextControl.h"\
+	{$(INCLUDE)}"aygshell.h"\
+	{$(INCLUDE)}"sipapi.h"\
 	
 
 !ELSEIF  "$(CFG)" == "simplegui - Win32 (WCE ARM) Debug"
@@ -1823,6 +1823,18 @@
 # End Source File
 # Begin Source File
 
+SOURCE=..\gui\bitmap1.bmp
+# End Source File
+# Begin Source File
+
+SOURCE=..\gui\search.bmp
+# End Source File
+# Begin Source File
+
+SOURCE=..\gui\search.ico
+# End Source File
+# Begin Source File
+
 SOURCE=.\simplegui.rc
 
 !IF  "$(CFG)" == "simplegui - Win32 (WCE ARM) Release"




More information about the sword-cvs mailing list