oox/source/drawingml/diagram/diagramlayoutatoms.cxx    |    3 +--
 oox/source/drawingml/diagram/diagramlayoutatoms.hxx    |   12 +++++-------
 oox/source/drawingml/diagram/layoutatomvisitorbase.cxx |    2 --
 oox/source/drawingml/diagram/layoutatomvisitorbase.hxx |    4 +---
 oox/source/drawingml/diagram/layoutatomvisitors.cxx    |   15 +++++----------
 5 files changed, 12 insertions(+), 24 deletions(-)

New commits:
commit 338630cdaf6121c057a3f6e519a281315ee2778b
Author:     Grzegorz Araminowicz <grzegorz.araminow...@collabora.com>
AuthorDate: Sun Jul 7 11:31:22 2019 +0200
Commit:     Grzegorz Araminowicz <grzegorz.araminow...@collabora.com>
CommitDate: Thu Jul 11 09:56:10 2019 +0200

    Revert "SmartArt: support multiple levels of shapes in LayoutNodes"
    
    As we have presentation node - shape mapping, keeping shape level 
information is no longer needed.
    
    This reverts commit 596a03b65e1b870be671ea1a44f4fba9fc66e4ae.
    
    Change-Id: Ibde1b4afde41778304138253c1548422c5b173c3
    Reviewed-on: https://gerrit.libreoffice.org/75173
    Tested-by: Jenkins
    Reviewed-by: Grzegorz Araminowicz <grzegorz.araminow...@collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/75393
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>

diff --git a/oox/source/drawingml/diagram/diagramlayoutatoms.cxx 
b/oox/source/drawingml/diagram/diagramlayoutatoms.cxx
index eff192868c61..8d569bc8fa3b 100644
--- a/oox/source/drawingml/diagram/diagramlayoutatoms.cxx
+++ b/oox/source/drawingml/diagram/diagramlayoutatoms.cxx
@@ -445,8 +445,7 @@ void AlgAtom::accept( LayoutAtomVisitor& rVisitor )
 }
 
 void AlgAtom::layoutShape( const ShapePtr& rShape,
-                           const std::vector<Constraint>& rConstraints,
-                           sal_Int32 /*nShapeLevel*/ )
+                           const std::vector<Constraint>& rConstraints )
 {
     switch(mnType)
     {
diff --git a/oox/source/drawingml/diagram/diagramlayoutatoms.hxx 
b/oox/source/drawingml/diagram/diagramlayoutatoms.hxx
index f3833434950a..726e75e2b01e 100644
--- a/oox/source/drawingml/diagram/diagramlayoutatoms.hxx
+++ b/oox/source/drawingml/diagram/diagramlayoutatoms.hxx
@@ -161,8 +161,7 @@ public:
     void addParam( sal_Int32 nType, sal_Int32 nVal )
         { maMap[nType]=nVal; }
     void layoutShape( const ShapePtr& rShape,
-                      const std::vector<Constraint>& rConstraints,
-                      sal_Int32 nShapeLevel );
+                      const std::vector<Constraint>& rConstraints );
 
     /// Gives access to <dgm:alg type="..."/>.
     sal_Int32 getType() const { return mnType; }
@@ -240,7 +239,6 @@ class LayoutNode
 {
 public:
     typedef std::map<sal_Int32, OUString> VarMap;
-    typedef std::map<sal_Int32, std::vector<ShapePtr>> ShapeLevelMap;
 
     LayoutNode(const Diagram& rDgm) : LayoutAtom(*this), mrDgm(rDgm), 
mnChildOrder(0) {}
     const Diagram& getDiagram() const
@@ -258,10 +256,10 @@ public:
         { mpExistingShape = pShape; }
     const ShapePtr& getExistingShape() const
         { return mpExistingShape; }
-    const ShapeLevelMap& getNodeShapes() const
+    const std::vector<ShapePtr> & getNodeShapes() const
         { return mpNodeShapes; }
-    void addNodeShape(const ShapePtr& pShape, sal_Int32 nLevel)
-        { mpNodeShapes[nLevel].push_back(pShape); }
+    void addNodeShape(const ShapePtr& pShape)
+        { mpNodeShapes.push_back(pShape); }
 
     bool setupShape( const ShapePtr& rShape,
                      const dgm::Point* pPresNode ) const;
@@ -274,7 +272,7 @@ private:
     OUString                     msMoveWith;
     OUString                     msStyleLabel;
     ShapePtr                     mpExistingShape;
-    ShapeLevelMap                mpNodeShapes;
+    std::vector<ShapePtr>        mpNodeShapes;
     sal_Int32                    mnChildOrder;
 };
 
diff --git a/oox/source/drawingml/diagram/layoutatomvisitorbase.cxx 
b/oox/source/drawingml/diagram/layoutatomvisitorbase.cxx
index c8761ffa3d67..98206433653a 100644
--- a/oox/source/drawingml/diagram/layoutatomvisitorbase.cxx
+++ b/oox/source/drawingml/diagram/layoutatomvisitorbase.cxx
@@ -131,11 +131,9 @@ void LayoutAtomVisitorBase::visit(LayoutNode& rAtom)
 
     const dgm::Point* pPreviousNode = mpCurrentNode;
     mpCurrentNode = pNewNode;
-    mnCurrLevel++;
 
     defaultVisit(rAtom);
 
-    mnCurrLevel--;
     mpCurrentNode = pPreviousNode;
 }
 
