From 18730641dbb8d2c2eb307877b6141f0a1b6e6acc Mon Sep 17 00:00:00 2001 From: twanvl Date: Sat, 10 Jan 2009 14:39:29 +0000 Subject: [PATCH] fixed spelling correction popup when there is no extra dictionary git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1335 0fc631ac-6414-0410-93d0-97cfa31319b6 --- src/gui/value/text.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/value/text.cpp b/src/gui/value/text.cpp index afa5b759..6d84f2dd 100644 --- a/src/gui/value/text.cpp +++ b/src/gui/value/text.cpp @@ -519,10 +519,11 @@ String spellcheck_word_at(const String& str, size_t start) { void spellcheck_language_at(const String& str, size_t error_pos, SpellChecker** out) { String tag = tag_at(str,error_pos); size_t pos = min(tag.find_first_of(_(':')), tag.size()-1); - size_t pos2 = min(tag.find_first_of(_(':'),pos+1), tag.size()-1); + size_t pos2 = min(tag.find_first_of(_(':'),pos+1), tag.size()); String language = tag.substr(pos+1,pos2-pos-1); if (language.empty()) return; out[0] = &SpellChecker::get(language); + if (pos2 >= tag.size()) return; String extra = tag.substr(pos2+1); if (extra.empty()) return; out[1] = &SpellChecker::get(extra,language);