diff options
author | Cédric Bosdonnat <cedric.bosdonnat@free.fr> | 2013-05-31 10:51:47 +0200 |
---|---|---|
committer | Cédric Bosdonnat <cedric.bosdonnat@free.fr> | 2013-05-31 14:12:46 +0200 |
commit | 173d24a7316fccf0e838f71b92c10a772b19298d (patch) | |
tree | 47c4bba7f77292d7f0394e4c869d05b255d49380 /sw | |
parent | f00db76911d4fdc53a737e1b9d4ffe6ae31bc97e (diff) |
n#816593: docx consecutive tables with different tblpPr needs to be split
When importing docx with 2 <w:tbl> following each other, we have 2
possible behaviors: either merge them as one table as we did before or
split them into two tables. The tables need to be split if they have
different floating position properties.
This required the ooxml tokenizer to repeat the table properties for
each row of the table: or how would we know we don't need to split the
table?
The basic idea behind this hack is to temporarily store the table
position and table properties before saving them. Thus we can compare
them at the end of the row and decide to split the table or not.
Change-Id: I2e3e70dfe7386090fe356575ee9d0e81aa031dc4
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/ooxmlimport/data/n816593.docx | bin | 0 -> 17030 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlimport/ooxmlimport.cxx | 11 |
2 files changed, 11 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlimport/data/n816593.docx b/sw/qa/extras/ooxmlimport/data/n816593.docx Binary files differnew file mode 100644 index 000000000000..7d784e69d4e6 --- /dev/null +++ b/sw/qa/extras/ooxmlimport/data/n816593.docx diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx index 5a268e48597e..c422ecc829ca 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx @@ -116,6 +116,7 @@ public: void testPageBackground(); void testWatermark(); void testPageBorderShadow(); + void testN816593(); CPPUNIT_TEST_SUITE(Test); #if !defined(MACOSX) && !defined(WNT) @@ -200,6 +201,7 @@ void Test::run() {"page-background.docx", &Test::testPageBackground}, {"watermark.docx", &Test::testWatermark}, {"page-border-shadow.docx", &Test::testPageBorderShadow}, + {"n816593.docx", &Test::testN816593}, }; header(); for (unsigned int i = 0; i < SAL_N_ELEMENTS(aMethods); ++i) @@ -1430,6 +1432,15 @@ void Test::testPageBorderShadow() CPPUNIT_ASSERT_EQUAL(sal_Int16(TWIP_TO_MM100(48/8*20)), aShadow.ShadowWidth); } +void Test::testN816593() +{ + // Two consecutive <w:tbl> without any paragraph in between, but with different tblpPr. In this + // case we need to have 2 different tables instead of 1 + uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables( ), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(2), xTables->getCount()); +} + CPPUNIT_TEST_SUITE_REGISTRATION(Test); CPPUNIT_PLUGIN_IMPLEMENT(); |