summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-10-25 12:15:16 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-10-25 12:52:27 +0200
commitf824b1b575dbdb2bc515656a66cbb94764031a44 (patch)
tree9af71f509c7caa759a30103eb4fc75fbf2439bcb
parent8f97b20e94ea5e1b56f534eb5bbff8e48402d6be (diff)
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. Change-Id: I6d6eedbc8d3ee4bee0f2aadb51a376c7734c6640
-rw-r--r--sw/CppunitTest_sw_rtfexport.mk1
-rw-r--r--sw/qa/extras/rtfexport/data/fdo82858.docxbin0 -> 10672 bytes
-rw-r--r--sw/qa/extras/rtfexport/rtfexport.cxx6
-rw-r--r--sw/source/filter/ww8/rtfattributeoutput.cxx3
4 files changed, 10 insertions, 0 deletions
diff --git a/sw/CppunitTest_sw_rtfexport.mk b/sw/CppunitTest_sw_rtfexport.mk
index fc692d76a0f4..33f366b16ff1 100644
--- a/sw/CppunitTest_sw_rtfexport.mk
+++ b/sw/CppunitTest_sw_rtfexport.mk
@@ -76,6 +76,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 000000000000..e0b1a1392da6
--- /dev/null
+++ b/sw/qa/extras/rtfexport/data/fdo82858.docx
Binary files differ
diff --git a/sw/qa/extras/rtfexport/rtfexport.cxx b/sw/qa/extras/rtfexport/rtfexport.cxx
index 2ffbb38c5ddf..4cbb975019a7 100644
--- a/sw/qa/extras/rtfexport/rtfexport.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport.cxx
@@ -719,6 +719,12 @@ DECLARE_RTFEXPORT_TEST(testFdo82860, "fdo82860.odt")
CPPUNIT_ASSERT_EQUAL(OUString("hello"), getParagraphOfText(1, xText)->getString());
}
+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 bb0e6f5a198e..2d3a882f5a2c 100644
--- a/sw/source/filter/ww8/rtfattributeoutput.cxx
+++ b/sw/source/filter/ww8/rtfattributeoutput.cxx
@@ -3104,6 +3104,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;