[Libreoffice-commits] core.git: writerfilter/source

Adrien Ollier (via logerrit) logerrit at kemper.freedesktop.org
Sat Aug 24 12:29:22 UTC 2019


 writerfilter/source/rtftok/rtfsprm.cxx  |    4 ++--
 writerfilter/source/rtftok/rtfsprm.hxx  |    2 +-
 writerfilter/source/rtftok/rtfvalue.cxx |    2 +-
 writerfilter/source/rtftok/rtfvalue.hxx |    2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)

New commits:
commit e1c7cb5d2759341fc235eb41c80a0dbc9107db5c
Author:     Adrien Ollier <adr.ollier at hotmail.fr>
AuthorDate: Wed Jul 24 04:14:58 2019 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Sat Aug 24 14:28:19 2019 +0200

    equality test functions are const
    
    RTFSprms::equals and RTFValue::equals
    are mutually dependent, which is insane.
    
    Change-Id: Ib6de7954e97d5a1620ea3f8db92fe9a989ee8667
    Signed-off-by: Adrien Ollier <adr.ollier at hotmail.fr>
    Reviewed-on: https://gerrit.libreoffice.org/76211
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/writerfilter/source/rtftok/rtfsprm.cxx b/writerfilter/source/rtftok/rtfsprm.cxx
index 7ede5a30e2b9..7d2de7c0bb79 100644
--- a/writerfilter/source/rtftok/rtfsprm.cxx
+++ b/writerfilter/source/rtftok/rtfsprm.cxx
@@ -374,9 +374,9 @@ RTFSprms RTFSprms::cloneAndDeduplicate(RTFSprms& rReference, Id const nStyleType
     return ret;
 }
 
-bool RTFSprms::equals(RTFValue& rOther)
+bool RTFSprms::equals(const RTFValue& rOther) const
 {
-    return std::all_of(m_pSprms->begin(), m_pSprms->end(),
+    return std::all_of(m_pSprms->cbegin(), m_pSprms->cend(),
                        [&](const std::pair<Id, RTFValue::Pointer_t>& raPair) -> bool {
                            return raPair.second->equals(rOther);
                        });
diff --git a/writerfilter/source/rtftok/rtfsprm.hxx b/writerfilter/source/rtftok/rtfsprm.hxx
index 561f716e603b..b2eb9f25102d 100644
--- a/writerfilter/source/rtftok/rtfsprm.hxx
+++ b/writerfilter/source/rtftok/rtfsprm.hxx
@@ -75,7 +75,7 @@ public:
     Iterator_t begin() { return m_pSprms->begin(); }
     Iterator_t end() { return m_pSprms->end(); }
     void clear();
-    bool equals(RTFValue& rOther);
+    bool equals(const RTFValue& rOther) const;
 
 private:
     void ensureCopyBeforeWrite();
diff --git a/writerfilter/source/rtftok/rtfvalue.cxx b/writerfilter/source/rtftok/rtfvalue.cxx
index 15648f9dba9b..49ebfc10eef4 100644
--- a/writerfilter/source/rtftok/rtfvalue.cxx
+++ b/writerfilter/source/rtftok/rtfvalue.cxx
@@ -186,7 +186,7 @@ RTFValue* RTFValue::CloneWithSprms(RTFSprms const& rAttributes, RTFSprms const&
                         m_bForceString, *m_pShape, *m_pPicture);
 }
 
-bool RTFValue::equals(RTFValue& rOther)
+bool RTFValue::equals(const RTFValue& rOther) const
 {
     if (m_nValue != rOther.m_nValue)
         return false;
diff --git a/writerfilter/source/rtftok/rtfvalue.hxx b/writerfilter/source/rtftok/rtfvalue.hxx
index e2ff4e9e8fcc..8fbd49bd0a8e 100644
--- a/writerfilter/source/rtftok/rtfvalue.hxx
+++ b/writerfilter/source/rtftok/rtfvalue.hxx
@@ -73,7 +73,7 @@ public:
     RTFSprms& getSprms();
     RTFShape& getShape() const;
     RTFPicture& getPicture() const;
-    bool equals(RTFValue& rOther);
+    bool equals(const RTFValue& rOther) const;
     RTFValue& operator=(RTFValue const& rOther) = delete;
 
 private:


More information about the Libreoffice-commits mailing list