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

Grzegorz Araminowicz (via logerrit) logerrit at kemper.freedesktop.org
Tue Jun 25 14:10:16 UTC 2019


 oox/source/drawingml/diagram/diagramlayoutatoms.hxx |    5 -----
 oox/source/drawingml/diagram/layoutatomvisitors.cxx |    6 +-----
 oox/source/drawingml/diagram/layoutnodecontext.cxx  |    1 -
 3 files changed, 1 insertion(+), 11 deletions(-)

New commits:
commit cd7fd73714ac9b727f64b8d9fa6795fb71b1251c
Author:     Grzegorz Araminowicz <grzegorz.araminowicz at collabora.com>
AuthorDate: Mon Jun 24 16:31:48 2019 +0200
Commit:     Grzegorz Araminowicz <grzegorz.araminowicz at collabora.com>
CommitDate: Tue Jun 25 16:09:34 2019 +0200

    SmartArt: move setting shape aspect ratio to alg atom visit
    
    it allows to correctly follow if/else nodes instead of using once assigned
    alg atom
    
    Change-Id: I8c321b638524df3ca68242da6300bc8c2a838bbf
    Reviewed-on: https://gerrit.libreoffice.org/74648
    Tested-by: Jenkins
    Reviewed-by: Grzegorz Araminowicz <grzegorz.araminowicz at collabora.com>

diff --git a/oox/source/drawingml/diagram/diagramlayoutatoms.hxx b/oox/source/drawingml/diagram/diagramlayoutatoms.hxx
index 9fff33686dd6..ef99229b66ab 100644
--- a/oox/source/drawingml/diagram/diagramlayoutatoms.hxx
+++ b/oox/source/drawingml/diagram/diagramlayoutatoms.hxx
@@ -271,10 +271,6 @@ public:
 
     const LayoutNode* getParentLayoutNode() const;
 
-    void setAlgAtom(AlgAtomPtr pAlgAtom) { mpAlgAtom = pAlgAtom; }
-
-    AlgAtomPtr getAlgAtom() const { return mpAlgAtom.lock(); }
-
 private:
     const Diagram&               mrDgm;
     VarMap                       mVariables;
@@ -283,7 +279,6 @@ private:
     ShapePtr                     mpExistingShape;
     ShapeLevelMap                mpNodeShapes;
     sal_Int32                    mnChildOrder;
-    std::weak_ptr<AlgAtom>       mpAlgAtom;
 };
 
 typedef std::shared_ptr< LayoutNode > LayoutNodePtr;
diff --git a/oox/source/drawingml/diagram/layoutatomvisitors.cxx b/oox/source/drawingml/diagram/layoutatomvisitors.cxx
index 5d6f0065241d..aa1d21b179f1 100644
--- a/oox/source/drawingml/diagram/layoutatomvisitors.cxx
+++ b/oox/source/drawingml/diagram/layoutatomvisitors.cxx
@@ -43,7 +43,7 @@ void ShapeCreationVisitor::visit(ConstraintAtom& /*rAtom*/)
 
 void ShapeCreationVisitor::visit(AlgAtom& rAtom)
 {
-    defaultVisit(rAtom);
+    mpParentShape->setAspectRatio(rAtom.getAspectRatio());
 }
 
 void ShapeCreationVisitor::visit(ForEachAtom& rAtom)
@@ -140,8 +140,6 @@ void ShapeCreationVisitor::visit(LayoutNode& rAtom)
         if (rAtom.setupShape(pShape, pNewNode))
         {
             pShape->setInternalName(rAtom.getName());
-            if (AlgAtomPtr pAlgAtom = rAtom.getAlgAtom())
-                pShape->setAspectRatio(pAlgAtom->getAspectRatio());
             rAtom.addNodeShape(pShape, mnCurrLevel);
         }
     }
@@ -161,8 +159,6 @@ void ShapeCreationVisitor::visit(LayoutNode& rAtom)
             if (rAtom.setupShape(pShape, pNewNode))
             {
                 pShape->setInternalName(rAtom.getName());
-                if (AlgAtomPtr pAlgAtom = rAtom.getAlgAtom())
-                    pShape->setAspectRatio(pAlgAtom->getAspectRatio());
                 pCurrParent->addChild(pShape);
                 pCurrParent = pShape;
                 rAtom.addNodeShape(pShape, mnCurrLevel);
diff --git a/oox/source/drawingml/diagram/layoutnodecontext.cxx b/oox/source/drawingml/diagram/layoutnodecontext.cxx
index 8e3e3c2f6eb4..3547aad28a7a 100644
--- a/oox/source/drawingml/diagram/layoutnodecontext.cxx
+++ b/oox/source/drawingml/diagram/layoutnodecontext.cxx
@@ -233,7 +233,6 @@ LayoutNodeContext::onCreateContext( ::sal_Int32 aElement,
         // CT_Algorithm
         AlgAtomPtr pAtom( new AlgAtom(mpNode->getLayoutNode()) );
         LayoutAtom::connect(mpNode, pAtom);
-        mpNode->getLayoutNode().setAlgAtom(pAtom);
         return new AlgorithmContext( *this, rAttribs, pAtom );
     }
     case DGM_TOKEN( choose ):


More information about the Libreoffice-commits mailing list