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;
|
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 {
|
[&](const std::pair<Id, RTFValue::Pointer_t>& raPair) -> bool {
|
||||||
return raPair.second->equals(rOther);
|
return raPair.second->equals(rOther);
|
||||||
});
|
});
|
||||||
|
@@ -75,7 +75,7 @@ public:
|
|||||||
Iterator_t begin() { return m_pSprms->begin(); }
|
Iterator_t begin() { return m_pSprms->begin(); }
|
||||||
Iterator_t end() { return m_pSprms->end(); }
|
Iterator_t end() { return m_pSprms->end(); }
|
||||||
void clear();
|
void clear();
|
||||||
bool equals(RTFValue& rOther);
|
bool equals(const RTFValue& rOther) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void ensureCopyBeforeWrite();
|
void ensureCopyBeforeWrite();
|
||||||
|
@@ -186,7 +186,7 @@ RTFValue* RTFValue::CloneWithSprms(RTFSprms const& rAttributes, RTFSprms const&
|
|||||||
m_bForceString, *m_pShape, *m_pPicture);
|
m_bForceString, *m_pShape, *m_pPicture);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool RTFValue::equals(RTFValue& rOther)
|
bool RTFValue::equals(const RTFValue& rOther) const
|
||||||
{
|
{
|
||||||
if (m_nValue != rOther.m_nValue)
|
if (m_nValue != rOther.m_nValue)
|
||||||
return false;
|
return false;
|
||||||
|
@@ -73,7 +73,7 @@ public:
|
|||||||
RTFSprms& getSprms();
|
RTFSprms& getSprms();
|
||||||
RTFShape& getShape() const;
|
RTFShape& getShape() const;
|
||||||
RTFPicture& getPicture() const;
|
RTFPicture& getPicture() const;
|
||||||
bool equals(RTFValue& rOther);
|
bool equals(const RTFValue& rOther) const;
|
||||||
RTFValue& operator=(RTFValue const& rOther) = delete;
|
RTFValue& operator=(RTFValue const& rOther) = delete;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
Reference in New Issue
Block a user