summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-11-18 16:25:21 +0000
committerCaolán McNamara <caolanm@redhat.com>2020-11-19 09:48:43 +0100
commitf854e62a9d21f7874390952491ba38ed3056edd0 (patch)
tree39077b4c14dfa6a80c4066979d39dcd00a94572c
parent06498c589f665e5e517b9e004a28d560abc4c299 (diff)
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>
-rw-r--r--sc/inc/chartlis.hxx2
-rw-r--r--sc/source/core/tool/chartlis.cxx4
-rw-r--r--sc/source/filter/xml/XMLTableShapeResizer.cxx3
3 files changed, 5 insertions, 4 deletions
diff --git a/sc/inc/chartlis.hxx b/sc/inc/chartlis.hxx
index 97ddea607343..f6baf78bc124 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 3c5e602ae670..25696eefb9b4 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 83a9f8a35d73..61b651a94a0b 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();
}