diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-01-25 10:44:57 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-03-11 19:26:45 +0100 |
commit | 7b634028cec2df4136017be483ebc3c32bc8d9ec (patch) | |
tree | 6749050a173cbd9c464c98b9f241fb2b0689a4b9 /extensions/source/propctrlr | |
parent | 0234ddcac3acfd00f3a0a7ff89d943cd0b36e34c (diff) |
use more SfxItemSet::GetItemIfSet
Change-Id: I58af59d82d92c89ca1939d35f9fb4121b6815559
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131336
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'extensions/source/propctrlr')
-rw-r--r-- | extensions/source/propctrlr/formcomponenthandler.cxx | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/extensions/source/propctrlr/formcomponenthandler.cxx b/extensions/source/propctrlr/formcomponenthandler.cxx index 20a21ad8ae72..69e418b64e3d 100644 --- a/extensions/source/propctrlr/formcomponenthandler.cxx +++ b/extensions/source/propctrlr/formcomponenthandler.cxx @@ -2715,18 +2715,15 @@ namespace pcr { const SfxItemSet* pResult = aDialog.GetOutputItemSet(); - const SfxPoolItem* pItem = pResult->GetItem( SID_ATTR_NUMBERFORMAT_INFO ); - const SvxNumberInfoItem* pInfoItem = dynamic_cast< const SvxNumberInfoItem* >( pItem ); - if (pInfoItem) + if (const SvxNumberInfoItem* pInfoItem = pResult->GetItem( SID_ATTR_NUMBERFORMAT_INFO )) { for (sal_uInt32 key : pInfoItem->GetDelFormats()) pFormatter->DeleteEntry(key); } - pItem = nullptr; - if ( SfxItemState::SET == pResult->GetItemState( SID_ATTR_NUMBERFORMAT_VALUE, false, &pItem ) ) + if ( const SfxUInt32Item* pItem = pResult->GetItemIfSet( SID_ATTR_NUMBERFORMAT_VALUE, false ) ) { - _out_rNewValue <<= static_cast<sal_Int32>( static_cast< const SfxUInt32Item* >( pItem )->GetValue() ); + _out_rNewValue <<= static_cast<sal_Int32>( pItem->GetValue() ); bChanged = true; } } |