diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-02-09 15:57:36 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-02-10 09:47:46 +0100 |
commit | 1c0aa970650ffc7c749e0b5ea655ebb2d137c8ae (patch) | |
tree | 9e119ca2556f5e05d21ced0874abe1e7562cffdb /sd/source/ui | |
parent | 3e340d3f7b73c8577e58c561a34c2b826e77da51 (diff) |
add more TypedWhichId
Change-Id: I6401dcf2507ac53a71dbe4de4ba774aed905961e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129731
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sd/source/ui')
-rw-r--r-- | sd/source/ui/dlg/paragr.cxx | 4 | ||||
-rw-r--r-- | sd/source/ui/dlg/tpoption.cxx | 17 | ||||
-rw-r--r-- | sd/source/ui/func/fuprlout.cxx | 8 |
3 files changed, 12 insertions, 17 deletions
diff --git a/sd/source/ui/dlg/paragr.cxx b/sd/source/ui/dlg/paragr.cxx index cead5dfc4634..be9df558e50d 100644 --- a/sd/source/ui/dlg/paragr.cxx +++ b/sd/source/ui/dlg/paragr.cxx @@ -97,7 +97,7 @@ void SdParagraphNumTabPage::Reset( const SfxItemSet* rSet ) SfxItemState eItemState = rSet->GetItemState( ATTR_NUMBER_NEWSTART ); if(eItemState > SfxItemState::DEFAULT ) { - const SfxBoolItem& rStart = static_cast<const SfxBoolItem&>(rSet->Get(ATTR_NUMBER_NEWSTART)); + const SfxBoolItem& rStart = rSet->Get(ATTR_NUMBER_NEWSTART); m_xNewStartCB->set_state( rStart.GetValue() ? TRISTATE_TRUE : TRISTATE_FALSE ); } else @@ -110,7 +110,7 @@ void SdParagraphNumTabPage::Reset( const SfxItemSet* rSet ) eItemState = rSet->GetItemState( ATTR_NUMBER_NEWSTART_AT); if( eItemState > SfxItemState::DEFAULT ) { - sal_Int16 nNewStart = static_cast<const SfxInt16Item&>(rSet->Get(ATTR_NUMBER_NEWSTART_AT)).GetValue(); + sal_Int16 nNewStart = rSet->Get(ATTR_NUMBER_NEWSTART_AT).GetValue(); m_xNewStartNumberCB->set_active(-1 != nNewStart); if(-1 == nNewStart) nNewStart = 1; diff --git a/sd/source/ui/dlg/tpoption.cxx b/sd/source/ui/dlg/tpoption.cxx index 48e24d1f752d..27bd1396684f 100644 --- a/sd/source/ui/dlg/tpoption.cxx +++ b/sd/source/ui/dlg/tpoption.cxx @@ -78,8 +78,7 @@ void SdTpOptionsSnap::Reset( const SfxItemSet* rAttrs ) { SvxGridTabPage::Reset(rAttrs); - SdOptionsSnapItem aOptsItem( static_cast<const SdOptionsSnapItem&>( rAttrs-> - Get( ATTR_OPTIONS_SNAP ) ) ); + SdOptionsSnapItem aOptsItem( rAttrs->Get( ATTR_OPTIONS_SNAP ) ); m_xCbxSnapHelplines->set_active( aOptsItem.GetOptionsSnap().IsSnapHelplines() ); m_xCbxSnapBorder->set_active( aOptsItem.GetOptionsSnap().IsSnapBorder() ); @@ -143,8 +142,7 @@ bool SdTpOptionsContents::FillItemSet( SfxItemSet* rAttrs ) void SdTpOptionsContents::Reset( const SfxItemSet* rAttrs ) { - SdOptionsLayoutItem aLayoutItem( static_cast<const SdOptionsLayoutItem&>( rAttrs-> - Get( ATTR_OPTIONS_LAYOUT ) ) ); + SdOptionsLayoutItem aLayoutItem( rAttrs->Get( ATTR_OPTIONS_LAYOUT ) ); m_xCbxRuler->set_active( aLayoutItem.GetOptionsLayout().IsRulerVisible() ); m_xCbxMoveOutline->set_active( aLayoutItem.GetOptionsLayout().IsMoveOutline() ); @@ -398,8 +396,7 @@ bool SdTpOptionsMisc::FillItemSet( SfxItemSet* rAttrs ) void SdTpOptionsMisc::Reset( const SfxItemSet* rAttrs ) { - SdOptionsMiscItem aOptsItem( static_cast<const SdOptionsMiscItem&>( rAttrs-> - Get( ATTR_OPTIONS_MISC ) ) ); + SdOptionsMiscItem aOptsItem( rAttrs->Get( ATTR_OPTIONS_MISC ) ); m_xCbxStartWithTemplate->set_active( aOptsItem.GetOptionsMisc().IsStartWithTemplate() ); m_xCbxMarkedHitMovesAlways->set_active( aOptsItem.GetOptionsMisc().IsMarkedHitMovesAlways() ); @@ -449,16 +446,14 @@ void SdTpOptionsMisc::Reset( const SfxItemSet* rAttrs ) if( rAttrs->GetItemState( nWhich2 ) >= SfxItemState::DEFAULT ) { MapUnit eUnit = rAttrs->GetPool()->GetMetric( nWhich2 ); - const SfxUInt16Item& rItem = static_cast<const SfxUInt16Item&>(rAttrs->Get( nWhich2 )); + const SfxUInt16Item& rItem = rAttrs->Get( nWhich2 ); SetMetricValue( *m_xMtrFldTabstop, rItem.GetValue(), eUnit ); } m_xLbMetric->save_value(); m_xMtrFldTabstop->save_value(); //Scale - sal_Int32 nX = static_cast<const SfxInt32Item&>( rAttrs-> - Get( ATTR_OPTIONS_SCALE_X ) ).GetValue(); - sal_Int32 nY = static_cast<const SfxInt32Item&>( rAttrs-> - Get( ATTR_OPTIONS_SCALE_Y ) ).GetValue(); + sal_Int32 nX = rAttrs->Get( ATTR_OPTIONS_SCALE_X ).GetValue(); + sal_Int32 nY = rAttrs->Get( ATTR_OPTIONS_SCALE_Y ).GetValue(); nWidth = static_cast<const SfxUInt32Item&>( rAttrs-> Get( ATTR_OPTIONS_SCALE_WIDTH ) ).GetValue(); nHeight = static_cast<const SfxUInt32Item&>( rAttrs-> diff --git a/sd/source/ui/func/fuprlout.cxx b/sd/source/ui/func/fuprlout.cxx index 37120721c72d..c436b78f05c4 100644 --- a/sd/source/ui/func/fuprlout.cxx +++ b/sd/source/ui/func/fuprlout.cxx @@ -150,11 +150,11 @@ void FuPresentationLayout::DoExecute( SfxRequest& rReq ) if (pArgs->GetItemState(ATTR_PRESLAYOUT_LOAD) == SfxItemState::SET) bLoad = static_cast<const SfxBoolItem&>(pArgs->Get(ATTR_PRESLAYOUT_LOAD)).GetValue(); if( pArgs->GetItemState( ATTR_PRESLAYOUT_MASTER_PAGE ) == SfxItemState::SET ) - bMasterPage = static_cast<const SfxBoolItem&>( pArgs->Get( ATTR_PRESLAYOUT_MASTER_PAGE ) ).GetValue(); + bMasterPage = pArgs->Get( ATTR_PRESLAYOUT_MASTER_PAGE ).GetValue(); if( pArgs->GetItemState( ATTR_PRESLAYOUT_CHECK_MASTERS ) == SfxItemState::SET ) bCheckMasters = static_cast<const SfxBoolItem&>( pArgs->Get( ATTR_PRESLAYOUT_CHECK_MASTERS ) ).GetValue(); if (pArgs->GetItemState(ATTR_PRESLAYOUT_NAME) == SfxItemState::SET) - aFile = static_cast<const SfxStringItem&>(pArgs->Get(ATTR_PRESLAYOUT_NAME)).GetValue(); + aFile = pArgs->Get(ATTR_PRESLAYOUT_NAME).GetValue(); } else { @@ -171,11 +171,11 @@ void FuPresentationLayout::DoExecute( SfxRequest& rReq ) if (aSet.GetItemState(ATTR_PRESLAYOUT_LOAD) == SfxItemState::SET) bLoad = static_cast<const SfxBoolItem&>(aSet.Get(ATTR_PRESLAYOUT_LOAD)).GetValue(); if( aSet.GetItemState( ATTR_PRESLAYOUT_MASTER_PAGE ) == SfxItemState::SET ) - bMasterPage = static_cast<const SfxBoolItem&>(aSet.Get( ATTR_PRESLAYOUT_MASTER_PAGE ) ).GetValue(); + bMasterPage = aSet.Get( ATTR_PRESLAYOUT_MASTER_PAGE ).GetValue(); if( aSet.GetItemState( ATTR_PRESLAYOUT_CHECK_MASTERS ) == SfxItemState::SET ) bCheckMasters = static_cast<const SfxBoolItem&>(aSet.Get( ATTR_PRESLAYOUT_CHECK_MASTERS ) ).GetValue(); if (aSet.GetItemState(ATTR_PRESLAYOUT_NAME) == SfxItemState::SET) - aFile = static_cast<const SfxStringItem&>(aSet.Get(ATTR_PRESLAYOUT_NAME)).GetValue(); + aFile = aSet.Get(ATTR_PRESLAYOUT_NAME).GetValue(); } break; |