summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/qa/extras/rtfimport/data/tdf106694.rtf10
-rw-r--r--sw/qa/extras/rtfimport/rtfimport.cxx8
-rw-r--r--writerfilter/source/rtftok/rtfsprm.cxx20
3 files changed, 37 insertions, 1 deletions
diff --git a/sw/qa/extras/rtfimport/data/tdf106694.rtf b/sw/qa/extras/rtfimport/data/tdf106694.rtf
new file mode 100644
index 000000000000..9abcb205bbeb
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/tdf106694.rtf
@@ -0,0 +1,10 @@
+{\rtf1\ansi\deflang3081\ftnbj\uc1\deff0
+{\colortbl ;\red255\green255\blue255 ;\red0\green0\blue0 ;\red54\green95\blue145 ;\red79\green129\blue188 ;\red255\green0\blue0 ;\red255\green255\blue128 ;\red128\green0\blue0 ;\red127\green127\blue127 ;\red35\green62\blue95 ;\red63\green63\blue63 ;\red95\green95\blue95 ;\red47\green47\blue47 ;\red0\green64\blue128 ;\red79\green79\blue79 ;\red111\green111\blue111 ;\red0\green0\blue255 ;\red239\green239\blue239 ;\red192\green1\blue1 ;}
+{\stylesheet
+{\f0\fs24 Normal;}
+{\s22\snext0\f1\fs18\b\tqr\tldot\tx8280\fi0\li0\ri720\sb120\sa40\sl0 TOC 1
+;}
+}
+\pard\ssparaaux0\s22\tqr\tldot\tx8280\ri720\sb120\sa40\ql\outlinelevel0\plain\f0\fs24\plain\f2\fs18\hich\f2\dbch\f2\loch\f2\fs18\b
+Model Detail\tab 2\par
+}
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx
index 2ee47bfd8cee..d03d76979498 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -2803,6 +2803,14 @@ DECLARE_RTFIMPORT_TEST(testTdf105729, "tdf105729.rtf")
CPPUNIT_ASSERT_EQUAL(style::ParagraphAdjust_CENTER, static_cast<style::ParagraphAdjust>(getProperty<sal_Int16>(getParagraph(1), "ParaAdjust")));
}
+DECLARE_RTFIMPORT_TEST(testTdf106694, "tdf106694.rtf")
+{
+ auto aTabs = getProperty< uno::Sequence<style::TabStop> >(getParagraph(1), "ParaTabStops");
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), aTabs.getLength());
+ // This was 0, tab position was incorrect, looked like it was missing.
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(14605), aTabs[0].Position);
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/rtftok/rtfsprm.cxx b/writerfilter/source/rtftok/rtfsprm.cxx
index da7bc815c6ca..7afee14a4189 100644
--- a/writerfilter/source/rtftok/rtfsprm.cxx
+++ b/writerfilter/source/rtftok/rtfsprm.cxx
@@ -153,6 +153,23 @@ static RTFValue::Pointer_t getDefaultSPRM(Id const id)
}
}
+/// Is it problematic to deduplicate this SPRM?
+static bool isSPRMDeduplicateBlacklist(Id nId)
+{
+ switch (nId)
+ {
+ case NS_ooxml::LN_CT_TabStop_val:
+ case NS_ooxml::LN_CT_TabStop_leader:
+ case NS_ooxml::LN_CT_TabStop_pos:
+ // See the NS_ooxml::LN_CT_PPrBase_tabs handler in DomainMapper,
+ // deduplication is explicitly not wanted for these tokens.
+ return true;
+
+ default:
+ return false;
+ }
+}
+
/// Does the clone / deduplication of a single sprm.
static void cloneAndDeduplicateSprm(std::pair<Id, RTFValue::Pointer_t>& rSprm, RTFSprms& ret)
{
@@ -161,7 +178,8 @@ static void cloneAndDeduplicateSprm(std::pair<Id, RTFValue::Pointer_t>& rSprm, R
{
if (rSprm.second->equals(*pValue))
{
- ret.erase(rSprm.first); // duplicate to style
+ if (!isSPRMDeduplicateBlacklist(rSprm.first))
+ ret.erase(rSprm.first); // duplicate to style
}
else if (!rSprm.second->getSprms().empty() || !rSprm.second->getAttributes().empty())
{