summaryrefslogtreecommitdiff
path: root/svx/source/fmcomp/fmgridif.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-05-04 16:44:04 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-05-07 08:34:14 +0200
commita1e4def198f37cdc929211e44206875dd406d258 (patch)
treec9483b5c6a21725c07018d667a2a2237f32d9d16 /svx/source/fmcomp/fmgridif.cxx
parentdbba08c7d430948775d47164c760ea1100442beb (diff)
loplugin:useuniqueptr in FmXGridPeer
Change-Id: I05d6fd36bb92e88016ac9cb062c4443ec8796b97 Reviewed-on: https://gerrit.libreoffice.org/53882 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx/source/fmcomp/fmgridif.cxx')
-rw-r--r--svx/source/fmcomp/fmgridif.cxx22
1 files changed, 8 insertions, 14 deletions
diff --git a/svx/source/fmcomp/fmgridif.cxx b/svx/source/fmcomp/fmgridif.cxx
index e7c6fa716127..e3cee1d1e471 100644
--- a/svx/source/fmcomp/fmgridif.cxx
+++ b/svx/source/fmcomp/fmgridif.cxx
@@ -2715,10 +2715,8 @@ void FmXGridPeer::UpdateDispatches()
if (!nDispatchersGot)
{
- delete[] m_pStateCache;
- delete[] m_pDispatchers;
- m_pStateCache = nullptr;
- m_pDispatchers = nullptr;
+ m_pStateCache.reset();
+ m_pDispatchers.reset();
}
}
@@ -2735,8 +2733,8 @@ void FmXGridPeer::ConnectToDispatcher()
const Sequence< css::util::URL>& aSupportedURLs = getSupportedURLs();
// _before_ adding the status listeners (as the add should result in a statusChanged-call) !
- m_pStateCache = new bool[aSupportedURLs.getLength()];
- m_pDispatchers = new Reference< css::frame::XDispatch > [aSupportedURLs.getLength()];
+ m_pStateCache.reset(new bool[aSupportedURLs.getLength()]);
+ m_pDispatchers.reset(new Reference< css::frame::XDispatch > [aSupportedURLs.getLength()]);
sal_uInt16 nDispatchersGot = 0;
const css::util::URL* pSupportedURLs = aSupportedURLs.getConstArray();
@@ -2753,10 +2751,8 @@ void FmXGridPeer::ConnectToDispatcher()
if (!nDispatchersGot)
{
- delete[] m_pStateCache;
- delete[] m_pDispatchers;
- m_pStateCache = nullptr;
- m_pDispatchers = nullptr;
+ m_pStateCache.reset();
+ m_pDispatchers.reset();
}
}
@@ -2775,10 +2771,8 @@ void FmXGridPeer::DisConnectFromDispatcher()
m_pDispatchers[i]->removeStatusListener(static_cast<css::frame::XStatusListener*>(this), *pSupportedURLs);
}
- delete[] m_pStateCache;
- delete[] m_pDispatchers;
- m_pStateCache = nullptr;
- m_pDispatchers = nullptr;
+ m_pStateCache.reset();
+ m_pDispatchers.reset();
}