Kaydet (Commit) 08eaac43 authored tarafından Miklos Vajna's avatar Miklos Vajna

RTF import: handle right-to-left tables

Change-Id: If2e60557b7551839c344d56cb3a720ae3659e93c
üst 4f844244
{\rtf1
\trowd\rtlrow\cellx4703\cellx9514
\pard\plain\intbl A1\cell B1\cell\row
\pard\plain\par
}
......@@ -22,6 +22,7 @@
#include <com/sun/star/text/XFootnotesSupplier.hpp>
#include <com/sun/star/text/XPageCursor.hpp>
#include <com/sun/star/text/XTextViewCursorSupplier.hpp>
#include <com/sun/star/text/WritingMode2.hpp>
#include <com/sun/star/view/XViewSettingsSupplier.hpp>
#include <vcl/svapp.hxx>
......@@ -826,6 +827,15 @@ DECLARE_RTFEXPORT_TEST(testCjklist38, "cjklist38.rtf")
CPPUNIT_ASSERT_EQUAL(style::NumberingType::NUMBER_UPPER_ZH, numFormat);
}
DECLARE_RTFEXPORT_TEST(testTableRtl, "table-rtl.rtf")
{
uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY);
uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY);
uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY);
// This was text::WritingMode2::LR_TB, i.e. direction of the table was ignored.
CPPUNIT_ASSERT_EQUAL(text::WritingMode2::RL_TB, getProperty<sal_Int16>(xTable, "WritingMode"));
}
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -3007,7 +3007,7 @@ int RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword)
break;
case RTF_LTRROW:
case RTF_RTLROW:
// dmapper does not support these.
m_aStates.top().aTableRowSprms.set(NS_ooxml::LN_CT_TblPrBase_bidiVisual, RTFValue::Pointer_t(new RTFValue(nKeyword == RTF_RTLROW)));
break;
case RTF_LTRCH:
// dmapper does not support this.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment