diff options
author | Miklos Vajna <vmiklos@suse.cz> | 2013-08-29 14:17:09 +0200 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-09-06 11:31:21 +0000 |
commit | 124b2e26797726851116646b478f056583213d5b (patch) | |
tree | a8d05851060e6878911c1a1e26d54b70e174e557 /sw | |
parent | cb5a333fdda48ec1d141d1aa9ce7ae899aea2777 (diff) |
bnc#816593 DOCX filter: import paragraph spacing from table style
(cherry picked from commit 17e904ed66c3caf87e658b9d3a18d7b13f4a0b52)
Change-Id: I9dce59ecd8a2d2bfadb8c7273cd46c6c0cf17774
Reviewed-on: https://gerrit.libreoffice.org/5786
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw')
-rwxr-xr-x | sw/qa/extras/ooxmlimport/data/table-style-parprop.docx | bin | 0 -> 10098 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/table-style-parprop.docx b/sw/qa/extras/ooxmlimport/data/table-style-parprop.docx Binary files differnew file mode 100755 index 000000000000..1c68c704e7fb --- /dev/null +++ b/sw/qa/extras/ooxmlimport/data/table-style-parprop.docx diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx index 0c066df125b0..090b5d8c6b82 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx @@ -129,6 +129,7 @@ public: void testTableAutoColumnFixedSize(); void testTableFloating(); void testTableAutoNested(); + void testTableStyleParprop(); CPPUNIT_TEST_SUITE(Test); #if !defined(MACOSX) && !defined(WNT) @@ -223,6 +224,7 @@ void Test::run() {"table-auto-column-fixed-size.docx", &Test::testTableAutoColumnFixedSize}, {"table-floating.docx", &Test::testTableFloating}, {"table-auto-nested.docx", &Test::testTableAutoNested}, + {"table-style-parprop.docx", &Test::testTableStyleParprop}, }; header(); for (unsigned int i = 0; i < SAL_N_ELEMENTS(aMethods); ++i) @@ -1583,6 +1585,15 @@ void Test::testTableAutoNested() CPPUNIT_ASSERT_EQUAL(sal_Int32(23051), getProperty<sal_Int32>(xTables->getByIndex(1), "Width")); } +void Test::testTableStyleParprop() +{ + // The problem was that w:spacing's w:after=0 (a paragraph property) wasn't imported from table style. + uno::Reference<text::XTextTable> xTable(getParagraphOrTable(1), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xCell(xTable->getCellByName("A1"), uno::UNO_QUERY); + // This was 353, the document default, i.e. paragraph property from table style had no effect. + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty<sal_Int32>(getParagraphOfText(1, xCell->getText()), "ParaBottomMargin")); +} + CPPUNIT_TEST_SUITE_REGISTRATION(Test); CPPUNIT_PLUGIN_IMPLEMENT(); |