diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2013-10-01 16:57:56 +0200 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-10-09 13:52:41 +0000 |
commit | d41fc60d4443e3ff22ac3ef0e56cb9131cd49cc9 (patch) | |
tree | 2a9200917c86f10c67ff200aee26a70a3fdd890d /sw | |
parent | 34c5218c9a33d136bbb9b1e2f91f0f4557ab3fad (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.
(cherry picked from commit bbef85c157169efa958ea1014d91d467cb243e6f)
Conflicts:
sw/qa/extras/ooxmlimport/ooxmlimport.cxx
writerfilter/source/dmapper/DomainMapper_Impl.hxx
Change-Id: Ic1fbceb54c8ec223ed01836fafe6220bb3b2410a
Reviewed-on: https://gerrit.libreoffice.org/6104
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw')
-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 913cc1626423..2076c8c96fcf 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx @@ -134,6 +134,7 @@ public: void testFdo68607(); void testVmlTextVerticalAdjust(); void testGroupshapeSdt(); + void testBnc779620(); CPPUNIT_TEST_SUITE(Test); #if !defined(MACOSX) && !defined(WNT) @@ -233,6 +234,7 @@ void Test::run() {"fdo68607.docx", &Test::testFdo68607}, {"vml-text-vertical-adjust.docx", &Test::testVmlTextVerticalAdjust}, {"groupshape-sdt.docx", &Test::testGroupshapeSdt}, + {"bnc779620.docx", &Test::testBnc779620}, }; header(); for (unsigned int i = 0; i < SAL_N_ELEMENTS(aMethods); ++i) @@ -1642,6 +1644,14 @@ void Test::testGroupshapeSdt() CPPUNIT_ASSERT_EQUAL(sal_Int32(20), getProperty<sal_Int32>(getRun(getParagraphOfText(1, xShape->getText()), 1), "CharKerning")); } +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(); |