diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-02-15 08:56:13 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-02-15 09:19:34 +0100 |
commit | 339fde9d905135e24b2f4e204009ee289d678b0c (patch) | |
tree | b76ca536c6a8b4d1979818a990f947ee065bcbe3 /svx | |
parent | 459373a2fe7c7a5d04b3dd4d64f70d3f18525d33 (diff) |
add typed GetWhich operations
to reduce boilerplate at call sites
Change-Id: I290c2bf60ad5e6ddb000aa26cf543830ed39120a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129949
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/dialog/hdft.cxx | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/svx/source/dialog/hdft.cxx b/svx/source/dialog/hdft.cxx index 5921d3b53c56..f3bb4eccfd38 100644 --- a/svx/source/dialog/hdft.cxx +++ b/svx/source/dialog/hdft.cxx @@ -335,21 +335,21 @@ void SvxHFPage::Reset( const SfxItemSet* rSet ) { const SfxItemSet& rHeaderSet = pSetItem->GetItemSet(); const SfxBoolItem& rHeaderOn = - static_cast<const SfxBoolItem&>(rHeaderSet.Get(GetWhich(SID_ATTR_PAGE_ON))); + rHeaderSet.Get(GetWhich(SID_ATTR_PAGE_ON)); m_xTurnOnBox->set_active(rHeaderOn.GetValue()); if ( rHeaderOn.GetValue() ) { const SfxBoolItem& rDynamic = - static_cast<const SfxBoolItem&>(rHeaderSet.Get( GetWhich( SID_ATTR_PAGE_DYNAMIC ) )); + rHeaderSet.Get( GetWhich( SID_ATTR_PAGE_DYNAMIC ) ); const SfxBoolItem& rShared = - static_cast<const SfxBoolItem&>(rHeaderSet.Get( GetWhich( SID_ATTR_PAGE_SHARED ) )); + rHeaderSet.Get( GetWhich( SID_ATTR_PAGE_SHARED ) ); const SfxBoolItem* pSharedFirst = nullptr; if (rHeaderSet.HasItem(GetWhich(SID_ATTR_PAGE_SHARED_FIRST))) pSharedFirst = static_cast<const SfxBoolItem*>(&rHeaderSet.Get( GetWhich( SID_ATTR_PAGE_SHARED_FIRST ) )); const SvxSizeItem& rSize = - static_cast<const SvxSizeItem&>(rHeaderSet.Get( GetWhich( SID_ATTR_PAGE_SIZE ) )); + rHeaderSet.Get( GetWhich( SID_ATTR_PAGE_SIZE ) ); const SvxULSpaceItem& rUL = static_cast<const SvxULSpaceItem&>(rHeaderSet.Get( GetWhich( SID_ATTR_ULSPACE ) )); const SvxLRSpaceItem& rLR = @@ -696,7 +696,7 @@ void SvxHFPage::ResetBackground_Impl( const SfxItemSet& rSet ) { const SvxSetItem& rSetItem = static_cast< const SvxSetItem& >(rSet.Get(nWhich, false)); const SfxItemSet& rTmpSet = rSetItem.GetItemSet(); - const SfxBoolItem& rOn = static_cast< const SfxBoolItem& >(rTmpSet.Get(GetWhich(SID_ATTR_PAGE_ON))); + const SfxBoolItem& rOn = rTmpSet.Get(GetWhich(SID_ATTR_PAGE_ON)); if(rOn.GetValue()) { @@ -732,7 +732,7 @@ void SvxHFPage::ResetBackground_Impl( const SfxItemSet& rSet ) { const SvxSetItem& rSetItem = static_cast< const SvxSetItem& >(rSet.Get(nWhich, false)); const SfxItemSet& rTmpSet = rSetItem.GetItemSet(); - const SfxBoolItem& rOn = static_cast< const SfxBoolItem& >(rTmpSet.Get(GetWhich(SID_ATTR_PAGE_ON))); + const SfxBoolItem& rOn = rTmpSet.Get(GetWhich(SID_ATTR_PAGE_ON)); if(rOn.GetValue()) { @@ -855,12 +855,12 @@ void SvxHFPage::ActivatePage( const SfxItemSet& rSet ) { const SfxItemSet& rHeaderSet = pSetItem->GetItemSet(); const SfxBoolItem& rHeaderOn = - static_cast<const SfxBoolItem&>(rHeaderSet.Get( GetWhich( SID_ATTR_PAGE_ON ) )); + rHeaderSet.Get( GetWhich( SID_ATTR_PAGE_ON ) ); if ( rHeaderOn.GetValue() ) { - const SvxSizeItem& rSize = static_cast<const SvxSizeItem&>( - rHeaderSet.Get( GetWhich( SID_ATTR_PAGE_SIZE ) )); + const SvxSizeItem& rSize = + rHeaderSet.Get( GetWhich( SID_ATTR_PAGE_SIZE ) ); const SvxULSpaceItem& rUL = static_cast<const SvxULSpaceItem&>( rHeaderSet.Get( GetWhich(SID_ATTR_ULSPACE ) )); const SvxLRSpaceItem& rLR = static_cast<const SvxLRSpaceItem&>( @@ -895,12 +895,12 @@ void SvxHFPage::ActivatePage( const SfxItemSet& rSet ) { const SfxItemSet& rFooterSet = pSetItem->GetItemSet(); const SfxBoolItem& rFooterOn = - static_cast<const SfxBoolItem&>(rFooterSet.Get( GetWhich( SID_ATTR_PAGE_ON ) )); + rFooterSet.Get( GetWhich( SID_ATTR_PAGE_ON ) ); if ( rFooterOn.GetValue() ) { - const SvxSizeItem& rSize = static_cast<const SvxSizeItem&>( - rFooterSet.Get( GetWhich( SID_ATTR_PAGE_SIZE ) )); + const SvxSizeItem& rSize = + rFooterSet.Get( GetWhich( SID_ATTR_PAGE_SIZE ) ); const SvxULSpaceItem& rUL = static_cast<const SvxULSpaceItem&>( rFooterSet.Get( GetWhich( SID_ATTR_ULSPACE ) )); const SvxLRSpaceItem& rLR = static_cast<const SvxLRSpaceItem&>( |