[Libreoffice-commits] core.git: 2 commits - sw/qa
Miklos Vajna
vmiklos at collabora.co.uk
Tue Jun 10 09:35:25 PDT 2014
sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 33 +++++++++++++++++++++++++------
1 file changed, 27 insertions(+), 6 deletions(-)
New commits:
commit ab4279d7f2e613f69d21eef1e3ba6bf09b708b00
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Tue Jun 10 18:27:16 2014 +0200
CppunitTest_sw_ooxmlexport: port testTableFloating to textboxes
Change-Id: Ie20e0ca939139c952f3524c7dae494e24bc7cab7
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index 50703c0..8bf3a58 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -1084,11 +1084,24 @@ DECLARE_OOXMLEXPORT_TEST(testTableFloating, "table-floating.docx")
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);
- // This was 0, should be the the opposite of (left margin + half of the border width).
- CPPUNIT_ASSERT_EQUAL(sal_Int32(-199), getProperty<sal_Int32>(xFrame, "HoriOrientPosition"));
- // Was 0 as well, should be the right margin.
- CPPUNIT_ASSERT_EQUAL(sal_Int32(250), getProperty<sal_Int32>(xFrame, "RightMargin"));
+ if (xIndexAccess->getCount())
+ {
+ // After import, table is inside a TextFrame.
+ uno::Reference<beans::XPropertySet> xFrame(xIndexAccess->getByIndex(0), uno::UNO_QUERY);
+ // This was 0, should be the the opposite of (left margin + half of the border width).
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(-199), getProperty<sal_Int32>(xFrame, "HoriOrientPosition"));
+ // Was 0 as well, should be the right margin.
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(250), getProperty<sal_Int32>(xFrame, "RightMargin"));
+ }
+ else
+ {
+ // After import, table is inside a TextFrame.
+ uno::Reference<beans::XPropertySet> xShape(getShape(1), uno::UNO_QUERY);
+ // This was 0, should be the the opposite of (left margin + half of the border width).
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(-198), getProperty<sal_Int32>(xShape, "HoriOrientPosition"));
+ // Was 0 as well, should be the right margin.
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(250), getProperty<sal_Int32>(xShape, "RightMargin"));
+ }
}
DECLARE_OOXMLEXPORT_TEST(testFdo44689_start_page_0, "fdo44689_start_page_0.docx")
commit 13f7b89c2c74bfe9afa43a4d2187b848aaa5c94d
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Tue Jun 10 18:05:08 2014 +0200
CppunitTest_sw_ooxmlexport: port testFdo60990 to textboxes
Change-Id: I5871ca0c3eea931e2144d7a469844cf3a69d0038
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index c106f3c..50703c0 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -984,9 +984,17 @@ DECLARE_OOXMLEXPORT_TEST(testFdo66781, "fdo66781.docx")
DECLARE_OOXMLEXPORT_TEST(testFdo60990, "fdo60990.odt")
{
+ // TODO TextBox: remove this when TextBox is enabled by default
+ uno::Reference<text::XTextFramesSupplier> xTextFramesSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> xIndexAccess(xTextFramesSupplier->getTextFrames(), uno::UNO_QUERY);
+ bool bTextBox = xIndexAccess->getCount() == 0;
+
// The shape had no background, no paragraph adjust and no font color.
uno::Reference<beans::XPropertySet> xShape(getShape(1), uno::UNO_QUERY);
- CPPUNIT_ASSERT_EQUAL(sal_Int32(0x00CFE7F5), getProperty<sal_Int32>(xShape, "BackColor"));
+ if (bTextBox)
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(0x00CFE7F5), getProperty<sal_Int32>(xShape, "FillColor"));
+ else
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(0x00CFE7F5), getProperty<sal_Int32>(xShape, "BackColor"));
uno::Reference<text::XText> xText = uno::Reference<text::XTextRange>(xShape, uno::UNO_QUERY)->getText();
uno::Reference<text::XTextRange> xParagraph = getParagraphOfText(1, xText);
CPPUNIT_ASSERT_EQUAL(style::ParagraphAdjust_CENTER, static_cast<style::ParagraphAdjust>(getProperty<sal_Int16>(xParagraph, "ParaAdjust")));
More information about the Libreoffice-commits
mailing list