diff options
author | Caolán McNamara <caolan.mcnamara@collabora.com> | 2023-12-07 08:49:19 +0000 |
---|---|---|
committer | Caolán McNamara <caolan.mcnamara@collabora.com> | 2023-12-07 18:22:46 +0100 |
commit | 12b96aca8666bca5bf905c8c9da44a20e0c06ef3 (patch) | |
tree | c447c77e0444a8981899fe536da27d0892750fd5 /editeng | |
parent | caea33a11a212fc1c0426c90715c06376dbb9f06 (diff) |
cid#1546503 Using invalid iterator
and
cid#1546284 Using invalid iterator
cid#1546275 Using invalid iterator
cid#1546049 Using invalid iterator
cid#1545929 Using invalid iterator
cid#1545870 Using invalid iterator
cid#1545668 Using invalid iterator
cid#1545420 Using invalid iterator
Change-Id: I3ad3000631b4be5917b9c5f49f21b8cc003a309c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159056
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/misc/svxacorr.cxx | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx index 2788c6694c09..f6941d6cc371 100644 --- a/editeng/source/misc/svxacorr.cxx +++ b/editeng/source/misc/svxacorr.cxx @@ -2008,7 +2008,9 @@ const SvxAutocorrWord* SvxAutoCorrect::SearchWordsInList( if (m_aLangTable.find(aLanguageTag) != m_aLangTable.end() || CreateLanguageFile(aLanguageTag, false)) { //the language is available - so bring it on - SvxAutoCorrectLanguageLists & rList = m_aLangTable.find(aLanguageTag)->second; + const auto iter = m_aLangTable.find(aLanguageTag); + assert(iter != m_aLangTable.end()); + SvxAutoCorrectLanguageLists & rList = iter->second; pRet = lcl_SearchWordsInList( &rList, rTxt, rStt, nEndPos ); if( pRet ) { @@ -2068,7 +2070,9 @@ bool SvxAutoCorrect::FindInWordStartExceptList( LanguageType eLang, if (m_aLangTable.find(aLanguageTag) != m_aLangTable.end() || CreateLanguageFile(aLanguageTag, false)) { //the language is available - so bring it on - auto& rList = m_aLangTable.find(aLanguageTag)->second; + const auto iter = m_aLangTable.find(aLanguageTag); + assert(iter != m_aLangTable.end() && "CreateLanguageFile can't fail"); + auto& rList = iter->second; if(rList.GetWordStartExceptList()->find(sWord) != rList.GetWordStartExceptList()->end() ) return true; } @@ -2082,7 +2086,9 @@ bool SvxAutoCorrect::FindInWordStartExceptList( LanguageType eLang, CreateLanguageFile(aLanguageTag, false))) { //the language is available - so bring it on - auto& rList = m_aLangTable.find(aLanguageTag)->second; + const auto iter = m_aLangTable.find(aLanguageTag); + assert(iter != m_aLangTable.end() && "CreateLanguageFile can't fail"); + auto& rList = iter->second; if(rList.GetWordStartExceptList()->find(sWord) != rList.GetWordStartExceptList()->end() ) return true; } @@ -2162,7 +2168,9 @@ bool SvxAutoCorrect::FindInCplSttExceptList(LanguageType eLang, CreateLanguageFile(aLanguageTag, false))) { //the language is available - so bring it on - const SvStringsISortDtor* pList = m_aLangTable.find(aLanguageTag)->second.GetCplSttExceptList(); + const auto iter = m_aLangTable.find(aLanguageTag); + assert(iter != m_aLangTable.end() && "CreateLanguageFile can't fail"); + const SvStringsISortDtor* pList = iter->second.GetCplSttExceptList(); if(bAbbreviation ? lcl_FindAbbreviation(pList, sWord) : pList->find(sWord) != pList->end() ) return true; } |