diff options
author | Michael Stahl <mstahl@redhat.com> | 2014-08-01 10:44:00 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-08-01 16:07:50 +0000 |
commit | 9294fd3f8630391f3b85031a345a53d066934a42 (patch) | |
tree | dcc7b6bcde5ab323defd049e7a6bf47297428784 | |
parent | 818f4d14981f6731090e5d3ea7c818c9149b4d27 (diff) |
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 <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
-rw-r--r-- | sw/qa/extras/rtfimport/data/fdo81892.rtf | 26 | ||||
-rw-r--r-- | sw/qa/extras/rtfimport/rtfimport.cxx | 9 | ||||
-rw-r--r-- | writerfilter/source/rtftok/rtfdocumentimpl.cxx | 21 |
3 files changed, 56 insertions, 0 deletions
diff --git a/sw/qa/extras/rtfimport/data/fdo81892.rtf b/sw/qa/extras/rtfimport/data/fdo81892.rtf new file mode 100644 index 000000000000..73cd53d50acc --- /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 cfa347beacc0..f36b53032503 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 68db15d778da..01a857479bdc 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) { |