From 8f1b42984d7ce142074db6ac5d348b811c58c970 Mon Sep 17 00:00:00 2001 From: Abdelrazak Younes Date: Fri, 1 May 2009 08:44:35 +0000 Subject: [PATCH] Better compil fix than previous commit. Sorry... git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@29460 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/Thesaurus.cpp | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/src/Thesaurus.cpp b/src/Thesaurus.cpp index 7310e7ebe5..6bc0823425 100644 --- a/src/Thesaurus.cpp +++ b/src/Thesaurus.cpp @@ -141,16 +141,24 @@ typedef std::map 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); } -- 2.39.5