summaryrefslogtreecommitdiff
path: root/sc/source/ui/view/editsh.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2021-01-10 13:58:50 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-01-10 14:59:31 +0100
commit8f453c674f19188360ba5895c2bd9bd80273a83b (patch)
treece569bb8caeaea0b110e1e23e845716cb841588f /sc/source/ui/view/editsh.cxx
parentc5367ee0a60966b755e726de6d175dfcd1630741 (diff)
static_cast after dynamic_cast
Change-Id: I3792ddadad9582a7e6f4740829c081d9571ddaff Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109049 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/source/ui/view/editsh.cxx')
-rw-r--r--sc/source/ui/view/editsh.cxx9
1 files changed, 3 insertions, 6 deletions
diff --git a/sc/source/ui/view/editsh.cxx b/sc/source/ui/view/editsh.cxx
index 619001a27d8c..4b1b414f329e 100644
--- a/sc/source/ui/view/editsh.cxx
+++ b/sc/source/ui/view/editsh.cxx
@@ -246,12 +246,9 @@ void ScEditShell::Execute( SfxRequest& rReq )
{
SotClipboardFormatId nFormat = SotClipboardFormatId::NONE;
const SfxPoolItem* pItem;
- if ( pReqArgs &&
- pReqArgs->GetItemState(nSlot, true, &pItem) == SfxItemState::SET &&
- dynamic_cast<const SfxUInt32Item*>( pItem) != nullptr )
- {
- nFormat = static_cast<SotClipboardFormatId>(static_cast<const SfxUInt32Item*>(pItem)->GetValue());
- }
+ if ( pReqArgs && pReqArgs->GetItemState(nSlot, true, &pItem) == SfxItemState::SET )
+ if (auto pIntItem = dynamic_cast<const SfxUInt32Item*>( pItem))
+ nFormat = static_cast<SotClipboardFormatId>(pIntItem->GetValue());
if ( nFormat != SotClipboardFormatId::NONE )
{