summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorAdrien Ollier <adr.ollier@hotmail.fr>2019-07-24 04:14:58 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-08-24 14:28:19 +0200
commite1c7cb5d2759341fc235eb41c80a0dbc9107db5c (patch)
tree8f6f7771b6c1533268f610a8112812abc1033290 /writerfilter
parentd53144e9d185b7b0b41d887c689c13bf27cd9906 (diff)
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@hotmail.fr> Reviewed-on: https://gerrit.libreoffice.org/76211 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'writerfilter')
-rw-r--r--writerfilter/source/rtftok/rtfsprm.cxx4
-rw-r--r--writerfilter/source/rtftok/rtfsprm.hxx2
-rw-r--r--writerfilter/source/rtftok/rtfvalue.cxx2
-rw-r--r--writerfilter/source/rtftok/rtfvalue.hxx2
4 files changed, 5 insertions, 5 deletions
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: