Kaydet (Commit) 6eb02ac8 authored tarafından Miklos Vajna's avatar Miklos Vajna

fdo#65090 RTF filter: import RTF_CLMGF and RTF_CLMRG

These describe an explicit horizontal merge, that is not something Word
itself creates, but it turns out the Calc RTF export does.

Change-Id: I1b6ec10bb8e8bd40e24791ccc96f2f066dd0d5d5
üst c7662eea
{\rtf\ansi
{
\trowd\trgaph30\trleft-30\trrh242\clmgf\clvertalc\cellx1280\clmrg\clvertalb\cellx2560\clvertalb\cellx3840\pard\plain\intbl
\qc a\cell\cell\ql b\cell\row
}
}
......@@ -1379,6 +1379,16 @@ DECLARE_RTFIMPORT_TEST(testCp1000016, "hello.rtf")
CPPUNIT_ASSERT_EQUAL(false, bFound);
}
DECLARE_RTFIMPORT_TEST(testFdo65090, "fdo65090.rtf")
{
uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY);
uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables( ), uno::UNO_QUERY);
uno::Reference<text::XTextTable> xTextTable(xTables->getByIndex(0), uno::UNO_QUERY);
uno::Reference<table::XTableRows> xTableRows(xTextTable->getRows(), uno::UNO_QUERY);
// The first row had 3 cells, instead of a horizontally merged one and a normal one (2 -> 1 separator).
CPPUNIT_ASSERT_EQUAL(sal_Int32(1), getProperty< uno::Sequence<text::TableColumnSeparator> >(xTableRows->getByIndex(0), "TableColumnSeparators").getLength());
}
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -2449,6 +2449,18 @@ int RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword)
m_aStates.top().nBorderState = BORDER_CHARACTER;
}
break;
case RTF_CLMGF:
{
RTFValue::Pointer_t pValue(new RTFValue(NS_ooxml::LN_Value_ST_Merge_restart));
m_aStates.top().aTableCellSprms.set(NS_ooxml::LN_CT_TcPrBase_hMerge, pValue);
}
break;
case RTF_CLMRG:
{
RTFValue::Pointer_t pValue(new RTFValue(NS_ooxml::LN_Value_ST_Merge_continue));
m_aStates.top().aTableCellSprms.set(NS_ooxml::LN_CT_TcPrBase_hMerge, pValue);
}
break;
case RTF_CLVMGF:
{
RTFValue::Pointer_t pValue(new RTFValue(NS_ooxml::LN_Value_ST_Merge_restart));
......
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