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,6 +2373,11 @@ DECLARE_OOXMLEXPORT_TEST(testFdo73550, "fdo73550.docx")
DECLARE_OOXMLEXPORT_TEST(testPageRelSize, "pagerelsize.docx")
{
uno::Reference<text::XTextFramesSupplier> xTextFramesSupplier(mxComponent, uno::UNO_QUERY);
uno::Reference<container::XIndexAccess> xIndexAccess(xTextFramesSupplier->getTextFrames(), uno::UNO_QUERY);
if (xIndexAccess->getCount())
{
// TODO TextBox: remove this when TextBox is enabled by default
// First textframe: width is relative from page, but not height.
uno::Reference<drawing::XShape> xTextFrame = getTextFrameByName("Frame1");
CPPUNIT_ASSERT_EQUAL(text::RelOrientation::PAGE_FRAME, getProperty<sal_Int16>(xTextFrame, "RelativeWidthRelation"));
......@@ -2382,6 +2387,19 @@ DECLARE_OOXMLEXPORT_TEST(testPageRelSize, "pagerelsize.docx")
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")
......
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