diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-01-27 19:21:39 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-01-28 08:28:31 +0100 |
commit | 4abb554b164ae537a9854c40ab347d5cbfb125f5 (patch) | |
tree | 3fbb810a0bf2186e2792f5ae2179d4e5ddf0c6b7 | |
parent | 7875b1d4dab504d3b8a8632a1d8fd0afe910d7c3 (diff) |
no need to call GetWhich on these SID_ values
none of them are remapped (via the SfxItemEntryInfo stuff in the pool)
Change-Id: Ic4f1b13e1f35f7e67195a12c727ea2f088f8ddc7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129060
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | chart2/source/controller/main/ChartController_Position.cxx | 13 | ||||
-rw-r--r-- | cui/source/dialogs/zoom.cxx | 7 | ||||
-rw-r--r-- | cui/source/tabpages/swpossizetabpage.cxx | 18 | ||||
-rw-r--r-- | cui/source/tabpages/transfrm.cxx | 36 | ||||
-rw-r--r-- | sw/source/ui/frmdlg/frmpage.cxx | 2 |
5 files changed, 35 insertions, 41 deletions
diff --git a/chart2/source/controller/main/ChartController_Position.cxx b/chart2/source/controller/main/ChartController_Position.cxx index f57a3b8e8f96..3482196b1616 100644 --- a/chart2/source/controller/main/ChartController_Position.cxx +++ b/chart2/source/controller/main/ChartController_Position.cxx @@ -150,26 +150,21 @@ void ChartController::executeDispatch_PositionAndSize(const ::css::uno::Sequence if (!pPool) return; - sal_uInt16 nWhich; for (const auto& aProp: *pArgs) { sal_Int32 nValue = 0; aProp.Value >>= nValue; if (aProp.Name == "TransformPosX") { - nWhich = pPool->GetWhich(SID_ATTR_TRANSFORM_POS_X); - aItemSet.Put(SfxInt32Item(nWhich, nValue)); + aItemSet.Put(SfxInt32Item(SID_ATTR_TRANSFORM_POS_X, nValue)); } else if (aProp.Name == "TransformPosY") { - nWhich = pPool->GetWhich(SID_ATTR_TRANSFORM_POS_Y); - aItemSet.Put(SfxInt32Item(nWhich, nValue)); + aItemSet.Put(SfxInt32Item(SID_ATTR_TRANSFORM_POS_Y, nValue)); } else if (aProp.Name == "TransformWidth") { - nWhich = pPool->GetWhich(SID_ATTR_TRANSFORM_WIDTH); - aItemSet.Put(SfxUInt32Item(nWhich, static_cast<sal_uInt32>(nValue))); + aItemSet.Put(SfxUInt32Item(SID_ATTR_TRANSFORM_WIDTH, static_cast<sal_uInt32>(nValue))); } else if (aProp.Name == "TransformHeight") { - nWhich = pPool->GetWhich(SID_ATTR_TRANSFORM_HEIGHT); - aItemSet.Put(SfxUInt32Item(nWhich, static_cast<sal_uInt32>(nValue))); + aItemSet.Put(SfxUInt32Item(SID_ATTR_TRANSFORM_HEIGHT, static_cast<sal_uInt32>(nValue))); } } } diff --git a/cui/source/dialogs/zoom.cxx b/cui/source/dialogs/zoom.cxx index 90999d96798a..c1e56d28647d 100644 --- a/cui/source/dialogs/zoom.cxx +++ b/cui/source/dialogs/zoom.cxx @@ -185,7 +185,7 @@ SvxZoomDialog::SvxZoomDialog(weld::Window* pParent, const SfxItemSet& rCoreSet) SetLimits(nMin, nMax); m_xUserEdit->set_value(nValue, FieldUnit::PERCENT); - const SfxPoolItem& rItem = m_rSet.Get(m_rSet.GetPool()->GetWhich(SID_ATTR_ZOOM)); + const SfxPoolItem& rItem = m_rSet.Get(SID_ATTR_ZOOM); if (auto pZoomItem = dynamic_cast<const SvxZoomItem*>(&rItem)) { @@ -344,9 +344,8 @@ IMPL_LINK_NOARG(SvxZoomDialog, OKHdl, weld::Button&, void) { if (m_bModified) { - SvxZoomItem aZoomItem(SvxZoomType::PERCENT, 0, m_rSet.GetPool()->GetWhich(SID_ATTR_ZOOM)); - SvxViewLayoutItem aViewLayoutItem(0, false, - m_rSet.GetPool()->GetWhich(SID_ATTR_VIEWLAYOUT)); + SvxZoomItem aZoomItem(SvxZoomType::PERCENT, 0, SID_ATTR_ZOOM); + SvxViewLayoutItem aViewLayoutItem(0, false, SID_ATTR_VIEWLAYOUT); sal_uInt16 nFactor = GetFactor(); diff --git a/cui/source/tabpages/swpossizetabpage.cxx b/cui/source/tabpages/swpossizetabpage.cxx index fe1d46a4d0c8..0d1475193610 100644 --- a/cui/source/tabpages/swpossizetabpage.cxx +++ b/cui/source/tabpages/swpossizetabpage.cxx @@ -748,7 +748,7 @@ bool SvxSwPosSizeTabPage::FillItemSet( SfxItemSet* rSet) rSet->InvalidateItem( SID_ATTR_TRANSFORM_PROTECT_POS ); else rSet->Put( - SfxBoolItem( GetWhich( SID_ATTR_TRANSFORM_PROTECT_POS ), + SfxBoolItem( SID_ATTR_TRANSFORM_PROTECT_POS, m_xPositionCB->get_state() == TRISTATE_TRUE ) ); bModified = true; } @@ -759,7 +759,7 @@ bool SvxSwPosSizeTabPage::FillItemSet( SfxItemSet* rSet) rSet->InvalidateItem( SID_ATTR_TRANSFORM_PROTECT_SIZE ); else rSet->Put( - SfxBoolItem( GetWhich( SID_ATTR_TRANSFORM_PROTECT_SIZE ), + SfxBoolItem( SID_ATTR_TRANSFORM_PROTECT_SIZE, m_xSizeCB->get_state() == TRISTATE_TRUE ) ); bModified = true; } @@ -783,8 +783,8 @@ bool SvxSwPosSizeTabPage::FillItemSet( SfxItemSet* rSet) nHoriByPos += m_aAnchorPos.X(); nVertByPos += m_aAnchorPos.Y(); - rSet->Put( SfxInt32Item( GetWhich( SID_ATTR_TRANSFORM_POS_X ), nHoriByPos ) ); - rSet->Put( SfxInt32Item( GetWhich( SID_ATTR_TRANSFORM_POS_Y ), nVertByPos ) ); + rSet->Put( SfxInt32Item( SID_ATTR_TRANSFORM_POS_X, nHoriByPos ) ); + rSet->Put( SfxInt32Item( SID_ATTR_TRANSFORM_POS_Y, nVertByPos ) ); bModified = true; } @@ -870,10 +870,10 @@ bool SvxSwPosSizeTabPage::FillItemSet( SfxItemSet* rSet) { sal_uInt32 nWidth = static_cast<sal_uInt32>(m_xWidthMF->denormalize(m_xWidthMF->get_value(FieldUnit::TWIP))); sal_uInt32 nHeight = static_cast<sal_uInt32>(m_xHeightMF->denormalize(m_xHeightMF->get_value(FieldUnit::TWIP))); - rSet->Put( SfxUInt32Item( GetWhich( SID_ATTR_TRANSFORM_WIDTH ), nWidth ) ); - rSet->Put( SfxUInt32Item( GetWhich( SID_ATTR_TRANSFORM_HEIGHT ), nHeight ) ); + rSet->Put( SfxUInt32Item( SID_ATTR_TRANSFORM_WIDTH, nWidth ) ); + rSet->Put( SfxUInt32Item( SID_ATTR_TRANSFORM_HEIGHT, nHeight ) ); //this item is required by SdrEditView::SetGeoAttrToMarked() - rSet->Put( SfxUInt16Item( GetWhich( SID_ATTR_TRANSFORM_SIZE_POINT ), sal_uInt16(RectPoint::LT) ) ); + rSet->Put( SfxUInt16Item( SID_ATTR_TRANSFORM_SIZE_POINT, sal_uInt16(RectPoint::LT) ) ); bModified = true; } @@ -1049,9 +1049,9 @@ DeactivateRC SvxSwPosSizeTabPage::DeactivatePage( SfxItemSet* _pSet ) { if( _pSet ) { - _pSet->Put(SfxBoolItem(GetWhich( SID_ATTR_TRANSFORM_PROTECT_POS ), + _pSet->Put(SfxBoolItem( SID_ATTR_TRANSFORM_PROTECT_POS, m_xPositionCB->get_active())); - _pSet->Put(SfxBoolItem(GetWhich( SID_ATTR_TRANSFORM_PROTECT_SIZE ), + _pSet->Put(SfxBoolItem( SID_ATTR_TRANSFORM_PROTECT_SIZE, m_xSizeCB->get_active())); FillItemSet( _pSet ); } diff --git a/cui/source/tabpages/transfrm.cxx b/cui/source/tabpages/transfrm.cxx index 61b858dc15b3..04335500ea58 100644 --- a/cui/source/tabpages/transfrm.cxx +++ b/cui/source/tabpages/transfrm.cxx @@ -231,9 +231,9 @@ bool SvxAngleTabPage::FillItemSet(SfxItemSet* rSet) const double fTmpX((GetCoreValue(*m_xMtrPosX, ePoolUnit) + maAnchor.getX()) * fUIScale); const double fTmpY((GetCoreValue(*m_xMtrPosY, ePoolUnit) + maAnchor.getY()) * fUIScale); - rSet->Put(SdrAngleItem(GetWhich(SID_ATTR_TRANSFORM_ANGLE), m_xCtlAngle->GetRotation())); - rSet->Put(SfxInt32Item(GetWhich(SID_ATTR_TRANSFORM_ROT_X), basegfx::fround(fTmpX))); - rSet->Put(SfxInt32Item(GetWhich(SID_ATTR_TRANSFORM_ROT_Y), basegfx::fround(fTmpY))); + rSet->Put(SdrAngleItem(SID_ATTR_TRANSFORM_ANGLE, m_xCtlAngle->GetRotation())); + rSet->Put(SfxInt32Item(SID_ATTR_TRANSFORM_ROT_X, basegfx::fround(fTmpX))); + rSet->Put(SfxInt32Item(SID_ATTR_TRANSFORM_ROT_Y, basegfx::fround(fTmpY))); bModified = true; } @@ -290,7 +290,7 @@ std::unique_ptr<SfxTabPage> SvxAngleTabPage::Create(weld::Container* pPage, weld void SvxAngleTabPage::ActivatePage(const SfxItemSet& rSet) { SfxBoolItem const * bPosProtect = nullptr; - if(SfxItemState::SET == rSet.GetItemState( GetWhich(SID_ATTR_TRANSFORM_PROTECT_POS ) , false, reinterpret_cast<SfxPoolItem const **>(&bPosProtect) )) + if(SfxItemState::SET == rSet.GetItemState( SID_ATTR_TRANSFORM_PROTECT_POS, false, reinterpret_cast<SfxPoolItem const **>(&bPosProtect) )) { m_xFlPosition->set_sensitive(!bPosProtect->GetValue()); m_xFlAngle->set_sensitive(!bPosProtect->GetValue()); @@ -690,12 +690,12 @@ std::unique_ptr<SfxTabPage> SvxSlantTabPage::Create(weld::Container* pPage, weld void SvxSlantTabPage::ActivatePage( const SfxItemSet& rSet ) { SfxBoolItem const * bPosProtect = nullptr; - if(SfxItemState::SET == rSet.GetItemState( GetWhich(SID_ATTR_TRANSFORM_PROTECT_POS ) , false, reinterpret_cast<SfxPoolItem const **>(&bPosProtect) )) + if(SfxItemState::SET == rSet.GetItemState( SID_ATTR_TRANSFORM_PROTECT_POS, false, reinterpret_cast<SfxPoolItem const **>(&bPosProtect) )) { m_xFlAngle->set_sensitive(!bPosProtect->GetValue()); } SfxBoolItem const * bSizeProtect = nullptr; - if(SfxItemState::SET == rSet.GetItemState( GetWhich(SID_ATTR_TRANSFORM_PROTECT_SIZE ) , false, reinterpret_cast<SfxPoolItem const **>(&bSizeProtect) )) + if(SfxItemState::SET == rSet.GetItemState( SID_ATTR_TRANSFORM_PROTECT_SIZE, false, reinterpret_cast<SfxPoolItem const **>(&bSizeProtect) )) { m_xFlAngle->set_sensitive(!bSizeProtect->GetValue()); } @@ -907,8 +907,8 @@ bool SvxPositionSizeTabPage::FillItemSet( SfxItemSet* rOutAttrs ) // #101581# GetTopLeftPosition(...) needs coordinates after UI scaling, in real PagePositions GetTopLeftPosition(fX, fY, maRange); - rOutAttrs->Put(SfxInt32Item(GetWhich(SID_ATTR_TRANSFORM_POS_X), basegfx::fround(fX))); - rOutAttrs->Put(SfxInt32Item(GetWhich(SID_ATTR_TRANSFORM_POS_Y), basegfx::fround(fY))); + rOutAttrs->Put(SfxInt32Item(SID_ATTR_TRANSFORM_POS_X, basegfx::fround(fX))); + rOutAttrs->Put(SfxInt32Item(SID_ATTR_TRANSFORM_POS_Y, basegfx::fround(fY))); bModified = true; } @@ -922,7 +922,7 @@ bool SvxPositionSizeTabPage::FillItemSet( SfxItemSet* rOutAttrs ) else { rOutAttrs->Put( - SfxBoolItem( GetWhich( SID_ATTR_TRANSFORM_PROTECT_POS ), + SfxBoolItem( SID_ATTR_TRANSFORM_PROTECT_POS, m_xTsbPosProtect->get_active() ) ); } @@ -947,9 +947,9 @@ bool SvxPositionSizeTabPage::FillItemSet( SfxItemSet* rOutAttrs ) lHeight = static_cast<tools::Long>(m_xMtrHeight->denormalize( lHeight )); // put Width & Height to itemset - rOutAttrs->Put( SfxUInt32Item( GetWhich( SID_ATTR_TRANSFORM_WIDTH ), static_cast<sal_uInt32>(lWidth) ) ); - rOutAttrs->Put( SfxUInt32Item( GetWhich( SID_ATTR_TRANSFORM_HEIGHT ), static_cast<sal_uInt32>(lHeight) ) ); - rOutAttrs->Put( SfxUInt16Item( GetWhich( SID_ATTR_TRANSFORM_SIZE_POINT ), sal::static_int_cast< sal_uInt16 >( meRP ) ) ); + rOutAttrs->Put( SfxUInt32Item( SID_ATTR_TRANSFORM_WIDTH, static_cast<sal_uInt32>(lWidth) ) ); + rOutAttrs->Put( SfxUInt32Item( SID_ATTR_TRANSFORM_HEIGHT, static_cast<sal_uInt32>(lHeight) ) ); + rOutAttrs->Put( SfxUInt16Item( SID_ATTR_TRANSFORM_SIZE_POINT, sal::static_int_cast< sal_uInt16 >( meRP ) ) ); bModified = true; } @@ -959,7 +959,7 @@ bool SvxPositionSizeTabPage::FillItemSet( SfxItemSet* rOutAttrs ) rOutAttrs->InvalidateItem( SID_ATTR_TRANSFORM_PROTECT_SIZE ); else rOutAttrs->Put( - SfxBoolItem( GetWhich( SID_ATTR_TRANSFORM_PROTECT_SIZE ), + SfxBoolItem( SID_ATTR_TRANSFORM_PROTECT_SIZE, m_xTsbSizeProtect->get_active() ) ); bModified = true; } @@ -972,7 +972,7 @@ bool SvxPositionSizeTabPage::FillItemSet( SfxItemSet* rOutAttrs ) rOutAttrs->InvalidateItem( SID_ATTR_TRANSFORM_AUTOWIDTH ); else rOutAttrs->Put( - SfxBoolItem( GetWhich( SID_ATTR_TRANSFORM_AUTOWIDTH ), + SfxBoolItem( SID_ATTR_TRANSFORM_AUTOWIDTH, m_xTsbAutoGrowWidth->get_active() ) ); } bModified = true; @@ -989,7 +989,7 @@ bool SvxPositionSizeTabPage::FillItemSet( SfxItemSet* rOutAttrs ) else { rOutAttrs->Put( - SfxBoolItem( GetWhich( SID_ATTR_TRANSFORM_AUTOHEIGHT ), + SfxBoolItem( SID_ATTR_TRANSFORM_AUTOHEIGHT, m_xTsbAutoGrowHeight->get_active() ) ); } } @@ -1107,7 +1107,7 @@ void SvxPositionSizeTabPage::ActivatePage( const SfxItemSet& rSet ) { SfxRectangleItem const * pRectItem = nullptr; - if( SfxItemState::SET == rSet.GetItemState( GetWhich( SID_ATTR_TRANSFORM_INTERN ) , false, reinterpret_cast<SfxPoolItem const **>(&pRectItem) ) ) + if( SfxItemState::SET == rSet.GetItemState( SID_ATTR_TRANSFORM_INTERN, false, reinterpret_cast<SfxPoolItem const **>(&pRectItem) ) ) { { // #i75273# const ::tools::Rectangle aTempRect(pRectItem->GetValue()); @@ -1131,9 +1131,9 @@ DeactivateRC SvxPositionSizeTabPage::DeactivatePage( SfxItemSet* _pSet ) basegfx::fround(fX), basegfx::fround(fY), basegfx::fround(fX + maRange.getWidth()), basegfx::fround(fY + maRange.getHeight())); _pSet->Put(SfxRectangleItem(SID_ATTR_TRANSFORM_INTERN, aOutRectangle)); - _pSet->Put(SfxBoolItem( GetWhich( SID_ATTR_TRANSFORM_PROTECT_POS ), + _pSet->Put(SfxBoolItem( SID_ATTR_TRANSFORM_PROTECT_POS, m_xTsbPosProtect->get_state() == TRISTATE_TRUE )); - _pSet->Put(SfxBoolItem( GetWhich( SID_ATTR_TRANSFORM_PROTECT_SIZE ), + _pSet->Put(SfxBoolItem( SID_ATTR_TRANSFORM_PROTECT_SIZE, m_xTsbSizeProtect->get_state() == TRISTATE_TRUE )); FillItemSet(_pSet); } diff --git a/sw/source/ui/frmdlg/frmpage.cxx b/sw/source/ui/frmdlg/frmpage.cxx index 5e5629495687..2298995460aa 100644 --- a/sw/source/ui/frmdlg/frmpage.cxx +++ b/sw/source/ui/frmdlg/frmpage.cxx @@ -2503,7 +2503,7 @@ bool SwGrfExtPage::FillItemSet( SfxItemSet *rSet ) // RotGrfFlyFrame: Safe rotation if modified if(m_xCtlAngle->IsValueModified()) { - rSet->Put(SdrAngleItem(GetWhich(SID_ATTR_TRANSFORM_ANGLE), m_xCtlAngle->GetRotation())); + rSet->Put(SdrAngleItem(SID_ATTR_TRANSFORM_ANGLE, m_xCtlAngle->GetRotation())); bModified = true; } |