summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorTakeshi Abe <tabe@fixedpoint.jp>2017-12-23 17:47:29 +0900
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-12-23 13:22:06 +0100
commit40cfea9a5b4854ada381642d502bf8f74c87c00b (patch)
treeadde56c84962f4cb3003a981ecde332e92296c58 /svtools
parentc5417a21f50042686c43e8702ec50408f948a366 (diff)
svtools: Use std::unique_ptr for SvImpLBox
Change-Id: I4c5917eaa478e76411e9d8bbc5bd59c655693383 Reviewed-on: https://gerrit.libreoffice.org/47012 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svtools')
-rw-r--r--svtools/source/contnr/svimpbox.cxx11
-rw-r--r--svtools/source/inc/svimpbox.hxx3
2 files changed, 5 insertions, 9 deletions
diff --git a/svtools/source/contnr/svimpbox.cxx b/svtools/source/contnr/svimpbox.cxx
index acf2e84e216f..8c3f8ed0e093 100644
--- a/svtools/source/contnr/svimpbox.cxx
+++ b/svtools/source/contnr/svimpbox.cxx
@@ -53,7 +53,6 @@ SvImpLBox::SvImpLBox( SvTreeListBox* pLBView, SvTreeList* pLBTree, WinBits nWinS
, aFctSet(this, pLBView)
, bAreChildrenTransient(true)
, mbForceMakeVisible (false)
- , m_pStringSorter(nullptr)
, aVerSBar(VclPtr<ScrollBar>::Create(pLBView, WB_DRAG | WB_VSCROLL))
, aOutputSize(0, 0)
, mbNoAutoCurEntry(false)
@@ -119,7 +118,6 @@ SvImpLBox::~SvImpLBox()
aEditIdle.Stop();
StopUserEvent();
- delete m_pStringSorter;
if ( osl_atomic_decrement(&s_nImageRefCount) == 0 )
{
DELETEZ(s_pDefCollapsed);
@@ -141,17 +139,14 @@ void SvImpLBox::UpdateStringSorter()
if( aLocale.Language != rNewLocale.Language ||
aLocale.Country != rNewLocale.Country ||
aLocale.Variant != rNewLocale.Variant )
- {
- delete m_pStringSorter;
- m_pStringSorter = nullptr;
- }
+ m_pStringSorter.reset();
}
if( !m_pStringSorter )
{
- m_pStringSorter = new comphelper::string::NaturalStringSorter(
+ m_pStringSorter.reset(new comphelper::string::NaturalStringSorter(
::comphelper::getProcessComponentContext(),
- rNewLocale);
+ rNewLocale));
}
}
diff --git a/svtools/source/inc/svimpbox.hxx b/svtools/source/inc/svimpbox.hxx
index 1c56643c11ee..373c715e3577 100644
--- a/svtools/source/inc/svimpbox.hxx
+++ b/svtools/source/inc/svimpbox.hxx
@@ -25,6 +25,7 @@
#include <vcl/vclevent.hxx>
#include <unotools/intlwrapper.hxx>
#include <o3tl/enumarray.hxx>
+#include <memory>
#include <vector>
#include "svtaccessiblefactory.hxx"
@@ -142,7 +143,7 @@ private:
Point aEditClickPos;
Idle aEditIdle;
- comphelper::string::NaturalStringSorter *m_pStringSorter;
+ std::unique_ptr<comphelper::string::NaturalStringSorter> m_pStringSorter;
std::vector< short > aContextBmpWidthVector;