summaryrefslogtreecommitdiff
path: root/writerfilter/source/rtftok/rtfsprm.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'writerfilter/source/rtftok/rtfsprm.cxx')
-rw-r--r--writerfilter/source/rtftok/rtfsprm.cxx20
1 files changed, 20 insertions, 0 deletions
diff --git a/writerfilter/source/rtftok/rtfsprm.cxx b/writerfilter/source/rtftok/rtfsprm.cxx
index fb61d292a5b8..2958cde25cb8 100644
--- a/writerfilter/source/rtftok/rtfsprm.cxx
+++ b/writerfilter/source/rtftok/rtfsprm.cxx
@@ -29,6 +29,7 @@
#include <rtl/strbuf.hxx>
#include <resourcemodel/QNameToString.hxx>
+#include <doctok/resourceids.hxx> // NS_rtf namespace
using rtl::OStringBuffer;
@@ -130,6 +131,25 @@ bool RTFSprms::erase(Id nKeyword)
return false;
}
+void RTFSprms::deduplicate(RTFSprms& rReference)
+{
+ RTFSprms::Iterator_t i = m_aSprms.begin();
+ while (i != m_aSprms.end())
+ {
+ bool bIgnore = false;
+ if (i->first != NS_rtf::LN_ISTD)
+ {
+ RTFValue::Pointer_t pValue(rReference.find(i->first));
+ if (pValue.get() && i->second->equals(*pValue))
+ bIgnore = true;
+ }
+ if (bIgnore)
+ i = m_aSprms.erase(i);
+ else
+ ++i;
+ }
+}
+
RTFSprms::RTFSprms()
: m_aSprms()
{