summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-02-06 11:38:34 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-02-17 07:07:08 +0100
commit794066fa1ac67b6e352c17e78245a2698b0c470b (patch)
treed433b0c84b7854d36266a3ba3fe07857ae165898
parentc503df794f942488840ac2d69e61895e42a35b2a (diff)
loplugin:useuniqueptr in FmXGridPeer
Change-Id: Ie9a705852035eb99c9d0e5862c4d9f6bdb4c6a05 Reviewed-on: https://gerrit.libreoffice.org/49877 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--include/svx/fmgridif.hxx3
-rw-r--r--svx/source/fmcomp/fmgridif.cxx7
2 files changed, 4 insertions, 6 deletions
diff --git a/include/svx/fmgridif.hxx b/include/svx/fmgridif.hxx
index 5aa857005c69..fbec6ea6435f 100644
--- a/include/svx/fmgridif.hxx
+++ b/include/svx/fmgridif.hxx
@@ -48,6 +48,7 @@
#include <comphelper/uno3.hxx>
#include <cppuhelper/implbase.hxx>
#include <cppuhelper/implbase10.hxx>
+#include <memory>
class DbGridColumn;
enum class DbGridControlNavigationBarState;
@@ -359,7 +360,7 @@ class SAL_WARN_UNUSED SVX_DLLPUBLIC FmXGridPeer:
class GridListenerDelegator;
friend class GridListenerDelegator;
- GridListenerDelegator* m_pGridListener;
+ std::unique_ptr<GridListenerDelegator> m_pGridListener;
protected:
css::uno::Reference< css::uno::XComponentContext > m_xContext;
diff --git a/svx/source/fmcomp/fmgridif.cxx b/svx/source/fmcomp/fmgridif.cxx
index 31280a401825..262d4d47f5bc 100644
--- a/svx/source/fmcomp/fmgridif.cxx
+++ b/svx/source/fmcomp/fmgridif.cxx
@@ -1041,11 +1041,10 @@ FmXGridPeer::FmXGridPeer(const Reference< XComponentContext >& _rxContext)
,m_bInterceptingDispatch(false)
,m_pStateCache(nullptr)
,m_pDispatchers(nullptr)
- ,m_pGridListener(nullptr)
,m_xContext(_rxContext)
{
// Create must be called after this constructor
- m_pGridListener = new GridListenerDelegator( this );
+ m_pGridListener.reset( new GridListenerDelegator( this ) );
}
@@ -1064,7 +1063,7 @@ void FmXGridPeer::Create(vcl::Window* pParent, WinBits nStyle)
pWin->SetSlotExecutor(LINK(this, FmXGridPeer, OnExecuteGridSlot));
// want to hear about row selections
- pWin->setGridListener( m_pGridListener );
+ pWin->setGridListener( m_pGridListener.get() );
// Init must always be called
pWin->Init();
@@ -1078,8 +1077,6 @@ FmXGridPeer::~FmXGridPeer()
{
setRowSet(Reference< XRowSet > ());
setColumns(Reference< XIndexContainer > ());
-
- delete m_pGridListener;
}
namespace