[Libreoffice-commits] core.git: sc/inc sc/source

Eike Rathke erack at redhat.com
Fri Nov 3 13:46:38 UTC 2017


 sc/inc/mtvelements.hxx              |    2 --
 sc/source/core/data/column.cxx      |    1 -
 sc/source/core/data/mtvelements.cxx |    5 -----
 3 files changed, 8 deletions(-)

New commits:
commit 911e2aff3cc37cb7410292728ffea05fffbfb0b3
Author: Eike Rathke <erack at redhat.com>
Date:   Fri Nov 3 14:43:21 2017 +0100

    Resolves: tdf#111428 swap (only) ScColumn::mnBlkCountFormula
    
        commit 423df1fa929784c14e3a133c06468589fe9269cd
        Date:   Thu Nov 2 12:53:14 2017 +0100
    
            Resolves: tdf#111428 implement CellStoreEvent::swap() in ScColumn::SwapCol()
    
    erroneously swapped also the CellStoreEvent's ScColumn* but of
    course the CellStoreEvent stays at its ScColumn and is not swapped
    with the CellStoreType. So swap only the mnBlkCountFormula that
    CellStoreEvent::mpCol accesses.
    
    ASAN rightly complained about heap-use-after-free.
    
    Change-Id: Ic44fed96c49bea7365bf1200e06788860966795c

diff --git a/sc/inc/mtvelements.hxx b/sc/inc/mtvelements.hxx
index 2809b7a621c5..f13562d47fbd 100644
--- a/sc/inc/mtvelements.hxx
+++ b/sc/inc/mtvelements.hxx
@@ -97,8 +97,6 @@ public:
 
     void element_block_acquired(const mdds::mtv::base_element_block* block);
     void element_block_released(const mdds::mtv::base_element_block* block);
-
-    void swap(CellStoreEvent& r);
 };
 
 /// Cell note container
diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx
index 3afcc2bce2ec..ea93b02156f1 100644
--- a/sc/source/core/data/column.cxx
+++ b/sc/source/core/data/column.cxx
@@ -1896,7 +1896,6 @@ void ScColumn::SwapCol(ScColumn& rCol)
     maCellNotes.swap(rCol.maCellNotes);
 
     // Swap all CellStoreEvent mdds event_func related.
-    maCells.event_handler().swap( rCol.maCells.event_handler());
     std::swap( mnBlkCountFormula, rCol.mnBlkCountFormula);
 
     // notes update caption
diff --git a/sc/source/core/data/mtvelements.cxx b/sc/source/core/data/mtvelements.cxx
index 199284cad878..e34010af54d8 100644
--- a/sc/source/core/data/mtvelements.cxx
+++ b/sc/source/core/data/mtvelements.cxx
@@ -54,11 +54,6 @@ void CellStoreEvent::element_block_released(const mdds::mtv::base_element_block*
     }
 }
 
-void CellStoreEvent::swap(CellStoreEvent& r)
-{
-    std::swap( mpCol, r.mpCol);
-}
-
 ColumnBlockPositionSet::ColumnBlockPositionSet(ScDocument& rDoc) : mrDoc(rDoc) {}
 
 ColumnBlockPosition* ColumnBlockPositionSet::getBlockPosition(SCTAB nTab, SCCOL nCol)


More information about the Libreoffice-commits mailing list