diff options
author | Miklos Vajna <vmiklos@suse.cz> | 2013-08-28 15:27:07 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@suse.cz> | 2013-08-28 16:15:12 +0200 |
commit | 76d1ca523ddcf89cc269fe51c70e66066943ef5a (patch) | |
tree | 51154f20fc49e8e7f71b16354aa48a2a39a2ccb1 /sw/qa | |
parent | b70d4ad13b909265c54a9ff55f07224a14e9feb2 (diff) |
bnc#816593 DOCX import: fix auto table width wrt nested tables
The bugdoc has a table with a single cell, and also a nested table in
that cell. Both tables have auto width. The problem was that the width
of the outer table was too large.
There is a trick in DomainMapperTableManager::startLevel() to get the
cell widths at the correct level: do the same in
DomainMapperTableManager::endLevel(), and that'll fix the table width
problem. (Because with that, the outer table will correctly have access
to its cell width.)
Change-Id: Ib750f0475364fd7e47c445cb54f2df34f3af085d
Diffstat (limited to 'sw/qa')
-rwxr-xr-x | sw/qa/extras/ooxmlimport/data/table-auto-nested.docx | bin | 0 -> 10297 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlimport/ooxmlimport.cxx | 13 |
2 files changed, 13 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlimport/data/table-auto-nested.docx b/sw/qa/extras/ooxmlimport/data/table-auto-nested.docx Binary files differnew file mode 100755 index 000000000000..85f47dbba0b3 --- /dev/null +++ b/sw/qa/extras/ooxmlimport/data/table-auto-nested.docx diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx index f79167b0cea8..3c13f052a879 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx @@ -127,6 +127,7 @@ public: void testFdo66474(); void testGroupshapeRotation(); void testBnc780044Spacing(); + void testTableAutoNested(); CPPUNIT_TEST_SUITE(Test); #if !defined(MACOSX) && !defined(WNT) @@ -220,6 +221,7 @@ void Test::run() {"fdo66474.docx", &Test::testFdo66474}, {"groupshape-rotation.docx", &Test::testGroupshapeRotation}, {"bnc780044_spacing.docx", &Test::testBnc780044Spacing}, + {"table-auto-nested.docx", &Test::testTableAutoNested}, }; header(); for (unsigned int i = 0; i < SAL_N_ELEMENTS(aMethods); ++i) @@ -1495,6 +1497,17 @@ void Test::testBnc780044Spacing() CPPUNIT_ASSERT_EQUAL(sal_Int16(1), xCursor->getPage()); } +void Test::testTableAutoNested() +{ + // This was 176, when compat option is not enabled, the auto paragraph bottom margin value was incorrect. + CPPUNIT_ASSERT_EQUAL(sal_Int32(494), getProperty<sal_Int32>(getParagraph(1), "ParaBottomMargin")); + + uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY); + // This was 115596, i.e. the width of the outer table was too large. + CPPUNIT_ASSERT_EQUAL(sal_Int32(23051), getProperty<sal_Int32>(xTables->getByIndex(1), "Width")); +} + CPPUNIT_TEST_SUITE_REGISTRATION(Test); CPPUNIT_PLUGIN_IMPLEMENT(); |