sw/qa/extras/ooxmlimport/data/n779941.docx |binary sw/qa/extras/ooxmlimport/ooxmlimport.cxx | 25 +++++++++++++++ writerfilter/source/dmapper/DomainMapperTableHandler.cxx | 5 +++ 3 files changed, 30 insertions(+)
New commits: commit e33a9181c76309d31f2ace01b924e404906da28c Author: Pierre-Eric Pelloux-Prayer <[email protected]> Date: Wed Sep 26 15:25:39 2012 +0200 docx import: set table above/bottom spacing to 0 Conflicts: sw/qa/extras/ooxmlimport/ooxmlimport.cxx Change-Id: I3e0397dd3d5d14f1e584ac7bc3d22d4638393b06 diff --git a/sw/qa/extras/ooxmlimport/data/n779941.docx b/sw/qa/extras/ooxmlimport/data/n779941.docx new file mode 100644 index 0000000..9889d81 Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/n779941.docx differ diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx index c545a89..1267eac 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx @@ -92,6 +92,7 @@ public: void testInk(); void testN779834(); void testN779627(); + void testN779941(); void testFdo55187(); void testN780563(); void testN780853(); @@ -136,6 +137,7 @@ public: CPPUNIT_TEST(testInk); CPPUNIT_TEST(testN779834); CPPUNIT_TEST(testN779627); + CPPUNIT_TEST(testN779941); CPPUNIT_TEST(testFdo55187); CPPUNIT_TEST(testN780563); CPPUNIT_TEST(testN780853); @@ -1006,6 +1008,29 @@ void Test::testN782345() CPPUNIT_ASSERT_EQUAL(style::BreakType_PAGE_BEFORE, getProperty<style::BreakType>(getParagraph(2), "BreakType")); } +void Test::testN779941() +{ + /* + * Make sure top/bottom margins of tables are set to 0 (problem was: bottom margin set to 0.35cm) + */ + load("n779941.docx"); + 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(0), uno::UNO_QUERY); + { + uno::Any aValue = xTableProperties->getPropertyValue("TopMargin"); + sal_Int32 nTopMargin; + aValue >>= nTopMargin; + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), nTopMargin); + } + { + uno::Any aValue = xTableProperties->getPropertyValue("BottomMargin"); + sal_Int32 nBottomMargin; + aValue >>= nBottomMargin; + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), nBottomMargin); + } +} + CPPUNIT_TEST_SUITE_REGISTRATION(Test); CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx index dce337d..e710a13 100644 --- a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx +++ b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx @@ -391,6 +391,11 @@ TableStyleSheetEntry * DomainMapperTableHandler::endTableGetTableStyle(TableInfo m_aTableProperties->Insert( PROP_TABLE_BORDER_DISTANCES, false, uno::makeAny( aDistances ) ); + // Set table above/bottom spacing to 0. + // TODO: handle 'Around' text wrapping mode + m_aTableProperties->Insert( PropertyIds::PROP_TOP_MARGIN, true, uno::makeAny( 0 ) ); + m_aTableProperties->Insert( PropertyIds::PROP_BOTTOM_MARGIN, true, uno::makeAny( 0 ) ); + //table border settings table::TableBorder aTableBorder; table::BorderLine2 aBorderLine; _______________________________________________ Libreoffice-commits mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
