Better compil fix than previous commit. Sorry...

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@29460 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Abdelrazak Younes 2009-05-01 08:44:35 +00:00
parent 27842f0bd5
commit 8f1b42984d

View File

@ -141,16 +141,24 @@ typedef std::map<docstring, MyThes *> Thesauri;
struct Thesaurus::Private
{
~Private(Thesaurus & parent): parent_(parent)
~Private()
{
for (Thesauri::iterator it = thes_.begin();
it != thes_.end(); ++it) {
delete it->second;
}
}
///
Thesaurus & parent_;
bool thesaurusAvailable(docstring const & lang) const
{
for (Thesauri::const_iterator it = thes_.begin();
it != thes_.end(); ++it) {
if (it->first == lang)
if (it->second)
return true;
}
return false;
}
/// add a thesaurus to the list
bool addThesaurus(docstring const & lang);
@ -166,7 +174,7 @@ bool Thesaurus::Private::addThesaurus(docstring const & lang)
if (thes_path.empty())
return false;
if (parent_.thesaurusAvailable(lang))
if (thesaurusAvailable(lang))
return true;
FileNameList const idx_files = FileName(thes_path).dirList("idx");
@ -206,14 +214,7 @@ bool Thesaurus::Private::addThesaurus(docstring const & lang)
bool Thesaurus::thesaurusAvailable(docstring const & lang) const
{
for (Thesauri::const_iterator it = d->thes_.begin();
it != d->thes_.end(); ++it) {
if (it->first == lang)
if (it->second)
return true;
}
return false;
return d->thesaurusAvailable(lang);
}