summaryrefslogtreecommitdiffstats
path: root/oox/source
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-07-11 07:25:21 +0200
commit583a3140c01e6140022b846e6b067c2846812e56 (patch)
tree6c4906cb91a8b4a5b9b21a86fc2059c2116ea80d /oox/source
parentSmartArt: omit last atom in forEach loop only when necessary (diff)
downloadcore-583a3140c01e6140022b846e6b067c2846812e56.tar.gz
core-583a3140c01e6140022b846e6b067c2846812e56.zip
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> Reviewed-on: https://gerrit.libreoffice.org/75385 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Diffstat (limited to 'oox/source')
-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 842acc0757f6..4dcee899a4c0 100644
--- a/oox/source/drawingml/diagram/diagramlayoutatoms.hxx
+++ b/oox/source/drawingml/diagram/diagramlayoutatoms.hxx
@@ -274,10 +274,6 @@ public:
const LayoutNode* getParentLayoutNode() const;
- void setAlgAtom(AlgAtomPtr pAlgAtom) { mpAlgAtom = pAlgAtom; }
-
- AlgAtomPtr getAlgAtom() const { return mpAlgAtom.lock(); }
-
private:
const Diagram& mrDgm;
VarMap mVariables;
@@ -286,7 +282,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 0d022ca41504..27b5917b1ac9 100644
--- a/oox/source/drawingml/diagram/layoutnodecontext.cxx
+++ b/oox/source/drawingml/diagram/layoutnodecontext.cxx
@@ -234,7 +234,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 ):