Kaydet (Commit) e33a9181 authored tarafından Pierre-Eric Pelloux-Prayer's avatar Pierre-Eric Pelloux-Prayer Kaydeden (comit) Miklos Vajna

docx import: set table above/bottom spacing to 0

Conflicts:
	sw/qa/extras/ooxmlimport/ooxmlimport.cxx

Change-Id: I3e0397dd3d5d14f1e584ac7bc3d22d4638393b06
üst b966a09c
......@@ -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();
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment