From 2cccf0ee964afca56e9fb6b532ab9f863fc6091f Mon Sep 17 00:00:00 2001 From: danglassey Date: Sun, 29 Sep 2002 13:01:33 +0000 Subject: sync with crosswire 20020929-1300 --- src/modules/comments/rawcom/rawcom.cpp | 2 ++ src/modules/comments/swcom.cpp | 38 ++++++++++++++++++++++++++++++++++ src/modules/texts/swtext.cpp | 38 ++++++++++++++++++++++++++++++++++ 3 files changed, 78 insertions(+) (limited to 'src/modules') diff --git a/src/modules/comments/rawcom/rawcom.cpp b/src/modules/comments/rawcom/rawcom.cpp index 0f5396b..8d789af 100644 --- a/src/modules/comments/rawcom/rawcom.cpp +++ b/src/modules/comments/rawcom/rawcom.cpp @@ -221,3 +221,5 @@ void RawCom::deleteEntry() { if (key != this->key) delete key; } + + diff --git a/src/modules/comments/swcom.cpp b/src/modules/comments/swcom.cpp index 1feb0cf..21afd8e 100644 --- a/src/modules/comments/swcom.cpp +++ b/src/modules/comments/swcom.cpp @@ -28,3 +28,41 @@ SWCom::SWCom(const char *imodname, const char *imoddesc, SWDisplay *idisp, SWTex SWCom::~SWCom() { } + + +long SWCom::Index() const { + VerseKey *key = 0; + try { + key = SWDYNAMIC_CAST(VerseKey, this->key); + } + catch ( ... ) {} + if (!key) + key = new VerseKey(this->key); + + entryIndex = key->NewIndex(); + + if (key != this->key) + delete key; + + return entryIndex; +} + +long SWCom::Index(long iindex) { + VerseKey *key = 0; + try { + key = SWDYNAMIC_CAST(VerseKey, this->key); + } + catch ( ... ) {} + if (!key) + key = new VerseKey(this->key); + + key->Testament(1); + key->Index(iindex); + + if (key != this->key) { + this->key->copyFrom(*key); + delete key; + } + + return Index(); +} diff --git a/src/modules/texts/swtext.cpp b/src/modules/texts/swtext.cpp index 5f6b424..dc8ea43 100644 --- a/src/modules/texts/swtext.cpp +++ b/src/modules/texts/swtext.cpp @@ -38,3 +38,41 @@ SWKey *SWText::CreateKey() { return new VerseKey(); } + + +long SWText::Index() const { + VerseKey *key = 0; + try { + key = SWDYNAMIC_CAST(VerseKey, this->key); + } + catch ( ... ) {} + if (!key) + key = new VerseKey(this->key); + + entryIndex = key->NewIndex(); + + if (key != this->key) + delete key; + + return entryIndex; +} + +long SWText::Index(long iindex) { + VerseKey *key = 0; + try { + key = SWDYNAMIC_CAST(VerseKey, this->key); + } + catch ( ... ) {} + if (!key) + key = new VerseKey(this->key); + + key->Testament(1); + key->Index(iindex); + + if (key != this->key) { + this->key->copyFrom(*key); + delete key; + } + + return Index(); +} -- cgit