diff options
Diffstat (limited to 'oox/source/drawingml/diagram/diagramlayoutatoms.hxx')
-rw-r--r-- | oox/source/drawingml/diagram/diagramlayoutatoms.hxx | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/oox/source/drawingml/diagram/diagramlayoutatoms.hxx b/oox/source/drawingml/diagram/diagramlayoutatoms.hxx index 75149a5cbecd..9b184f917f17 100644 --- a/oox/source/drawingml/diagram/diagramlayoutatoms.hxx +++ b/oox/source/drawingml/diagram/diagramlayoutatoms.hxx @@ -91,10 +91,10 @@ typedef std::shared_ptr< LayoutAtom > LayoutAtomPtr; class LayoutAtom { public: - LayoutAtom(const LayoutNode& rLayoutNode) : mrLayoutNode(rLayoutNode) {} + LayoutAtom(LayoutNode& rLayoutNode) : mrLayoutNode(rLayoutNode) {} virtual ~LayoutAtom() { } - const LayoutNode& getLayoutNode() const + LayoutNode& getLayoutNode() { return mrLayoutNode; } /** visitor acceptance @@ -127,7 +127,7 @@ public: void dump(int level = 0); protected: - const LayoutNode& mrLayoutNode; + LayoutNode& mrLayoutNode; std::vector< LayoutAtomPtr > mpChildNodes; std::weak_ptr<LayoutAtom> mpParent; OUString msName; @@ -137,7 +137,7 @@ class ConstraintAtom : public LayoutAtom { public: - ConstraintAtom(const LayoutNode& rLayoutNode) : LayoutAtom(rLayoutNode) {} + ConstraintAtom(LayoutNode& rLayoutNode) : LayoutAtom(rLayoutNode) {} virtual void accept( LayoutAtomVisitor& ) override; Constraint& getConstraint() { return maConstraint; } @@ -150,7 +150,7 @@ class AlgAtom : public LayoutAtom { public: - AlgAtom(const LayoutNode& rLayoutNode) : LayoutAtom(rLayoutNode), mnType(0), maMap() {} + AlgAtom(LayoutNode& rLayoutNode) : LayoutAtom(rLayoutNode), mnType(0), maMap() {} typedef std::map<sal_Int32,sal_Int32> ParamMap; @@ -161,7 +161,7 @@ public: void addParam( sal_Int32 nType, sal_Int32 nVal ) { maMap[nType]=nVal; } void layoutShape( const ShapePtr& rShape, - const std::vector<Constraint>& rConstraints ) const; + const std::vector<Constraint>& rConstraints ); /// Gives access to <dgm:alg type="..."/>. sal_Int32 getType() const { return mnType; } @@ -171,6 +171,8 @@ public: void setAspectRatio(double fAspectRatio) { mfAspectRatio = fAspectRatio; } + double getAspectRatio() const { return mfAspectRatio; } + private: sal_Int32 mnType; ParamMap maMap; @@ -184,7 +186,7 @@ class ForEachAtom : public LayoutAtom { public: - explicit ForEachAtom(const LayoutNode& rLayoutNode, const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttributes); + explicit ForEachAtom(LayoutNode& rLayoutNode, const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttributes); IteratorAttr & iterator() { return maIter; } @@ -200,7 +202,7 @@ class ConditionAtom : public LayoutAtom { public: - explicit ConditionAtom(const LayoutNode& rLayoutNode, bool isElse, const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttributes); + explicit ConditionAtom(LayoutNode& rLayoutNode, bool isElse, const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttributes); virtual void accept( LayoutAtomVisitor& ) override; bool getDecision() const; private: @@ -220,7 +222,7 @@ class ChooseAtom : public LayoutAtom { public: - ChooseAtom(const LayoutNode& rLayoutNode) + ChooseAtom(LayoutNode& rLayoutNode) : LayoutAtom(rLayoutNode) #if defined __clang__ && __clang_major__ == 3 && __clang_minor__ == 8 , maEmptyChildren() @@ -264,6 +266,10 @@ public: const LayoutNode* getParentLayoutNode() const; + void setAlgAtom(AlgAtomPtr pAlgAtom) { mpAlgAtom = pAlgAtom; } + + AlgAtomPtr getAlgAtom() const { return mpAlgAtom.lock(); } + private: const Diagram& mrDgm; VarMap mVariables; @@ -272,6 +278,7 @@ private: ShapePtr mpExistingShape; std::vector<ShapePtr> mpNodeShapes; sal_Int32 mnChildOrder; + std::weak_ptr<AlgAtom> mpAlgAtom; }; typedef std::shared_ptr< LayoutNode > LayoutNodePtr; @@ -280,7 +287,7 @@ class ShapeAtom : public LayoutAtom { public: - ShapeAtom(const LayoutNode& rLayoutNode, const ShapePtr& pShape) : LayoutAtom(rLayoutNode), mpShapeTemplate(pShape) {} + ShapeAtom(LayoutNode& rLayoutNode, const ShapePtr& pShape) : LayoutAtom(rLayoutNode), mpShapeTemplate(pShape) {} virtual void accept( LayoutAtomVisitor& ) override; const ShapePtr& getShapeTemplate() const { return mpShapeTemplate; } |