From fd61dee6457a44687f1142dd55bfee6b64fda2ef Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Fri, 8 Apr 2016 17:18:55 +0200 Subject: tdf#99140 DOCX import: fix table horizontal aligment to be 'from left' ... ... when it was 'manual'. Regression from commit c1e563f6efd09cd3463f1b92a3022ae288c92087 (fdo#76741 [DOCX] Table Alignment and width type, 2014-04-04), DOCX import code had to deal with two kinds of horizontal alignment when it came to floating tables: the alignment of the table itself, and the alignment of the float parameters. The problem is, in general it's wanted that the table is aligned according to the floating parameters, but in Writer the "from left" UI setting is described differently for tables and fly frames: tables use LEFT_AND_WIDTH for that, while fly frames use NONE. Fix the problem by touching the default only in case the floating parameters have something that's different from NONE. With this, the width of tables is no longer lost when they are described to be floating ones in the DOCX markup, but FloatingTableConversion() decides to ignore that. Change-Id: Idd41c3e03e6ded8552e9d15b6080e4b45eb18d3d Reviewed-on: https://gerrit.libreoffice.org/23923 Reviewed-by: Miklos Vajna Tested-by: Jenkins --- sw/qa/extras/ooxmlimport/ooxmlimport.cxx | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'sw') diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx index da3ccc7db741..d838edb08553 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx @@ -3231,6 +3231,12 @@ DECLARE_OOXMLIMPORT_TEST(testTdf99140, "tdf99140.docx") uno::Reference xDrawPage = xDrawPageSupplier->getDrawPage(); // This was 1: a multi-page floating table was imported as a TextFrame. CPPUNIT_ASSERT_EQUAL(static_cast(0), xDrawPage->getCount()); + + uno::Reference xTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY); + uno::Reference xTableProperties(xTables->getByIndex(1), uno::UNO_QUERY); + // This was text::HoriOrientation::NONE, the second table was too wide due to this. + CPPUNIT_ASSERT_EQUAL(text::HoriOrientation::LEFT_AND_WIDTH, getProperty(xTableProperties, "HoriOrient")); } CPPUNIT_PLUGIN_IMPLEMENT(); -- cgit v1.2.3