[sword-cvs] sword/src/modules/texts/ztext ztext2.cpp,1.1,1.2
sword at www.crosswire.org
sword at www.crosswire.org
Fri May 7 10:27:16 MST 2004
Update of /cvs/core/sword/src/modules/texts/ztext
In directory www:/tmp/cvs-serv6998/src/modules/texts/ztext
Modified Files:
ztext2.cpp
Log Message:
dglassey: add option to specify how many chapters/verses/books you want in a block - 7 chapters works quite nicely
Index: ztext2.cpp
===================================================================
RCS file: /cvs/core/sword/src/modules/texts/ztext/ztext2.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- ztext2.cpp 12 Apr 2004 13:53:04 -0000 1.1
+++ ztext2.cpp 7 May 2004 17:27:14 -0000 1.2
@@ -89,7 +89,6 @@
*
* RET: buffer with verse
*/
-#if 0 // do we really want this any more
SWBuf &zText2::getRawEntryBuf() {
long start = 0;
unsigned short size = 0;
@@ -110,22 +109,33 @@
return entryBuf;
}
-#endif
bool zText2::sameBlock(VerseKey2 *k1, VerseKey2 *k2) {
switch (blockType) {
case VERSEBLOCKS:
- if (k1->Verse() != k2->Verse())
+ if ((k1->Verse() / m_idxPerBlock) != (k2->Verse() / m_idxPerBlock) ||
+ (k1->Chapter() != k2->Chapter()) || (k1->Book() != k2->Book()))
+ {
return false;
+ }
+ break;
case CHAPTERBLOCKS:
- if (k1->Chapter() != k2->Chapter())
+ if ((k1->Chapter() / m_idxPerBlock) != (k2->Chapter() / m_idxPerBlock)
+ || (k1->Book() != k2->Book()))
+ {
return false;
+ }
+ break;
case BOOKBLOCKS:
- if (k1->Book() != k2->Book())
+ if ((k1->Book() / m_idxPerBlock) != (k2->Book() / m_idxPerBlock))
+ {
return false;
+ }
+ break;
case INDEXBLOCKS:
- if ((k1->Index() % m_idxPerBlock) != (k2->Index() % m_idxPerBlock))
+ if ((k1->Index() / m_idxPerBlock) != (k2->Index() / m_idxPerBlock))
return false;
+ break;
}
return true;
}
More information about the sword-cvs
mailing list