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>
This commit is contained in:
committed by
Noel Grandin
parent
d53144e9d1
commit
e1c7cb5d27
@@ -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);
|
||||
});
|
||||
|
@@ -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();
|
||||
|
@@ -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;
|
||||
|
@@ -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:
|
||||
|
Reference in New Issue
Block a user