[sword-svn] r2793 - trunk/src/keys

scribe at crosswire.org scribe at crosswire.org
Thu Mar 21 15:40:44 MST 2013


Author: scribe
Date: 2013-03-21 15:40:44 -0700 (Thu, 21 Mar 2013)
New Revision: 2793

Modified:
   trunk/src/keys/versekey.cpp
Log:
added skip of verse and chapter max lookup if book = 0 (intro)


Modified: trunk/src/keys/versekey.cpp
===================================================================
--- trunk/src/keys/versekey.cpp	2013-03-16 23:20:35 UTC (rev 2792)
+++ trunk/src/keys/versekey.cpp	2013-03-21 22:40:44 UTC (rev 2793)
@@ -1234,11 +1234,13 @@
 }
 
 int VerseKey::getChapterMax() const {
+	if (book < 1) return 0;
 	const VersificationMgr::Book *b = refSys->getBook(((testament>1)?BMAX[0]:0)+book-1);
 	return (b) ? b->getChapterMax() : -1;
 }
 
 int VerseKey::getVerseMax() const {
+	if (book < 1) return 0;
 	const VersificationMgr::Book *b = refSys->getBook(((testament>1)?BMAX[0]:0)+book-1);
 	return (b) ? b->getVerseMax(chapter) : -1;
 }




More information about the sword-cvs mailing list