summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorGrzegorz Araminowicz <grzegorz.araminowicz@collabora.com>2019-06-24 16:31:48 +0200
committerGrzegorz Araminowicz <grzegorz.araminowicz@collabora.com>2019-06-25 16:09:34 +0200
commitcd7fd73714ac9b727f64b8d9fa6795fb71b1251c (patch)
treea14873f93b67e33c10569db751b110793504192c /oox
parentd1c075c6a7002521129bddb5860f20746f168a29 (diff)
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@collabora.com>
Diffstat (limited to 'oox')
-rw-r--r--oox/source/drawingml/diagram/diagramlayoutatoms.hxx5
-rw-r--r--oox/source/drawingml/diagram/layoutatomvisitors.cxx6
-rw-r--r--oox/source/drawingml/diagram/layoutnodecontext.cxx1
3 files changed, 1 insertions, 11 deletions
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 ):