summaryrefslogtreecommitdiff
path: root/svtools/source
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-04-24 13:38:41 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-04-30 08:38:50 +0200
commitdb41d66179916146411cd2483460d7ab4ba7e6c4 (patch)
treed78ebfa9639be17be5b0caac137813ed98eca1cc /svtools/source
parent6b2e5bce6e658a6e6c202ed801052da14b5f87be (diff)
loplugin:useuniqueptr in SvTreeListBox
Change-Id: Ib5b4cb667e8c7979ba03a680af7923f9caf9dfc3 Reviewed-on: https://gerrit.libreoffice.org/53593 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svtools/source')
-rw-r--r--svtools/source/contnr/treelistbox.cxx13
1 files changed, 5 insertions, 8 deletions
diff --git a/svtools/source/contnr/treelistbox.cxx b/svtools/source/contnr/treelistbox.cxx
index 63ddcdbd62e1..c236e432e227 100644
--- a/svtools/source/contnr/treelistbox.cxx
+++ b/svtools/source/contnr/treelistbox.cxx
@@ -352,7 +352,6 @@ SvTreeListBox::SvTreeListBox(vcl::Window* pParent, WinBits nWinStyle) :
pModel->SetCloneLink( LINK(this, SvTreeListBox, CloneHdl_Impl ));
pModel->InsertView( this );
pHdlEntry = nullptr;
- pEdCtrl = nullptr;
eSelMode = SelectionMode::Single;
nDragDropMode = DragDropMode::NONE;
SetType(WindowType::TREELISTBOX);
@@ -885,14 +884,14 @@ void SvTreeListBox::EnableSelectionAsDropTarget( bool bEnable )
void SvTreeListBox::EditText( const OUString& rStr, const tools::Rectangle& rRect,
const Selection& rSel )
{
- delete pEdCtrl;
+ pEdCtrl.reset();
nImpFlags |= SvTreeListBoxFlags::IN_EDT;
nImpFlags &= ~SvTreeListBoxFlags::EDTEND_CALLED;
HideFocus();
- pEdCtrl = new SvInplaceEdit2(
+ pEdCtrl.reset( new SvInplaceEdit2(
this, rRect.TopLeft(), rRect.GetSize(), rStr,
LINK( this, SvTreeListBox, TextEditEndedHdl_Impl ),
- rSel );
+ rSel ) );
}
IMPL_LINK_NOARG(SvTreeListBox, TextEditEndedHdl_Impl, SvInplaceEdit2&, void)
@@ -1363,8 +1362,7 @@ void SvTreeListBox::dispose()
{
ClearTabList();
- delete pEdCtrl;
- pEdCtrl = nullptr;
+ pEdCtrl.reset();
if( pModel )
{
@@ -2033,8 +2031,7 @@ void SvTreeListBox::LoseFocus()
void SvTreeListBox::ModelHasCleared()
{
pImpl->pCursor = nullptr; // else we crash in GetFocus when editing in-place
- delete pEdCtrl;
- pEdCtrl = nullptr;
+ pEdCtrl.reset();
pImpl->Clear();
nFocusWidth = -1;