summaryrefslogtreecommitdiff
path: root/sc/source/ui/view
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-11-07 13:55:06 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-11-09 07:31:24 +0100
commit5ba447bdcd13ba3d7c27c8609f207910227e4ab6 (patch)
tree9a59e7058ef40be90867518590e35abb6c0615f5 /sc/source/ui/view
parentea4a47d7d442d5d897cfa3a6e9f09ce3f1f233c5 (diff)
new loplugin simplifydynamiccast
simplify dynamic_cast followed by static_cast Change-Id: I965afcf05d1675094cfde53d3590a0fd00f26279 Reviewed-on: https://gerrit.libreoffice.org/44460 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/source/ui/view')
-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 1a8e08520db4..fb4c178e10f1 100644
--- a/sc/source/ui/view/viewfun2.cxx
+++ b/sc/source/ui/view/viewfun2.cxx
@@ -2616,11 +2616,11 @@ void ScViewFunc::MoveTable(
{ &aItem, &aTarget });
if ( pRetItem )
{
- 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 )
+ if ( auto pObjectItem = dynamic_cast<const SfxObjectItem*>(pRetItem) )
+ pDestShell = dynamic_cast<ScDocShell*>( pObjectItem->GetShell() );
+ else if ( auto pViewFrameItem = dynamic_cast<const SfxViewFrameItem*>( pRetItem) )
{
- SfxViewFrame* pFrm = static_cast<const SfxViewFrameItem*>(pRetItem)->GetFrame();
+ SfxViewFrame* pFrm = pViewFrameItem->GetFrame();
if (pFrm)
pDestShell = dynamic_cast<ScDocShell*>( pFrm->GetObjectShell() );
}