Kaydet (Commit) bdb0177b authored tarafından László Németh's avatar László Németh

tdf#122563 DOCX import: fix OLE size after roundtrip

Embedded XLSX spreadsheets and other OLE objects
became small in Writer after a roundtrip between
LibO and MSO, caused by the empty drawing path of
OLE shapes.

Change-Id: I4cd39d4bcd6707cc5a3b8e40dde8c6148a20cabc
Reviewed-on: https://gerrit.libreoffice.org/66053
Tested-by: Jenkins
Reviewed-by: 's avatarLászló Németh <nemeth@numbertext.org>
üst 403e3c04
...@@ -240,7 +240,9 @@ ContextHandlerRef ShapeContextBase::createShapeContext( ContextHandler2Helper co ...@@ -240,7 +240,9 @@ ContextHandlerRef ShapeContextBase::createShapeContext( ContextHandler2Helper co
case VML_TOKEN( group ): case VML_TOKEN( group ):
return new GroupShapeContext( rParent, rShapes.createShape< GroupShape >(), rAttribs ); return new GroupShapeContext( rParent, rShapes.createShape< GroupShape >(), rAttribs );
case VML_TOKEN( shape ): case VML_TOKEN( shape ):
if (rAttribs.hasAttribute(XML_path)) if (rAttribs.hasAttribute(XML_path) &&
// tdf#122563 skip in the case of empty path
!rAttribs.getString(XML_path, "").isEmpty())
return new ShapeContext( rParent, rShapes.createShape< BezierShape >(), rAttribs ); return new ShapeContext( rParent, rShapes.createShape< BezierShape >(), rAttribs );
else else
return new ShapeContext( rParent, rShapes.createShape< ComplexShape >(), rAttribs ); return new ShapeContext( rParent, rShapes.createShape< ComplexShape >(), rAttribs );
......
...@@ -936,6 +936,17 @@ DECLARE_OOXMLEXPORT_TEST(testTdf99631, "tdf99631.docx") ...@@ -936,6 +936,17 @@ DECLARE_OOXMLEXPORT_TEST(testTdf99631, "tdf99631.docx")
assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[2]/w:object[1]", "dyaOrig", "768"); assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[2]/w:object[1]", "dyaOrig", "768");
} }
DECLARE_OOXMLEXPORT_TEST(testTdf122563, "tdf122563.docx")
{
xmlDocPtr pXmlDoc = parseExport("word/document.xml");
if (!pXmlDoc)
return;
assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r/w:object", 1);
// Size of the embedded OLE spreadsheet was the bad "width:28.35pt;height:28.35pt"
assertXPath(pXmlDoc, "/w:document/w:body/w:p[2]/w:r[1]/w:object/v:shape", "style",
"width:255.75pt;height:63.75pt");
}
CPPUNIT_PLUGIN_IMPLEMENT(); CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
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