summaryrefslogtreecommitdiff
path: root/editeng
diff options
context:
space:
mode:
authorCaolán McNamara <caolan.mcnamara@collabora.com>2023-12-01 11:50:19 +0000
committerCaolán McNamara <caolan.mcnamara@collabora.com>2023-12-01 18:06:54 +0100
commit004807caaa5f5e4516ba5cc9fac085fe8cd30dee (patch)
tree67eb6be7a66a9d9952a5f0ceb39c6757b2765c23 /editeng
parentfc288036a51f3d6a529ef4f145468f3ee3c8fc32 (diff)
cid#1546413 silence Using invalid iterator
sample to test silencing this Change-Id: I73a8e22a5266367d7b2c76aa00d38d40431b4841 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160213 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Diffstat (limited to 'editeng')
-rw-r--r--editeng/source/misc/svxacorr.cxx11
1 files changed, 7 insertions, 4 deletions
diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx
index 4c4b6883f247..ab8a43091b00 100644
--- a/editeng/source/misc/svxacorr.cxx
+++ b/editeng/source/misc/svxacorr.cxx
@@ -1888,11 +1888,14 @@ bool SvxAutoCorrect::PutText( const OUString& rShort, const OUString& rLong,
LanguageType eLang )
{
LanguageTag aLanguageTag( eLang);
- auto const iter = m_aLangTable.find(aLanguageTag);
- if (iter != m_aLangTable.end())
+ if (auto const iter = m_aLangTable.find(aLanguageTag); iter != m_aLangTable.end())
return iter->second.PutText(rShort, rLong);
- if(CreateLanguageFile(aLanguageTag))
- return m_aLangTable.find(aLanguageTag)->second.PutText(rShort, rLong);
+ if (CreateLanguageFile(aLanguageTag))
+ {
+ auto const iter = m_aLangTable.find(aLanguageTag);
+ assert (iter != m_aLangTable.end());
+ return iter->second.PutText(rShort, rLong);
+ }
return false;
}