[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sw/CppunitTest_sw_rtfexport.mk sw/qa sw/source

Miklos Vajna vmiklos at collabora.co.uk
Mon Nov 3 06:53:48 PST 2014


 sw/CppunitTest_sw_rtfexport.mk              |    1 +
 sw/qa/extras/rtfexport/data/fdo82858.docx   |binary
 sw/qa/extras/rtfexport/rtfexport.cxx        |    6 ++++++
 sw/source/filter/ww8/rtfattributeoutput.cxx |    3 +++
 4 files changed, 10 insertions(+)

New commits:
commit 0ec92e9bc778d6edf3a349e7c89eac8850caef60
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Sat Oct 25 12:15:16 2014 +0200

    fdo#82858 RTF export: fix "none" line style of TextFrames
    
    Regression from commit 9e6a5b94e00f0054b058dbb42c2c0b6c75236c9d
    (RtfAttributeOutput::FormatBox: export line{Color,Width} shape
    properties, 2013-04-15), in case lineColor is written, but there is no
    border style, then an explicit fLine=0 property is needed, otherwise a
    black border shows up.
    
    (cherry picked from commit f824b1b575dbdb2bc515656a66cbb94764031a44)
    
    Change-Id: I6d6eedbc8d3ee4bee0f2aadb51a376c7734c6640
    Reviewed-on: https://gerrit.libreoffice.org/12185
    Reviewed-by: Michael Stahl <mstahl at redhat.com>
    Tested-by: Michael Stahl <mstahl at redhat.com>

diff --git a/sw/CppunitTest_sw_rtfexport.mk b/sw/CppunitTest_sw_rtfexport.mk
index 9c5e175..bacb2c1 100644
--- a/sw/CppunitTest_sw_rtfexport.mk
+++ b/sw/CppunitTest_sw_rtfexport.mk
@@ -75,6 +75,7 @@ $(eval $(call gb_CppunitTest_use_components,sw_rtfexport,\
 	uui/util/uui \
     writerfilter/util/writerfilter \
     xmloff/util/xo \
+	oox/util/oox \
 ))
 
 $(eval $(call gb_CppunitTest_use_configuration,sw_rtfexport))
diff --git a/sw/qa/extras/rtfexport/data/fdo82858.docx b/sw/qa/extras/rtfexport/data/fdo82858.docx
new file mode 100644
index 0000000..e0b1a13
Binary files /dev/null and b/sw/qa/extras/rtfexport/data/fdo82858.docx differ
diff --git a/sw/qa/extras/rtfexport/rtfexport.cxx b/sw/qa/extras/rtfexport/rtfexport.cxx
index 0617258..0f53098 100644
--- a/sw/qa/extras/rtfexport/rtfexport.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport.cxx
@@ -661,6 +661,12 @@ DECLARE_RTFEXPORT_TEST(testFdo79599, "fdo79599.rtf")
 
 #endif
 
+DECLARE_RTFEXPORT_TEST(testFdo82858, "fdo82858.docx")
+{
+    // This was table::BorderLineStyle::SOLID, exporter failed to write explicit no line when line color was written.
+    CPPUNIT_ASSERT_EQUAL(table::BorderLineStyle::NONE, getProperty<table::BorderLine2>(getShape(1), "TopBorder").LineStyle);
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx
index 51f9033..1ac0795 100644
--- a/sw/source/filter/ww8/rtfattributeoutput.cxx
+++ b/sw/source/filter/ww8/rtfattributeoutput.cxx
@@ -3042,6 +3042,9 @@ void RtfAttributeOutput::FormatBox(const SvxBoxItem& rBox)
                 sal_Int32 nWidth = sal_Int32(fConverted * 635); // Twips -> EMUs
                 m_aFlyProperties.push_back(std::make_pair<OString, OString>("lineWidth", OString::number(nWidth)));
             }
+            else
+                // No border: no line.
+                m_aFlyProperties.push_back(std::make_pair<OString, OString>("fLine", "0"));
         }
 
         return;


More information about the Libreoffice-commits mailing list