Kaydet (Commit) 32d6d27e authored tarafından Miklos Vajna's avatar Miklos Vajna

CppunitTest_sw_ooxmlexport: port testPageRelSize to textboxes

Change-Id: I08e112b3816797a848ae9d16fa7002a67c12fc3d
üst 0e8c0666
...@@ -2373,15 +2373,33 @@ DECLARE_OOXMLEXPORT_TEST(testFdo73550, "fdo73550.docx") ...@@ -2373,15 +2373,33 @@ DECLARE_OOXMLEXPORT_TEST(testFdo73550, "fdo73550.docx")
DECLARE_OOXMLEXPORT_TEST(testPageRelSize, "pagerelsize.docx") DECLARE_OOXMLEXPORT_TEST(testPageRelSize, "pagerelsize.docx")
{ {
// First textframe: width is relative from page, but not height. uno::Reference<text::XTextFramesSupplier> xTextFramesSupplier(mxComponent, uno::UNO_QUERY);
uno::Reference<drawing::XShape> xTextFrame = getTextFrameByName("Frame1"); uno::Reference<container::XIndexAccess> xIndexAccess(xTextFramesSupplier->getTextFrames(), uno::UNO_QUERY);
CPPUNIT_ASSERT_EQUAL(text::RelOrientation::PAGE_FRAME, getProperty<sal_Int16>(xTextFrame, "RelativeWidthRelation")); if (xIndexAccess->getCount())
CPPUNIT_ASSERT_EQUAL(text::RelOrientation::FRAME, getProperty<sal_Int16>(xTextFrame, "RelativeHeightRelation")); {
// TODO TextBox: remove this when TextBox is enabled by default
// Second textframe: height is relative from page, but not height. // First textframe: width is relative from page, but not height.
xTextFrame = getTextFrameByName("Text Box 2"); uno::Reference<drawing::XShape> xTextFrame = getTextFrameByName("Frame1");
CPPUNIT_ASSERT_EQUAL(text::RelOrientation::PAGE_FRAME, getProperty<sal_Int16>(xTextFrame, "RelativeHeightRelation")); CPPUNIT_ASSERT_EQUAL(text::RelOrientation::PAGE_FRAME, getProperty<sal_Int16>(xTextFrame, "RelativeWidthRelation"));
CPPUNIT_ASSERT_EQUAL(text::RelOrientation::FRAME, getProperty<sal_Int16>(xTextFrame, "RelativeWidthRelation")); CPPUNIT_ASSERT_EQUAL(text::RelOrientation::FRAME, getProperty<sal_Int16>(xTextFrame, "RelativeHeightRelation"));
// Second textframe: height is relative from page, but not height.
xTextFrame = getTextFrameByName("Text Box 2");
CPPUNIT_ASSERT_EQUAL(text::RelOrientation::PAGE_FRAME, getProperty<sal_Int16>(xTextFrame, "RelativeHeightRelation"));
CPPUNIT_ASSERT_EQUAL(text::RelOrientation::FRAME, getProperty<sal_Int16>(xTextFrame, "RelativeWidthRelation"));
}
else
{
// First shape: width is relative from page, but not height.
uno::Reference<drawing::XShape> xShape = getShape(1);
CPPUNIT_ASSERT_EQUAL(text::RelOrientation::PAGE_FRAME, getProperty<sal_Int16>(xShape, "RelativeWidthRelation"));
CPPUNIT_ASSERT_EQUAL(text::RelOrientation::FRAME, getProperty<sal_Int16>(xShape, "RelativeHeightRelation"));
// Second shape: height is relative from page, but not height.
xShape = getShape(2);
CPPUNIT_ASSERT_EQUAL(text::RelOrientation::PAGE_FRAME, getProperty<sal_Int16>(xShape, "RelativeHeightRelation"));
CPPUNIT_ASSERT_EQUAL(text::RelOrientation::FRAME, getProperty<sal_Int16>(xShape, "RelativeWidthRelation"));
}
} }
DECLARE_OOXMLEXPORT_TEST(testRelSizeRound, "rel-size-round.docx") DECLARE_OOXMLEXPORT_TEST(testRelSizeRound, "rel-size-round.docx")
......
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