diff options
author | Balazs Varga <balazs.varga991@gmail.com> | 2018-07-17 10:06:27 +0200 |
---|---|---|
committer | László Németh <nemeth@numbertext.org> | 2018-07-18 09:20:20 +0200 |
commit | 4edb7599d83c897cc7e800b916dcedf07b645cba (patch) | |
tree | 3adb67beeedec639030a620af25b04e998ab74ae /sw | |
parent | 1445d84cdc906fabf6cc7a59f3c94b4049477701 (diff) |
tdf#118651 OOXML ActiveX textbox: fix multiline support
of textfield component in DOCX/PPTX by handling properties
AX_FLAGS_MULTILINE and AX_FLAGS_WORDWRAP during the import
and export. Both of them need to be enabled to get multiline
textfield in MSO, but LibreOffice has got only one multiline
property. With this fix, LibreOffice imports only really
multiline textfields as multiline, and it doesn't export
multiline textfields as single line anymore.
Change-Id: I9b567c3fcdc5d01a5838a3ec2517579f8d788954
Reviewed-on: https://gerrit.libreoffice.org/57552
Reviewed-by: László Németh <nemeth@numbertext.org>
Tested-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/activex_textbox.docx | bin | 0 -> 16937 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport9.cxx | 25 |
2 files changed, 25 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/activex_textbox.docx b/sw/qa/extras/ooxmlexport/data/activex_textbox.docx Binary files differnew file mode 100644 index 000000000000..6f137008ce78 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/activex_textbox.docx diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx index 1d40cfef8268..b3551e52ae89 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx @@ -934,6 +934,31 @@ DECLARE_OOXMLEXPORT_TEST(testTdf106062_nonHangingFootnote, "tdf106062_nonHanging CPPUNIT_ASSERT_MESSAGE( "Footnote starts with a tab", xTextRange->getString().startsWith("\t") ); } +DECLARE_OOXMLEXPORT_TEST( testActiveXTextfield, "activex_textbox.docx" ) +{ + uno::Reference<drawing::XControlShape> xControlShape( getShape(1), uno::UNO_QUERY ); + CPPUNIT_ASSERT( xControlShape.is() ); + + // Check control type + uno::Reference<beans::XPropertySet> xPropertySet( xControlShape->getControl(), uno::UNO_QUERY ); + uno::Reference<lang::XServiceInfo> xServiceInfo( xPropertySet, uno::UNO_QUERY ); + CPPUNIT_ASSERT_EQUAL( true, bool( xServiceInfo->supportsService ( "com.sun.star.form.component.TextField" ) ) ); + + // Check textfield is multi-line + CPPUNIT_ASSERT_EQUAL( true, getProperty<bool>(xPropertySet, "MultiLine") ); + + uno::Reference<drawing::XControlShape> xControlShape2( getShape(2), uno::UNO_QUERY ); + CPPUNIT_ASSERT( xControlShape2.is() ); + + // Check control type + uno::Reference<beans::XPropertySet> xPropertySet2( xControlShape2->getControl(), uno::UNO_QUERY ); + uno::Reference<lang::XServiceInfo> xServiceInfo2( xPropertySet2, uno::UNO_QUERY ); + CPPUNIT_ASSERT_EQUAL( true, bool( xServiceInfo2->supportsService ( "com.sun.star.form.component.TextField" ) ) ); + + // Check textfield is single-line + CPPUNIT_ASSERT_EQUAL( false, getProperty<bool>(xPropertySet2, "MultiLine") ); +} + DECLARE_OOXMLEXPORT_TEST( testActiveXCheckbox, "activex_checkbox.docx" ) { uno::Reference<drawing::XControlShape> xControlShape( getShape(1), uno::UNO_QUERY ); |