diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-11-07 13:55:06 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-11-09 07:31:24 +0100 |
commit | 5ba447bdcd13ba3d7c27c8609f207910227e4ab6 (patch) | |
tree | 9a59e7058ef40be90867518590e35abb6c0615f5 /sc/source/ui/drawfunc/fuins2.cxx | |
parent | ea4a47d7d442d5d897cfa3a6e9f09ce3f1f233c5 (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/drawfunc/fuins2.cxx')
-rw-r--r-- | sc/source/ui/drawfunc/fuins2.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sc/source/ui/drawfunc/fuins2.cxx b/sc/source/ui/drawfunc/fuins2.cxx index 15904ee521e6..08466129371d 100644 --- a/sc/source/ui/drawfunc/fuins2.cxx +++ b/sc/source/ui/drawfunc/fuins2.cxx @@ -530,14 +530,14 @@ FuInsertChart::FuInsertChart(ScTabViewShell* pViewSh, vcl::Window* pWin, ScDrawV if( pReqArgs->HasItem( FN_PARAM_4, &pItem ) ) { - if ( dynamic_cast<const SfxUInt16Item*>( pItem) != nullptr ) - nToTable = static_cast<const SfxUInt16Item*>(pItem)->GetValue(); - else if ( dynamic_cast<const SfxBoolItem*>( pItem) != nullptr ) + if ( auto pUInt16Item = dynamic_cast<const SfxUInt16Item*>( pItem) ) + nToTable = pUInt16Item->GetValue(); + else if ( auto pBoolItem = dynamic_cast<const SfxBoolItem*>( pItem) ) { // In IDL for Basic FN_PARAM_4 means SfxBoolItem // -> if set new table, else current table - if ( static_cast<const SfxBoolItem*>(pItem)->GetValue() ) + if ( pBoolItem->GetValue() ) nToTable = static_cast<sal_uInt16>(rScDoc.GetTableCount()); else nToTable = static_cast<sal_uInt16>(rData.GetTabNo()); |