summaryrefslogtreecommitdiff
path: root/sw/qa/extras/rtfexport
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2017-07-11 17:34:30 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2017-07-18 09:00:50 +0200
commit138269391a9ac8cdc0c00b55e1fbc84a94c84a77 (patch)
tree13c913d1d981748ba546825cca9ffc520cf28265 /sw/qa/extras/rtfexport
parent8fc843472e764ce78c41d59134d72170a27facf9 (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". Change-Id: I88904cbd0a3c7686ede1f98d06df8fc875978afc Reviewed-on: https://gerrit.libreoffice.org/40099 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'sw/qa/extras/rtfexport')
-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 abba8f9bfe39..b7745e2c659e 100644
--- a/sw/qa/extras/rtfexport/rtfexport.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport.cxx
@@ -932,6 +932,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);