diff options
author | Tomaž Vajngerl <quikee@gmail.com> | 2013-05-20 08:22:50 +0200 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2013-05-20 08:23:36 +0200 |
commit | 784e472aa24d2f2cb9c240b91af4a184c6fcb949 (patch) | |
tree | 420bc3d32c86c43ae8a9054cba4c82052bad989b /starmath/inc | |
parent | 5ef0015704ca67a8f9ffd8f4ae207be355da7f3e (diff) |
Math: Use shared_ptr in ElementsDockingWindow
Change-Id: Id31765f0c2f47cd2ebe830a8b42a9397d6eeffae
Diffstat (limited to 'starmath/inc')
-rw-r--r-- | starmath/inc/ElementsDockingWindow.hxx | 42 | ||||
-rw-r--r-- | starmath/inc/node.hxx | 1 |
2 files changed, 23 insertions, 20 deletions
diff --git a/starmath/inc/ElementsDockingWindow.hxx b/starmath/inc/ElementsDockingWindow.hxx index 48fc51bf8052..c338bdaf6ca9 100644 --- a/starmath/inc/ElementsDockingWindow.hxx +++ b/starmath/inc/ElementsDockingWindow.hxx @@ -19,34 +19,33 @@ #ifndef _ELEMENTSDOCKINGWINDOW_HXX_ #define _ELEMENTSDOCKINGWINDOW_HXX_ -#include <sfx2/ctrlitem.hxx> #include <sfx2/dockwin.hxx> -#include <vcl/toolbox.hxx> -#include <vcl/fixed.hxx> -#include <vcl/group.hxx> -#include <vcl/graph.hxx> - #include <svx/dlgctrl.hxx> + #include <document.hxx> +#include <node.hxx> class SmElement { - SmNode* mpNode; - OUString maText; + SmNodePointer mpNode; + OUString maText; public: - SmElement(SmNode* pNode, OUString aText); + Point mBoxLocation; + Size mBoxSize; + + SmElement(SmNodePointer pNode, OUString aText); virtual ~SmElement(); - SmNode* getNode(); - OUString getText() { return maText; } + SmNodePointer getNode(); + OUString getText() + { + return maText; + } virtual bool isSeparator() { return false; } - - Point mBoxLocation; - Size mBoxSize; }; class SmElementSeparator : public SmElement @@ -79,13 +78,16 @@ class SmElementsControl : public Control virtual void MouseButtonDown(const MouseEvent& rMEvt); virtual void MouseMove( const MouseEvent& rMEvt ); - SmDocShell* mpDocShell; - SmFormat maFormat; - sal_uInt16 maCurrentSetId; - SmElement* mpCurrentElement; + typedef boost::shared_ptr<SmElement> SmElementPointer; + typedef std::vector< SmElementPointer > SmElementList; + + SmDocShell* mpDocShell; + SmFormat maFormat; + sal_uInt16 maCurrentSetId; + SmElement* mpCurrentElement; - std::vector<SmElement*> maElementList; - Size maMaxElementDimensions; + SmElementList maElementList; + Size maMaxElementDimensions; void addElement(OUString aElementVisual, OUString aElementSource); diff --git a/starmath/inc/node.hxx b/starmath/inc/node.hxx index 8d4bc8c15630..b1640a338e56 100644 --- a/starmath/inc/node.hxx +++ b/starmath/inc/node.hxx @@ -57,6 +57,7 @@ class SmDocShell; class SmNode; class SmStructureNode; +typedef boost::shared_ptr<SmNode> SmNodePointer; typedef std::vector< SmNode * > SmNodeArray; typedef std::vector< SmStructureNode * > SmStructureNodeArray; |