summaryrefslogtreecommitdiff
path: root/sd/source/ui/func/fuparagr.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-03-02 10:12:37 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-03-02 11:48:43 +0100
commit9f7cbc3a5358620f94fd175dbd494e6d5c01f3de (patch)
treefdf17ff608430b7d80d655983144fa33e6b29894 /sd/source/ui/func/fuparagr.cxx
parent615f72e74c9ac2202bce4dd95d98b6558b178f19 (diff)
use SfxItemSet::GetItemIfSet in sd
Change-Id: I198b6101c1d62e81a70bac6a57faa2adc2dd36f0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130820 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sd/source/ui/func/fuparagr.cxx')
-rw-r--r--sd/source/ui/func/fuparagr.cxx9
1 files changed, 4 insertions, 5 deletions
diff --git a/sd/source/ui/func/fuparagr.cxx b/sd/source/ui/func/fuparagr.cxx
index 0caaa83647f9..ac5d87636098 100644
--- a/sd/source/ui/func/fuparagr.cxx
+++ b/sd/source/ui/func/fuparagr.cxx
@@ -111,16 +111,15 @@ void FuParagraph::DoExecute( SfxRequest& rReq )
{
ESelection eSelection = pOutlView->GetSelection();
- const SfxPoolItem *pItem = nullptr;
- if( SfxItemState::SET == pArgs->GetItemState( ATTR_NUMBER_NEWSTART, false, &pItem ) )
+ if( const SfxBoolItem* pItem = pArgs->GetItemIfSet( ATTR_NUMBER_NEWSTART, false ) )
{
- const bool bNewStart = static_cast<const SfxBoolItem*>(pItem)->GetValue();
+ const bool bNewStart = pItem->GetValue();
pOutliner->SetParaIsNumberingRestart( eSelection.nStartPara, bNewStart );
}
- if( SfxItemState::SET == pArgs->GetItemState( ATTR_NUMBER_NEWSTART_AT, false, &pItem ) )
+ if( const SfxInt16Item* pItem = pArgs->GetItemIfSet( ATTR_NUMBER_NEWSTART_AT, false ) )
{
- const sal_Int16 nStartAt = static_cast<const SfxInt16Item*>(pItem)->GetValue();
+ const sal_Int16 nStartAt = pItem->GetValue();
pOutliner->SetNumberingStartValue( eSelection.nStartPara, nStartAt );
}
}