summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakeshi Abe <tabe@fixedpoint.jp>2015-12-09 17:59:04 +0900
committerNoel Grandin <noelgrandin@gmail.com>2015-12-10 10:40:15 +0000
commit434d8e2c7042a4d11b9d74ce84434e2bcc249038 (patch)
tree39e6c9359d92ff45fafc4996326725cf9be7306c
parent363a9c05fa074df5551bef7876654b38eaca4060 (diff)
starmath: SmElementPointer is not shared actually
... rather, it's owned by maElementList. So, use just std::unique_ptr<SmElement> instead. Change-Id: Id18466083535677e0f7d07f8c523b433c5e2a9ec Reviewed-on: https://gerrit.libreoffice.org/20490 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
-rw-r--r--starmath/inc/ElementsDockingWindow.hxx5
-rw-r--r--starmath/source/ElementsDockingWindow.cxx7
2 files changed, 4 insertions, 8 deletions
diff --git a/starmath/inc/ElementsDockingWindow.hxx b/starmath/inc/ElementsDockingWindow.hxx
index e57e50c73eae..4e1652abbcd1 100644
--- a/starmath/inc/ElementsDockingWindow.hxx
+++ b/starmath/inc/ElementsDockingWindow.hxx
@@ -85,15 +85,12 @@ class SmElementsControl : public Control
virtual void MouseButtonDown(const MouseEvent& rMEvt) override;
virtual void MouseMove( const MouseEvent& rMEvt ) override;
- typedef std::shared_ptr<SmElement> SmElementPointer;
- typedef std::vector< SmElementPointer > SmElementList;
-
SmDocShell* mpDocShell;
SmFormat maFormat;
sal_uInt16 maCurrentSetId;
SmElement* mpCurrentElement;
- SmElementList maElementList;
+ std::vector< std::unique_ptr<SmElement> > maElementList;
Size maMaxElementDimensions;
bool mbVerticalMode;
VclPtr< ScrollBar > mxScroll;
diff --git a/starmath/source/ElementsDockingWindow.cxx b/starmath/source/ElementsDockingWindow.cxx
index 229eeedb6b05..b3b0f2ce7147 100644
--- a/starmath/source/ElementsDockingWindow.cxx
+++ b/starmath/source/ElementsDockingWindow.cxx
@@ -24,6 +24,7 @@
#include <view.hxx>
#include <visitors.hxx>
+#include <o3tl/make_unique.hxx>
#include <svl/stritem.hxx>
#include <sfx2/dispatch.hxx>
#include <sfx2/sfxmodelfactory.hxx>
@@ -457,8 +458,7 @@ void SmElementsControl::DoScroll(long nDelta)
void SmElementsControl::addSeparator()
{
- SmElementPointer pElement(new SmElementSeparator());
- maElementList.push_back(pElement);
+ maElementList.push_back(o3tl::make_unique<SmElementSeparator>());
}
void SmElementsControl::addElement(const OUString& aElementVisual, const OUString& aElementSource, const OUString& aHelpText)
@@ -478,8 +478,7 @@ void SmElementsControl::addElement(const OUString& aElementVisual, const OUStrin
maMaxElementDimensions.Height() = aSizePixel.Height();
}
- SmElementPointer pElement(new SmElement(pNode, aElementSource, aHelpText));
- maElementList.push_back(pElement);
+ maElementList.push_back(o3tl::make_unique<SmElement>(pNode, aElementSource, aHelpText));
}
void SmElementsControl::setElementSetId(sal_uInt16 aSetId)