summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2023-12-03 21:23:03 +0100
committerCaolán McNamara <caolan.mcnamara@collabora.com>2023-12-04 10:46:28 +0100
commitcdb180e767ebf2011414f4a5ba7213752474ee36 (patch)
tree5adb5060ee910d20256a66b6c336d72fdb5d0b55
parentbeb0b57a638a2577d89ab5bdee6351008c5127ca (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>
-rw-r--r--sc/source/core/data/SolverSettings.cxx4
-rw-r--r--sc/source/ui/namedlg/namemgrtable.cxx12
-rw-r--r--sd/source/filter/eppt/pptx-epptooxml.cxx6
-rw-r--r--sdext/source/pdfimport/tree/pdfiprocessor.cxx1
4 files changed, 19 insertions, 4 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));
}
diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx b/sd/source/filter/eppt/pptx-epptooxml.cxx
index 6cb5e277ee87..ae8ccc063cf2 100644
--- a/sd/source/filter/eppt/pptx-epptooxml.cxx
+++ b/sd/source/filter/eppt/pptx-epptooxml.cxx
@@ -2317,9 +2317,13 @@ void PowerPointExport::WritePlaceholderReferenceShapes(PowerPointShapeExport& rD
&& aAny == true))
{
if ((xShape = GetReferencedPlaceholderXShape(SlideNumber, ePageType)))
+ {
+ const auto iter = maPlaceholderShapeToIndexMap.find(xShape);
+ assert(iter != maPlaceholderShapeToIndexMap.end());
rDML.WritePlaceholderReferenceShape(SlideNumber,
- maPlaceholderShapeToIndexMap.find(xShape)->second,
+ iter->second,
ePageType, mXPagePropSet);
+ }
}
if (ePageType == LAYOUT
diff --git a/sdext/source/pdfimport/tree/pdfiprocessor.cxx b/sdext/source/pdfimport/tree/pdfiprocessor.cxx
index 7967a74a67cf..bf590c544334 100644
--- a/sdext/source/pdfimport/tree/pdfiprocessor.cxx
+++ b/sdext/source/pdfimport/tree/pdfiprocessor.cxx
@@ -471,6 +471,7 @@ const FontAttributes& PDFIProcessor::getFont( sal_Int32 nFontId ) const
IdToFontMap::const_iterator it = m_aIdToFont.find( nFontId );
if( it == m_aIdToFont.end() )
it = m_aIdToFont.find( 0 );
+ assert(it != m_aIdToFont.end());
return it->second;
}