summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-04-22 12:53:24 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-04-22 13:10:57 +0200
commit8e8f9388c323ad3c32cef3f91609ad19386b7d56 (patch)
tree2a04abe4e8a447b9d8cf8bda2b590126cf0ed83f /writerfilter
parent88c3b4bbf005299203370efecbc09dd9d9d26a72 (diff)
Related: fdo#77600 RTF import: RTFValue::equals: compare attribute content
Previously only the number of nested sprms / attributes was compared. With this, the font of the bugdoc is correctly Arial, not Times. Change-Id: I351de414b6734336b31c1334dbd2349072f16002
Diffstat (limited to 'writerfilter')
-rw-r--r--writerfilter/source/rtftok/rtfsprm.cxx9
-rw-r--r--writerfilter/source/rtftok/rtfsprm.hxx1
-rw-r--r--writerfilter/source/rtftok/rtfvalue.cxx4
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;
}