[Libreoffice-commits] core.git: oox/source

nd101 (via logerrit) logerrit at kemper.freedesktop.org
Fri Sep 18 17:04:24 UTC 2020


 oox/source/drawingml/transform2dcontext.cxx |   14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

New commits:
commit b3f2fd983f0728893505d7ae12e3def924ab520f
Author:     nd101 <Fong at nd.com.cn>
AuthorDate: Thu Sep 17 17:09:19 2020 +0800
Commit:     Xisco Fauli <xiscofauli at libreoffice.org>
CommitDate: Fri Sep 18 19:03:44 2020 +0200

    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 at libreoffice.org>

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;
     }
 


More information about the Libreoffice-commits mailing list