summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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();
}