diff options
author | nd101 <Fong@nd.com.cn> | 2020-09-17 17:09:19 +0800 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2020-09-18 19:03:44 +0200 |
commit | b3f2fd983f0728893505d7ae12e3def924ab520f (patch) | |
tree | f9fcd2656ff2e581fa7f595fcd47446d153d3da4 | |
parent | a11bb74d4f464e9639ddb5b8d87dc4770663fea8 (diff) |
tdf#136830 Fix: positions of group shapes of PPTX
For certain PPTXs, Impress fails to import
the document with correct group shape positions.
More specifically, chExt (Child Extents) calculation
should take the values from group shape when 0 is given.
Change-Id: I1f8e89dcfe61ab2071ad00850ff99aecb7218067
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102895
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
-rw-r--r-- | oox/source/drawingml/transform2dcontext.cxx | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/oox/source/drawingml/transform2dcontext.cxx b/oox/source/drawingml/transform2dcontext.cxx index 234cf5920269..fcd7da9dec0a 100644 --- a/oox/source/drawingml/transform2dcontext.cxx +++ b/oox/source/drawingml/transform2dcontext.cxx @@ -105,7 +105,19 @@ ContextHandlerRef Transform2DContext::onCreateContext( sal_Int32 aElementToken, mrShape.setChildPosition( awt::Point( rAttribs.getString( XML_x ).get().toInt32(), rAttribs.getString( XML_y ).get().toInt32() ) ); break; case A_TOKEN( chExt ): // horz/vert size of children - mrShape.setChildSize( awt::Size( rAttribs.getString( XML_cx ).get().toInt32(), rAttribs.getString( XML_cy ).get().toInt32() ) ); + { + sal_Int32 nChExtCx = rAttribs.getString(XML_cx).get().toInt32(); + + if(nChExtCx == 0) + nChExtCx = mrShape.getSize().Width; + + sal_Int32 nChExtCy = rAttribs.getString(XML_cy).get().toInt32(); + + if(nChExtCy == 0) + nChExtCy = mrShape.getSize().Height; + + mrShape.setChildSize(awt::Size(nChExtCx, nChExtCy)); + } break; } |