diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-01-28 09:52:17 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-01-29 14:07:09 +0100 |
commit | 0e0175629fd0c6a99bb286f155e7a4855b8473d6 (patch) | |
tree | 44f3afb2e49a31d0c87339fe459b4318a9b90e86 /sd | |
parent | 1be7f03c8f6b945a0fc6514e1f5c1e228ea03547 (diff) |
no need to call GetWhich on these SID_ values
none of them are remapped (via the SfxItemfo stuff in the pool)
Change-Id: Iefd38f1aac55e6059e2c57d102efb508bd1572b0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129090
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/ui/dlg/tpoption.cxx | 13 | ||||
-rw-r--r-- | sd/source/ui/func/fubullet.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/view/drtxtob1.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/view/drviews3.cxx | 12 | ||||
-rw-r--r-- | sd/source/ui/view/drviews7.cxx | 2 |
5 files changed, 15 insertions, 16 deletions
diff --git a/sd/source/ui/dlg/tpoption.cxx b/sd/source/ui/dlg/tpoption.cxx index 1da1974bedb7..48e24d1f752d 100644 --- a/sd/source/ui/dlg/tpoption.cxx +++ b/sd/source/ui/dlg/tpoption.cxx @@ -378,9 +378,8 @@ bool SdTpOptionsMisc::FillItemSet( SfxItemSet* rAttrs ) // tabulator space if( m_xMtrFldTabstop->get_value_changed_from_saved() ) { - sal_uInt16 nWh = GetWhich( SID_ATTR_DEFTABSTOP ); - MapUnit eUnit = rAttrs->GetPool()->GetMetric( nWh ); - SfxUInt16Item aDef( nWh,static_cast<sal_uInt16>(GetCoreValue( *m_xMtrFldTabstop, eUnit )) ); + MapUnit eUnit = rAttrs->GetPool()->GetMetric( SID_ATTR_DEFTABSTOP ); + SfxUInt16Item aDef( SID_ATTR_DEFTABSTOP, static_cast<sal_uInt16>(GetCoreValue( *m_xMtrFldTabstop, eUnit )) ); rAttrs->Put( aDef ); bModified = true; } @@ -446,11 +445,11 @@ void SdTpOptionsMisc::Reset( const SfxItemSet* rAttrs ) } // tabulator space - nWhich = GetWhich( SID_ATTR_DEFTABSTOP ); - if( rAttrs->GetItemState( nWhich ) >= SfxItemState::DEFAULT ) + constexpr auto nWhich2 = SID_ATTR_DEFTABSTOP; + if( rAttrs->GetItemState( nWhich2 ) >= SfxItemState::DEFAULT ) { - MapUnit eUnit = rAttrs->GetPool()->GetMetric( nWhich ); - const SfxUInt16Item& rItem = static_cast<const SfxUInt16Item&>(rAttrs->Get( nWhich )); + MapUnit eUnit = rAttrs->GetPool()->GetMetric( nWhich2 ); + const SfxUInt16Item& rItem = static_cast<const SfxUInt16Item&>(rAttrs->Get( nWhich2 )); SetMetricValue( *m_xMtrFldTabstop, rItem.GetValue(), eUnit ); } m_xLbMetric->save_value(); diff --git a/sd/source/ui/func/fubullet.cxx b/sd/source/ui/func/fubullet.cxx index 2d83a0763993..1b830abadc12 100644 --- a/sd/source/ui/func/fubullet.cxx +++ b/sd/source/ui/func/fubullet.cxx @@ -162,7 +162,7 @@ void FuBullet::InsertSpecialCharacter( SfxRequest const & rReq ) { aChars = static_cast<const SfxStringItem*>(pItem)->GetValue(); const SfxPoolItem* pFtItem = nullptr; - pArgs->GetItemState( mpDoc->GetPool().GetWhich(SID_ATTR_SPECIALCHAR), false, &pFtItem); + pArgs->GetItemState( SID_ATTR_SPECIALCHAR, false, &pFtItem); const SfxStringItem* pFontItem = dynamic_cast<const SfxStringItem*>( pFtItem ); if ( pFontItem ) { diff --git a/sd/source/ui/view/drtxtob1.cxx b/sd/source/ui/view/drtxtob1.cxx index 3fa5aa4dfb51..2f5a67864912 100644 --- a/sd/source/ui/view/drtxtob1.cxx +++ b/sd/source/ui/view/drtxtob1.cxx @@ -355,7 +355,7 @@ void TextObjectBar::Execute( SfxRequest &rReq ) case SID_ATTR_PARA_LRSPACE: { SvxLRSpaceItem aLRSpace = static_cast<const SvxLRSpaceItem&>(pArgs->Get( - GetPool().GetWhich(SID_ATTR_PARA_LRSPACE))); + SID_ATTR_PARA_LRSPACE)); SfxItemSetFixed<EE_PARA_LRSPACE, EE_PARA_LRSPACE> aEditAttr( GetPool() ); aLRSpace.SetWhich( EE_PARA_LRSPACE ); diff --git a/sd/source/ui/view/drviews3.cxx b/sd/source/ui/view/drviews3.cxx index 54ec1575255b..bddb47947e88 100644 --- a/sd/source/ui/view/drviews3.cxx +++ b/sd/source/ui/view/drviews3.cxx @@ -557,7 +557,7 @@ void DrawViewShell::ExecRuler(SfxRequest& rReq) pUndoGroup->SetComment(SdResId(STR_UNDO_CHANGE_PAGEBORDER)); const SvxLongLRSpaceItem& rLRSpace = static_cast<const SvxLongLRSpaceItem&>( - pArgs->Get(GetPool().GetWhich(SID_ATTR_LONG_LRSPACE))); + pArgs->Get(SID_ATTR_LONG_LRSPACE)); if( mpDrawView->IsTextEdit() ) { @@ -622,7 +622,7 @@ void DrawViewShell::ExecRuler(SfxRequest& rReq) pUndoGroup->SetComment(SdResId(STR_UNDO_CHANGE_PAGEBORDER)); const SvxLongULSpaceItem& rULSpace = static_cast<const SvxLongULSpaceItem&>( - pArgs->Get(GetPool().GetWhich(SID_ATTR_LONG_ULSPACE))); + pArgs->Get(SID_ATTR_LONG_ULSPACE)); if( mpDrawView->IsTextEdit() ) { @@ -784,7 +784,7 @@ void DrawViewShell::ExecRuler(SfxRequest& rReq) if (pArgs) { SvxULSpaceItem aULSP = static_cast<const SvxULSpaceItem&>(pArgs->Get( - GetPool().GetWhich(SID_ATTR_PARA_ULSPACE))); + SID_ATTR_PARA_ULSPACE)); SfxItemSetFixed<EE_PARA_ULSPACE, EE_PARA_ULSPACE> aEditAttr( GetPool() ); aULSP.SetWhich( EE_PARA_ULSPACE ); @@ -798,7 +798,7 @@ void DrawViewShell::ExecRuler(SfxRequest& rReq) if (pArgs) { SvxLRSpaceItem aLRSpace = static_cast<const SvxLRSpaceItem&>(pArgs->Get( - GetPool().GetWhich(SID_ATTR_PARA_LRSPACE))); + SID_ATTR_PARA_LRSPACE)); SfxItemSetFixed<EE_PARA_LRSPACE, EE_PARA_LRSPACE> aEditAttr( GetPool() ); aLRSpace.SetWhich( EE_PARA_LRSPACE ); @@ -922,10 +922,10 @@ void DrawViewShell::GetRulerState(SfxItemSet& rSet) SvxLongLRSpaceItem aLRSpace(aPagePos.X() + mpActualPage->GetLeftBorder(), aRect.Right() + mpActualPage->GetRightBorder(), - GetPool().GetWhich(SID_ATTR_LONG_LRSPACE)); + SID_ATTR_LONG_LRSPACE); SvxLongULSpaceItem aULSpace(aPagePos.Y() + mpActualPage->GetUpperBorder(), aRect.Bottom() + mpActualPage->GetLowerBorder(), - GetPool().GetWhich(SID_ATTR_LONG_ULSPACE)); + SID_ATTR_LONG_ULSPACE); rSet.Put(SvxPagePosSizeItem(Point(0,0) - aPagePos, aViewSize.Width(), aViewSize.Height())); SfxPointItem aPointItem( SID_RULER_NULL_OFFSET, aPagePos + aOrigin ); diff --git a/sd/source/ui/view/drviews7.cxx b/sd/source/ui/view/drviews7.cxx index 7ef14e54a83b..0a4fe894468d 100644 --- a/sd/source/ui/view/drviews7.cxx +++ b/sd/source/ui/view/drviews7.cxx @@ -1896,7 +1896,7 @@ void DrawViewShell::SetPageProperties (SfxRequest& rReq) switch (nSlotId) { case SID_ATTR_PAGE_LRSPACE: - if( pArgs->GetItemState(GetPool().GetWhich(SID_ATTR_PAGE_LRSPACE), + if( pArgs->GetItemState(SID_ATTR_PAGE_LRSPACE, true,&pPoolItem) == SfxItemState::SET ) { nLeft = static_cast<const SvxLongLRSpaceItem*>(pPoolItem)->GetLeft(); |