diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2018-05-08 09:06:26 +0200 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2018-05-15 10:15:16 +0200 |
commit | 0e0bdd709e744112018bd042fced01ba931cfd90 (patch) | |
tree | 915fd584f591a0b9b48e3991d3cc378ade833c0f /sw | |
parent | cf88c107abb3a77b939665baeee897f1bae4d854 (diff) |
tdf#117403 RTF import: fix lost cell border of merged cell
If two source cells have different border types, then Writer takes the
second, Word takes the first. So mimic the MSO behavior explicitly in
dmapper.
(cherry picked from commit 42b32321381126ad70700424b8970dbc45a843f5)
Change-Id: I25adc62e024a929216c7b05fec44e1f602f28285
Reviewed-on: https://gerrit.libreoffice.org/54089
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
(cherry picked from commit 9223a8766e5a055f77e9cc7bccbfa718e6122e28)
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/rtfimport/data/tdf117403.rtf | 15 | ||||
-rw-r--r-- | sw/qa/extras/rtfimport/rtfimport.cxx | 14 |
2 files changed, 29 insertions, 0 deletions
diff --git a/sw/qa/extras/rtfimport/data/tdf117403.rtf b/sw/qa/extras/rtfimport/data/tdf117403.rtf new file mode 100644 index 000000000000..243fe548c246 --- /dev/null +++ b/sw/qa/extras/rtfimport/data/tdf117403.rtf @@ -0,0 +1,15 @@ +{\rtf\ansi\ansicpg1252\deff2 +{\fonttbl +{\f0\fcharset238\froman Tms Rmn;} +{\f1\fdecor Symbol;} +{\f2\fcharset238\fswiss Helv;} +{\f3\fcharset238\fmodern Courier New;} +} +\sectd +\pgwsxn16837\pghsxn11905\marglsxn400\margrsxn400\margtsxn801\margbsxn801\lndscpsxn\plain\fs20\pard\qc +\pard\pard +\par +\trowd\clmgf\clbrdrb\brdrs\brdrw1\cellx1764\clmrg\cellx2325 +\pard\intbl \qc \fs12 A1\cell +\pard\intbl \cell +\row \pard \par} diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx index 22e037ae2235..f49ba5eece55 100644 --- a/sw/qa/extras/rtfimport/rtfimport.cxx +++ b/sw/qa/extras/rtfimport/rtfimport.cxx @@ -1316,6 +1316,20 @@ DECLARE_RTFIMPORT_TEST(testTdf78506, "tdf78506.rtf") } } +DECLARE_RTFIMPORT_TEST(testTdf117403, "tdf117403.rtf") +{ + uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTextTablesSupplier->getTextTables(), + uno::UNO_QUERY); + uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xCell(xTable->getCellByName("A1"), uno::UNO_QUERY); + CPPUNIT_ASSERT(xCell.is()); + table::BorderLine2 aExpected(static_cast<sal_Int32>(COL_BLACK), 0, 4, 0, + table::BorderLineStyle::SOLID, 4); + // This failed, border was not imported, OuterLineWidth was 0 instead of 4. + CPPUNIT_ASSERT_BORDER_EQUAL(aExpected, getProperty<table::BorderLine2>(xCell, "BottomBorder")); +} + DECLARE_RTFIMPORT_TEST(testImportHeaderFooter, "tdf108055.rtf") { // The RTF import sometimes added Header and Footer multiple Times |