sc/inc/chartlis.hxx                           |    2 +-
 sc/source/core/tool/chartlis.cxx              |    4 ++--
 sc/source/filter/xml/XMLTableShapeResizer.cxx |    3 ++-
 3 files changed, 5 insertions(+), 4 deletions(-)

New commits:
commit f854e62a9d21f7874390952491ba38ed3056edd0
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Wed Nov 18 16:25:21 2020 +0000
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Thu Nov 19 09:48:43 2020 +0100

    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 <caol...@redhat.com>

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();
 }
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to