Kaydet (Commit) 434d8e2c authored tarafından Takeshi Abe's avatar Takeshi Abe Kaydeden (comit) Noel Grandin

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/20490Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noelgrandin@gmail.com>
üst 363a9c05
......@@ -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;
......
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment