summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-01-28 09:52:17 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-01-29 14:07:09 +0100
commit0e0175629fd0c6a99bb286f155e7a4855b8473d6 (patch)
tree44f3afb2e49a31d0c87339fe459b4318a9b90e86
parent1be7f03c8f6b945a0fc6514e1f5c1e228ea03547 (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>
-rw-r--r--cui/source/dialogs/cuicharmap.cxx2
-rw-r--r--cui/source/dialogs/postdlg.cxx30
-rw-r--r--cui/source/options/optlingu.cxx7
-rw-r--r--cui/source/tabpages/backgrnd.cxx10
-rw-r--r--cui/source/tabpages/chardlg.cxx9
-rw-r--r--cui/source/tabpages/grfpage.cxx2
-rw-r--r--cui/source/tabpages/numfmt.cxx11
-rw-r--r--cui/source/tabpages/paragrph.cxx16
-rw-r--r--sc/source/ui/drawfunc/drtxtob.cxx2
-rw-r--r--sc/source/ui/view/cellsh1.cxx2
-rw-r--r--sc/source/ui/view/editsh.cxx2
-rw-r--r--sd/source/ui/dlg/tpoption.cxx13
-rw-r--r--sd/source/ui/func/fubullet.cxx2
-rw-r--r--sd/source/ui/view/drtxtob1.cxx2
-rw-r--r--sd/source/ui/view/drviews3.cxx12
-rw-r--r--sd/source/ui/view/drviews7.cxx2
-rw-r--r--svx/source/dialog/optgrid.cxx6
-rw-r--r--svx/source/sidebar/paragraph/ParaSpacingWindow.cxx6
-rw-r--r--sw/source/uibase/shells/annotsh.cxx2
-rw-r--r--sw/source/uibase/shells/drwtxtsh.cxx2
-rw-r--r--sw/source/uibase/shells/textsh.cxx2
21 files changed, 58 insertions, 84 deletions
diff --git a/cui/source/dialogs/cuicharmap.cxx b/cui/source/dialogs/cuicharmap.cxx
index 2a2129a6d162..0cba92656090 100644
--- a/cui/source/dialogs/cuicharmap.cxx
+++ b/cui/source/dialogs/cuicharmap.cxx
@@ -657,7 +657,7 @@ void SvxCharacterMap::insertCharToDoc(const OUString& sGlyph)
m_xOutputSet->Put( SvxFontItem( aFont.GetFamilyType(), aFont.GetFamilyName(),
aFont.GetStyleName(), aFont.GetPitch(), aFont.GetCharSet(), pPool->GetWhich(SID_ATTR_CHAR_FONT) ) );
m_xOutputSet->Put( SfxStringItem( SID_FONT_NAME, aFont.GetFamilyName() ) );
- m_xOutputSet->Put( SfxInt32Item( pPool->GetWhich(SID_ATTR_CHAR), cChar ) );
+ m_xOutputSet->Put( SfxInt32Item( SID_ATTR_CHAR, cChar ) );
}
}
diff --git a/cui/source/dialogs/postdlg.cxx b/cui/source/dialogs/postdlg.cxx
index 6bd7766b04c2..1bcb6b7a0156 100644
--- a/cui/source/dialogs/postdlg.cxx
+++ b/cui/source/dialogs/postdlg.cxx
@@ -52,30 +52,24 @@ SvxPostItDialog::SvxPostItDialog(weld::Widget* pParent, const SfxItemSet& rCoreS
m_xOKBtn->connect_clicked( LINK( this, SvxPostItDialog, OKHdl ) );
bool bNew = true;
- sal_uInt16 nWhich = 0;
m_xPrevBtn->set_visible(bPrevNext);
m_xNextBtn->set_visible(bPrevNext);
- nWhich = m_rSet.GetPool()->GetWhich( SID_ATTR_POSTIT_AUTHOR );
OUString aAuthorStr, aDateStr;
- if (m_rSet.GetItemState( nWhich ) >= SfxItemState::DEFAULT)
+ if (m_rSet.GetItemState( SID_ATTR_POSTIT_AUTHOR ) >= SfxItemState::DEFAULT)
{
bNew = false;
- const SvxPostItAuthorItem& rAuthor =
- static_cast<const SvxPostItAuthorItem&>(m_rSet.Get(nWhich));
+ const SvxPostItAuthorItem& rAuthor = m_rSet.Get(SID_ATTR_POSTIT_AUTHOR);
aAuthorStr = rAuthor.GetValue();
}
else
aAuthorStr = SvtUserOptions().GetID();
- nWhich = m_rSet.GetPool()->GetWhich( SID_ATTR_POSTIT_DATE );
-
- if (m_rSet.GetItemState( nWhich ) >= SfxItemState::DEFAULT)
+ if (m_rSet.GetItemState( SID_ATTR_POSTIT_DATE ) >= SfxItemState::DEFAULT)
{
- const SvxPostItDateItem& rDate =
- static_cast<const SvxPostItDateItem&>(m_rSet.Get( nWhich ));
+ const SvxPostItDateItem& rDate = m_rSet.Get( SID_ATTR_POSTIT_DATE );
aDateStr = rDate.GetValue();
}
else
@@ -84,13 +78,10 @@ SvxPostItDialog::SvxPostItDialog(weld::Widget* pParent, const SfxItemSet& rCoreS
aDateStr = rLocaleWrapper.getDate( Date( Date::SYSTEM ) );
}
- nWhich = m_rSet.GetPool()->GetWhich( SID_ATTR_POSTIT_TEXT );
-
OUString aTextStr;
- if (m_rSet.GetItemState( nWhich ) >= SfxItemState::DEFAULT)
+ if (m_rSet.GetItemState( SID_ATTR_POSTIT_TEXT ) >= SfxItemState::DEFAULT)
{
- const SvxPostItTextItem& rText =
- static_cast<const SvxPostItTextItem&>(m_rSet.Get( nWhich ));
+ const SvxPostItTextItem& rText = m_rSet.Get( SID_ATTR_POSTIT_TEXT );
aTextStr = rText.GetValue();
}
@@ -162,12 +153,9 @@ IMPL_LINK_NOARG(SvxPostItDialog, OKHdl, weld::Button&, void)
{
const LocaleDataWrapper& rLocaleWrapper( Application::GetSettings().GetLocaleDataWrapper() );
m_xOutSet.reset(new SfxItemSet(m_rSet));
- m_xOutSet->Put( SvxPostItAuthorItem(SvtUserOptions().GetID(),
- m_rSet.GetPool()->GetWhich( SID_ATTR_POSTIT_AUTHOR ) ) );
- m_xOutSet->Put( SvxPostItDateItem(rLocaleWrapper.getDate( Date( Date::SYSTEM ) ),
- m_rSet.GetPool()->GetWhich( SID_ATTR_POSTIT_DATE ) ) );
- m_xOutSet->Put( SvxPostItTextItem(m_xEditED->get_text(),
- m_rSet.GetPool()->GetWhich( SID_ATTR_POSTIT_TEXT ) ) );
+ m_xOutSet->Put( SvxPostItAuthorItem(SvtUserOptions().GetID(), SID_ATTR_POSTIT_AUTHOR ) );
+ m_xOutSet->Put( SvxPostItDateItem(rLocaleWrapper.getDate( Date( Date::SYSTEM ) ), SID_ATTR_POSTIT_DATE ) );
+ m_xOutSet->Put( SvxPostItTextItem(m_xEditED->get_text(), SID_ATTR_POSTIT_TEXT ) );
m_xDialog->response(RET_OK);
}
diff --git a/cui/source/options/optlingu.cxx b/cui/source/options/optlingu.cxx
index c0f40df728e6..6a38e014d580 100644
--- a/cui/source/options/optlingu.cxx
+++ b/cui/source/options/optlingu.cxx
@@ -1041,7 +1041,7 @@ bool SvxLinguTabPage::FillItemSet( SfxItemSet* rCoreSet )
OptionsUserData aPostBreakData(m_xLinguOptionsCLB->get_id(EID_NUM_POST_BREAK).toUInt32());
if ( aPreBreakData.IsModified() || aPostBreakData.IsModified() )
{
- SfxHyphenRegionItem aHyp( GetWhich( SID_ATTR_HYPHENREGION ) );
+ SfxHyphenRegionItem aHyp( SID_ATTR_HYPHENREGION );
aHyp.GetMinLead() = static_cast<sal_uInt8>(aPreBreakData.GetNumericValue());
aHyp.GetMinTrail() = static_cast<sal_uInt8>(aPostBreakData.GetNumericValue());
rCoreSet->Put( aHyp );
@@ -1224,9 +1224,8 @@ void SvxLinguTabPage::Reset( const SfxItemSet* rSet )
nUPN_HYPH_MIN_WORD_LENGTH = nEntry;
const SfxHyphenRegionItem *pHyp = nullptr;
- sal_uInt16 nWhich = GetWhich( SID_ATTR_HYPHENREGION );
- if ( rSet->GetItemState( nWhich, false ) == SfxItemState::SET )
- pHyp = &static_cast<const SfxHyphenRegionItem &>( rSet->Get( nWhich ) );
+ if ( rSet->GetItemState( SID_ATTR_HYPHENREGION, false ) == SfxItemState::SET )
+ pHyp = & rSet->Get( SID_ATTR_HYPHENREGION );
m_xLinguOptionsCLB->append();
++nEntry;
diff --git a/cui/source/tabpages/backgrnd.cxx b/cui/source/tabpages/backgrnd.cxx
index c40fe32e9623..a52e7da3ee97 100644
--- a/cui/source/tabpages/backgrnd.cxx
+++ b/cui/source/tabpages/backgrnd.cxx
@@ -202,19 +202,17 @@ bool SvxBkgTabPage::FillItemSet( SfxItemSet* rCoreSet )
}
if (nSlot != SID_ATTR_BRUSH_ROW)
{
- nWhich = maSet.GetPool()->GetWhich(SID_ATTR_BRUSH_ROW);
- if (SfxItemState::SET == maSet.GetItemState(nWhich))
+ if (SfxItemState::SET == maSet.GetItemState(SID_ATTR_BRUSH_ROW))
{
- SvxBrushItem aBrushItem(static_cast<const SvxBrushItem&>(maSet.Get(nWhich)));
+ SvxBrushItem aBrushItem(static_cast<const SvxBrushItem&>(maSet.Get(SID_ATTR_BRUSH_ROW)));
rCoreSet->Put(aBrushItem);
}
}
if (nSlot != SID_ATTR_BRUSH_TABLE)
{
- nWhich = maSet.GetPool()->GetWhich(SID_ATTR_BRUSH_TABLE);
- if (SfxItemState::SET == maSet.GetItemState(nWhich))
+ if (SfxItemState::SET == maSet.GetItemState(SID_ATTR_BRUSH_TABLE))
{
- SvxBrushItem aBrushItem(static_cast<const SvxBrushItem&>(maSet.Get(nWhich)));
+ SvxBrushItem aBrushItem(static_cast<const SvxBrushItem&>(maSet.Get(SID_ATTR_BRUSH_TABLE)));
rCoreSet->Put(aBrushItem);
}
}
diff --git a/cui/source/tabpages/chardlg.cxx b/cui/source/tabpages/chardlg.cxx
index 86e29f9d16c0..c3f5984e6ea4 100644
--- a/cui/source/tabpages/chardlg.cxx
+++ b/cui/source/tabpages/chardlg.cxx
@@ -2804,9 +2804,8 @@ void SvxCharPositionPage::Reset( const SfxItemSet* rSet )
else
m_xScaleWidthMF->set_value(100, FieldUnit::PERCENT);
- nWhich = GetWhich( SID_ATTR_CHAR_WIDTH_FIT_TO_LINE );
- if ( rSet->GetItemState( nWhich ) >= SfxItemState::DEFAULT )
- m_nScaleWidthItemSetVal = static_cast<const SfxUInt16Item&>( rSet->Get( nWhich )).GetValue();
+ if ( rSet->GetItemState( SID_ATTR_CHAR_WIDTH_FIT_TO_LINE ) >= SfxItemState::DEFAULT )
+ m_nScaleWidthItemSetVal = static_cast<const SfxUInt16Item&>( rSet->Get( SID_ATTR_CHAR_WIDTH_FIT_TO_LINE )).GetValue();
// Rotation
nWhich = GetWhich( SID_ATTR_CHAR_ROTATED );
@@ -2854,8 +2853,8 @@ void SvxCharPositionPage::Reset( const SfxItemSet* rSet )
m_xFitToLineCB->set_sensitive(!m_x0degRB->get_active());
// is this value set?
- if( SfxItemState::UNKNOWN == rSet->GetItemState( GetWhich(
- SID_ATTR_CHAR_WIDTH_FIT_TO_LINE ) ))
+ if( SfxItemState::UNKNOWN == rSet->GetItemState(
+ SID_ATTR_CHAR_WIDTH_FIT_TO_LINE ))
m_xFitToLineCB->hide();
}
ChangesApplied();
diff --git a/cui/source/tabpages/grfpage.cxx b/cui/source/tabpages/grfpage.cxx
index f18b2aa006fd..8eb5608c966f 100644
--- a/cui/source/tabpages/grfpage.cxx
+++ b/cui/source/tabpages/grfpage.cxx
@@ -225,7 +225,7 @@ bool SvxGrfCropPage::FillItemSet(SfxItemSet *rSet)
if( m_xWidthMF->get_value_changed_from_saved() ||
m_xHeightMF->get_value_changed_from_saved() )
{
- sal_uInt16 nW = rPool.GetWhich( SID_ATTR_GRAF_FRMSIZE );
+ constexpr sal_uInt16 nW = SID_ATTR_GRAF_FRMSIZE;
FieldUnit eUnit = MapToFieldUnit( rSet->GetPool()->GetMetric( nW ));
std::shared_ptr<SvxSizeItem> aSz(std::make_shared<SvxSizeItem>(nW));
diff --git a/cui/source/tabpages/numfmt.cxx b/cui/source/tabpages/numfmt.cxx
index b79d2f5de7db..13c01c8f43f9 100644
--- a/cui/source/tabpages/numfmt.cxx
+++ b/cui/source/tabpages/numfmt.cxx
@@ -360,7 +360,7 @@ void SvxNumberFormatTabPage::Reset( const SfxItemSet* rSet )
double nValDouble = 0;
OUString aValString;
- SfxItemState eState = rSet->GetItemState( GetWhich( SID_ATTR_NUMBERFORMAT_NOLANGUAGE ),true,&pItem);
+ SfxItemState eState = rSet->GetItemState( SID_ATTR_NUMBERFORMAT_NOLANGUAGE,true,&pItem);
if(eState==SfxItemState::SET)
{
@@ -411,7 +411,7 @@ void SvxNumberFormatTabPage::Reset( const SfxItemSet* rSet )
}
}
- eState = rSet->GetItemState( GetWhich( SID_ATTR_NUMBERFORMAT_SOURCE ) );
+ eState = rSet->GetItemState( SID_ATTR_NUMBERFORMAT_SOURCE );
if ( eState == SfxItemState::SET )
{
@@ -512,7 +512,7 @@ void SvxNumberFormatTabPage::Reset( const SfxItemSet* rSet )
{
SetCategory(nCatLbSelPos );
}
- eState = rSet->GetItemState( GetWhich( SID_ATTR_NUMBERFORMAT_ADD_AUTO ) );
+ eState = rSet->GetItemState( SID_ATTR_NUMBERFORMAT_ADD_AUTO );
if(SfxItemState::SET == eState)
pAutoEntryAttr = static_cast<const SfxBoolItem*>(
GetItem( *rSet, SID_ATTR_NUMBERFORMAT_ADD_AUTO ));
@@ -734,12 +734,11 @@ bool SvxNumberFormatTabPage::FillItemSet( SfxItemSet* rCoreAttrs )
if ( m_xCbSourceFormat->get_sensitive() )
{
- sal_uInt16 _nWhich = GetWhich( SID_ATTR_NUMBERFORMAT_SOURCE );
- SfxItemState _eItemState = rMyItemSet.GetItemState( _nWhich, false );
+ SfxItemState _eItemState = rMyItemSet.GetItemState( SID_ATTR_NUMBERFORMAT_SOURCE, false );
const SfxBoolItem* pBoolItem = static_cast<const SfxBoolItem*>(
GetItem( rMyItemSet, SID_ATTR_NUMBERFORMAT_SOURCE ));
bool bOld = pBoolItem && pBoolItem->GetValue();
- rCoreAttrs->Put( SfxBoolItem( _nWhich, m_xCbSourceFormat->get_active() ) );
+ rCoreAttrs->Put( SfxBoolItem( SID_ATTR_NUMBERFORMAT_SOURCE, m_xCbSourceFormat->get_active() ) );
if ( !bDataChanged )
bDataChanged = (bOld != m_xCbSourceFormat->get_active() ||
_eItemState != SfxItemState::SET);
diff --git a/cui/source/tabpages/paragrph.cxx b/cui/source/tabpages/paragrph.cxx
index 427e2bdc5708..1771c15d209f 100644
--- a/cui/source/tabpages/paragrph.cxx
+++ b/cui/source/tabpages/paragrph.cxx
@@ -1402,7 +1402,6 @@ bool SvxExtParagraphTabPage::FillItemSet( SfxItemSet* rOutSet )
TriState eState = m_xApplyCollBtn->get_state();
bool bIsPageModel = false;
- _nWhich = GetWhich( SID_ATTR_PARA_MODEL );
OUString sPage;
if ( m_xApplyCollBtn->get_state_changed_from_saved() ||
( TRISTATE_TRUE == eState &&
@@ -1417,7 +1416,7 @@ bool SvxExtParagraphTabPage::FillItemSet( SfxItemSet* rOutSet )
if ( !pOld || static_cast<const SvxPageModelItem*>(pOld)->GetValue() != sPage )
{
- rOutSet->Put( SvxPageModelItem( sPage, false, _nWhich ) );
+ rOutSet->Put( SvxPageModelItem( sPage, false, SID_ATTR_PARA_MODEL ) );
bModified = true;
}
else
@@ -1426,7 +1425,7 @@ bool SvxExtParagraphTabPage::FillItemSet( SfxItemSet* rOutSet )
else if(TRISTATE_TRUE == eState && m_xApplyCollBtn->get_sensitive())
bIsPageModel = true;
else
- rOutSet->Put( SvxPageModelItem( sPage, false, _nWhich ) );
+ rOutSet->Put( SvxPageModelItem( sPage, false, SID_ATTR_PARA_MODEL ) );
_nWhich = GetWhich( SID_ATTR_PARA_PAGEBREAK );
@@ -1587,15 +1586,13 @@ void SvxExtParagraphTabPage::Reset( const SfxItemSet* rSet )
m_xMaxHyphenLabel->set_sensitive(bEnable);
m_xMaxHyphenEdit->set_sensitive(bEnable);
- _nWhich = GetWhich( SID_ATTR_PARA_PAGENUM );
-
- switch (rSet->GetItemState(_nWhich))
+ switch (rSet->GetItemState(SID_ATTR_PARA_PAGENUM))
{
case SfxItemState::SET:
{
aPageNumState.bTriStateEnabled = false;
m_xPageNumBox->set_state(TRISTATE_TRUE);
- SfxUInt16Item const*const pItem(rSet->GetItem<SfxUInt16Item>(_nWhich));
+ SfxUInt16Item const*const pItem(rSet->GetItem<SfxUInt16Item>(SID_ATTR_PARA_PAGENUM));
const sal_uInt16 nPageNum(pItem->GetValue());
m_xPagenumEdit->set_value(nPageNum);
break;
@@ -1622,16 +1619,15 @@ void SvxExtParagraphTabPage::Reset( const SfxItemSet* rSet )
if ( bPageBreak )
{
// first handle PageModel
- _nWhich = GetWhich( SID_ATTR_PARA_MODEL );
bool bIsPageModel = false;
- eItemState = rSet->GetItemState( _nWhich );
+ eItemState = rSet->GetItemState( SID_ATTR_PARA_MODEL );
if ( eItemState >= SfxItemState::SET )
{
aApplyCollState.bTriStateEnabled = false;
const SvxPageModelItem& rModel =
- static_cast<const SvxPageModelItem&>(rSet->Get( _nWhich ));
+ static_cast<const SvxPageModelItem&>(rSet->Get( SID_ATTR_PARA_MODEL ));
const OUString& aStr( rModel.GetValue() );
if (!aStr.isEmpty() && m_xApplyCollBox->find_text(aStr) != -1)
diff --git a/sc/source/ui/drawfunc/drtxtob.cxx b/sc/source/ui/drawfunc/drtxtob.cxx
index f2af9e93be22..e3ec1fabd97b 100644
--- a/sc/source/ui/drawfunc/drtxtob.cxx
+++ b/sc/source/ui/drawfunc/drtxtob.cxx
@@ -219,7 +219,7 @@ void ScDrawTextObjectBar::Execute( SfxRequest &rReq )
{
aString = static_cast<const SfxStringItem*>(pItem)->GetValue();
const SfxPoolItem* pFtItem = nullptr;
- pArgs->GetItemState( 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/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx
index 8d342d0d2c4e..254eccac5769 100644
--- a/sc/source/ui/view/cellsh1.cxx
+++ b/sc/source/ui/view/cellsh1.cxx
@@ -2541,7 +2541,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
if ( pStringItem )
aChars = pStringItem->GetValue();
const SfxPoolItem* pFtItem = nullptr;
- pArgs->GetItemState( GetPool().GetWhich(SID_ATTR_SPECIALCHAR), false, &pFtItem);
+ pArgs->GetItemState( SID_ATTR_SPECIALCHAR, false, &pFtItem);
const SfxStringItem* pFontItem = dynamic_cast<const SfxStringItem*>( pFtItem );
if ( pFontItem )
aFontName = pFontItem->GetValue();
diff --git a/sc/source/ui/view/editsh.cxx b/sc/source/ui/view/editsh.cxx
index 559f4a539a83..30df7ebea5c0 100644
--- a/sc/source/ui/view/editsh.cxx
+++ b/sc/source/ui/view/editsh.cxx
@@ -398,7 +398,7 @@ void ScEditShell::Execute( SfxRequest& rReq )
{
aString = static_cast<const SfxStringItem*>(pItem)->GetValue();
const SfxPoolItem* pFtItem = nullptr;
- pArgs->GetItemState( 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/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();
diff --git a/svx/source/dialog/optgrid.cxx b/svx/source/dialog/optgrid.cxx
index 3262e7819abf..b836a042c03d 100644
--- a/svx/source/dialog/optgrid.cxx
+++ b/svx/source/dialog/optgrid.cxx
@@ -159,8 +159,7 @@ bool SvxGridTabPage::FillItemSet( SfxItemSet* rCoreSet )
aGridItem.bSynchronize = m_xCbxSynchronize->get_active();
aGridItem.bGridVisible = m_xCbxGridVisible->get_active();
- MapUnit eUnit =
- rCoreSet->GetPool()->GetMetric( GetWhich( SID_ATTR_GRID_OPTIONS ) );
+ MapUnit eUnit = rCoreSet->GetPool()->GetMetric( SID_ATTR_GRID_OPTIONS );
tools::Long nX = GetCoreValue( *m_xMtrFldDrawX, eUnit );
tools::Long nY = GetCoreValue( *m_xMtrFldDrawY, eUnit );
@@ -186,8 +185,7 @@ void SvxGridTabPage::Reset( const SfxItemSet* rSet )
m_xCbxSynchronize->set_active(pGridAttr->bSynchronize);
m_xCbxGridVisible->set_active(pGridAttr->bGridVisible);
- MapUnit eUnit =
- rSet->GetPool()->GetMetric( GetWhich( SID_ATTR_GRID_OPTIONS ) );
+ MapUnit eUnit = rSet->GetPool()->GetMetric( SID_ATTR_GRID_OPTIONS );
SetMetricValue( *m_xMtrFldDrawX , pGridAttr->nFldDrawX, eUnit );
SetMetricValue( *m_xMtrFldDrawY , pGridAttr->nFldDrawY, eUnit );
diff --git a/svx/source/sidebar/paragraph/ParaSpacingWindow.cxx b/svx/source/sidebar/paragraph/ParaSpacingWindow.cxx
index fdfbf6fd0b1f..8c48de0e0761 100644
--- a/svx/source/sidebar/paragraph/ParaSpacingWindow.cxx
+++ b/svx/source/sidebar/paragraph/ParaSpacingWindow.cxx
@@ -74,8 +74,7 @@ void ParaULSpacingWindow::SetUnit(FieldUnit eUnit)
m_xBelowSpacing->SetFieldUnit(eUnit);
SfxItemPool &rPool = SfxGetpApp()->GetPool();
- sal_uInt16 nWhich = rPool.GetWhich(SID_ATTR_PARA_ULSPACE);
- m_eUnit = rPool.GetMetric(nWhich);
+ m_eUnit = rPool.GetMetric(SID_ATTR_PARA_ULSPACE);
m_xAboveSpacing->set_max(m_xAboveSpacing->normalize(MAX_DURCH), MapToFieldUnit(m_eUnit));
m_xBelowSpacing->set_max(m_xBelowSpacing->normalize(MAX_DURCH), MapToFieldUnit(m_eUnit));
@@ -277,8 +276,7 @@ void ParaLRSpacingWindow::SetUnit(FieldUnit eUnit)
m_xFLSpacing->SetFieldUnit(eUnit);
SfxItemPool &rPool = SfxGetpApp()->GetPool();
- sal_uInt16 nWhich = rPool.GetWhich(SID_ATTR_PARA_LRSPACE);
- m_eUnit = rPool.GetMetric(nWhich);
+ m_eUnit = rPool.GetMetric(SID_ATTR_PARA_LRSPACE);
}
IMPL_LINK_NOARG(ParaLRSpacingWindow, ModifySpacingHdl, weld::MetricSpinButton&, void)
diff --git a/sw/source/uibase/shells/annotsh.cxx b/sw/source/uibase/shells/annotsh.cxx
index 95880f303579..b671d2924701 100644
--- a/sw/source/uibase/shells/annotsh.cxx
+++ b/sw/source/uibase/shells/annotsh.cxx
@@ -1743,7 +1743,7 @@ void SwAnnotationShell::InsertSymbol(SfxRequest& rReq)
{
sSym = static_cast<const SfxStringItem*>(pItem)->GetValue();
const SfxPoolItem* pFtItem = nullptr;
- pArgs->GetItemState( GetPool().GetWhich(SID_ATTR_SPECIALCHAR), false, &pFtItem);
+ pArgs->GetItemState( SID_ATTR_SPECIALCHAR, false, &pFtItem);
if (const SfxStringItem* pFontItem = dynamic_cast<const SfxStringItem*>(pFtItem))
sFontName = pFontItem->GetValue();
diff --git a/sw/source/uibase/shells/drwtxtsh.cxx b/sw/source/uibase/shells/drwtxtsh.cxx
index d1f82bdfb572..43c35159f671 100644
--- a/sw/source/uibase/shells/drwtxtsh.cxx
+++ b/sw/source/uibase/shells/drwtxtsh.cxx
@@ -685,7 +685,7 @@ void SwDrawTextShell::InsertSymbol(SfxRequest& rReq)
{
sSym = static_cast<const SfxStringItem*>(pItem)->GetValue();
const SfxPoolItem* pFtItem = nullptr;
- pArgs->GetItemState( GetPool().GetWhich(SID_ATTR_SPECIALCHAR), false, &pFtItem);
+ pArgs->GetItemState( SID_ATTR_SPECIALCHAR, false, &pFtItem);
const SfxStringItem* pFontItem = dynamic_cast<const SfxStringItem*>( pFtItem );
if ( pFontItem )
sFontName = pFontItem->GetValue();
diff --git a/sw/source/uibase/shells/textsh.cxx b/sw/source/uibase/shells/textsh.cxx
index 627861a7b13f..158e381b1351 100644
--- a/sw/source/uibase/shells/textsh.cxx
+++ b/sw/source/uibase/shells/textsh.cxx
@@ -885,7 +885,7 @@ void SwTextShell::InsertSymbol( SfxRequest& rReq )
{
aChars = static_cast<const SfxStringItem*>(pItem)->GetValue();
const SfxPoolItem* pFtItem = nullptr;
- pArgs->GetItemState( GetPool().GetWhich(SID_ATTR_SPECIALCHAR), false, &pFtItem);
+ pArgs->GetItemState( SID_ATTR_SPECIALCHAR, false, &pFtItem);
const SfxStringItem* pFontItem = dynamic_cast<const SfxStringItem*>( pFtItem );
if ( pFontItem )
aFontName = pFontItem->GetValue();