summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2017-07-11 17:34:30 +0200
committerMichael Stahl <mstahl@redhat.com>2017-07-18 17:45:57 +0200
commitb15de6b1e670b277b31f7fb579fc42a8ae5efbee (patch)
tree3ee81eadcfa8817252b1999127bdbf3c80293a15 /sw
parent2cd91d79b90316f6a21db64bd944cb828b345a78 (diff)
tdf#108955 RTF import: fix missing paragraph background
See commit 1be0a3fa9ebb22b607c54b47739d4467acfed259 (n#825305: writerfilter RTF import: override style properties like Word, 2014-06-17) for the context. Here the problem was that details of the paragraph background were removed during the style deduplication, but not the paragraph background sprm itself. That was interpreted (correctly) by dmapper as "no background", rather than "inherit from style". (cherry picked from commit 138269391a9ac8cdc0c00b55e1fbc84a94c84a77) Change-Id: I88904cbd0a3c7686ede1f98d06df8fc875978afc Reviewed-on: https://gerrit.libreoffice.org/40131 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/rtfexport/data/tdf108955.rtf11
-rw-r--r--sw/qa/extras/rtfexport/rtfexport.cxx7
2 files changed, 18 insertions, 0 deletions
diff --git a/sw/qa/extras/rtfexport/data/tdf108955.rtf b/sw/qa/extras/rtfexport/data/tdf108955.rtf
new file mode 100644
index 000000000000..f804a897be4c
--- /dev/null
+++ b/sw/qa/extras/rtfexport/data/tdf108955.rtf
@@ -0,0 +1,11 @@
+{\rtf1\adeflang1037\ansi\ansicpg1252\uc1\adeff0\deff0\stshfdbch0\stshfloch0\stshfhich0\stshfbi0\deflang1033\deflangfe1033\themelang1033\themelangfe0\themelangcs1037
+{\colortbl;\red0\green0\blue0;\red0\green0\blue255;
+\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;\red128\green0\blue128;\red128\green0\blue0;
+\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;\red255\green255\blue153;}
+\noqfpromote
+{\stylesheet
+{\s2 \cbpat17 heading 2;}
+}
+\pard\plain \s2\cbpat17 Lorum qua spo
+\par }
+}
diff --git a/sw/qa/extras/rtfexport/rtfexport.cxx b/sw/qa/extras/rtfexport/rtfexport.cxx
index e7407fb3c886..85f1c83a988b 100644
--- a/sw/qa/extras/rtfexport/rtfexport.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport.cxx
@@ -933,6 +933,13 @@ DECLARE_RTFEXPORT_TEST(testHyphpar, "hyphpar.rtf")
CPPUNIT_ASSERT_EQUAL(false, getProperty<bool>(getParagraph(2), "ParaIsHyphenation"));
}
+DECLARE_RTFEXPORT_TEST(testTdf108955, "tdf108955.rtf")
+{
+ CPPUNIT_ASSERT_EQUAL(drawing::FillStyle_SOLID, getProperty<drawing::FillStyle>(getParagraph(1), "FillStyle"));
+ // This was 0xffffff, i.e. non-white background was overwritten from the paragraph style.
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0xffff99), getProperty<sal_Int32>(getParagraph(1), "FillColor"));
+}
+
DECLARE_RTFEXPORT_TEST(testTdf80708, "tdf80708.rtf")
{
uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY);