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

Grzegorz Araminowicz g.araminowicz at gmail.com
Mon Jun 26 08:18:39 UTC 2017


 oox/source/drawingml/diagram/diagram.cxx            |    2 ++
 oox/source/drawingml/diagram/diagramlayoutatoms.cxx |   16 +++++++++++-----
 2 files changed, 13 insertions(+), 5 deletions(-)

New commits:
commit 603a8414454ab963b5907085d6642dcfd432ce34
Author: Grzegorz Araminowicz <g.araminowicz at gmail.com>
Date:   Fri Jun 23 15:11:08 2017 +0200

    SmartArt: layout diagram
    
    Change-Id: I854703ea3cb09ace2d0b01a47d9f07bb7a98b70e
    Reviewed-on: https://gerrit.libreoffice.org/39172
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Jan Holesovsky <kendy at collabora.com>

diff --git a/oox/source/drawingml/diagram/diagram.cxx b/oox/source/drawingml/diagram/diagram.cxx
index a72988627602..3272e47da5fe 100644
--- a/oox/source/drawingml/diagram/diagram.cxx
+++ b/oox/source/drawingml/diagram/diagram.cxx
@@ -317,6 +317,8 @@ void Diagram::addTo( const ShapePtr & pParentShape )
     // collect data, init maps
     build( );
 
+    pParentShape->setChildSize(pParentShape->getSize());
+
     // create Shape hierarchy
     ShapeCreationVisitor aCreationVisitor(pParentShape, *this);
     if( mpLayout->getNode() )
diff --git a/oox/source/drawingml/diagram/diagramlayoutatoms.cxx b/oox/source/drawingml/diagram/diagramlayoutatoms.cxx
index 46510dee0126..d77020ad7ab7 100644
--- a/oox/source/drawingml/diagram/diagramlayoutatoms.cxx
+++ b/oox/source/drawingml/diagram/diagramlayoutatoms.cxx
@@ -271,6 +271,7 @@ void AlgAtom::layoutShape( const ShapePtr& rShape,
             break;
 
         case XML_lin:
+        case XML_snake:
         {
             if( rShape->getChildren().empty() )
             {
@@ -300,8 +301,8 @@ void AlgAtom::layoutShape( const ShapePtr& rShape,
                     aCurrPos.Y + sz.Height);
 
                 // HACK: the spacing is arbitrary
-                aCurrPos.X += nIncX*(sz.Width+5);
-                aCurrPos.Y += nIncY*(sz.Height+5);
+                aCurrPos.X += nIncX*(sz.Width+50);
+                aCurrPos.Y += nIncY*(sz.Height+50);
 
                 ++aCurrShape;
             }
@@ -311,7 +312,6 @@ void AlgAtom::layoutShape( const ShapePtr& rShape,
         }
 
         case XML_pyra:
-        case XML_snake:
             break;
 
         case XML_sp:
@@ -331,8 +331,8 @@ void AlgAtom::layoutShape( const ShapePtr& rShape,
 
             // HACK - count chars & paragraphs to come up with *some*
             // notion of necessary size
-            const sal_Int32 nHackyFontHeight=50;
-            const sal_Int32 nHackyFontWidth=20;
+            const sal_Int32 nHackyFontHeight=500;
+            const sal_Int32 nHackyFontWidth=400;
             awt::Size aTotalSize;
             for( size_t nPara=0; nPara<pTextBody->getParagraphs().size(); ++nPara )
             {
@@ -489,6 +489,12 @@ bool LayoutNode::setupShape( const ShapePtr& rShape, const Diagram& rDgm, sal_uI
                     rShape->getShapeStyleRefs()[XML_fontRef].maPhClr = rColor.maTextFillColor;
             }
         }
+        else
+        {
+            // if no style label apply at least some fill color
+            rShape->getShapeStyleRefs()[XML_fillRef].maPhClr.setScrgbClr(0, 0, 0);
+            rShape->getShapeStyleRefs()[XML_fillRef].mnThemedIdx = 2;
+        }
 
         // even if no data node found, successful anyway. it's
         // contained at the layoutnode


More information about the Libreoffice-commits mailing list