diff --git a/oox/source/drawingml/diagram/layoutatomvisitorbase.hxx 
b/oox/source/drawingml/diagram/layoutatomvisitorbase.hxx
index 25f2b4dea54b..7007cf283070 100644
--- a/oox/source/drawingml/diagram/layoutatomvisitorbase.hxx
+++ b/oox/source/drawingml/diagram/layoutatomvisitorbase.hxx
@@ -50,8 +50,7 @@ public:
         mpCurrentNode(pRootPoint),
         mnCurrIdx(0),
         mnCurrStep(0),
-        mnCurrCnt(0),
-        mnCurrLevel(0)
+        mnCurrCnt(0)
     {}
 
     void defaultVisit(LayoutAtom const& rAtom);
@@ -68,7 +67,6 @@ protected:
     sal_Int32 mnCurrIdx;
     sal_Int32 mnCurrStep;
     sal_Int32 mnCurrCnt;
-    sal_Int32 mnCurrLevel;
 };
 
 class ShallowPresNameVisitor : public LayoutAtomVisitorBase
diff --git a/oox/source/drawingml/diagram/layoutatomvisitors.cxx 
b/oox/source/drawingml/diagram/layoutatomvisitors.cxx
index b72133033470..31b853664577 100644
--- a/oox/source/drawingml/diagram/layoutatomvisitors.cxx
+++ b/oox/source/drawingml/diagram/layoutatomvisitors.cxx
@@ -69,7 +69,7 @@ void ShapeCreationVisitor::visit(LayoutNode& rAtom)
         if (rAtom.setupShape(pShape, pNewNode))
         {
             pShape->setInternalName(rAtom.getName());
-            rAtom.addNodeShape(pShape, mnCurrLevel);
+            rAtom.addNodeShape(pShape);
             mrDgm.getLayout()->getPresPointShapeMap()[pNewNode] = pShape;
         }
     }
@@ -83,15 +83,14 @@ void ShapeCreationVisitor::visit(LayoutNode& rAtom)
         {
             SAL_INFO(
                 "oox.drawingml",
-                "processing shape type " << 
(pShape->getCustomShapeProperties()->getShapePresetType())
-                << " level " << mnCurrLevel);
+                "processing shape type " << 
(pShape->getCustomShapeProperties()->getShapePresetType()));
 
             if (rAtom.setupShape(pShape, pNewNode))
             {
                 pShape->setInternalName(rAtom.getName());
                 pCurrParent->addChild(pShape);
                 pCurrParent = pShape;
-                rAtom.addNodeShape(pShape, mnCurrLevel);
+                rAtom.addNodeShape(pShape);
                 mrDgm.getLayout()->getPresPointShapeMap()[pNewNode] = pShape;
             }
         }
@@ -107,13 +106,11 @@ void ShapeCreationVisitor::visit(LayoutNode& rAtom)
     // set new parent for children
     ShapePtr pPreviousParent(mpParentShape);
     mpParentShape=pCurrParent;
-    mnCurrLevel++;
 
     // process children
     defaultVisit(rAtom);
 
     // restore parent
-    mnCurrLevel--;
     mpParentShape=pPreviousParent;
     mpCurrentNode = pPreviousNode;
 
@@ -180,7 +177,7 @@ void ShapeLayoutingVisitor::visit(AlgAtom& rAtom)
         const PresPointShapeMap aMap = 
rAtom.getLayoutNode().getDiagram().getLayout()->getPresPointShapeMap();
         auto pShape = aMap.find(mpCurrentNode);
         if (pShape != aMap.end())
-            rAtom.layoutShape(pShape->second, maConstraints, mnCurrLevel);
+            rAtom.layoutShape(pShape->second, maConstraints);
     }
 }
 
@@ -220,11 +217,9 @@ void ShapeLayoutingVisitor::visit(LayoutNode& rAtom)
     defaultVisit(rAtom);
     meLookFor = ALGORITHM;
     defaultVisit(rAtom);
-
-    mnCurrLevel++;
     meLookFor = LAYOUT_NODE;
     defaultVisit(rAtom);
-    mnCurrLevel--;
+
     mpCurrentNode = pPreviousNode;
 
     // delete added constraints, keep parent constraints
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to