diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-12-02 09:05:14 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-12-03 20:26:44 +0100 |
commit | 5e09e31a3ae8941d8733855f0cca49756c80d1bb (patch) | |
tree | d9dffb15e62fcfa9834b58bca7c90bdb6371feaa /sw | |
parent | e83b77681d8716e0e044ecaf53bbdd4d083f1137 (diff) |
tdf#94043 RTF filter: implement column separator handling
Change-Id: I9d74642156d7bb79577671bae24346c75178c5c7
(cherry picked from commit 5cbe4bcc281c77f4929caf1c387f7732fc8f113b)
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/rtfexport/data/tdf94043.rtf | 17 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/rtfexport.cxx | 9 | ||||
-rw-r--r-- | sw/source/filter/ww8/rtfattributeoutput.cxx | 3 |
3 files changed, 29 insertions, 0 deletions
diff --git a/sw/qa/extras/rtfexport/data/tdf94043.rtf b/sw/qa/extras/rtfexport/data/tdf94043.rtf new file mode 100644 index 000000000000..36bd0973c2d8 --- /dev/null +++ b/sw/qa/extras/rtfexport/data/tdf94043.rtf @@ -0,0 +1,17 @@ +{\rtf1 +\pard\plain +{AAA} +\par \sect\sectd\cols2\linebetcol\colsx0\ltrsect\sbknone\pard\plain +{\rtlch \ltrch\loch +Section 1, first column, this has a separator.} +\par \pard\plain +{Section 1, second column.} +\par \sect\sectd\sbknone\pard\plain +{BBB} +\par \sect\sectd\cols2\colsx0\ltrsect\sbknone\pard\plain +{Section 2, first column, this has no separator.} +\par \pard\plain +{Section 2, second column.} +\par \sect\sectd\sbknone\pard\plain +{CCC} +\par } diff --git a/sw/qa/extras/rtfexport/rtfexport.cxx b/sw/qa/extras/rtfexport/rtfexport.cxx index 4ae23e958300..136860806a49 100644 --- a/sw/qa/extras/rtfexport/rtfexport.cxx +++ b/sw/qa/extras/rtfexport/rtfexport.cxx @@ -28,6 +28,7 @@ #include <com/sun/star/text/WritingMode2.hpp> #include <com/sun/star/view/XViewSettingsSupplier.hpp> #include <com/sun/star/text/RubyAdjust.hpp> +#include <com/sun/star/text/XTextColumns.hpp> #include <vcl/svapp.hxx> @@ -943,6 +944,14 @@ DECLARE_RTFEXPORT_TEST(testTdf92521, "tdf92521.odt") CPPUNIT_ASSERT_EQUAL(2, getPages()); } +DECLARE_RTFEXPORT_TEST(testTdf94043, "tdf94043.rtf") +{ + auto xTextSection = getProperty< uno::Reference<beans::XPropertySet> >(getParagraph(2), "TextSection"); + auto xTextColumns = getProperty< uno::Reference<text::XTextColumns> >(xTextSection, "TextColumns"); + // This was 0, the separator line was not visible due to 0 width. + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(2), getProperty<sal_Int32>(xTextColumns, "SeparatorLineWidth")); +} + 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 577d827d14b4..ab9ad06b857b 100644 --- a/sw/source/filter/ww8/rtfattributeoutput.cxx +++ b/sw/source/filter/ww8/rtfattributeoutput.cxx @@ -3330,6 +3330,9 @@ void RtfAttributeOutput::FormatColumns_Impl(sal_uInt16 nCols, const SwFormatCol& m_rExport.Strm().WriteCharPtr(OOO_STRING_SVTOOLS_RTF_COLS); m_rExport.OutLong(nCols); + if (rCol.GetLineAdj() != COLADJ_NONE) + m_rExport.Strm().WriteCharPtr(OOO_STRING_SVTOOLS_RTF_LINEBETCOL); + if (bEven) { m_rExport.Strm().WriteCharPtr(OOO_STRING_SVTOOLS_RTF_COLSX); |