summaryrefslogtreecommitdiff
path: root/vcl/source/control
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-01-07 10:42:07 +0200
committerMichael Meeks <michael.meeks@collabora.com>2015-04-09 19:58:50 +0100
commit3ad9d2550f922ae7f555ca0753c57907d4d78ab6 (patch)
treee4c49fb42eca8566d9ab56600f4d372f4c2eb748 /vcl/source/control
parent09b4246c6aa5e75c89df2961816b0124fea7fd78 (diff)
vcl: make VclPtr<T>(T*) constructor explicit
to make it obvious in the code when we are translating between the reference-counted type and raw pointers, since that is the danger-point Change-Id: I32822432325fa34969e78cccf937e2ccbe1bfb70
Diffstat (limited to 'vcl/source/control')
-rw-r--r--vcl/source/control/combobox.cxx4
-rw-r--r--vcl/source/control/spinfld.cxx14
2 files changed, 12 insertions, 6 deletions
diff --git a/vcl/source/control/combobox.cxx b/vcl/source/control/combobox.cxx
index 4a4de5cd842d..d84797564a68 100644
--- a/vcl/source/control/combobox.cxx
+++ b/vcl/source/control/combobox.cxx
@@ -80,7 +80,7 @@ ComboBox::~ComboBox()
void ComboBox::ImplInitComboBoxData()
{
- mpSubEdit = NULL;
+ mpSubEdit.disposeAndClear();
mpBtn = NULL;
mpImplLB = NULL;
mpFloatWin = NULL;
@@ -164,7 +164,7 @@ void ComboBox::ImplInit( vcl::Window* pParent, WinBits nStyle )
}
}
- mpSubEdit = new Edit( this, nEditStyle );
+ mpSubEdit.set( new Edit( this, nEditStyle ) );
mpSubEdit->EnableRTL( false );
SetSubEdit( mpSubEdit );
mpSubEdit->SetPosPixel( Point() );
diff --git a/vcl/source/control/spinfld.cxx b/vcl/source/control/spinfld.cxx
index 85aa37b07769..048f2f4f281c 100644
--- a/vcl/source/control/spinfld.cxx
+++ b/vcl/source/control/spinfld.cxx
@@ -286,7 +286,7 @@ void ImplDrawSpinButton( OutputDevice* pOutDev,
void SpinField::ImplInitSpinFieldData()
{
- mpEdit = NULL;
+ mpEdit.disposeAndClear();
mbSpin = false;
mbRepeat = false;
mbUpperIn = false;
@@ -311,11 +311,11 @@ void SpinField::ImplInit( vcl::Window* pParent, WinBits nWinStyle )
if ( (nWinStyle & WB_SPIN) && ImplUseNativeBorder( nWinStyle ) )
{
SetBackground();
- mpEdit = new Edit( this, WB_NOBORDER );
+ mpEdit.set( new Edit( this, WB_NOBORDER ) );
mpEdit->SetBackground();
}
else
- mpEdit = new Edit( this, WB_NOBORDER );
+ mpEdit.set( new Edit( this, WB_NOBORDER ) );
mpEdit->EnableRTL( false );
mpEdit->SetPosPixel( Point() );
@@ -359,7 +359,13 @@ SpinField::SpinField( vcl::Window* pParent, const ResId& rResId ) :
SpinField::~SpinField()
{
- delete mpEdit;
+ dispose();
+}
+
+void SpinField::dispose()
+{
+ mpEdit.disposeAndClear();
+ Edit::dispose();
}
void SpinField::Up()