diff options
Diffstat (limited to 'vcl/source/control')
-rw-r--r-- | vcl/source/control/combobox.cxx | 4 | ||||
-rw-r--r-- | vcl/source/control/spinfld.cxx | 14 |
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() |