Kaydet (Commit) 52803dca authored tarafından Miklos Vajna's avatar Miklos Vajna

fdo#44984 RTF import: handle form fields inside tables

Change-Id: I84b3d5186e99b8313cfb32398869de028a267b49
üst 422f873b
{\rtf1
\pard\plain
{A\par \ltrrow}
\trowd \cellx954
\pard \intbl
{\field\flddirty\fldpriv
{\*\fldinst
{\rtlch
\fcs1 \af4\afs16 \ltrch\fcs0 \f4\fs16\insrsid7932335
\hich\af4\dbch\af31505\loch\f4 FORMCHECKBOX }
{
\rtlch\fcs1 \af4\afs16 \ltrch\fcs0 \f4\fs16\insrsid7932335
{\*\datafield 6500000014000000114b6f6e74726f6c6c6be473746368656e3100000000000000000000000000}
{\*\formfield
{\fftype1\ffres25\fftypetxt0\ffhps20
{\*\ffname Kontrollk\'e4stchen1}
\ffdefres0}
}
}
}
{\fldrslt }
}
{B \cell }
\pard \intbl
\row
\pard
{
C
\par }
}
......@@ -1941,6 +1941,16 @@ DECLARE_RTFIMPORT_TEST(testFdo82114, "fdo82114.rtf")
CPPUNIT_ASSERT_EQUAL(aExpected, aActual);
}
DECLARE_RTFIMPORT_TEST(testFdo44984, "fdo44984.rtf")
{
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);
uno::Reference<text::XTextRange> xCell(xTable->getCellByName("A1"), uno::UNO_QUERY);
// This was Text, i.e. the checkbox field portion was missing.
CPPUNIT_ASSERT_EQUAL(OUString("TextFieldStartEnd"), getProperty<OUString>(getRun(getParagraphOfText(1, xCell->getText()), 1), "TextPortionType"));
}
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -4922,8 +4922,16 @@ int RTFDocumentImpl::popState()
RTFSprms aFFAttributes;
RTFSprms aFFSprms;
aFFSprms.set(NS_ooxml::LN_ffdata, pValue);
writerfilter::Reference<Properties>::Pointer_t const pProperties(new RTFReferenceProperties(aFFAttributes, aFFSprms));
Mapper().props(pProperties);
if (!m_aStates.top().pCurrentBuffer)
{
writerfilter::Reference<Properties>::Pointer_t const pProperties(new RTFReferenceProperties(aFFAttributes, aFFSprms));
Mapper().props(pProperties);
}
else
{
RTFValue::Pointer_t pFFValue(new RTFValue(aFFAttributes, aFFSprms));
m_aStates.top().pCurrentBuffer->push_back(Buf_t(BUFFER_PROPS, pFFValue));
}
m_aFormfieldAttributes.clear();
m_aFormfieldSprms.clear();
singleChar(0x14);
......
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