summaryrefslogtreecommitdiff
path: root/writerfilter/source/rtftok/rtfsprm.cxx
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2012-11-25 00:54:10 +0100
committerMiklos Vajna <vmiklos@suse.cz>2012-11-25 00:54:27 +0100
commit9f5263c477b82fef5aa9c3e79fb6af92aa049e24 (patch)
tree53a705a8f98f08b73bb9039d0cf859b997d63c13 /writerfilter/source/rtftok/rtfsprm.cxx
parent7bf64a5af4088c0f6d4dbf7f493e94fa63e2a4b2 (diff)
fdo#44736 RTF import: ignore direct formatting which equals to style
Change-Id: Ie82f18381a95adbfedf7ea02d6844685e44b151d
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()
{