Kaydet (Commit) 4e49887b authored tarafından Miklos Vajna's avatar Miklos Vajna

DOCX export: fix relativeFrom=page, align=right handling

This is the export part of 51a61bd4.

Change-Id: I9f7459e99ada8f5f73e9075d249c4e508c941d44
üst c161ceb9
......@@ -2163,6 +2163,18 @@ DECLARE_OOXMLEXPORT_TEST(testFileOpenInputOutputError,"floatingtbl_with_formula.
assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:pPr/w:pStyle", "val", "Normal");
}
DECLARE_OOXMLEXPORT_TEST(testRelorientation, "relorientation.docx")
{
uno::Reference<drawing::XShape> xShape = getShape(1);
// This was text::RelOrientation::FRAME, when handling relativeFrom=page, align=right
CPPUNIT_ASSERT_EQUAL(text::RelOrientation::PAGE_RIGHT, getProperty<sal_Int16>(xShape, "HoriOrientRelation"));
uno::Reference<drawing::XShapes> xGroup(xShape, uno::UNO_QUERY);
// This resulted in lang::IndexOutOfBoundsException, as nested groupshapes weren't handled.
uno::Reference<drawing::XShapeDescriptor> xShapeDescriptor(xGroup->getByIndex(0), uno::UNO_QUERY);
CPPUNIT_ASSERT_EQUAL(OUString("com.sun.star.drawing.GroupShape"), xShapeDescriptor->getShapeType());
}
#endif
CPPUNIT_PLUGIN_IMPLEMENT();
......
......@@ -153,6 +153,10 @@ void DocxSdrExport::startDMLAnchorInline(const SwFrmFmt* pFrmFmt, const Size& rS
case text::RelOrientation::CHAR:
relativeFromH = "character";
break;
case text::RelOrientation::PAGE_RIGHT:
relativeFromH = "page";
alignH = "right";
break;
case text::RelOrientation::FRAME:
default:
relativeFromH = "column";
......
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