sw/qa/extras/rtfimport/data/fdo81892.rtf | 26 +++++++++++++++++++++++++ sw/qa/extras/rtfimport/rtfimport.cxx | 9 ++++++++ writerfilter/source/rtftok/rtfdocumentimpl.cxx | 21 ++++++++++++++++++++ 3 files changed, 56 insertions(+)
New commits: commit 9294fd3f8630391f3b85031a345a53d066934a42 Author: Michael Stahl <mst...@redhat.com> Date: Fri Aug 1 10:44:00 2014 +0200 fdo#81892: writerfilter: RTF import: add support for table row alignment These keywords were simply not implemented. (cherry picked from commit df041e468baf604f6e2606e5b632aa654b19a65d) fdo#81892: oops forgot the test document (cherry picked from commit bac3cdb1b8afd2fa8fdfea99d1d01dc2770d1ef1) Change-Id: Ib4d07a4b2dfb07cfd56a4ee07d7c14d1c59323f9 Reviewed-on: https://gerrit.libreoffice.org/10674 Reviewed-by: Miklos Vajna <vmik...@collabora.co.uk> Tested-by: Miklos Vajna <vmik...@collabora.co.uk> diff --git a/sw/qa/extras/rtfimport/data/fdo81892.rtf b/sw/qa/extras/rtfimport/data/fdo81892.rtf new file mode 100644 index 0000000..73cd53d --- /dev/null +++ b/sw/qa/extras/rtfimport/data/fdo81892.rtf @@ -0,0 +1,26 @@ +{\rtf1 + +\pard +\qc +\page +Performance +\par + + +\trowd +\trqc +\cellx8199 + +\pard +\intbl +13 +\cell + +\trowd +\trqc +\cellx8199 +\row + +\pard +\par +} diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx index cfa347b..f36b530 100644 --- a/sw/qa/extras/rtfimport/rtfimport.cxx +++ b/sw/qa/extras/rtfimport/rtfimport.cxx @@ -337,6 +337,15 @@ DECLARE_RTFIMPORT_TEST(testFdo46955, "fdo46955.rtf") } } +DECLARE_RTFIMPORT_TEST(testFdo81892, "fdo81892.rtf") +{ + // table was not centered + 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); + CPPUNIT_ASSERT_EQUAL(text::HoriOrientation::CENTER, getProperty<sal_Int16>(xTable, "HoriOrient")); +} + DECLARE_RTFIMPORT_TEST(testFdo45394, "fdo45394.rtf") { uno::Reference<text::XText> xHeaderText = getProperty< uno::Reference<text::XText> >(getStyles("PageStyles")->getByName(DEFAULT_STYLE), "HeaderText"); diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index 68db15d..01a8574 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -2693,6 +2693,27 @@ int RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword) return 0; } + switch (nKeyword) + { + case RTF_TRQL: + nParam = 0; + break; + case RTF_TRQC: + nParam = 1; + break; + case RTF_TRQR: + nParam = 2; + break; + default: + break; + } + if (nParam >= 0) + { + RTFValue::Pointer_t const pValue(new RTFValue(nParam)); + m_aStates.top().aTableRowSprms.set(NS_ooxml::LN_CT_TrPrBase_jc, pValue); + return 0; + } + // Cell Text Flow switch (nKeyword) { _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits