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/basidesh.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/basidesh.cxx')
-rw-r--r-- | basctl/source/basicide/basidesh.cxx | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/basctl/source/basicide/basidesh.cxx b/basctl/source/basicide/basidesh.cxx index 7a8d733130ee..b59882c94229 100644 --- a/basctl/source/basicide/basidesh.cxx +++ b/basctl/source/basicide/basidesh.cxx @@ -251,19 +251,15 @@ BasicIDEShell::~BasicIDEShell() void BasicIDEShell::onDocumentCreated( const ScriptDocument& /*_rDocument*/ ) { - if(pCurWin && pCurWin->IsA( TYPE(ModulWindow))) - { - dynamic_cast<ModulWindow*>(pCurWin)->SetLineNumberDisplay(SourceLinesDisplayed()); - } + if (ModulWindow* pMCurWin = dynamic_cast<ModulWindow*>(pCurWin)) + pMCurWin->SetLineNumberDisplay(SourceLinesDisplayed()); UpdateWindows(); } void BasicIDEShell::onDocumentOpened( const ScriptDocument& /*_rDocument*/ ) { - if(pCurWin && pCurWin->IsA( TYPE(ModulWindow))) - { - dynamic_cast<ModulWindow*>(pCurWin)->SetLineNumberDisplay(SourceLinesDisplayed()); - } + if (ModulWindow* pMCurWin = dynamic_cast<ModulWindow*>(pCurWin)) + pMCurWin->SetLineNumberDisplay(SourceLinesDisplayed()); UpdateWindows(); } @@ -534,9 +530,9 @@ void BasicIDEShell::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId&, { if ( BasicIDEGlobals::GetShell() ) { - if ( rHint.IsA( TYPE( SfxSimpleHint ) ) ) + if (SfxSimpleHint* pSimpleHint = dynamic_cast<SfxSimpleHint*>(&rHint)) { - switch ( ((SfxSimpleHint&)rHint).GetId() ) + switch (pSimpleHint->GetId()) { case SFX_HINT_DYING: { @@ -546,15 +542,13 @@ void BasicIDEShell::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId&, break; } - if ( rHint.IsA( TYPE( SbxHint ) ) ) + if (SbxHint* pSbxHint = dynamic_cast<SbxHint*>(&rHint)) { - SbxHint& rSbxHint = (SbxHint&)rHint; - sal_uLong nHintId = rSbxHint.GetId(); + sal_uLong nHintId = pSbxHint->GetId(); if ( ( nHintId == SBX_HINT_BASICSTART ) || ( nHintId == SBX_HINT_BASICSTOP ) ) { - SfxBindings* pBindings = BasicIDE::GetBindingsPtr(); - if ( pBindings ) + if (SfxBindings* pBindings = BasicIDE::GetBindingsPtr()) { pBindings->Invalidate( SID_BASICRUN ); pBindings->Update( SID_BASICRUN ); |