From 6be7e2e9dd8027d284f1b00ef6e3b4654eec7d79 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 30 Aug 2018 13:54:33 +0200 Subject: pass SdrUndoAction around by std::unique_ptr convert the LINK we use here to std::function, since LINK does not currently handle std::unique_ptr Change-Id: I9df80352e612445e5f5ca513d7d4196d65589778 Reviewed-on: https://gerrit.libreoffice.org/59804 Tested-by: Jenkins Reviewed-by: Noel Grandin --- basctl/source/basicide/baside3.cxx | 6 ++---- basctl/source/inc/baside3.hxx | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) (limited to 'basctl') diff --git a/basctl/source/basicide/baside3.cxx b/basctl/source/basicide/baside3.cxx index 91e1d4972539..dfa698a4a345 100644 --- a/basctl/source/basicide/baside3.cxx +++ b/basctl/source/basicide/baside3.cxx @@ -83,7 +83,7 @@ DialogWindow::DialogWindow(DialogWindowLayout* pParent, ScriptDocument const& rD InitSettings(); m_pEditor->GetModel().SetNotifyUndoActionHdl( - LINK(this, DialogWindow, NotifyUndoActionHdl) + &DialogWindow::NotifyUndoActionHdl ); SetHelpId( HID_BASICIDE_DIALOGWINDOW ); @@ -217,13 +217,11 @@ void DialogWindow::Command( const CommandEvent& rCEvt ) } -IMPL_STATIC_LINK( - DialogWindow, NotifyUndoActionHdl, SdrUndoAction *, pUndoAction, void ) +void DialogWindow::NotifyUndoActionHdl( std::unique_ptr ) { // #i120515# pUndoAction needs to be deleted, this hand over is an ownership // change. As long as it does not get added to the undo manager, it needs at // least to be deleted. - delete pUndoAction; } void DialogWindow::DoInit() diff --git a/basctl/source/inc/baside3.hxx b/basctl/source/inc/baside3.hxx index 6d332ca90c65..0277d9cba92e 100644 --- a/basctl/source/inc/baside3.hxx +++ b/basctl/source/inc/baside3.hxx @@ -72,7 +72,7 @@ protected: virtual void Command( const CommandEvent& rCEvt ) override; virtual void LoseFocus() override; - DECL_STATIC_LINK( DialogWindow, NotifyUndoActionHdl, SdrUndoAction *, void ); + static void NotifyUndoActionHdl( std::unique_ptr ); virtual void DoInit() override; virtual void DoScroll( ScrollBar* pCurScrollBar ) override; virtual void DataChanged( const DataChangedEvent& rDCEvt ) override; -- cgit