summaryrefslogtreecommitdiff
path: root/sw/qa/extras/ooxmlimport
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2013-08-15 17:06:57 +0200
committerMiklos Vajna <vmiklos@suse.cz>2013-08-15 17:09:11 +0200
commit66b4bfe302e248fc1503c5c74b83f4fb5fee4026 (patch)
tree3928503e3cefd23c6315380bbca1280f55534b1a /sw/qa/extras/ooxmlimport
parent26d9efd36a16d2095d8fb885290c6816082ec814 (diff)
DOCX import: handle custom left cell margin for float table position
Change-Id: I5bc51b739c663d3e123c9d7fb4c2a70f01f8c841
Diffstat (limited to 'sw/qa/extras/ooxmlimport')
-rwxr-xr-xsw/qa/extras/ooxmlimport/data/table-floating-margins.docxbin0 -> 14346 bytes
-rw-r--r--sw/qa/extras/ooxmlimport/ooxmlimport.cxx14
2 files changed, 14 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlimport/data/table-floating-margins.docx b/sw/qa/extras/ooxmlimport/data/table-floating-margins.docx
new file mode 100755
index 000000000000..81f6f6cf1ffa
--- /dev/null
+++ b/sw/qa/extras/ooxmlimport/data/table-floating-margins.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index bf7db73700f5..3f6293192ef5 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -129,6 +129,7 @@ public:
void testGroupshapeRotation();
void testBnc780044Spacing();
void testTableFloating();
+ void testTableFloatingMargins();
CPPUNIT_TEST_SUITE(Test);
#if !defined(MACOSX) && !defined(WNT)
@@ -223,6 +224,7 @@ void Test::run()
{"groupshape-rotation.docx", &Test::testGroupshapeRotation},
{"bnc780044_spacing.docx", &Test::testBnc780044Spacing},
{"table-floating.docx", &Test::testTableFloating},
+ {"table-floating-margins.docx", &Test::testTableFloatingMargins},
};
header();
for (unsigned int i = 0; i < SAL_N_ELEMENTS(aMethods); ++i)
@@ -1569,6 +1571,18 @@ void Test::testTableFloating()
CPPUNIT_ASSERT_EQUAL(sal_Int32(250), getProperty<sal_Int32>(xFrame, "RightMargin"));
}
+void Test::testTableFloatingMargins()
+{
+ // In case the table had custom left cell margin, the horizontal position was still incorrect (too small, -199).
+ uno::Reference<text::XTextFramesSupplier> xTextFramesSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> xIndexAccess(xTextFramesSupplier->getTextFrames(), uno::UNO_QUERY);
+ uno::Reference<beans::XPropertySet> xFrame(xIndexAccess->getByIndex(0), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(-499), getProperty<sal_Int32>(xFrame, "HoriOrientPosition"));
+ // These were 0 as well, due to lack of import.
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(1000), getProperty<sal_Int32>(xFrame, "TopMargin"));
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(2000), getProperty<sal_Int32>(xFrame, "BottomMargin"));
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(Test);
CPPUNIT_PLUGIN_IMPLEMENT();