[Libreoffice-commits] core.git: Branch 'libreoffice-5-4' - sw/qa writerfilter/source

Miklos Vajna vmiklos at collabora.co.uk
Tue Jul 18 15:46:44 UTC 2017


 sw/qa/extras/rtfexport/data/tdf108955.rtf |   11 +++++++++++
 sw/qa/extras/rtfexport/rtfexport.cxx      |    7 +++++++
 writerfilter/source/rtftok/rtfsprm.cxx    |    3 +++
 3 files changed, 21 insertions(+)

New commits:
commit b15de6b1e670b277b31f7fb579fc42a8ae5efbee
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Tue Jul 11 17:34:30 2017 +0200

    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 at redhat.com>
    Tested-by: Jenkins <ci at libreoffice.org>

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);
diff --git a/writerfilter/source/rtftok/rtfsprm.cxx b/writerfilter/source/rtftok/rtfsprm.cxx
index 2304fa826044..a1d0605a248b 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:


More information about the Libreoffice-commits mailing list