diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2017-07-11 17:34:30 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2017-07-18 09:00:50 +0200 |
commit | 138269391a9ac8cdc0c00b55e1fbc84a94c84a77 (patch) | |
tree | 13c913d1d981748ba546825cca9ffc520cf28265 | |
parent | 8fc843472e764ce78c41d59134d72170a27facf9 (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>
-rw-r--r-- | sw/qa/extras/rtfexport/data/tdf108955.rtf | 11 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/rtfexport.cxx | 7 | ||||
-rw-r--r-- | writerfilter/source/rtftok/rtfsprm.cxx | 3 |
3 files changed, 21 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); diff --git a/writerfilter/source/rtftok/rtfsprm.cxx b/writerfilter/source/rtftok/rtfsprm.cxx index edc978e6bd6f..c88bd910cb88 100644 --- a/writerfilter/source/rtftok/rtfsprm.cxx +++ b/writerfilter/source/rtftok/rtfsprm.cxx @@ -185,6 +185,9 @@ static bool isSPRMChildrenExpected(Id nId) case NS_ooxml::LN_CT_PBdr_bottom: case NS_ooxml::LN_CT_PBdr_right: // Expected children are NS_ooxml::LN_CT_Border_*. + SAL_FALLTHROUGH; + case NS_ooxml::LN_CT_PrBase_shd: + // Expected children are NS_ooxml::LN_CT_Shd_*. return true; default: |