Kaydet (Commit) d71d1695 authored tarafından PriyankaGaikwad's avatar PriyankaGaikwad Kaydeden (comit) Miklos Vajna

fdo#73545 Shape position is wrong

Issue:
The <wp:align> is missing after roundtrip

XML Difference:
Original:
<wp:positionH relativeFrom="page">
 <wp:align>
 center
 </wp:align>
</wp:positionH>

Roundtrip:
<wp:positionH relativeFrom="page">
 <wp:posOffset>
 0
 </wp:posOffset>
</wp:positionH>

Conflicts:
	sw/qa/extras/ooxmlexport/ooxmlexport.cxx
Reviewed on:
	https://gerrit.libreoffice.org/7571

Change-Id: I3c8ef2f0ee3dd84a23fab197ab95f152b850067e
üst 3fdbaaee
......@@ -2624,6 +2624,16 @@ DECLARE_OOXMLEXPORT_TEST(testFdo73556,"fdo73556.docx")
CPPUNIT_ASSERT_EQUAL(sal_Int32(3751), tableWidth);
}
DECLARE_OOXMLEXPORT_TEST(testAlignForShape,"Shape.docx")
{
//fdo73545:Shape Horizontal and vertical orientation is wrong
//The wp:align tag is missing after roundtrip
xmlDocPtr pXmlDoc = parseExport("word/document.xml");
if (!pXmlDoc)
return;
assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/wp:positionH/wp:align","1");
}
#endif
CPPUNIT_PLUGIN_IMPLEMENT();
......
......@@ -696,13 +696,11 @@ void GraphicImport::lcl_attribute(Id nName, Value & val)
// This needs to be AT_PARAGRAPH and not AT_CHARACTER, otherwise shape will move when the user inserts a new paragraph.
xShapeProps->setPropertyValue("AnchorType", uno::makeAny(text::TextContentAnchorType_AT_PARAGRAPH));
//only the position orientation is handled in applyPosition()
m_pImpl->applyPosition(xShapeProps);
uno::Reference<lang::XServiceInfo> xServiceInfo(m_xShape, uno::UNO_QUERY_THROW);
if (xServiceInfo->supportsService("com.sun.star.text.TextFrame"))
{
// For non-textframes, this is handled already in oox::drawingml::Shape::createAndInsert().
m_pImpl->applyPosition(xShapeProps);
}
else if (xServiceInfo->supportsService("com.sun.star.drawing.GroupShape"))
if (xServiceInfo->supportsService("com.sun.star.drawing.GroupShape"))
{
// Position of the groupshape should be set after children have been added.
m_xShape->setPosition(awt::Point(m_pImpl->nLeftPosition, m_pImpl->nTopPosition));
......
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