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>
This commit is contained in:
committed by
Noel Grandin
parent
c5417a21f5
commit
40cfea9a5b
@@ -53,7 +53,6 @@ SvImpLBox::SvImpLBox( SvTreeListBox* pLBView, SvTreeList* pLBTree, WinBits nWinS
|
|||||||
, aFctSet(this, pLBView)
|
, aFctSet(this, pLBView)
|
||||||
, bAreChildrenTransient(true)
|
, bAreChildrenTransient(true)
|
||||||
, mbForceMakeVisible (false)
|
, mbForceMakeVisible (false)
|
||||||
, m_pStringSorter(nullptr)
|
|
||||||
, aVerSBar(VclPtr<ScrollBar>::Create(pLBView, WB_DRAG | WB_VSCROLL))
|
, aVerSBar(VclPtr<ScrollBar>::Create(pLBView, WB_DRAG | WB_VSCROLL))
|
||||||
, aOutputSize(0, 0)
|
, aOutputSize(0, 0)
|
||||||
, mbNoAutoCurEntry(false)
|
, mbNoAutoCurEntry(false)
|
||||||
@@ -119,7 +118,6 @@ SvImpLBox::~SvImpLBox()
|
|||||||
aEditIdle.Stop();
|
aEditIdle.Stop();
|
||||||
StopUserEvent();
|
StopUserEvent();
|
||||||
|
|
||||||
delete m_pStringSorter;
|
|
||||||
if ( osl_atomic_decrement(&s_nImageRefCount) == 0 )
|
if ( osl_atomic_decrement(&s_nImageRefCount) == 0 )
|
||||||
{
|
{
|
||||||
DELETEZ(s_pDefCollapsed);
|
DELETEZ(s_pDefCollapsed);
|
||||||
@@ -141,17 +139,14 @@ void SvImpLBox::UpdateStringSorter()
|
|||||||
if( aLocale.Language != rNewLocale.Language ||
|
if( aLocale.Language != rNewLocale.Language ||
|
||||||
aLocale.Country != rNewLocale.Country ||
|
aLocale.Country != rNewLocale.Country ||
|
||||||
aLocale.Variant != rNewLocale.Variant )
|
aLocale.Variant != rNewLocale.Variant )
|
||||||
{
|
m_pStringSorter.reset();
|
||||||
delete m_pStringSorter;
|
|
||||||
m_pStringSorter = nullptr;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if( !m_pStringSorter )
|
if( !m_pStringSorter )
|
||||||
{
|
{
|
||||||
m_pStringSorter = new comphelper::string::NaturalStringSorter(
|
m_pStringSorter.reset(new comphelper::string::NaturalStringSorter(
|
||||||
::comphelper::getProcessComponentContext(),
|
::comphelper::getProcessComponentContext(),
|
||||||
rNewLocale);
|
rNewLocale));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -25,6 +25,7 @@
|
|||||||
#include <vcl/vclevent.hxx>
|
#include <vcl/vclevent.hxx>
|
||||||
#include <unotools/intlwrapper.hxx>
|
#include <unotools/intlwrapper.hxx>
|
||||||
#include <o3tl/enumarray.hxx>
|
#include <o3tl/enumarray.hxx>
|
||||||
|
#include <memory>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include "svtaccessiblefactory.hxx"
|
#include "svtaccessiblefactory.hxx"
|
||||||
|
|
||||||
@@ -142,7 +143,7 @@ private:
|
|||||||
Point aEditClickPos;
|
Point aEditClickPos;
|
||||||
Idle aEditIdle;
|
Idle aEditIdle;
|
||||||
|
|
||||||
comphelper::string::NaturalStringSorter *m_pStringSorter;
|
std::unique_ptr<comphelper::string::NaturalStringSorter> m_pStringSorter;
|
||||||
|
|
||||||
std::vector< short > aContextBmpWidthVector;
|
std::vector< short > aContextBmpWidthVector;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user