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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Tue Mar 5 13:48:04 UTC 2019


 sc/inc/detdata.hxx              |    3 +++
 sc/source/core/tool/detdata.cxx |    2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

New commits:
commit f7ac78f90868a21c480e9b1d9389b36427f097c4
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Tue Mar 5 13:28:44 2019 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Tue Mar 5 14:47:40 2019 +0100

    fix ScDetOpList::operator==
    
    should be comparing the values of the elements, not the pointers.
    
    Regression from
        commit 927447356fb7025d2b61073f525adc24643c7925
        Date:   Sat Sep 12 16:49:29 2015 -0600
        replace boost::ptr_container with std::container<std::unique_ptr>
    
    noticed while doing some other plugin work
    
    Change-Id: I96230e52571e9a96e1c96f53f61bbc5afe902b31
    Reviewed-on: https://gerrit.libreoffice.org/68738
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/sc/inc/detdata.hxx b/sc/inc/detdata.hxx
index 688fff0b490a..e2be0c46b4f9 100644
--- a/sc/inc/detdata.hxx
+++ b/sc/inc/detdata.hxx
@@ -51,6 +51,9 @@ public:
 
     // for UpdateRef:
     void                SetPos(const ScAddress& rNew)   { aPos=rNew; }
+
+    bool operator==     ( const ScDetOpData& r ) const
+                        { return eOperation == r.eOperation && aPos == r.aPos; }
 };
 
 //  list of operators
diff --git a/sc/source/core/tool/detdata.cxx b/sc/source/core/tool/detdata.cxx
index aec1d032d0c2..d1233e0cf609 100644
--- a/sc/source/core/tool/detdata.cxx
+++ b/sc/source/core/tool/detdata.cxx
@@ -79,7 +79,7 @@ bool ScDetOpList::operator==( const ScDetOpList& r ) const
     size_t nCount = Count();
     bool bEqual = ( nCount == r.Count() );
     for (size_t i=0; i<nCount && bEqual; i++)       // order has to be the same
-        if ( aDetOpDataVector[i] != r.aDetOpDataVector[i] )    // entries are different ?
+        if ( !(*aDetOpDataVector[i] == *r.aDetOpDataVector[i]) )    // entries are different ?
             bEqual = false;
 
     return bEqual;


More information about the Libreoffice-commits mailing list