diff options
Diffstat (limited to 'writerfilter')
-rw-r--r-- | writerfilter/source/rtftok/rtfsprm.cxx | 9 | ||||
-rw-r--r-- | writerfilter/source/rtftok/rtfsprm.hxx | 1 | ||||
-rw-r--r-- | writerfilter/source/rtftok/rtfvalue.cxx | 4 |
3 files changed, 14 insertions, 0 deletions
diff --git a/writerfilter/source/rtftok/rtfsprm.cxx b/writerfilter/source/rtftok/rtfsprm.cxx index e69f6ed533da..c6349cb42858 100644 --- a/writerfilter/source/rtftok/rtfsprm.cxx +++ b/writerfilter/source/rtftok/rtfsprm.cxx @@ -156,6 +156,15 @@ void RTFSprms::deduplicate(RTFSprms& rReference) } } +bool RTFSprms::equals(RTFValue& rOther) +{ + RTFSprms::Iterator_t i = m_pSprms->begin(); + while (i != m_pSprms->end()) + if (!i->second->equals(rOther)) + return false; + return true; +} + void RTFSprms::ensureCopyBeforeWrite() { if (m_pSprms->m_nRefCount > 1) diff --git a/writerfilter/source/rtftok/rtfsprm.hxx b/writerfilter/source/rtftok/rtfsprm.hxx index 9f811bd9fa86..f6c9f5ba835b 100644 --- a/writerfilter/source/rtftok/rtfsprm.hxx +++ b/writerfilter/source/rtftok/rtfsprm.hxx @@ -90,6 +90,7 @@ public: return m_pSprms->end(); } void clear(); + bool equals(RTFValue& rOther); private: void ensureCopyBeforeWrite(); boost::intrusive_ptr<RTFSprmsImpl> m_pSprms; diff --git a/writerfilter/source/rtftok/rtfvalue.cxx b/writerfilter/source/rtftok/rtfvalue.cxx index 3ff04d748604..430b049de554 100644 --- a/writerfilter/source/rtftok/rtfvalue.cxx +++ b/writerfilter/source/rtftok/rtfvalue.cxx @@ -227,8 +227,12 @@ bool RTFValue::equals(RTFValue& rOther) return false; if (m_pAttributes->size() != rOther.m_pAttributes->size()) return false; + else if (!m_pAttributes->equals(rOther)) + return false; if (m_pSprms->size() != rOther.m_pSprms->size()) return false; + else if (!m_pSprms->equals(rOther)) + return false; return true; } |