crashtesting: assert the failure which will cause tdf129410-1.ods to crash
Change-Id: Ieb75e1d9ddf16ed95f3a7d984b16dc2049443c6f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106061
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
diff --git a/sc/inc/chartlis.hxx b/sc/inc/chartlis.hxx
index 97ddea6..f6baf78 100644
--- a/sc/inc/chartlis.hxx
+++ b/sc/inc/chartlis.hxx
@@ -154,7 +154,7 @@ public:
// only needed after copy-ctor, if newly added to doc
void StartAllListeners();
void insert(ScChartListener* pListener);
bool insert(ScChartListener* pListener);
ScChartListener* findByName(const OUString& rName);
const ScChartListener* findByName(const OUString& rName) const;
bool hasListeners() const;
diff --git a/sc/source/core/tool/chartlis.cxx b/sc/source/core/tool/chartlis.cxx
index 3c5e602..25696ee 100644
--- a/sc/source/core/tool/chartlis.cxx
+++ b/sc/source/core/tool/chartlis.cxx
@@ -384,12 +384,12 @@ void ScChartListenerCollection::StartAllListeners()
}
}
void ScChartListenerCollection::insert(ScChartListener* pListener)
bool ScChartListenerCollection::insert(ScChartListener* pListener)
{
if (meModifiedDuringUpdate == SC_CLCUPDATE_RUNNING)
meModifiedDuringUpdate = SC_CLCUPDATE_MODIFIED;
OUString aName = pListener->GetName();
m_Listeners.insert(std::make_pair(aName, std::unique_ptr<ScChartListener>(pListener)));
return m_Listeners.insert(std::make_pair(aName, std::unique_ptr<ScChartListener>(pListener))).second;
}
void ScChartListenerCollection::removeByName(const OUString& rName)
diff --git a/sc/source/filter/xml/XMLTableShapeResizer.cxx b/sc/source/filter/xml/XMLTableShapeResizer.cxx
index 83a9f8a..61b651a 100644
--- a/sc/source/filter/xml/XMLTableShapeResizer.cxx
+++ b/sc/source/filter/xml/XMLTableShapeResizer.cxx
@@ -98,7 +98,8 @@ void ScMyOLEFixer::CreateChartListener(ScDocument& rDoc,
rDoc.InterpretDirtyCells( *pCL->GetRangeList() );
}
pCollection->insert( pCL );
bool bSuccess = pCollection->insert(pCL);
assert(bSuccess && "failed to insert listener"); (void)bSuccess;
pCL->StartListeningTo();
}