diff options
author | Michael Stahl <mstahl@redhat.com> | 2014-08-01 10:44:00 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2014-08-01 11:02:32 +0200 |
commit | df041e468baf604f6e2606e5b632aa654b19a65d (patch) | |
tree | 40f610ec33a9b45f0e268eee9e1c2c4a2ba0bb02 | |
parent | b92e9f45442b109d743a620775e1691b45d1e831 (diff) |
fdo#81892: writerfilter: RTF import: add support for table row alignment
These keywords were simply not implemented.
Change-Id: Ib4d07a4b2dfb07cfd56a4ee07d7c14d1c59323f9
-rw-r--r-- | sw/qa/extras/rtfimport/rtfimport.cxx | 9 | ||||
-rw-r--r-- | writerfilter/source/rtftok/rtfdocumentimpl.cxx | 21 |
2 files changed, 30 insertions, 0 deletions
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx index bb9cbb40981a..5c033c22b9c8 100644 --- a/sw/qa/extras/rtfimport/rtfimport.cxx +++ b/sw/qa/extras/rtfimport/rtfimport.cxx @@ -336,6 +336,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 3bba4c451af9..61398ea5f275 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -2683,6 +2683,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) { |