diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-04-07 16:47:23 +0200 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2016-04-21 11:01:39 +0200 |
commit | aee29ee1ec19f16f2d5bdaa2f809fb6532d36951 (patch) | |
tree | b53cde2ffa4d6ef59d3a09e9b7428753b187d02c /sw | |
parent | d686fd67f25466c8a6ec9d24538550b86f7fb3cd (diff) |
tdf#99140 DOCX import: fix table at the bottom of the page to span over ...
... multiple pages.
In short, one more blacklist entry when conversion should not be
performed.
Conflicts:
sw/qa/extras/ooxmlimport/ooxmlimport.cxx
Also (because otherwise the first commit would introduce a regression):
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.
(cherry picked from commits d56deaeb2a1e8007e50fc2334f416fddd4e3cde3,
c07f04ab422eadba0f2c3c128a0e3ff78e90cdf2, and
fd61dee6457a44687f1142dd55bfee6b64fda2ef)
Change-Id: I764f02cc58ae1b7af802b81e570e4feaf73ee2c1
Reviewed-on: https://gerrit.libreoffice.org/23987
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Andras Timar <andras.timar@collabora.com>
(cherry picked from commit 52f6fb0f4e91ebcd5115e29d25407eeed82992d5)
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/ooxmlimport/data/tdf99140.docx | bin | 0 -> 13349 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlimport/ooxmlimport.cxx | 15 |
2 files changed, 15 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlimport/data/tdf99140.docx b/sw/qa/extras/ooxmlimport/data/tdf99140.docx Binary files differnew file mode 100644 index 000000000000..42fa73d2f8e0 --- /dev/null +++ b/sw/qa/extras/ooxmlimport/data/tdf99140.docx diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx index a5b5cac303e7..39c469a86630 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx @@ -2917,6 +2917,21 @@ DECLARE_OOXMLIMPORT_TEST(testTdf98882, "tdf98882.docx") CPPUNIT_ASSERT_EQUAL(nFlyHeight, nContentHeight); } +DECLARE_OOXMLIMPORT_TEST(testTdf99140, "tdf99140.docx") +{ + uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY); + uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(xTextDocument, uno::UNO_QUERY); + uno::Reference<drawing::XDrawPage> xDrawPage = xDrawPageSupplier->getDrawPage(); + // This was 1: a multi-page floating table was imported as a TextFrame. + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), xDrawPage->getCount()); + + uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY); + uno::Reference<beans::XPropertySet> 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<sal_Int16>(xTableProperties, "HoriOrient")); +} + #endif CPPUNIT_PLUGIN_IMPLEMENT(); |