[sword-devel] Notes on the search progress bug
Joachim Ansorg
sword-devel@crosswire.org
Sun, 29 Oct 2000 12:57:14 +0000
Hi!
> I'm trying to figure out how:
>
> key = BOTTOM
> long highIndex = key.NewIndex()
>
> can produce 8245
>
> This is the high NT index, NOT the high ENTIRE BIBLE index.
> NewIndex should always compute based on the entire bible, not just the
> testament.
>
> Hopefully, we'll figure it out soon. Still looking....
> In the mean time. Here is some code I found that doesn't look quite
> right:
>
> cswordmoduleinfo.cpp (line 225...):
>
> if (searchOptions & CSwordModuleSearch::useLastResult)
> scope = &m_searchResult;
> else if (searchOptions & CSwordModuleSearch::useScope) {
> scope = new VerseKey(lowerBound, upperBound);
> }
> ....
> m_searchResult = m_module->Search(searchedText, searchType,
> searchFlags, scope, 0, percentUpdate);
> ....
> if (scope)
> delete scope;
> I don't think you want to delete m_searchResult ever.
Ah, I see the problem. If we delete scope in the first case m_searchResult is
deleted, too.
I'll change it.
--Joachim