summaryrefslogtreecommitdiff
path: root/sw/source/ui/misc/pgfnote.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-03-09 16:51:29 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-03-09 18:21:05 +0100
commitd07cb9eccd7ae0a24e352906578d5c514ff3bc1d (patch)
treee90848bd90ee68d63eb4012448019e80da5ccc6d /sw/source/ui/misc/pgfnote.cxx
parentf56b932487509de1ecde46a42c40df76c6ecebcf (diff)
use SfxItemSet::GetItemIfSet in sw/.../ui/misc
Change-Id: Icf83de0ca3f0bef20d73f65d0d540a222f1edbe2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131260 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/ui/misc/pgfnote.cxx')
-rw-r--r--sw/source/ui/misc/pgfnote.cxx16
1 files changed, 7 insertions, 9 deletions
diff --git a/sw/source/ui/misc/pgfnote.cxx b/sw/source/ui/misc/pgfnote.cxx
index 786d8028f97a..fa94ea19e2bd 100644
--- a/sw/source/ui/misc/pgfnote.cxx
+++ b/sw/source/ui/misc/pgfnote.cxx
@@ -262,10 +262,9 @@ void SwFootNotePage::ActivatePage(const SfxItemSet& rSet)
auto const & rSize = rSet.Get( RES_FRM_SIZE );
lMaxHeight = rSize.GetHeight();
- const SfxPoolItem* pItem;
- if( SfxItemState::SET == rSet.GetItemState( rSet.GetPool()->GetWhich( SID_ATTR_PAGE_HEADERSET), false, &pItem ) )
+ if( const SvxSetItem* pHeaderSetItem = rSet.GetItemIfSet( rSet.GetPool()->GetWhich( SID_ATTR_PAGE_HEADERSET), false ) )
{
- const SfxItemSet& rHeaderSet = static_cast<const SvxSetItem*>(pItem)->GetItemSet();
+ const SfxItemSet& rHeaderSet = pHeaderSetItem->GetItemSet();
const SfxBoolItem& rHeaderOn =
rHeaderSet.Get( rSet.GetPool()->GetWhich( SID_ATTR_PAGE_ON ) );
@@ -277,10 +276,10 @@ void SwFootNotePage::ActivatePage(const SfxItemSet& rSet)
}
}
- if( SfxItemState::SET == rSet.GetItemState( rSet.GetPool()->GetWhich( SID_ATTR_PAGE_FOOTERSET),
- false, &pItem ) )
+ if( const SvxSetItem* pFooterSetItem = rSet.GetItemIfSet( rSet.GetPool()->GetWhich( SID_ATTR_PAGE_FOOTERSET),
+ false ) )
{
- const SfxItemSet& rFooterSet = static_cast<const SvxSetItem*>(pItem)->GetItemSet();
+ const SfxItemSet& rFooterSet = pFooterSetItem->GetItemSet();
const SfxBoolItem& rFooterOn = rFooterSet.Get( SID_ATTR_PAGE_ON );
if ( rFooterOn.GetValue() )
@@ -291,10 +290,9 @@ void SwFootNotePage::ActivatePage(const SfxItemSet& rSet)
}
}
- if ( rSet.GetItemState( RES_UL_SPACE , false ) == SfxItemState::SET )
+ if ( const SvxULSpaceItem* pSpaceItem = rSet.GetItemIfSet( RES_UL_SPACE , false ) )
{
- const SvxULSpaceItem &rUL = rSet.Get( RES_UL_SPACE );
- lMaxHeight -= rUL.GetUpper() + rUL.GetLower();
+ lMaxHeight -= pSpaceItem->GetUpper() + pSpaceItem->GetLower();
}
lMaxHeight *= 8;