Kaydet (Commit) 7c08c1af authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:useuniqueptr in MenuButton

Change-Id: I4e7a2ca5f8bb645e99414b1c99dc6261310c89bb
Reviewed-on: https://gerrit.libreoffice.org/53237Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst e098e2d5
......@@ -22,6 +22,7 @@
#include <vcl/button.hxx>
#include <vcl/dllapi.h>
#include <memory>
class FloatingWindow;
class Timer;
......@@ -34,7 +35,7 @@ class VCL_DLLPUBLIC MenuButton : public PushButton
private:
friend class VclBuilder;
Timer* mpMenuTimer;
std::unique_ptr<Timer> mpMenuTimer;
VclPtr<PopupMenu> mpMenu;
VclPtr<Window> mpFloatingWindow;
sal_uInt16 mnCurItemId;
......
......@@ -96,7 +96,7 @@ MenuButton::~MenuButton()
void MenuButton::dispose()
{
delete mpMenuTimer;
mpMenuTimer.reset();
mpFloatingWindow.clear();
mpMenu.clear();
PushButton::dispose();
......@@ -124,7 +124,7 @@ void MenuButton::MouseButtonDown( const MouseEvent& rMEvt )
{
if ( !mpMenuTimer )
{
mpMenuTimer = new Timer("MenuTimer");
mpMenuTimer.reset(new Timer("MenuTimer"));
mpMenuTimer->SetInvokeHandler( LINK( this, MenuButton, ImplMenuTimeoutHdl ) );
}
......
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