aboutsummaryrefslogtreecommitdiffstats
path: root/src/keys/versekey.cpp
diff options
context:
space:
mode:
authordanglassey <danglassey>2002-09-04 13:01:46 +0000
committerdanglassey <danglassey>2002-09-04 13:01:46 +0000
commitd18b997ae96079d784f304dd08dac70ee6bf0e7d (patch)
treeb1d9410e9685f967709b9e52f4e63a9a895ed798 /src/keys/versekey.cpp
parentdcf385382e6112b945452da8ef7fedd63f9624b3 (diff)
downloadsword-sf-cvs-d18b997ae96079d784f304dd08dac70ee6bf0e7d.tar.gz
sync with crosswire 20020904-1300
Diffstat (limited to 'src/keys/versekey.cpp')
-rw-r--r--src/keys/versekey.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/keys/versekey.cpp b/src/keys/versekey.cpp
index 8773298..3b8da18 100644
--- a/src/keys/versekey.cpp
+++ b/src/keys/versekey.cpp
@@ -55,6 +55,7 @@ void VerseKey::init() {
headings = 0; // default display headings option is false
upperBound = 0;
lowerBound = 0;
+ boundSet = false;
testament = 0;
book = 0;
chapter = 0;
@@ -103,8 +104,10 @@ VerseKey::VerseKey(VerseKey const &k) : SWKey(k)
book = k.Book();
chapter = k.Chapter();
verse = k.Verse();
- LowerBound(k.LowerBound());
- UpperBound(k.UpperBound());
+ if (k.isBoundSet()) {
+ LowerBound(k.LowerBound());
+ UpperBound(k.UpperBound());
+ }
}
@@ -719,7 +722,7 @@ VerseKey &VerseKey::LowerBound(const char *lb)
(*lowerBound) = lb;
lowerBound->Normalize();
lowerBound->setLocale( this->getLocale() );
-
+ boundSet = true;
return (*lowerBound);
}
@@ -760,7 +763,7 @@ VerseKey &VerseKey::UpperBound(const char *ub)
// -- end kludge
-
+ boundSet = true;
return (*upperBound);
}
@@ -823,6 +826,7 @@ void VerseKey::initBounds() const
upperBound->Book(BMAX[1]);
upperBound->Chapter(books[1][BMAX[1]-1].chapmax);
upperBound->Verse(books[1][BMAX[1]-1].versemax[upperBound->Chapter()-1]);
+ boundSet = false;
}
@@ -1466,9 +1470,9 @@ const char *VerseKey::getOSISRef() const {
*/
const char *VerseKey::getRangeText() const {
- if ((upperBound) && (lowerBound)) {
+ if (isBoundSet()) {
char buf[1023];
- sprintf(buf, "%s-%s", (const char *)lowerBound, (const char *)upperBound);
+ sprintf(buf, "%s-%s", (const char *)LowerBound(), (const char *)UpperBound());
stdstr(&rangeText, buf);
}
else stdstr(&rangeText, getText());