diff options
author | Uray M. János <uray.janos@gmail.com> | 2012-08-07 14:33:56 +0200 |
---|---|---|
committer | Tor Lillqvist <tlillqvist@suse.com> | 2012-08-07 16:00:14 +0300 |
commit | 51bb488ac1b3e0c18947d6c68be6b577106f27d9 (patch) | |
tree | 3b139929d7319f4a32f6116850e0a2dac4a48538 /basctl/source/basicide/basicbox.cxx | |
parent | 69a70bf0285e8dfdbba10694fe56bbc80f0fdae0 (diff) |
IDE: PTR_CAST, ISA to dynamic_cast
Convert the obsolete PTR_CAST and ISA macros (from tools/rtti.hxx) to
C++ dynamic_cast is basctl.
Change-Id: I45530d1d34d132904f812e238ee3b59b1a4f227b
Diffstat (limited to 'basctl/source/basicide/basicbox.cxx')
-rw-r--r-- | basctl/source/basicide/basicbox.cxx | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/basctl/source/basicide/basicbox.cxx b/basctl/source/basicide/basicbox.cxx index 99ffa2392d73..34158fcfadd7 100644 --- a/basctl/source/basicide/basicbox.cxx +++ b/basctl/source/basicide/basicbox.cxx @@ -69,11 +69,7 @@ void LibBoxControl::StateChanged( sal_uInt16, SfxItemState eState, const SfxPool else { pBox->Enable(); - - if ( pState->ISA(SfxStringItem) ) - pBox->Update( (const SfxStringItem*)pState ); - else - pBox->Update( NULL ); + pBox->Update(dynamic_cast<SfxStringItem const*>(pState)); } } @@ -357,23 +353,17 @@ LanguageBoxControl::~LanguageBoxControl() { } -void LanguageBoxControl::StateChanged( sal_uInt16 _nID, SfxItemState _eState, const SfxPoolItem* _pItem ) +void LanguageBoxControl::StateChanged( sal_uInt16 nID, SfxItemState eState, const SfxPoolItem* pItem ) { - (void)_nID; - - BasicLanguageBox* pBox = (BasicLanguageBox*)( GetToolBox().GetItemWindow( GetId() ) ); - - if ( pBox ) + (void)nID; + if (BasicLanguageBox* pBox = static_cast<BasicLanguageBox*>(GetToolBox().GetItemWindow(GetId()))) { - if ( _eState != SFX_ITEM_AVAILABLE ) + if (eState != SFX_ITEM_AVAILABLE) pBox->Disable(); else { pBox->Enable(); - if ( _pItem->ISA(SfxStringItem) ) - pBox->Update( (const SfxStringItem*)_pItem ); - else - pBox->Update( NULL ); + pBox->Update(dynamic_cast<SfxStringItem const*>(pItem)); } } } |