From ec0141aa1d8af27abb4b2c06ef52f0cb7a1c9754 Mon Sep 17 00:00:00 2001 From: Ianos Gnatiuc Date: Wed, 30 Nov 2005 06:55:55 +0000 Subject: [PATCH] Fixed dictionary unloading bug, on language changing --- goldlib/gall/gespell.cpp | 7 ++++--- goldlib/gall/gespell.h | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/goldlib/gall/gespell.cpp b/goldlib/gall/gespell.cpp index c1fa140..0704511 100644 --- a/goldlib/gall/gespell.cpp +++ b/goldlib/gall/gespell.cpp @@ -400,14 +400,15 @@ void CSpellChecker::Close() // ------------------------------------------------------------------ -bool CSpellChecker::Load(word lic, const char *userdic) +bool CSpellChecker::Load(LIDC lidc, const char *userdic) { if (!IsInited()) return false; + if (IsLoaded() && (mLang->GetLangCode() == lidc)) return true; - std::vector::iterator it; + CSpellLangV::iterator it; for (it = mLangs.begin(); it != mLangs.end(); it++) { - if ((it->GetLangCode() == lic) && it->Load(userdic)) + if ((it->GetLangCode() == lidc) && it->Load(userdic)) { UnLoad(); mLang = it; diff --git a/goldlib/gall/gespell.h b/goldlib/gall/gespell.h index c6270a0..b10fe94 100644 --- a/goldlib/gall/gespell.h +++ b/goldlib/gall/gespell.h @@ -199,7 +199,7 @@ public: bool Init(); void Close(); - bool Load(word lic, const char *userdic = NULL); + bool Load(LIDC lidc, const char *userdic = NULL); void UnLoad(); bool Check(const char *text);