diff options
Diffstat (limited to 'svtools/source/contnr/ivctrl.cxx')
-rw-r--r-- | svtools/source/contnr/ivctrl.cxx | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/svtools/source/contnr/ivctrl.cxx b/svtools/source/contnr/ivctrl.cxx index 38f2d5ad82d2..6ed9becbdb4b 100644 --- a/svtools/source/contnr/ivctrl.cxx +++ b/svtools/source/contnr/ivctrl.cxx @@ -88,8 +88,18 @@ SvtIconChoiceCtrl::SvtIconChoiceCtrl( vcl::Window* pParent, WinBits nWinStyle ) SvtIconChoiceCtrl::~SvtIconChoiceCtrl() { - _pImp->CallEventListeners( VCLEVENT_OBJECT_DYING ); - delete _pImp; + disposeOnce(); +} + +void SvtIconChoiceCtrl::dispose() +{ + if (_pImp) + { + _pImp->CallEventListeners( VCLEVENT_OBJECT_DYING ); + delete _pImp; + _pImp = NULL; + } + Control::dispose(); } SvxIconChoiceCtrlEntry* SvtIconChoiceCtrl::InsertEntry( const OUString& rText, const Image& rImage, sal_uLong nPos, const Point* pPos, SvxIconViewFlags nFlags ) @@ -206,7 +216,8 @@ void SvtIconChoiceCtrl::GetFocus() void SvtIconChoiceCtrl::LoseFocus() { - _pImp->LoseFocus(); + if (_pImp) + _pImp->LoseFocus(); Control::LoseFocus(); } @@ -257,12 +268,12 @@ void SvtIconChoiceCtrl::SetEntryTextMode( SvxIconChoiceCtrlTextMode eMode, SvxIc sal_uLong SvtIconChoiceCtrl::GetEntryCount() const { - return _pImp->GetEntryCount(); + return _pImp ? _pImp->GetEntryCount() : 0; } SvxIconChoiceCtrlEntry* SvtIconChoiceCtrl::GetEntry( sal_uLong nPos ) const { - return _pImp->GetEntry( nPos ); + return _pImp ? _pImp->GetEntry( nPos ) : NULL; } void SvtIconChoiceCtrl::CreateAutoMnemonics( MnemonicGenerator& _rUsedMnemonics ) @@ -272,7 +283,7 @@ void SvtIconChoiceCtrl::CreateAutoMnemonics( MnemonicGenerator& _rUsedMnemonics SvxIconChoiceCtrlEntry* SvtIconChoiceCtrl::GetSelectedEntry( sal_uLong& rPos ) const { - return _pImp->GetFirstSelectedEntry( rPos ); + return _pImp ? _pImp->GetFirstSelectedEntry( rPos ) : NULL; } void SvtIconChoiceCtrl::ClickIcon() |