diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2023-12-03 21:23:03 +0100 |
---|---|---|
committer | Caolán McNamara <caolan.mcnamara@collabora.com> | 2023-12-04 10:46:28 +0100 |
commit | cdb180e767ebf2011414f4a5ba7213752474ee36 (patch) | |
tree | 5adb5060ee910d20256a66b6c336d72fdb5d0b55 /sc | |
parent | beb0b57a638a2577d89ab5bdee6351008c5127ca (diff) |
cid#1546332 Using invalid iterator
and :
cid#1546327 Using invalid iterator
cid#1546289 Using invalid iterator
cid#1546284 Using invalid iterator
Change-Id: Ia0c8c69433a51fd356930f40f17f50774f244239
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160279
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/core/data/SolverSettings.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/namedlg/namemgrtable.cxx | 12 |
2 files changed, 13 insertions, 3 deletions
diff --git a/sc/source/core/data/SolverSettings.cxx b/sc/source/core/data/SolverSettings.cxx index bbeeca7bd4cf..ac2d2aa24aeb 100644 --- a/sc/source/core/data/SolverSettings.cxx +++ b/sc/source/core/data/SolverSettings.cxx @@ -339,7 +339,9 @@ void SolverSettings::SaveSolverSettings() */ bool SolverSettings::ReadParamValue(SolverParameter eParam, OUString& rValue, bool bRemoveQuotes) { - OUString sRange = m_mNamedRanges.find(eParam)->second; + const auto iter = m_mNamedRanges.find(eParam); + assert(iter != m_mNamedRanges.end()); + OUString sRange = iter->second; ScRangeData* pRangeData = m_pRangeName->findByUpperName(ScGlobal::getCharClass().uppercase(sRange)); if (pRangeData) diff --git a/sc/source/ui/namedlg/namemgrtable.cxx b/sc/source/ui/namedlg/namemgrtable.cxx index fa4b3ff4ef47..5b2330665374 100644 --- a/sc/source/ui/namedlg/namemgrtable.cxx +++ b/sc/source/ui/namedlg/namemgrtable.cxx @@ -83,9 +83,17 @@ const ScRangeData* ScRangeManagerTable::findRangeData(const ScRangeNameLine& rLi { const ScRangeName* pRangeName; if (rLine.aScope == maGlobalString) - pRangeName = &m_RangeMap.find(STR_GLOBAL_RANGE_NAME)->second; + { + const auto iter = m_RangeMap.find(STR_GLOBAL_RANGE_NAME); + assert(iter != m_RangeMap.end()); + pRangeName = &iter->second; + } else - pRangeName = &m_RangeMap.find(rLine.aScope)->second; + { + const auto iter = m_RangeMap.find(rLine.aScope); + assert(iter != m_RangeMap.end()); + pRangeName = &iter->second; + } return pRangeName->findByUpperName(ScGlobal::getCharClass().uppercase(rLine.aName)); } |