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

scribe at www.crosswire.org scribe at www.crosswire.org
Mon Feb 4 18:37:26 MST 2008


Author: scribe
Date: 2008-02-04 18:37:25 -0700 (Mon, 04 Feb 2008)
New Revision: 2135

Modified:
   trunk/src/keys/versekey.cpp
Log:
handle out of order ranges (e.g. jn1.7-2)


Modified: trunk/src/keys/versekey.cpp
===================================================================
--- trunk/src/keys/versekey.cpp	2008-01-31 06:06:00 UTC (rev 2134)
+++ trunk/src/keys/versekey.cpp	2008-02-05 01:37:25 UTC (rev 2135)
@@ -631,7 +631,13 @@
 								curKey = MAXCHAPTER;
 							if (partial > 0)
 								curKey = MAXVERSE;
-							newElement->UpperBound(curKey);
+							if (newElement->LowerBound() > curKey) {
+								newElement->UpperBound(newElement->LowerBound());
+								newElement->LowerBound(curKey);
+							}
+							else {
+								newElement->UpperBound(curKey);
+							}
 							*newElement = TOP;
 							tmpListKey.GetElement()->userData = (void *)buf;
 						}
@@ -816,7 +822,13 @@
 						curKey = MAXCHAPTER;
 					if (partial > 0)
 						curKey = MAXVERSE;
-					newElement->UpperBound(curKey);
+					if (newElement->LowerBound() > curKey) {
+						newElement->UpperBound(newElement->LowerBound());
+						newElement->LowerBound(curKey);
+					}
+					else {
+						newElement->UpperBound(curKey);
+					}
 					*newElement = TOP;
 					tmpListKey.GetElement()->userData = (void *)buf;
 				}




More information about the sword-cvs mailing list