diff options
author | danglassey <danglassey> | 2002-09-29 13:01:33 +0000 |
---|---|---|
committer | danglassey <danglassey> | 2002-09-29 13:01:33 +0000 |
commit | 2cccf0ee964afca56e9fb6b532ab9f863fc6091f (patch) | |
tree | 4eb52f7bac13ea5a82cf581fee805ff6269de71c /src/modules/texts | |
parent | 1503eed6289ffbf12185d73a9fa4dbde8a7b5fba (diff) | |
download | sword-sf-cvs-2cccf0ee964afca56e9fb6b532ab9f863fc6091f.tar.gz |
sync with crosswire 20020929-1300
Diffstat (limited to 'src/modules/texts')
-rw-r--r-- | src/modules/texts/swtext.cpp | 38 |
1 files changed, 38 insertions, 0 deletions
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(); +} |