diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2013-10-01 16:57:56 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2013-10-01 17:28:18 +0200 |
commit | bbef85c157169efa958ea1014d91d467cb243e6f (patch) | |
tree | 0160faef29a7ef7bf33b4b37e8bcdc307e4d7f29 /sw/qa/extras/ooxmlimport | |
parent | e85eadc888285a42561cc52133172cf5f4317da2 (diff) |
bnc#779620 DOCX import: try harder to convert floating tables to text frames
Since 78d1f1c2835b9fae0f91ed771fc1d594c7817502, we convert floating
tables to text frames only in case it's possible that there will be
wrapping, to give better results for multi-page tables, which are
multi-page, and technically floating ones, but that has no effect on the
layout.
The problem was that we try to do this decision too early, effectively
the page width and margins were counted from the default letter size,
instead of the actual values, which did not arrive at the time of the
decision. Fix this by moving this logic at the section end.
Change-Id: Ic1fbceb54c8ec223ed01836fafe6220bb3b2410a
Diffstat (limited to 'sw/qa/extras/ooxmlimport')
-rw-r--r-- | sw/qa/extras/ooxmlimport/data/bnc779620.docx | bin | 0 -> 10299 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlimport/ooxmlimport.cxx | 10 |
2 files changed, 10 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlimport/data/bnc779620.docx b/sw/qa/extras/ooxmlimport/data/bnc779620.docx Binary files differnew file mode 100644 index 000000000000..23c126d7ce21 --- /dev/null +++ b/sw/qa/extras/ooxmlimport/data/bnc779620.docx diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx index f2ab2c4407dc..b1c45838d98f 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx @@ -137,6 +137,7 @@ public: void testDefaultSectBreakCols(); void testFdo69636(); void testChartProp(); + void testBnc779620(); CPPUNIT_TEST_SUITE(Test); #if !defined(MACOSX) && !defined(WNT) @@ -238,6 +239,7 @@ void Test::run() {"default-sect-break-cols.docx", &Test::testDefaultSectBreakCols}, {"fdo69636.docx", &Test::testFdo69636}, {"chart-prop.docx", &Test::testChartProp}, + {"bnc779620.docx", &Test::testBnc779620}, }; header(); for (unsigned int i = 0; i < SAL_N_ELEMENTS(aMethods); ++i) @@ -1584,6 +1586,14 @@ void Test::testChartProp() CPPUNIT_ASSERT_EQUAL(sal_Int32(8886), getProperty<sal_Int32>(xPropertySet, "Height")); } +void Test::testBnc779620() +{ + // The problem was that the floating table was imported as a non-floating one. + uno::Reference<text::XTextFramesSupplier> xTextFramesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xIndexAccess(xTextFramesSupplier->getTextFrames(), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xIndexAccess->getCount()); +} + CPPUNIT_TEST_SUITE_REGISTRATION(Test); CPPUNIT_PLUGIN_IMPLEMENT(); |