summaryrefslogtreecommitdiff
path: root/sc/source/ui/view/viewfun2.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/ui/view/viewfun2.cxx')
-rw-r--r--sc/source/ui/view/viewfun2.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx
index 0c57a933e254..eeddce788b50 100644
--- a/sc/source/ui/view/viewfun2.cxx
+++ b/sc/source/ui/view/viewfun2.cxx
@@ -2533,13 +2533,13 @@ void ScViewFunc::MoveTable(
SID_OPENDOC, SfxCallMode::API|SfxCallMode::SYNCHRON, &aItem, &aTarget, 0L );
if ( pRetItem )
{
- if ( pRetItem->ISA( SfxObjectItem ) )
- pDestShell = PTR_CAST( ScDocShell, static_cast<const SfxObjectItem*>(pRetItem)->GetShell() );
- else if ( pRetItem->ISA( SfxViewFrameItem ) )
+ if ( dynamic_cast<const SfxObjectItem*>( pRetItem) != nullptr )
+ pDestShell = dynamic_cast<ScDocShell*>( static_cast<const SfxObjectItem*>(pRetItem)->GetShell() );
+ else if ( dynamic_cast<const SfxViewFrameItem*>( pRetItem) != nullptr )
{
SfxViewFrame* pFrm = static_cast<const SfxViewFrameItem*>(pRetItem)->GetFrame();
if (pFrm)
- pDestShell = PTR_CAST( ScDocShell, pFrm->GetObjectShell() );
+ pDestShell = dynamic_cast<ScDocShell*>( pFrm->GetObjectShell() );
}
if (pDestShell)
pDestViewSh = pDestShell->GetBestViewShell();