diff options
Diffstat (limited to 'bindings/corba/orbitcpp/swordorb-impl.cpp')
-rw-r--r-- | bindings/corba/orbitcpp/swordorb-impl.cpp | 32 |
1 files changed, 28 insertions, 4 deletions
diff --git a/bindings/corba/orbitcpp/swordorb-impl.cpp b/bindings/corba/orbitcpp/swordorb-impl.cpp index 29b5b5e..da1819c 100644 --- a/bindings/corba/orbitcpp/swordorb-impl.cpp +++ b/bindings/corba/orbitcpp/swordorb-impl.cpp @@ -1,3 +1,20 @@ +/* + * Copyright 2009 CrossWire Bible Society (http://www.crosswire.org) + * CrossWire Bible Society + * P. O. Box 2528 + * Tempe, AZ 85280-2528 + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation version 2. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + */ + #include "swordorb-impl.hpp" #include <iostream> #include <swmgr.h> @@ -155,7 +172,6 @@ StringList *SWModule_impl::parseKeyList(const char *keyText) throw(CORBA::System SearchHitList *SWModule_impl::search(const char *istr, SearchType searchType, CORBA::Long flags, const char *scope) throw(CORBA::SystemException) { int stype = 2; sword::ListKey lscope; - sword::VerseKey parser; if (searchType == REGEX) stype = 0; if (searchType == PHRASE) stype = -1; if (searchType == MULTIWORD) stype = -2; @@ -164,8 +180,16 @@ SearchHitList *SWModule_impl::search(const char *istr, SearchType searchType, CO sword::ListKey result; if ((scope) && (strlen(scope)) > 0) { - lscope = parser.ParseVerseList(scope, parser, true); + sword::SWKey *p = delegate->CreateKey(); + sword::VerseKey *parser = SWDYNAMIC_CAST(VerseKey, p); + if (!parser) { + delete p; + parser = new VerseKey(); + } + *parser = delegate->getKeyText(); + lscope = parser->ParseVerseList(scope, *parser, true); result = delegate->Search(istr, stype, flags, &lscope); + delete parser; } else result = delegate->Search(istr, stype, flags); @@ -278,10 +302,10 @@ StringList *SWModule_impl::getKeyChildren() throw(CORBA::SystemException) { num.appendFormatted("%d", vkey->Verse()); (*retVal)[3] = CORBA::string_dup(num.c_str()); num = ""; - num.appendFormatted("%d", vkey->books[vkey->Testament()-1][vkey->Book()-1].chapmax); + num.appendFormatted("%d", vkey->getChapterMax()); (*retVal)[4] = CORBA::string_dup(num.c_str()); num = ""; - num.appendFormatted("%d", vkey->books[vkey->Testament()-1][vkey->Book()-1].versemax[vkey->Chapter()-1]); + num.appendFormatted("%d", vkey->getVerseMax()); (*retVal)[5] = CORBA::string_dup(num.c_str()); } else { |