tdf#79315 Fix wp:effectExtent issue when exporting inline picture to DOCX.

Change-Id: I250bb365593c6a06f1d99f28b36e8bde183b16e6
Reviewed-on: https://gerrit.libreoffice.org/53679
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Jacobo Aragunde Pérez <jaragunde@igalia.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
This commit is contained in:
Victor Mireyev
2018-05-04 16:56:22 +03:00
committed by Miklos Vajna
parent c0965754df
commit 9992338fbb
3 changed files with 21 additions and 0 deletions

View File

@@ -558,6 +558,20 @@ DECLARE_OOXMLEXPORT_TEST(testEffectExtent, "effect-extent.docx")
assertXPath(pXmlDoc, "//wp:effectExtent", "l", "114300");
}
DECLARE_OOXMLEXPORT_TEST(testEffectExtentInline, "effect-extent-inline.docx")
{
// The problem was that in case there was inline rotated picture, we
// wrote a <wp:effectExtent> full or zeros.
if (xmlDocPtr pXmlDoc = parseExport("word/document.xml"))
{
// E.g. this was 0.
assertXPath(pXmlDoc, "//wp:effectExtent", "l", "609600");
assertXPath(pXmlDoc, "//wp:effectExtent", "r", "590550");
assertXPath(pXmlDoc, "//wp:effectExtent", "t", "590550");
assertXPath(pXmlDoc, "//wp:effectExtent", "b", "571500");
}
}
DECLARE_OOXMLEXPORT_TEST(testEm, "em.docx")
{
// Test all possible <w:em> arguments.

View File

@@ -838,6 +838,13 @@ void GraphicImport::lcl_attribute(Id nName, Value& rValue)
aInteropGrabBag.update(m_pImpl->getInteropGrabBag());
xShapeProps->setPropertyValue("InteropGrabBag", uno::makeAny(aInteropGrabBag.getAsConstPropertyValueList()));
}
else if (bUseShape && m_pImpl->eGraphicImportType == IMPORT_AS_DETECTED_INLINE)
{
uno::Reference< beans::XPropertySet > xShapeProps(m_xShape, uno::UNO_QUERY_THROW);
comphelper::SequenceAsHashMap aInteropGrabBag(xShapeProps->getPropertyValue("InteropGrabBag"));
aInteropGrabBag.update(m_pImpl->getInteropGrabBag());
xShapeProps->setPropertyValue("InteropGrabBag", uno::makeAny(aInteropGrabBag.getAsConstPropertyValueList()));
}
}
}
break;