cui/source/tabpages/backgrnd.cxx                          |    8 ++--
 cui/source/tabpages/border.cxx                            |   18 ++++-----
 cui/source/tabpages/grfpage.cxx                           |   26 ++++++-------
 cui/source/tabpages/numpages.cxx                          |   18 ++++-----
 cui/source/tabpages/paragrph.cxx                          |    8 ++--
 cui/source/tabpages/tpline.cxx                            |   18 ++++-----
 editeng/source/editeng/editdoc.cxx                        |    2 -
 editeng/source/editeng/edtspell.cxx                       |    2 -
 editeng/source/items/textitem.cxx                         |    6 +--
 editeng/source/rtf/svxrtf.cxx                             |    4 +-
 forms/source/richtext/parametrizedattributedispatcher.cxx |    2 -
 forms/source/richtext/richtextcontrol.cxx                 |    2 -
 forms/source/richtext/richtextimplcontrol.cxx             |    2 -
 forms/source/richtext/rtattributehandler.cxx              |    2 -
 include/sfx2/tabdlg.hxx                                   |    2 -
 include/svl/itempool.hxx                                  |   28 ++++++++------
 sc/source/ui/app/scmod.cxx                                |    2 -
 sc/source/ui/dbgui/PivotLayoutDialog.cxx                  |    2 -
 sc/source/ui/dbgui/consdlg.cxx                            |    4 +-
 sc/source/ui/dbgui/filtdlg.cxx                            |    2 -
 sc/source/ui/dbgui/pfiltdlg.cxx                           |    2 -
 sc/source/ui/dbgui/sfiltdlg.cxx                           |    2 -
 sc/source/ui/dbgui/tpsort.cxx                             |    4 +-
 sc/source/ui/dbgui/tpsubt.cxx                             |    4 +-
 sc/source/ui/docshell/docsh4.cxx                          |   18 ++++-----
 sc/source/ui/drawfunc/drawsh.cxx                          |    2 -
 sc/source/ui/drawfunc/drtxtob.cxx                         |    6 +--
 sc/source/ui/pagedlg/hfedtdlg.cxx                         |    2 -
 sc/source/ui/view/cellsh1.cxx                             |    2 -
 sc/source/ui/view/editsh.cxx                              |    8 ++--
 sc/source/ui/view/formatsh.cxx                            |   14 +++----
 sc/source/ui/view/viewutil.cxx                            |    2 -
 sd/source/ui/dlg/BulletAndPositionDlg.cxx                 |    5 +-
 sd/source/ui/dlg/dlgolbul.cxx                             |    2 -
 sd/source/ui/func/bulmaper.cxx                            |   20 +++++-----
 sd/source/ui/func/fuolbull.cxx                            |    2 -
 sd/source/ui/func/fupage.cxx                              |   16 ++++----
 sd/source/ui/view/drtxtob1.cxx                            |    4 +-
 sd/source/ui/view/drviews3.cxx                            |    2 -
 sd/source/ui/view/viewshel.cxx                            |    2 -
 sfx2/source/appl/appuno.cxx                               |   16 ++++----
 sfx2/source/control/ctrlitem.cxx                          |    2 -
 sfx2/source/control/dispatch.cxx                          |    4 +-
 sfx2/source/control/msg.cxx                               |    2 -
 sfx2/source/control/request.cxx                           |    2 -
 sfx2/source/control/unoctitm.cxx                          |    2 -
 sfx2/source/dialog/tabdlg.cxx                             |   10 ++---
 svl/source/items/itempool.cxx                             |    8 ++--
 svl/source/items/itemset.cxx                              |    2 -
 svx/source/dialog/cuicharmap.cxx                          |    2 -
 svx/source/dialog/fntctrl.cxx                             |    2 -
 svx/source/dialog/srchdlg.cxx                             |    8 ++--
 svx/source/form/fmtextcontrolshell.cxx                    |    6 +--
 svx/source/sidebar/nbdtmg.cxx                             |    4 +-
 svx/source/sidebar/text/TextCharacterSpacingControl.cxx   |    2 -
 svx/source/styles/CommonStylePreviewRenderer.cxx          |    2 -
 svx/source/tbxctrls/linewidthctrl.cxx                     |    2 -
 svx/source/tbxctrls/tbcontrl.cxx                          |    2 -
 svx/source/unodraw/unopool.cxx                            |   10 ++---
 sw/source/core/doc/docfmt.cxx                             |    2 -
 sw/source/core/draw/drawdoc.cxx                           |    2 -
 sw/source/core/edit/acorrect.cxx                          |    2 -
 sw/source/filter/html/svxcss1.cxx                         |    2 -
 sw/source/filter/ww8/writerhelper.cxx                     |    2 -
 sw/source/filter/ww8/wrtw8esh.cxx                         |    4 +-
 sw/source/filter/ww8/ww8graf.cxx                          |    4 +-
 sw/source/ui/misc/pgfnote.cxx                             |   10 ++---
 sw/source/ui/misc/pggrid.cxx                              |    4 +-
 sw/source/uibase/app/docst.cxx                            |    2 -
 sw/source/uibase/app/docstyle.cxx                         |    2 -
 sw/source/uibase/docvw/PageBreakWin.cxx                   |    4 +-
 sw/source/uibase/frmdlg/colex.cxx                         |   22 +++++------
 sw/source/uibase/shells/annotsh.cxx                       |    8 ++--
 sw/source/uibase/shells/basesh.cxx                        |    8 ++--
 sw/source/uibase/shells/drwtxtex.cxx                      |   10 ++---
 sw/source/uibase/shells/frmsh.cxx                         |    8 ++--
 sw/source/uibase/shells/grfsh.cxx                         |    4 +-
 sw/source/uibase/shells/tabsh.cxx                         |    4 +-
 sw/source/uibase/shells/textfld.cxx                       |    2 -
 sw/source/uibase/shells/textsh.cxx                        |    4 +-
 sw/source/uibase/shells/textsh1.cxx                       |   10 ++---
 sw/source/uibase/shells/txtattr.cxx                       |   12 +++---
 sw/source/uibase/sidebar/PageMarginControl.cxx            |    2 -
 sw/source/uibase/sidebar/PageSizeControl.cxx              |    2 -
 sw/source/uibase/uiview/formatclipboard.cxx               |   12 +++---
 sw/source/uibase/uiview/view2.cxx                         |    2 -
 sw/source/uibase/uiview/viewdlg.cxx                       |    2 -
 sw/source/uibase/uiview/viewdraw.cxx                      |    2 -
 sw/source/uibase/uiview/viewtab.cxx                       |    2 -
 89 files changed, 263 insertions(+), 258 deletions(-)

New commits:
commit cebbd5795d6256fb346ac8d70c15daceca48c554
Author:     Armin Le Grand (allotropia) <[email protected]>
AuthorDate: Sun Feb 18 19:17:48 2024 +0100
Commit:     Armin Le Grand <[email protected]>
CommitDate: Sun Feb 18 21:37:52 2024 +0100

    ITEM: Rename for more control over SlotID usages
    
    Change-Id: I51585f1c15984a066262023184f668662853d20f
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163556
    Tested-by: Jenkins
    Reviewed-by: Armin Le Grand <[email protected]>

diff --git a/cui/source/tabpages/backgrnd.cxx b/cui/source/tabpages/backgrnd.cxx
index 56bccfacdffe..b10c6f79c304 100644
--- a/cui/source/tabpages/backgrnd.cxx
+++ b/cui/source/tabpages/backgrnd.cxx
@@ -109,14 +109,14 @@ void SvxBkgTabPage::Reset(const SfxItemSet* pItemSet)
     }
     else if (m_bCharBackColor)
     {
-        sal_uInt16 
nWhich(pItemSet->GetPool()->GetWhich(SID_ATTR_CHAR_BACK_COLOR));
+        sal_uInt16 
nWhich(pItemSet->GetPool()->GetWhichIDFromSlotID(SID_ATTR_CHAR_BACK_COLOR));
         Color aBackColor(static_cast<const 
SvxColorItem&>(pItemSet->Get(nWhich)).GetValue());
         SvxBrushItem aBrushItem(SvxBrushItem(aBackColor, SID_ATTR_BRUSH_CHAR));
         setSvxBrushItemAsFillAttributesToTargetSet(aBrushItem, m_aAttrSet);
     }
     else
     {
-        sal_uInt16 nWhich(pItemSet->GetPool()->GetWhich(m_bHighlighting ? 
SID_ATTR_BRUSH_CHAR : SID_ATTR_BRUSH));
+        sal_uInt16 
nWhich(pItemSet->GetPool()->GetWhichIDFromSlotID(m_bHighlighting ? 
SID_ATTR_BRUSH_CHAR : SID_ATTR_BRUSH));
         SvxBrushItem aBrushItem(static_cast<const 
SvxBrushItem&>(pItemSet->Get(nWhich)));
         setSvxBrushItemAsFillAttributesToTargetSet(aBrushItem, m_aAttrSet);
     }
@@ -194,7 +194,7 @@ bool SvxBkgTabPage::FillItemSet(SfxItemSet* pCoreSet)
     // *Put* in the core set all table brushes that are *SET* in the m_aAttrSet
     if (nSlot != SID_ATTR_BRUSH)
     {
-        nWhich = m_aAttrSet.GetPool()->GetWhich(SID_ATTR_BRUSH);
+        nWhich = m_aAttrSet.GetPool()->GetWhichIDFromSlotID(SID_ATTR_BRUSH);
         if (SfxItemState::SET == m_aAttrSet.GetItemState(nWhich))
         {
             SvxBrushItem aBrushItem(static_cast<const 
SvxBrushItem&>(m_aAttrSet.Get(nWhich)));
@@ -310,7 +310,7 @@ void SvxBkgTabPage::SetActiveTableDestinationBrushItem()
         return;
     }
 
-    XFillStyleItem 
aFillStyleItem(m_aAttrSet.Get(m_aAttrSet.GetPool()->GetWhich(XATTR_FILLSTYLE)));
+    XFillStyleItem 
aFillStyleItem(m_aAttrSet.Get(m_aAttrSet.GetPool()->GetWhichIDFromSlotID(XATTR_FILLSTYLE)));
     drawing::FillStyle eXFS = aFillStyleItem.GetValue();
     switch(eXFS)
     {
diff --git a/cui/source/tabpages/border.cxx b/cui/source/tabpages/border.cxx
index ca2b7d61e2ef..ccb94fe46854 100644
--- a/cui/source/tabpages/border.cxx
+++ b/cui/source/tabpages/border.cxx
@@ -634,7 +634,7 @@ void SvxBorderTabPage::Reset( const SfxItemSet* rSet )
 
     if (m_aFrameSel.IsBorderEnabled(svx::FrameBorderType::TLBR))
     {
-        sal_uInt16 nBorderDiagId = pPool->GetWhich(SID_ATTR_BORDER_DIAG_TLBR);
+        sal_uInt16 nBorderDiagId = 
pPool->GetWhichIDFromSlotID(SID_ATTR_BORDER_DIAG_TLBR);
         if (const SvxLineItem* pLineItem = static_cast<const 
SvxLineItem*>(rSet->GetItem(nBorderDiagId)))
             m_aFrameSel.ShowBorder(svx::FrameBorderType::TLBR, 
pLineItem->GetLine());
         else
@@ -643,7 +643,7 @@ void SvxBorderTabPage::Reset( const SfxItemSet* rSet )
 
     if (m_aFrameSel.IsBorderEnabled(svx::FrameBorderType::BLTR))
     {
-        sal_uInt16 nBorderDiagId = pPool->GetWhich(SID_ATTR_BORDER_DIAG_BLTR);
+        sal_uInt16 nBorderDiagId = 
pPool->GetWhichIDFromSlotID(SID_ATTR_BORDER_DIAG_BLTR);
         if (const SvxLineItem* pLineItem = static_cast<const 
SvxLineItem*>(rSet->GetItem(nBorderDiagId)))
             m_aFrameSel.ShowBorder(svx::FrameBorderType::BLTR, 
pLineItem->GetLine());
         else
@@ -652,7 +652,7 @@ void SvxBorderTabPage::Reset( const SfxItemSet* rSet )
 
     if (m_xShadowControls)
     {
-        sal_uInt16 nShadowId = pPool->GetWhich(mnShadowSlot);
+        sal_uInt16 nShadowId = pPool->GetWhichIDFromSlotID(mnShadowSlot);
         const SfxPoolItem* pItem = rSet->GetItem(nShadowId);
         if (pItem)
             m_xShadowControls->SetControlValue(*static_cast<const 
SvxShadowItem*>(pItem));
@@ -662,7 +662,7 @@ void SvxBorderTabPage::Reset( const SfxItemSet* rSet )
 
     if (m_xMarginControls)
     {
-        sal_uInt16 nAlignMarginId = pPool->GetWhich(SID_ATTR_ALIGN_MARGIN);
+        sal_uInt16 nAlignMarginId = 
pPool->GetWhichIDFromSlotID(SID_ATTR_ALIGN_MARGIN);
         const SfxPoolItem* pItem = rSet->GetItem(nAlignMarginId);
         if (pItem)
             m_xMarginControls->SetControlValue(*static_cast<const 
SvxMarginItem*>(pItem));
@@ -670,7 +670,7 @@ void SvxBorderTabPage::Reset( const SfxItemSet* rSet )
             m_xMarginControls->SetControlDontKnow();
     }
 
-    sal_uInt16 nMergeAdjacentBordersId = 
pPool->GetWhich(SID_SW_COLLAPSING_BORDERS);
+    sal_uInt16 nMergeAdjacentBordersId = 
pPool->GetWhichIDFromSlotID(SID_SW_COLLAPSING_BORDERS);
     const SfxBoolItem *pMergeAdjacentBorders = static_cast<const 
SfxBoolItem*>(rSet->GetItem(nMergeAdjacentBordersId));
     if (!pMergeAdjacentBorders)
         m_xMergeAdjacentBordersCB->set_state(TRISTATE_INDET);
@@ -678,7 +678,7 @@ void SvxBorderTabPage::Reset( const SfxItemSet* rSet )
         
m_xMergeAdjacentBordersCB->set_active(pMergeAdjacentBorders->GetValue());
     m_xMergeAdjacentBordersCB->save_state();
 
-    sal_uInt16 nMergeWithNextId = pPool->GetWhich(SID_ATTR_BORDER_CONNECT);
+    sal_uInt16 nMergeWithNextId = 
pPool->GetWhichIDFromSlotID(SID_ATTR_BORDER_CONNECT);
     const SfxBoolItem *pMergeWithNext = static_cast<const 
SfxBoolItem*>(rSet->GetItem(nMergeWithNextId));
     if (!pMergeWithNext)
         m_xMergeWithNextCB->set_state(TRISTATE_INDET);
@@ -953,7 +953,7 @@ bool SvxBorderTabPage::FillItemSet( SfxItemSet* rCoreAttrs )
         auto nState = m_xMergeAdjacentBordersCB->get_state();
         if (nState == TRISTATE_INDET)
         {
-            sal_uInt16 nMergeAdjacentBordersId = 
pPool->GetWhich(SID_SW_COLLAPSING_BORDERS);
+            sal_uInt16 nMergeAdjacentBordersId = 
pPool->GetWhichIDFromSlotID(SID_SW_COLLAPSING_BORDERS);
             rCoreAttrs->ClearItem(nMergeAdjacentBordersId);
         }
         else
@@ -973,7 +973,7 @@ bool SvxBorderTabPage::FillItemSet( SfxItemSet* rCoreAttrs )
         auto nState = m_xMergeWithNextCB->get_state();
         if (nState == TRISTATE_INDET)
         {
-            sal_uInt16 nMergeWithNextId = 
pPool->GetWhich(SID_ATTR_BORDER_CONNECT);
+            sal_uInt16 nMergeWithNextId = 
pPool->GetWhichIDFromSlotID(SID_ATTR_BORDER_CONNECT);
             rCoreAttrs->ClearItem(nMergeWithNextId);
         }
         else
@@ -990,7 +990,7 @@ bool SvxBorderTabPage::FillItemSet( SfxItemSet* rCoreAttrs )
 
     bool                  bPut          = true;
     sal_uInt16            nBoxWhich     = GetWhich( mnBoxSlot );
-    sal_uInt16            nBoxInfoWhich = pPool->GetWhich( 
SID_ATTR_BORDER_INNER, false );
+    sal_uInt16            nBoxInfoWhich = pPool->GetWhichIDFromSlotID( 
SID_ATTR_BORDER_INNER, false );
     const SfxItemSet&     rOldSet       = GetItemSet();
     SvxBoxItem            aBoxItem      ( nBoxWhich );
     SvxBoxInfoItem        aBoxInfoItem  ( nBoxInfoWhich );
diff --git a/cui/source/tabpages/grfpage.cxx b/cui/source/tabpages/grfpage.cxx
index a12ffb0ea544..9e96fdbb603c 100644
--- a/cui/source/tabpages/grfpage.cxx
+++ b/cui/source/tabpages/grfpage.cxx
@@ -124,7 +124,7 @@ void SvxGrfCropPage::Reset( const SfxItemSet *rSet )
     const SfxPoolItem* pItem;
     const SfxItemPool& rPool = *rSet->GetPool();
 
-    if(SfxItemState::SET == rSet->GetItemState( rPool.GetWhich(
+    if(SfxItemState::SET == rSet->GetItemState( rPool.GetWhichIDFromSlotID(
                                     SID_ATTR_GRAF_KEEP_ZOOM ), true, &pItem ))
     {
         if( static_cast<const SfxBoolItem*>(pItem)->GetValue() )
@@ -134,7 +134,7 @@ void SvxGrfCropPage::Reset( const SfxItemSet *rSet )
         m_xZoomConstRB->save_state();
     }
 
-    sal_uInt16 nW = rPool.GetWhich( SID_ATTR_GRAF_CROP );
+    sal_uInt16 nW = rPool.GetWhichIDFromSlotID( SID_ATTR_GRAF_CROP );
     if( SfxItemState::SET == rSet->GetItemState( nW, true, &pItem))
     {
         FieldUnit eUnit = MapToFieldUnit( rSet->GetPool()->GetMetric( nW ));
@@ -164,7 +164,7 @@ void SvxGrfCropPage::Reset( const SfxItemSet *rSet )
     m_xTopMF->save_value();
     m_xBottomMF->save_value();
 
-    nW = rPool.GetWhich( SID_ATTR_PAGE_SIZE );
+    nW = rPool.GetWhichIDFromSlotID( SID_ATTR_PAGE_SIZE );
     if ( SfxItemState::SET == rSet->GetItemState( nW, false, &pItem ) )
     {
         // orientation and size from the PageItem
@@ -257,14 +257,14 @@ bool SvxGrfCropPage::FillItemSet(SfxItemSet *rSet)
 
         if (m_bSetOrigSize)
         {
-            bModified |= nullptr != rSet->Put( SvxSizeItem( rPool.GetWhich(
+            bModified |= nullptr != rSet->Put( SvxSizeItem( 
rPool.GetWhichIDFromSlotID(
                         SID_ATTR_GRAF_FRMSIZE_PERCENT ), Size( 0, 0 )) );
         }
     }
     if( m_xLeftMF->get_value_changed_from_saved() || 
m_xRightMF->get_value_changed_from_saved() ||
         m_xTopMF->get_value_changed_from_saved()  || 
m_xBottomMF->get_value_changed_from_saved() )
     {
-        sal_uInt16 nW = rPool.GetWhich( SID_ATTR_GRAF_CROP );
+        sal_uInt16 nW = rPool.GetWhichIDFromSlotID( SID_ATTR_GRAF_CROP );
         FieldUnit eUnit = MapToFieldUnit( rSet->GetPool()->GetMetric( nW ));
         std::unique_ptr<SvxGrfCrop> pNew(static_cast<SvxGrfCrop*>(rSet->Get( 
nW ).Clone()));
 
@@ -277,7 +277,7 @@ bool SvxGrfCropPage::FillItemSet(SfxItemSet *rSet)
 
     if( m_xZoomConstRB->get_state_changed_from_saved() )
     {
-        bModified |= nullptr != rSet->Put( SfxBoolItem( rPool.GetWhich(
+        bModified |= nullptr != rSet->Put( SfxBoolItem( 
rPool.GetWhichIDFromSlotID(
                     SID_ATTR_GRAF_KEEP_ZOOM), m_xZoomConstRB->get_active() ) );
     }
 
@@ -362,7 +362,7 @@ IMPL_LINK( SvxGrfCropPage, ZoomHdl, 
weld::MetricSpinButton&, rField, void )
 {
     SfxItemPool* pPool = GetItemSet().GetPool();
     DBG_ASSERT( pPool, "Where is the pool?" );
-    FieldUnit eUnit = MapToFieldUnit( pPool->GetMetric( pPool->GetWhich(
+    FieldUnit eUnit = MapToFieldUnit( pPool->GetMetric( 
pPool->GetWhichIDFromSlotID(
                                                     SID_ATTR_GRAF_CROP ) ) );
 
     if (&rField == m_xWidthZoomMF.get())
@@ -391,7 +391,7 @@ IMPL_LINK( SvxGrfCropPage, SizeHdl, 
weld::MetricSpinButton&, rField, void )
 {
     SfxItemPool* pPool = GetItemSet().GetPool();
     DBG_ASSERT( pPool, "Where is the pool?" );
-    FieldUnit eUnit = MapToFieldUnit( pPool->GetMetric( pPool->GetWhich(
+    FieldUnit eUnit = MapToFieldUnit( pPool->GetMetric( 
pPool->GetWhichIDFromSlotID(
                                                     SID_ATTR_GRAF_CROP ) ) );
 
     Size aSize( lcl_GetValue(*m_xWidthMF, eUnit),
@@ -427,7 +427,7 @@ IMPL_LINK( SvxGrfCropPage, CropModifyHdl, 
weld::MetricSpinButton&, rField, void
 {
     SfxItemPool* pPool = GetItemSet().GetPool();
     DBG_ASSERT( pPool, "Where is the pool?" );
-    FieldUnit eUnit = MapToFieldUnit( pPool->GetMetric( pPool->GetWhich(
+    FieldUnit eUnit = MapToFieldUnit( pPool->GetMetric( 
pPool->GetWhichIDFromSlotID(
                                                     SID_ATTR_GRAF_CROP ) ) );
 
     bool bZoom = m_xZoomConstRB->get_active();
@@ -512,7 +512,7 @@ IMPL_LINK_NOARG(SvxGrfCropPage, OrigSizeHdl, weld::Button&, 
void)
 {
     SfxItemPool* pPool = GetItemSet().GetPool();
     DBG_ASSERT( pPool, "Where is the pool?" );
-    FieldUnit eUnit = MapToFieldUnit( pPool->GetMetric( pPool->GetWhich(
+    FieldUnit eUnit = MapToFieldUnit( pPool->GetMetric( 
pPool->GetWhichIDFromSlotID(
                                                     SID_ATTR_GRAF_CROP ) ) );
 
     tools::Long nWidth = m_aOrigSize.Width() -
@@ -561,7 +561,7 @@ void SvxGrfCropPage::CalcZoom()
 {
     SfxItemPool* pPool = GetItemSet().GetPool();
     DBG_ASSERT( pPool, "Where is the pool?" );
-    FieldUnit eUnit = MapToFieldUnit( pPool->GetMetric( pPool->GetWhich(
+    FieldUnit eUnit = MapToFieldUnit( pPool->GetMetric( 
pPool->GetWhichIDFromSlotID(
                                                     SID_ATTR_GRAF_CROP ) ) );
 
     tools::Long nWidth = lcl_GetValue( *m_xWidthMF, eUnit );
@@ -590,7 +590,7 @@ void SvxGrfCropPage::CalcMinMaxBorder()
 {
     SfxItemPool* pPool = GetItemSet().GetPool();
     DBG_ASSERT( pPool, "Where is the pool?" );
-    FieldUnit eUnit = MapToFieldUnit( pPool->GetMetric( pPool->GetWhich(
+    FieldUnit eUnit = MapToFieldUnit( pPool->GetMetric( 
pPool->GetWhichIDFromSlotID(
                                                     SID_ATTR_GRAF_CROP ) ) );
     tools::Long nR = lcl_GetValue(*m_xRightMF, eUnit );
     tools::Long nMinWidth = (m_aOrigSize.Width() * 10) /11;
@@ -621,7 +621,7 @@ void SvxGrfCropPage::GraphicHasChanged( bool bFound )
     {
         SfxItemPool* pPool = GetItemSet().GetPool();
         DBG_ASSERT( pPool, "Where is the pool?" );
-        FieldUnit eUnit = MapToFieldUnit( pPool->GetMetric( pPool->GetWhich(
+        FieldUnit eUnit = MapToFieldUnit( pPool->GetMetric( 
pPool->GetWhichIDFromSlotID(
                                                     SID_ATTR_GRAF_CROP ) ));
 
         sal_Int64 nSpin = m_xLeftMF->normalize(m_aOrigSize.Width()) / 20;
diff --git a/cui/source/tabpages/numpages.cxx b/cui/source/tabpages/numpages.cxx
index 5ed761a5c579..36868e3579ab 100644
--- a/cui/source/tabpages/numpages.cxx
+++ b/cui/source/tabpages/numpages.cxx
@@ -278,7 +278,7 @@ void  SvxSingleNumPickTabPage::Reset( const SfxItemSet* 
rSet )
     SfxItemState eState = rSet->GetItemState(SID_ATTR_NUMBERING_RULE, false, 
&pItem);
     if(eState != SfxItemState::SET)
     {
-        nNumItemId = rSet->GetPool()->GetWhich(SID_ATTR_NUMBERING_RULE);
+        nNumItemId = 
rSet->GetPool()->GetWhichIDFromSlotID(SID_ATTR_NUMBERING_RULE);
         eState = rSet->GetItemState(nNumItemId, false, &pItem);
 
         if( eState != SfxItemState::SET )
@@ -419,7 +419,7 @@ void  SvxBulletPickTabPage::Reset( const SfxItemSet* rSet )
     const SvxNumBulletItem* pItem = 
rSet->GetItemIfSet(SID_ATTR_NUMBERING_RULE, false);
     if(!pItem)
     {
-        nNumItemId = rSet->GetPool()->GetWhich(SID_ATTR_NUMBERING_RULE);
+        nNumItemId = 
rSet->GetPool()->GetWhichIDFromSlotID(SID_ATTR_NUMBERING_RULE);
         pItem = rSet->GetItemIfSet(nNumItemId, false);
 
         if( !pItem )
@@ -600,7 +600,7 @@ void  SvxNumPickTabPage::Reset( const SfxItemSet* rSet )
     const SvxNumBulletItem* pItem = 
rSet->GetItemIfSet(SID_ATTR_NUMBERING_RULE, false);
     if(!pItem)
     {
-        nNumItemId = rSet->GetPool()->GetWhich(SID_ATTR_NUMBERING_RULE);
+        nNumItemId = 
rSet->GetPool()->GetWhichIDFromSlotID(SID_ATTR_NUMBERING_RULE);
         pItem = rSet->GetItemIfSet(nNumItemId, false);
 
         if( !pItem )
@@ -740,7 +740,7 @@ SvxBitmapPickTabPage::SvxBitmapPickTabPage(weld::Container* 
pPage, weld::DialogC
     m_xExamplesVS->SetDoubleClickHdl(LINK(this, SvxBitmapPickTabPage, 
DoubleClickHdl_Impl));
     m_xBtBrowseFile->connect_clicked(LINK(this, SvxBitmapPickTabPage, 
ClickAddBrowseHdl_Impl));
 
-    eCoreUnit = 
rSet.GetPool()->GetMetric(rSet.GetPool()->GetWhich(SID_ATTR_NUMBERING_RULE));
+    eCoreUnit = 
rSet.GetPool()->GetMetric(rSet.GetPool()->GetWhichIDFromSlotID(SID_ATTR_NUMBERING_RULE));
 
     // determine graphic name
     GalleryExplorer::FillObjList(GALLERY_THEME_BULLETS, aGrfNames);
@@ -848,7 +848,7 @@ void  SvxBitmapPickTabPage::Reset( const SfxItemSet* rSet )
     const SvxNumBulletItem* pItem = 
rSet->GetItemIfSet(SID_ATTR_NUMBERING_RULE, false);
     if(!pItem)
     {
-        nNumItemId = rSet->GetPool()->GetWhich(SID_ATTR_NUMBERING_RULE);
+        nNumItemId = 
rSet->GetPool()->GetWhichIDFromSlotID(SID_ATTR_NUMBERING_RULE);
         pItem = rSet->GetItemIfSet(nNumItemId, false);
 
         if( !pItem )
@@ -1102,7 +1102,7 @@ 
SvxNumOptionsTabPage::SvxNumOptionsTabPage(weld::Container* pPage, weld::DialogC
     aInvalidateTimer.SetInvokeHandler(LINK(this, SvxNumOptionsTabPage, 
PreviewInvalidateHdl_Impl));
     aInvalidateTimer.SetTimeout(50);
 
-    eCoreUnit = 
rSet.GetPool()->GetMetric(rSet.GetPool()->GetWhich(SID_ATTR_NUMBERING_RULE));
+    eCoreUnit = 
rSet.GetPool()->GetMetric(rSet.GetPool()->GetWhichIDFromSlotID(SID_ATTR_NUMBERING_RULE));
 
     // Fill ListBox with predefined / translated numbering types.
     sal_uInt32 nCount = SvxNumberingTypeTable::Count();
@@ -1221,7 +1221,7 @@ void    SvxNumOptionsTabPage::Reset( const SfxItemSet* 
rSet )
         rSet->GetItemIfSet(SID_ATTR_NUMBERING_RULE, false);
     if(!pBulletItem)
     {
-        nNumItemId = rSet->GetPool()->GetWhich(SID_ATTR_NUMBERING_RULE);
+        nNumItemId = 
rSet->GetPool()->GetWhichIDFromSlotID(SID_ATTR_NUMBERING_RULE);
         pBulletItem = rSet->GetItemIfSet(nNumItemId, false);
 
         if( !pBulletItem )
@@ -2249,7 +2249,7 @@ 
SvxNumPositionTabPage::SvxNumPositionTabPage(weld::Container* pPage, weld::Dialo
 
     m_xRelativeCB->set_active(bLastRelative);
     m_aPreviewWIN.SetPositionMode();
-    eCoreUnit = 
rSet.GetPool()->GetMetric(rSet.GetPool()->GetWhich(SID_ATTR_NUMBERING_RULE));
+    eCoreUnit = 
rSet.GetPool()->GetMetric(rSet.GetPool()->GetWhichIDFromSlotID(SID_ATTR_NUMBERING_RULE));
 }
 
 SvxNumPositionTabPage::~SvxNumPositionTabPage()
@@ -2533,7 +2533,7 @@ void SvxNumPositionTabPage::Reset( const SfxItemSet* rSet 
)
         rSet->GetItemIfSet(SID_ATTR_NUMBERING_RULE, false);
     if(!pItem)
     {
-        nNumItemId = rSet->GetPool()->GetWhich(SID_ATTR_NUMBERING_RULE);
+        nNumItemId = 
rSet->GetPool()->GetWhichIDFromSlotID(SID_ATTR_NUMBERING_RULE);
         pItem = rSet->GetItemIfSet(nNumItemId, false);
 
         if( !pItem )
diff --git a/cui/source/tabpages/paragrph.cxx b/cui/source/tabpages/paragrph.cxx
index 132b125f0293..d644570784e6 100644
--- a/cui/source/tabpages/paragrph.cxx
+++ b/cui/source/tabpages/paragrph.cxx
@@ -2539,7 +2539,7 @@ bool SvxAsianTabPage::FillItemSet( SfxItemSet* rSet )
     if (m_xScriptSpaceCB->get_sensitive() && 
m_xScriptSpaceCB->get_state_changed_from_saved())
     {
         std::unique_ptr<SfxBoolItem> 
pNewItem(static_cast<SfxBoolItem*>(rSet->Get(
-            pPool->GetWhich(SID_ATTR_PARA_SCRIPTSPACE)).Clone()));
+            pPool->GetWhichIDFromSlotID(SID_ATTR_PARA_SCRIPTSPACE)).Clone()));
         pNewItem->SetValue(m_xScriptSpaceCB->get_active());
         rSet->Put(std::move(pNewItem));
         bRet = true;
@@ -2547,7 +2547,7 @@ bool SvxAsianTabPage::FillItemSet( SfxItemSet* rSet )
     if (m_xHangingPunctCB->get_sensitive() && 
m_xHangingPunctCB->get_state_changed_from_saved())
     {
         std::unique_ptr<SfxBoolItem> 
pNewItem(static_cast<SfxBoolItem*>(rSet->Get(
-            pPool->GetWhich(SID_ATTR_PARA_HANGPUNCTUATION)).Clone()));
+            
pPool->GetWhichIDFromSlotID(SID_ATTR_PARA_HANGPUNCTUATION)).Clone()));
         pNewItem->SetValue(m_xHangingPunctCB->get_active());
         rSet->Put(std::move(pNewItem));
         bRet = true;
@@ -2555,7 +2555,7 @@ bool SvxAsianTabPage::FillItemSet( SfxItemSet* rSet )
     if (m_xForbiddenRulesCB->get_sensitive() && 
m_xForbiddenRulesCB->get_state_changed_from_saved())
     {
         std::unique_ptr<SfxBoolItem> 
pNewItem(static_cast<SfxBoolItem*>(rSet->Get(
-            pPool->GetWhich(SID_ATTR_PARA_FORBIDDEN_RULES)).Clone()));
+            
pPool->GetWhichIDFromSlotID(SID_ATTR_PARA_FORBIDDEN_RULES)).Clone()));
         pNewItem->SetValue(m_xForbiddenRulesCB->get_active());
         rSet->Put(std::move(pNewItem));
         bRet = true;
@@ -2565,7 +2565,7 @@ bool SvxAsianTabPage::FillItemSet( SfxItemSet* rSet )
 
 static void lcl_SetBox(const SfxItemSet& rSet, sal_uInt16 nSlotId, 
weld::CheckButton& rBox)
 {
-    sal_uInt16 _nWhich = rSet.GetPool()->GetWhich(nSlotId);
+    sal_uInt16 _nWhich = rSet.GetPool()->GetWhichIDFromSlotID(nSlotId);
     SfxItemState eState = rSet.GetItemState(_nWhich);
     if( eState == SfxItemState::UNKNOWN || eState == SfxItemState::DISABLED )
         rBox.set_sensitive(false);
diff --git a/cui/source/tabpages/tpline.cxx b/cui/source/tabpages/tpline.cxx
index 384488deacbb..b4eb30ac2849 100644
--- a/cui/source/tabpages/tpline.cxx
+++ b/cui/source/tabpages/tpline.cxx
@@ -623,8 +623,8 @@ bool SvxLineTabPage::FillItemSet( SfxItemSet* rAttrs )
     if(m_nSymbolType!=SVX_SYMBOLTYPE_UNKNOWN || m_bNewSize)
     {
         // Was set by selection or the size is different
-        SvxSizeItem  
aSItem(rAttrs->GetPool()->GetWhich(SID_ATTR_SYMBOLSIZE),m_aSymbolSize);
-        const SfxPoolItem* pSOld = GetOldItem( *rAttrs, 
rAttrs->GetPool()->GetWhich(SID_ATTR_SYMBOLSIZE) );
+        SvxSizeItem  
aSItem(rAttrs->GetPool()->GetWhichIDFromSlotID(SID_ATTR_SYMBOLSIZE),m_aSymbolSize);
+        const SfxPoolItem* pSOld = GetOldItem( *rAttrs, 
rAttrs->GetPool()->GetWhichIDFromSlotID(SID_ATTR_SYMBOLSIZE) );
         m_bNewSize  = pSOld ? *static_cast<const SvxSizeItem *>(pSOld) != 
aSItem : m_bNewSize ;
         if(m_bNewSize)
         {
@@ -632,8 +632,8 @@ bool SvxLineTabPage::FillItemSet( SfxItemSet* rAttrs )
             bModified=true;
         }
 
-        SfxInt32Item 
aTItem(rAttrs->GetPool()->GetWhich(SID_ATTR_SYMBOLTYPE),m_nSymbolType);
-        const SfxPoolItem* pTOld = GetOldItem( *rAttrs, 
rAttrs->GetPool()->GetWhich(SID_ATTR_SYMBOLTYPE) );
+        SfxInt32Item 
aTItem(rAttrs->GetPool()->GetWhichIDFromSlotID(SID_ATTR_SYMBOLTYPE),m_nSymbolType);
+        const SfxPoolItem* pTOld = GetOldItem( *rAttrs, 
rAttrs->GetPool()->GetWhichIDFromSlotID(SID_ATTR_SYMBOLTYPE) );
         bool bNewType = pTOld == nullptr || *static_cast<const 
SfxInt32Item*>(pTOld) != aTItem;
         if(bNewType && m_nSymbolType==SVX_SYMBOLTYPE_UNKNOWN)
             bNewType=false; // a small fix, type wasn't set -> don't create a 
type item after all!
@@ -645,8 +645,8 @@ bool SvxLineTabPage::FillItemSet( SfxItemSet* rAttrs )
 
         if(m_nSymbolType!=SVX_SYMBOLTYPE_NONE)
         {
-            SvxBrushItem 
aBItem(m_aSymbolGraphic,GPOS_MM,rAttrs->GetPool()->GetWhich(SID_ATTR_BRUSH));
-            const SfxPoolItem* pBOld = GetOldItem( *rAttrs, 
rAttrs->GetPool()->GetWhich(SID_ATTR_BRUSH) );
+            SvxBrushItem 
aBItem(m_aSymbolGraphic,GPOS_MM,rAttrs->GetPool()->GetWhichIDFromSlotID(SID_ATTR_BRUSH));
+            const SfxPoolItem* pBOld = GetOldItem( *rAttrs, 
rAttrs->GetPool()->GetWhichIDFromSlotID(SID_ATTR_BRUSH) );
             bool bNewBrush =
                 pBOld == nullptr || *static_cast<const SvxBrushItem*>(pBOld) 
!= aBItem;
             if(bNewBrush)
@@ -794,7 +794,7 @@ void SvxLineTabPage::Reset( const SfxItemSet* rAttrs )
     bool bEnable=true;
     bool bIgnoreGraphic=false;
     bool bIgnoreSize=false;
-    if(const SfxInt32Item* pSymbolTypeItem = 
rAttrs->GetItemIfSet(rAttrs->GetPool()->GetWhich(SID_ATTR_SYMBOLTYPE)))
+    if(const SfxInt32Item* pSymbolTypeItem = 
rAttrs->GetItemIfSet(rAttrs->GetPool()->GetWhichIDFromSlotID(SID_ATTR_SYMBOLTYPE)))
     {
         nSymType = pSymbolTypeItem->GetValue();
     }
@@ -880,7 +880,7 @@ void SvxLineTabPage::Reset( const SfxItemSet* rAttrs )
         }
         }
     }
-    if(const SvxBrushItem* pBrushItem = 
rAttrs->GetItemIfSet(rAttrs->GetPool()->GetWhich(SID_ATTR_BRUSH)))
+    if(const SvxBrushItem* pBrushItem = 
rAttrs->GetItemIfSet(rAttrs->GetPool()->GetWhichIDFromSlotID(SID_ATTR_BRUSH)))
     {
         const Graphic* pGraphic = pBrushItem->GetGraphic();
         if( pGraphic )
@@ -899,7 +899,7 @@ void SvxLineTabPage::Reset( const SfxItemSet* rAttrs )
         }
     }
 
-    if(const SvxSizeItem* pSymbolSizeItem = 
rAttrs->GetItemIfSet(rAttrs->GetPool()->GetWhich(SID_ATTR_SYMBOLSIZE)))
+    if(const SvxSizeItem* pSymbolSizeItem = 
rAttrs->GetItemIfSet(rAttrs->GetPool()->GetWhichIDFromSlotID(SID_ATTR_SYMBOLSIZE)))
     {
         m_aSymbolSize = pSymbolSizeItem->GetSize();
     }
diff --git a/editeng/source/editeng/editdoc.cxx 
b/editeng/source/editeng/editdoc.cxx
index bf9fca26f36c..e482eea38652 100644
--- a/editeng/source/editeng/editdoc.cxx
+++ b/editeng/source/editeng/editdoc.cxx
@@ -639,7 +639,7 @@ void ConvertAndPutItems( SfxItemSet& rDest, const 
SfxItemSet& rSource, const Map
         sal_uInt16 nSlot = pDestPool->GetTrueSlotId( nWhich );
         if ( nSlot )
         {
-            sal_uInt16 nW = pSourcePool->GetTrueWhich( nSlot );
+            sal_uInt16 nW = pSourcePool->GetTrueWhichIDFromSlotID( nSlot );
             if ( nW )
                 nSourceWhich = nW;
         }
diff --git a/editeng/source/editeng/edtspell.cxx 
b/editeng/source/editeng/edtspell.cxx
index c9fdc2bfde3b..514e70f93025 100644
--- a/editeng/source/editeng/edtspell.cxx
+++ b/editeng/source/editeng/edtspell.cxx
@@ -569,7 +569,7 @@ void EdtAutoCorrDoc::SetAttr(sal_Int32 nStt, sal_Int32 nEnd,
         pPool = pPool->GetSecondaryPool();
 
     }
-    sal_uInt16 nWhich = pPool->GetWhich( nSlotId );
+    sal_uInt16 nWhich = pPool->GetWhichIDFromSlotID( nSlotId );
     if ( nWhich )
     {
         rItem.SetWhich( nWhich );
diff --git a/editeng/source/items/textitem.cxx 
b/editeng/source/items/textitem.cxx
index 758208f7db81..b4fa77d59d6f 100644
--- a/editeng/source/items/textitem.cxx
+++ b/editeng/source/items/textitem.cxx
@@ -2878,9 +2878,9 @@ void SvxScriptSetItem::GetWhichIds( sal_uInt16 nSlotId, 
const SfxItemSet& rSet,
 {
     const SfxItemPool& rPool = *rSet.GetPool();
     GetSlotIds( nSlotId, rLatin, rAsian, rComplex );
-    rLatin = rPool.GetWhich( rLatin );
-    rAsian = rPool.GetWhich( rAsian );
-    rComplex = rPool.GetWhich( rComplex );
+    rLatin = rPool.GetWhichIDFromSlotID( rLatin );
+    rAsian = rPool.GetWhichIDFromSlotID( rAsian );
+    rComplex = rPool.GetWhichIDFromSlotID( rComplex );
 }
 
 void SvxScriptSetItem::GetWhichIds( sal_uInt16& rLatin, sal_uInt16& rAsian,
diff --git a/editeng/source/rtf/svxrtf.cxx b/editeng/source/rtf/svxrtf.cxx
index 24bbf69da88c..f24b61b0b4f6 100644
--- a/editeng/source/rtf/svxrtf.cxx
+++ b/editeng/source/rtf/svxrtf.cxx
@@ -917,7 +917,7 @@ void SvxRTFParser::BuildWhichTable()
          };
     for (sal_uInt16 nWid : WIDS1)
     {
-        sal_uInt16 nTrueWid = pAttrPool->GetTrueWhich(nWid, false);
+        sal_uInt16 nTrueWid = pAttrPool->GetTrueWhichIDFromSlotID(nWid, false);
         aPardMap.data[nWid] = nTrueWid;
         if (nTrueWid == 0)
             continue;
@@ -942,7 +942,7 @@ void SvxRTFParser::BuildWhichTable()
          };
     for (sal_uInt16 nWid : WIDS)
     {
-        sal_uInt16 nTrueWid = pAttrPool->GetTrueWhich(nWid, false);
+        sal_uInt16 nTrueWid = pAttrPool->GetTrueWhichIDFromSlotID(nWid, false);
         aPlainMap.data[nWid] = nTrueWid;
         if (nTrueWid == 0)
             continue;
diff --git a/forms/source/richtext/parametrizedattributedispatcher.cxx 
b/forms/source/richtext/parametrizedattributedispatcher.cxx
index d6666e2b0262..aa61bcfd5b1d 100644
--- a/forms/source/richtext/parametrizedattributedispatcher.cxx
+++ b/forms/source/richtext/parametrizedattributedispatcher.cxx
@@ -102,7 +102,7 @@ namespace frm
         if ( aParameterSet.Count() )
         {
             OSL_ENSURE( aParameterSet.Count() == 1, 
"OParametrizedAttributeDispatcher::convertDispatchArgsToItem: Arguments which 
form more than 1 item? How this?" );
-            WhichId nAttributeWhich = aParameterSet.GetPool()->GetWhich( 
nSlotId );
+            WhichId nAttributeWhich = 
aParameterSet.GetPool()->GetWhichIDFromSlotID( nSlotId );
             pArgument = aParameterSet.GetItem( nAttributeWhich );
             OSL_ENSURE( pArgument, 
"OParametrizedAttributeDispatcher::convertDispatchArgsToItem: suspicious: there 
were arguments, but they're not for my slot!" );
         }
diff --git a/forms/source/richtext/richtextcontrol.cxx 
b/forms/source/richtext/richtextcontrol.cxx
index b481b6bfc981..9e927f5b65e5 100644
--- a/forms/source/richtext/richtextcontrol.cxx
+++ b/forms/source/richtext/richtextcontrol.cxx
@@ -477,7 +477,7 @@ namespace frm
         default:
         {
             const SfxItemPool& rPool = 
*pRichTextControl->getView().GetEmptyItemSet().GetPool();
-            bool bSupportedSlot = rPool.IsInRange( rPool.GetWhich( _nSlotId ) 
);
+            bool bSupportedSlot = rPool.IsInRange( rPool.GetWhichIDFromSlotID( 
_nSlotId ) );
 
             if ( !bSupportedSlot )
                 bSupportedSlot = RichTextControl::isMappableSlot( _nSlotId );
diff --git a/forms/source/richtext/richtextimplcontrol.cxx 
b/forms/source/richtext/richtextimplcontrol.cxx
index 790a3f88b22a..eeb9fba98d33 100644
--- a/forms/source/richtext/richtextimplcontrol.cxx
+++ b/forms/source/richtext/richtextimplcontrol.cxx
@@ -217,7 +217,7 @@ namespace frm
         _rScriptSetItem.GetItemSet().Put( m_pView->GetAttribs(), false );
         const SfxPoolItem* pNormalizedItem = _rScriptSetItem.GetItemOfScript( 
getSelectedScriptType() );
 
-        WhichId nNormalizedWhichId = 
_rScriptSetItem.GetItemSet().GetPool()->GetWhich( _rScriptSetItem.Which() );
+        WhichId nNormalizedWhichId = 
_rScriptSetItem.GetItemSet().GetPool()->GetWhichIDFromSlotID( 
_rScriptSetItem.Which() );
         if ( pNormalizedItem )
         {
             _rScriptSetItem.GetItemSet().Put( 
pNormalizedItem->CloneSetWhich(nNormalizedWhichId) );
diff --git a/forms/source/richtext/rtattributehandler.cxx 
b/forms/source/richtext/rtattributehandler.cxx
index 19ae60dc892b..0075bd914119 100644
--- a/forms/source/richtext/rtattributehandler.cxx
+++ b/forms/source/richtext/rtattributehandler.cxx
@@ -108,7 +108,7 @@ namespace frm
             case SID_ATTR_CHAR_LATIN_WEIGHT:    nWhich = EE_CHAR_WEIGHT;    
break;
 
             default:
-                nWhich = _rPool.GetWhich( 
static_cast<SfxSlotId>(_nAttributeId) );
+                nWhich = _rPool.GetWhichIDFromSlotID( 
static_cast<SfxSlotId>(_nAttributeId) );
             }
             return nWhich;
         }
diff --git a/include/sfx2/tabdlg.hxx b/include/sfx2/tabdlg.hxx
index 1b2bbadd999f..6a207a573027 100644
--- a/include/sfx2/tabdlg.hxx
+++ b/include/sfx2/tabdlg.hxx
@@ -201,7 +201,7 @@ protected:
 
     sal_uInt16          GetWhich( sal_uInt16 nSlot, bool bDeep = true ) const
     {
-        return mpSet->GetPool()->GetWhich(nSlot, bDeep);
+        return mpSet->GetPool()->GetWhichIDFromSlotID(nSlot, bDeep);
     }
     template<class T>
     TypedWhichId<T> GetWhich( TypedWhichId<T> nSlot, bool bDeep = true ) const
diff --git a/include/svl/itempool.hxx b/include/svl/itempool.hxx
index 066cbedae7a8..5e30e83780c1 100644
--- a/include/svl/itempool.hxx
+++ b/include/svl/itempool.hxx
@@ -319,35 +319,39 @@ public:
     bool NeedsSurrogateSupport(sal_uInt16 nWhich) const
         { return CheckItemInfoFlag(nWhich, 
SFX_ITEMINFOFLAG_SUPPORT_SURROGATE); }
 
-    sal_uInt16                      GetWhich( sal_uInt16 nSlot, bool bDeep = 
true ) const;
-    template<class T>
-    TypedWhichId<T>                 GetWhich( TypedWhichId<T> nSlot, bool 
bDeep = true ) const
-    { return TypedWhichId<T>(GetWhich(sal_uInt16(nSlot), bDeep)); }
+    // tries to translate back from SlotID to WhichID. That may be
+    // expensive, it needs to linearly iterate over SfxItemInfo
+    // to evtl. find if a SlotID is defined for a WhichID
+    // If none is defined, return nSlot.
+    // If nSlot is not a SlotID, return nSlot.
+    sal_uInt16 GetWhichIDFromSlotID(sal_uInt16 nSlot, bool bDeep = true) const;
+    template<class T> TypedWhichId<T> GetWhichIDFromSlotID(TypedWhichId<T> 
nSlot, bool bDeep = true) const
+     { return TypedWhichId<T>(GetWhichIDFromSlotID(sal_uInt16(nSlot), bDeep)); 
}
 
     // get SlotID that may be registered in the SfxItemInfo for
     // the given WhichID.
     // If none is defined, return nWhich.
     // If nWhich is not a WhichID, return nWhich.
-    sal_uInt16                      GetSlotId( sal_uInt16 nWhich ) const;
+    sal_uInt16 GetSlotId( sal_uInt16 nWhich ) const;
 
-    // tries to translate back from SlotID to WhichID. That may be
-    // expensive, it needs to linearly iterate over SfxItemInfo
-    // to evtl. find if a SlotID is defined for a WhichID
-    sal_uInt16                      GetTrueWhich( sal_uInt16 nSlot, bool bDeep 
= true ) const;
+    // same as GetWhichIDFromSlotID, but returns 0 in error cases, so:
+    // If none is defined, return 0.
+    // If nSlot is not a SlotID, return 0.
+    sal_uInt16 GetTrueWhichIDFromSlotID( sal_uInt16 nSlot, bool bDeep = true ) 
const;
 
     // same as GetSlotId, but returns 0 in error cases, so:
     // If none is defined, return 0.
     // If nWhich is not a WhichID, return 0.
-    sal_uInt16                      GetTrueSlotId( sal_uInt16 nWhich ) const;
+    sal_uInt16 GetTrueSlotId( sal_uInt16 nWhich ) const;
 
     static bool IsWhich(sal_uInt16 nId) { return nId && nId <= SFX_WHICH_MAX; }
     static bool IsSlot(sal_uInt16 nId) { return nId && nId > SFX_WHICH_MAX; }
 
 private:
-    const SfxItemPool&              operator=(const SfxItemPool &) = delete;
+    const SfxItemPool& operator=(const SfxItemPool &) = delete;
 
      //IDs below or equal are Which IDs, IDs above slot IDs
-    static const sal_uInt16         SFX_WHICH_MAX = 4999;
+    static const sal_uInt16 SFX_WHICH_MAX = 4999;
 };
 
 // only the pool may manipulate the reference counts
diff --git a/sc/source/ui/app/scmod.cxx b/sc/source/ui/app/scmod.cxx
index e6f735aa11b7..0e44963b5b04 100644
--- a/sc/source/ui/app/scmod.cxx
+++ b/sc/source/ui/app/scmod.cxx
@@ -475,7 +475,7 @@ void ScModule::Execute( SfxRequest& rReq )
         case SID_ATTR_CHAR_CTL_LANGUAGE:
             {
                 const SfxPoolItem* pItem;
-                if ( pReqArgs && SfxItemState::SET == pReqArgs->GetItemState( 
GetPool().GetWhich(nSlot), true, &pItem ) )
+                if ( pReqArgs && SfxItemState::SET == pReqArgs->GetItemState( 
GetPool().GetWhichIDFromSlotID(nSlot), true, &pItem ) )
                 {
                     ScDocShell* pDocSh = dynamic_cast<ScDocShell*>( 
SfxObjectShell::Current() );
                     if ( pDocSh )
diff --git a/sc/source/ui/dbgui/PivotLayoutDialog.cxx 
b/sc/source/ui/dbgui/PivotLayoutDialog.cxx
index 51b0eda00b2f..cd84cf8b248c 100644
--- a/sc/source/ui/dbgui/PivotLayoutDialog.cxx
+++ b/sc/source/ui/dbgui/PivotLayoutDialog.cxx
@@ -477,7 +477,7 @@ void ScPivotLayoutDialog::ApplyChanges()
     SetDispatcherLock(false);
     SwitchToDocument();
 
-    sal_uInt16 nWhichPivot = SC_MOD()->GetPool().GetWhich(SID_PIVOT_TABLE);
+    sal_uInt16 nWhichPivot = 
SC_MOD()->GetPool().GetWhichIDFromSlotID(SID_PIVOT_TABLE);
     ScPivotItem aPivotItem(nWhichPivot, &aSaveData, &aDestinationRange, 
bToNewSheet);
     
mpViewData->GetViewShell()->SetDialogDPObject(std::make_unique<ScDPObject>(maPivotTableObject));
 
diff --git a/sc/source/ui/dbgui/consdlg.cxx b/sc/source/ui/dbgui/consdlg.cxx
index d0921f3eb96e..de1910cb4396 100644
--- a/sc/source/ui/dbgui/consdlg.cxx
+++ b/sc/source/ui/dbgui/consdlg.cxx
@@ -71,14 +71,14 @@ ScConsolidateDlg::ScConsolidateDlg(SfxBindings* pB, 
SfxChildWindow* pCW, weld::W
     , aStrUndefined   ( ScResId( SCSTR_UNDEFINED ) )
     , theConsData     ( static_cast<const ScConsolidateItem&>(
                          rArgSet.Get( rArgSet.GetPool()->
-                                          GetWhich( SID_CONSOLIDATE ) )
+                                          GetWhichIDFromSlotID( 
SID_CONSOLIDATE ) )
                                     ).GetData() )
     , rViewData       ( static_cast<ScTabViewShell*>(SfxViewShell::Current())->
                               GetViewData() )
     , rDoc            ( static_cast<ScTabViewShell*>(SfxViewShell::Current())->
                               GetViewData().GetDocument() )
     , nAreaDataCount  ( 0 )
-    , nWhichCons      ( rArgSet.GetPool()->GetWhich( SID_CONSOLIDATE ) )
+    , nWhichCons      ( rArgSet.GetPool()->GetWhichIDFromSlotID( 
SID_CONSOLIDATE ) )
     , bDlgLostFocus   ( false )
     , m_xLbFunc(m_xBuilder->weld_combo_box("func"))
     , m_xLbConsAreas(m_xBuilder->weld_tree_view("consareas"))
diff --git a/sc/source/ui/dbgui/filtdlg.cxx b/sc/source/ui/dbgui/filtdlg.cxx
index ca9a59ec566f..73dd94696a17 100644
--- a/sc/source/ui/dbgui/filtdlg.cxx
+++ b/sc/source/ui/dbgui/filtdlg.cxx
@@ -61,7 +61,7 @@ ScFilterDlg::ScFilterDlg(SfxBindings* pB, SfxChildWindow* 
pCW, weld::Window* pPa
     , aStrColumn(ScResId(SCSTR_COLUMN_LETTER))
     , aStrFontColor(ScResId(SCSTR_FILTER_FONT_COLOR_COND))
     , aStrBackgroundColor(ScResId(SCSTR_FILTER_BACKGROUND_COLOR_COND))
-    , nWhichQuery(rArgSet.GetPool()->GetWhich(SID_QUERY))
+    , nWhichQuery(rArgSet.GetPool()->GetWhichIDFromSlotID(SID_QUERY))
     , theQueryData(static_cast<const 
ScQueryItem&>(rArgSet.Get(nWhichQuery)).GetQueryData())
     , pViewData(nullptr)
     , pDoc(nullptr)
diff --git a/sc/source/ui/dbgui/pfiltdlg.cxx b/sc/source/ui/dbgui/pfiltdlg.cxx
index e87d676b595c..544db7640a5b 100644
--- a/sc/source/ui/dbgui/pfiltdlg.cxx
+++ b/sc/source/ui/dbgui/pfiltdlg.cxx
@@ -43,7 +43,7 @@ ScPivotFilterDlg::ScPivotFilterDlg(weld::Window* pParent, 
const SfxItemSet& rArg
     , aStrEmpty(ScResId(SCSTR_FILTER_EMPTY))
     , aStrNotEmpty(ScResId(SCSTR_FILTER_NOTEMPTY))
     , aStrColumn(ScResId(SCSTR_COLUMN_LETTER))
-    , nWhichQuery(rArgSet.GetPool()->GetWhich(SID_QUERY))
+    , nWhichQuery(rArgSet.GetPool()->GetWhichIDFromSlotID(SID_QUERY))
     , theQueryData(static_cast<const 
ScQueryItem&>(rArgSet.Get(nWhichQuery)).GetQueryData())
     , pViewData(nullptr)
     , pDoc(nullptr)
diff --git a/sc/source/ui/dbgui/sfiltdlg.cxx b/sc/source/ui/dbgui/sfiltdlg.cxx
index 3aeb3192372e..f30efbe89f19 100644
--- a/sc/source/ui/dbgui/sfiltdlg.cxx
+++ b/sc/source/ui/dbgui/sfiltdlg.cxx
@@ -55,7 +55,7 @@ ScSpecialFilterDlg::ScSpecialFilterDlg( SfxBindings* pB, 
SfxChildWindow* pCW, we
 
     : ScAnyRefDlgController(pB, pCW, pParent, 
"modules/scalc/ui/advancedfilterdialog.ui", "AdvancedFilterDialog")
     , aStrUndefined   ( ScResId(SCSTR_UNDEFINED) )
-    , nWhichQuery     ( rArgSet.GetPool()->GetWhich( SID_QUERY ) )
+    , nWhichQuery     ( rArgSet.GetPool()->GetWhichIDFromSlotID( SID_QUERY ) )
     , theQueryData    ( static_cast<const ScQueryItem&>(
                            rArgSet.Get( nWhichQuery )).GetQueryData() )
     , pViewData(nullptr)
diff --git a/sc/source/ui/dbgui/tpsort.cxx b/sc/source/ui/dbgui/tpsort.cxx
index 49390a404f35..a6050ecf8b3f 100644
--- a/sc/source/ui/dbgui/tpsort.cxx
+++ b/sc/source/ui/dbgui/tpsort.cxx
@@ -79,7 +79,7 @@ ScTabPageSortFields::ScTabPageSortFields(weld::Container* 
pPage, weld::DialogCon
         aStrRowLabel    ( ScResId( SCSTR_ROW_LABEL ) ),
         aStrColLabel    ( ScResId( SCSTR_COL_LABEL ) ),
 
-        nWhichSort      ( rArgSet.GetPool()->GetWhich( SID_SORT ) ),
+        nWhichSort      ( rArgSet.GetPool()->GetWhichIDFromSlotID( SID_SORT ) 
),
         pViewData       ( nullptr ),
         aSortData       ( rArgSet.Get( nWhichSort ).GetSortData() ),
         nFieldCount     ( 0 ),
@@ -496,7 +496,7 @@ ScTabPageSortOptions::ScTabPageSortOptions(weld::Container* 
pPage, weld::DialogC
     , aStrCommentsColLabel(ScResId(SCSTR_NOTES_COL_LABEL))
     , aStrImgRowLabel(ScResId(SCSTR_IMAGES_ROW_LABEL))
     , aStrImgColLabel(ScResId(SCSTR_IMAGES_COL_LABEL))
-    , nWhichSort(rArgSet.GetPool()->GetWhich(SID_SORT))
+    , nWhichSort(rArgSet.GetPool()->GetWhichIDFromSlotID(SID_SORT))
     , aSortData(rArgSet.Get(nWhichSort).GetSortData())
     , pViewData(nullptr)
     , pDoc(nullptr)
diff --git a/sc/source/ui/dbgui/tpsubt.cxx b/sc/source/ui/dbgui/tpsubt.cxx
index b7e5b9bc4a3f..dd8fabc534e7 100644
--- a/sc/source/ui/dbgui/tpsubt.cxx
+++ b/sc/source/ui/dbgui/tpsubt.cxx
@@ -44,7 +44,7 @@ ScTpSubTotalGroup::ScTpSubTotalGroup(weld::Container* pPage, 
weld::DialogControl
     , aStrColumn(ScResId(SCSTR_COLUMN_LETTER))
     , pViewData(nullptr)
     , pDoc(nullptr)
-    , nWhichSubTotals(rArgSet.GetPool()->GetWhich(SID_SUBTOTALS))
+    , nWhichSubTotals(rArgSet.GetPool()->GetWhichIDFromSlotID(SID_SUBTOTALS))
     , rSubTotalData(rArgSet.Get(nWhichSubTotals).GetSubTotalData())
     , nFieldCount(0)
     , mxLbGroup(m_xBuilder->weld_combo_box("group_by"))
@@ -442,7 +442,7 @@ ScTpSubTotalOptions::ScTpSubTotalOptions(weld::Container* 
pPage, weld::DialogCon
                               &rArgSet ),
             pViewData       ( nullptr ),
             pDoc            ( nullptr ),
-            nWhichSubTotals ( rArgSet.GetPool()->GetWhich( SID_SUBTOTALS ) ),
+            nWhichSubTotals ( rArgSet.GetPool()->GetWhichIDFromSlotID( 
SID_SUBTOTALS ) ),
             rSubTotalData   ( rArgSet.Get( nWhichSubTotals ).GetSubTotalData() 
)
     , m_xBtnPagebreak(m_xBuilder->weld_check_button("pagebreak"))
     , m_xBtnCase(m_xBuilder->weld_check_button("case"))
diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx
index 30dc4eb57014..00477ab1107d 100644
--- a/sc/source/ui/docshell/docsh4.cxx
+++ b/sc/source/ui/docshell/docsh4.cxx
@@ -1188,11 +1188,11 @@ void ScDocShell::Execute( SfxRequest& rReq )
                             if (aLangText == "LANGUAGE_NONE")
                             {
                                 pNewSet->Put(SvxLanguageItem(LANGUAGE_NONE,
-                                                             
pItemPool->GetWhich(SID_ATTR_CHAR_LANGUAGE)));
+                                                             
pItemPool->GetWhichIDFromSlotID(SID_ATTR_CHAR_LANGUAGE)));
                                 pNewSet->Put(SvxLanguageItem(LANGUAGE_NONE,
-                                                             
pItemPool->GetWhich(SID_ATTR_CHAR_CJK_LANGUAGE)));
+                                                             
pItemPool->GetWhichIDFromSlotID(SID_ATTR_CHAR_CJK_LANGUAGE)));
                                 pNewSet->Put(SvxLanguageItem(LANGUAGE_NONE,
-                                                             
pItemPool->GetWhich(SID_ATTR_CHAR_CTL_LANGUAGE)));
+                                                             
pItemPool->GetWhichIDFromSlotID(SID_ATTR_CHAR_CTL_LANGUAGE)));
                             }
                             else
                             {
@@ -1201,13 +1201,13 @@ void ScDocShell::Execute( SfxRequest& rReq )
                                     
SvtLanguageOptions::GetScriptTypeOfLanguage(nLangType);
                                 if (nScriptType == SvtScriptType::LATIN)
                                     pNewSet->Put(SvxLanguageItem(nLangType,
-                                                                 
pItemPool->GetWhich(SID_ATTR_CHAR_LANGUAGE)));
+                                                                 
pItemPool->GetWhichIDFromSlotID(SID_ATTR_CHAR_LANGUAGE)));
                                 if (nScriptType == SvtScriptType::COMPLEX)
                                     pNewSet->Put(SvxLanguageItem(nLangType,
-                                                                 
pItemPool->GetWhich(SID_ATTR_CHAR_CTL_LANGUAGE)));
+                                                                 
pItemPool->GetWhichIDFromSlotID(SID_ATTR_CHAR_CTL_LANGUAGE)));
                                 if (nScriptType == SvtScriptType::ASIAN)
                                     pNewSet->Put(SvxLanguageItem(nLangType,
-                                                                 
pItemPool->GetWhich(SID_ATTR_CHAR_CJK_LANGUAGE)));
+                                                                 
pItemPool->GetWhichIDFromSlotID(SID_ATTR_CHAR_CJK_LANGUAGE)));
                             }
                             pViewShell->ApplyAttributes(*pNewSet, rOldSet);
                             pBindings->Invalidate(SID_LANGUAGE_STATUS);
@@ -2271,15 +2271,15 @@ void ScDocShell::GetState( SfxItemSet &rSet )
                         if (pSelAttrs)
                         {
                             const SfxItemSet& rItemSet = 
pSelAttrs->GetItemSet();
-                            nLangWhich = 
rItemSet.GetPool()->GetWhich(SID_ATTR_CHAR_LANGUAGE);
+                            nLangWhich = 
rItemSet.GetPool()->GetWhichIDFromSlotID(SID_ATTR_CHAR_LANGUAGE);
                             if (SfxItemState::SET == 
rItemSet.GetItemState(nLangWhich))
                                 eLatin = static_cast<const 
SvxLanguageItem&>(rItemSet.Get(nLangWhich)).GetLanguage();
 
-                            nLangWhich = 
rItemSet.GetPool()->GetWhich(SID_ATTR_CHAR_CJK_LANGUAGE);
+                            nLangWhich = 
rItemSet.GetPool()->GetWhichIDFromSlotID(SID_ATTR_CHAR_CJK_LANGUAGE);
                             if (SfxItemState::SET == 
rItemSet.GetItemState(nLangWhich))
                                 eCjk = static_cast<const 
SvxLanguageItem&>(rItemSet.Get(nLangWhich)).GetLanguage();
 
-                            nLangWhich = 
rItemSet.GetPool()->GetWhich(SID_ATTR_CHAR_CTL_LANGUAGE);
+                            nLangWhich = 
rItemSet.GetPool()->GetWhichIDFromSlotID(SID_ATTR_CHAR_CTL_LANGUAGE);
                             if (SfxItemState::SET == 
rItemSet.GetItemState(nLangWhich))
                                 eCtl = static_cast<const 
SvxLanguageItem&>(rItemSet.Get(nLangWhich)).GetLanguage();
 
diff --git a/sc/source/ui/drawfunc/drawsh.cxx b/sc/source/ui/drawfunc/drawsh.cxx
index 33be79c566d9..c520f8cb931d 100644
--- a/sc/source/ui/drawfunc/drawsh.cxx
+++ b/sc/source/ui/drawfunc/drawsh.cxx
@@ -418,7 +418,7 @@ void ScDrawShell::ExecDrawAttr( SfxRequest& rReq )
 
 void ScDrawShell::ExecuteMacroAssign(SdrObject* pObj, weld::Window* pWin)
 {
-    SvxMacroItem aItem ( SfxGetpApp()->GetPool().GetWhich( SID_ATTR_MACROITEM 
) );
+    SvxMacroItem aItem ( SfxGetpApp()->GetPool().GetWhichIDFromSlotID( 
SID_ATTR_MACROITEM ) );
     ScMacroInfo* pInfo = ScDrawLayer::GetMacroInfo( pObj, true );
     if ( !pInfo->GetMacro().isEmpty() )
     {
diff --git a/sc/source/ui/drawfunc/drtxtob.cxx 
b/sc/source/ui/drawfunc/drtxtob.cxx
index a36691161c1a..8daf5a7c355b 100644
--- a/sc/source/ui/drawfunc/drtxtob.cxx
+++ b/sc/source/ui/drawfunc/drtxtob.cxx
@@ -943,7 +943,7 @@ void ScDrawTextObjectBar::ExecuteAttr( SfxRequest &rReq )
 
         SfxItemPool& rPool = GetPool();
         SvxScriptSetItem aSetItem( nSlot, rPool );
-        sal_uInt16 nWhich = rPool.GetWhich( nSlot );
+        sal_uInt16 nWhich = rPool.GetWhichIDFromSlotID( nSlot );
         aSetItem.PutItemForScriptType( nScript, pArgs->Get( nWhich ) );
 
         pView->SetAttributes( aSetItem.GetItemSet() );
@@ -963,7 +963,7 @@ void ScDrawTextObjectBar::ExecuteAttr( SfxRequest &rReq )
     else if( nSlot == SID_ATTR_PARA_LINESPACE )
     {
         SvxLineSpacingItem aLineSpaceItem = static_cast<const 
SvxLineSpacingItem&>(pArgs->Get(
-                                                            
GetPool().GetWhich(nSlot)));
+                                                            
GetPool().GetWhichIDFromSlotID(nSlot)));
         SfxItemSetFixed<EE_PARA_SBL, EE_PARA_SBL> aAttr( GetPool() );
         aAttr.Put( aLineSpaceItem );
         pView->SetAttributes( aAttr );
@@ -971,7 +971,7 @@ void ScDrawTextObjectBar::ExecuteAttr( SfxRequest &rReq )
     else if( nSlot == SID_ATTR_PARA_ULSPACE )
     {
         SvxULSpaceItem aULSpaceItem = static_cast<const 
SvxULSpaceItem&>(pArgs->Get(
-                                                            
GetPool().GetWhich(nSlot)));
+                                                            
GetPool().GetWhichIDFromSlotID(nSlot)));
         SfxItemSetFixed<EE_PARA_ULSPACE, EE_PARA_ULSPACE> aAttr( GetPool() );
         aULSpaceItem.SetWhich(EE_PARA_ULSPACE);
         aAttr.Put( aULSpaceItem );
diff --git a/sc/source/ui/pagedlg/hfedtdlg.cxx 
b/sc/source/ui/pagedlg/hfedtdlg.cxx
index 6b873e8f5760..de77c9e7cb09 100644
--- a/sc/source/ui/pagedlg/hfedtdlg.cxx
+++ b/sc/source/ui/pagedlg/hfedtdlg.cxx
@@ -224,7 +224,7 @@ ScHFEditActiveDlg::ScHFEditActiveDlg(
 {
     const SvxPageItem&  rPageItem =
                 rCoreSet.Get(
-                    rCoreSet.GetPool()->GetWhich(SID_ATTR_PAGE) );
+                    rCoreSet.GetPool()->GetWhichIDFromSlotID(SID_ATTR_PAGE) );
 
     bool bRightPage = SvxPageUsage::Left != rPageItem.GetPageUsage();
 
diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx
index b54837ea763a..4892147c55f9 100644
--- a/sc/source/ui/view/cellsh1.cxx
+++ b/sc/source/ui/view/cellsh1.cxx
@@ -2830,7 +2830,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
 
                 SfxAllItemSet aSet( GetPool() );
                 aSet.Put( SfxBoolItem( FN_PARAM_1, false ) );
-                aSet.Put( SvxFontItem( aCurFont.GetFamilyType(), 
aCurFont.GetFamilyName(), aCurFont.GetStyleName(), aCurFont.GetPitch(), 
aCurFont.GetCharSet(), GetPool().GetWhich(SID_ATTR_CHAR_FONT) ) );
+                aSet.Put( SvxFontItem( aCurFont.GetFamilyType(), 
aCurFont.GetFamilyName(), aCurFont.GetStyleName(), aCurFont.GetPitch(), 
aCurFont.GetCharSet(), GetPool().GetWhichIDFromSlotID(SID_ATTR_CHAR_FONT) ) );
                 SfxViewFrame& rViewFrame = pTabViewShell->GetViewFrame();
                 auto xFrame = rViewFrame.GetFrame().GetFrameInterface();
                 VclPtr<SfxAbstractDialog> 
pDlg(pFact->CreateCharMapDialog(pTabViewShell->GetFrameWeld(), aSet, xFrame));
diff --git a/sc/source/ui/view/editsh.cxx b/sc/source/ui/view/editsh.cxx
index f9e3fededd5a..bafbb20d645d 100644
--- a/sc/source/ui/view/editsh.cxx
+++ b/sc/source/ui/view/editsh.cxx
@@ -1029,7 +1029,7 @@ void ScEditShell::ExecuteAttr(SfxRequest& rReq)
 
                     SfxItemPool& rPool = GetPool();
                     SvxScriptSetItem aSetItem( nSlot, rPool );
-                    sal_uInt16 nWhich = rPool.GetWhich( nSlot );
+                    sal_uInt16 nWhich = rPool.GetWhichIDFromSlotID( nSlot );
                     aSetItem.PutItemForScriptType( nScript, pArgs->Get( nWhich 
) );
 
                     aSet.Put( aSetItem.GetItemSet(), false );
@@ -1041,7 +1041,7 @@ void ScEditShell::ExecuteAttr(SfxRequest& rReq)
             {
                 if (pArgs)
                 {
-                    aSet.Put( pArgs->Get( pArgs->GetPool()->GetWhich( nSlot ) 
) );
+                    aSet.Put( pArgs->Get( 
pArgs->GetPool()->GetWhichIDFromSlotID( nSlot ) ) );
                     rBindings.Invalidate( nSlot );
                 }
             }
@@ -1112,7 +1112,7 @@ void ScEditShell::ExecuteAttr(SfxRequest& rReq)
                     case SID_ATTR_CHAR_UNDERLINE:
                         if ( pArgs )
                         {
-                            const SvxTextLineItem& rTextLineItem = 
static_cast< const SvxTextLineItem& >( pArgs->Get( 
pArgs->GetPool()->GetWhich(nSlot) ) );
+                            const SvxTextLineItem& rTextLineItem = 
static_cast< const SvxTextLineItem& >( pArgs->Get( 
pArgs->GetPool()->GetWhichIDFromSlotID(nSlot) ) );
                             eNew = rTextLineItem.GetLineStyle();
                         }
                         else
@@ -1190,7 +1190,7 @@ void ScEditShell::ExecuteAttr(SfxRequest& rReq)
             {
                 if(pArgs)
                 {
-                    aSet.Put ( pArgs->Get(pArgs->GetPool()->GetWhich(nSlot)));
+                    aSet.Put ( 
pArgs->Get(pArgs->GetPool()->GetWhichIDFromSlotID(nSlot)));
                     rBindings.Invalidate( nSlot );
                 }
             }
diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx
index b426fae68722..c57aa34a57ce 100644
--- a/sc/source/ui/view/formatsh.cxx
+++ b/sc/source/ui/view/formatsh.cxx
@@ -595,7 +595,7 @@ void ScFormatShell::ExecuteAlignment( SfxRequest& rReq )
             if( pSet )
             {
                 const SfxPoolItem* pItem = nullptr;
-                if( pSet->GetItemState(GetPool().GetWhich(nSlot), true, &pItem 
 ) == SfxItemState::SET )
+                if( pSet->GetItemState(GetPool().GetWhichIDFromSlotID(nSlot), 
true, &pItem  ) == SfxItemState::SET )
                 {
 
                     switch ( nSlot )
@@ -1006,7 +1006,7 @@ void ScFormatShell::ExecuteAttr( SfxRequest& rReq )
             case SID_ATTR_CHAR_PREVIEW_FONT:
             {
                 SfxItemPool& rPool = GetPool();
-                sal_uInt16 nWhich = rPool.GetWhich( nSlot );
+                sal_uInt16 nWhich = rPool.GetWhichIDFromSlotID( nSlot );
                 const SvxFontItem& rFont = static_cast<const 
SvxFontItem&>(pNewAttrs->Get( nWhich ));
                 SvxScriptSetItem aSetItem( SID_ATTR_CHAR_FONT, rPool );
                 SvtScriptType nScript = 
pTabViewShell->GetSelectionScriptType();
@@ -1035,14 +1035,14 @@ void ScFormatShell::ExecuteAttr( SfxRequest& rReq )
             case SID_ATTR_CHAR_CONTOUR:
             case SID_ATTR_CHAR_SHADOWED:
             case SID_ATTR_CHAR_RELIEF:
-                pTabViewShell->ApplyAttr( pNewAttrs->Get( 
pNewAttrs->GetPool()->GetWhich( nSlot ) ) );
+                pTabViewShell->ApplyAttr( pNewAttrs->Get( 
pNewAttrs->GetPool()->GetWhichIDFromSlotID( nSlot ) ) );
                 rBindings.Invalidate( nSlot );
                 rBindings.Update( nSlot );
                 break;
             case SID_ATTR_CHAR_COLOR:
             case SID_SCATTR_PROTECTION :
             {
-                pTabViewShell->ApplyAttr( pNewAttrs->Get( 
pNewAttrs->GetPool()->GetWhich( nSlot) ), false);
+                pTabViewShell->ApplyAttr( pNewAttrs->Get( 
pNewAttrs->GetPool()->GetWhichIDFromSlotID( nSlot) ), false);
 
                 rBindings.Invalidate( nSlot );
                 rBindings.Update( nSlot );
@@ -1060,7 +1060,7 @@ void ScFormatShell::ExecuteAttr( SfxRequest& rReq )
 
                     SfxItemPool& rPool = GetPool();
                     SvxScriptSetItem aSetItem( nSlot, rPool );
-                    sal_uInt16 nWhich = rPool.GetWhich( nSlot );
+                    sal_uInt16 nWhich = rPool.GetWhichIDFromSlotID( nSlot );
                     aSetItem.PutItemForScriptType( nScript, pNewAttrs->Get( 
nWhich ) );
 
                     pTabViewShell->ApplyUserItemSet( aSetItem.GetItemSet() );
@@ -1237,7 +1237,7 @@ void ScFormatShell::ExecuteAttr( SfxRequest& rReq )
                     SvxBrushItem        aBrushItem( 
pTabViewShell->GetSelectionPattern()->
                                                 GetItem( ATTR_BACKGROUND ) );
                     const SvxBrushItem& rNewBrushItem = static_cast<const 
SvxBrushItem&>(
-                                            pNewAttrs->Get( 
GetPool().GetWhich(nSlot) ) );
+                                            pNewAttrs->Get( 
GetPool().GetWhichIDFromSlotID(nSlot) ) );
                     aBrushItem.SetColor(rNewBrushItem.GetColor());
                     
aBrushItem.setComplexColor(rNewBrushItem.getComplexColor());
                     pTabViewShell->ApplyAttr( aBrushItem );
@@ -1462,7 +1462,7 @@ void ScFormatShell::GetAttrState( SfxItemSet& rSet )
             break;
             case SID_ATTR_BRUSH:
             {
-                rSet.Put( rBrushItem.CloneSetWhich(GetPool().GetWhich(nWhich)) 
);
+                rSet.Put( 
rBrushItem.CloneSetWhich(GetPool().GetWhichIDFromSlotID(nWhich)) );
             }
             break;
             case SID_SCATTR_CELLPROTECTION:
diff --git a/sc/source/ui/view/viewutil.cxx b/sc/source/ui/view/viewutil.cxx
index 379c7dd8d9aa..9c345e4bf969 100644
--- a/sc/source/ui/view/viewutil.cxx
+++ b/sc/source/ui/view/viewutil.cxx
@@ -322,7 +322,7 @@ void ScViewUtil::ExecuteCharMap(const SvxFontItem& rOldFont,
     SfxViewFrame& rFrame = rShell.GetViewFrame();
     SfxAllItemSet aSet( rFrame.GetObjectShell()->GetPool() );
     aSet.Put( SfxBoolItem( FN_PARAM_1, false ) );
-    aSet.Put( SvxFontItem( rOldFont.GetFamily(), rOldFont.GetFamilyName(), 
rOldFont.GetStyleName(), rOldFont.GetPitch(), rOldFont.GetCharSet(), 
aSet.GetPool()->GetWhich( SID_ATTR_CHAR_FONT ) ) );
+    aSet.Put( SvxFontItem( rOldFont.GetFamily(), rOldFont.GetFamilyName(), 
rOldFont.GetStyleName(), rOldFont.GetPitch(), rOldFont.GetCharSet(), 
aSet.GetPool()->GetWhichIDFromSlotID( SID_ATTR_CHAR_FONT ) ) );
     auto xFrame = rFrame.GetFrame().GetFrameInterface();
     VclPtr<SfxAbstractDialog> 
pDlg(pFact->CreateCharMapDialog(rShell.GetFrameWeld(), aSet, xFrame));
     pDlg->StartExecuteAsync(
diff --git a/sd/source/ui/dlg/BulletAndPositionDlg.cxx 
b/sd/source/ui/dlg/BulletAndPositionDlg.cxx
index cc628683582e..a79a8e7f47d2 100644
--- a/sd/source/ui/dlg/BulletAndPositionDlg.cxx
+++ b/sd/source/ui/dlg/BulletAndPositionDlg.cxx
@@ -160,7 +160,8 @@ 
SvxBulletAndPositionDlg::SvxBulletAndPositionDlg(weld::Window* pWindow, const Sf
         LINK(this, SvxBulletAndPositionDlg, PreviewInvalidateHdl_Impl));
     aInvalidateTimer.SetTimeout(50);
 
-    eCoreUnit = 
rSet.GetPool()->GetMetric(rSet.GetPool()->GetWhich(SID_ATTR_NUMBERING_RULE));
+    eCoreUnit
+        = 
rSet.GetPool()->GetMetric(rSet.GetPool()->GetWhichIDFromSlotID(SID_ATTR_NUMBERING_RULE));
 
     // vertical alignment = fill makes the drawingarea expand the associated 
spinedits so we have to size it here
     const sal_Int16 aHeight
@@ -318,7 +319,7 @@ void SvxBulletAndPositionDlg::Reset(const SfxItemSet* rSet)
     // in Draw the item exists as WhichId, in Writer only as SlotId
     if (!pItem)
     {
-        nNumItemId = rSet->GetPool()->GetWhich(SID_ATTR_NUMBERING_RULE);
+        nNumItemId = 
rSet->GetPool()->GetWhichIDFromSlotID(SID_ATTR_NUMBERING_RULE);
         pItem = rSet->GetItemIfSet(nNumItemId, false);
 
         if (!pItem)
diff --git a/sd/source/ui/dlg/dlgolbul.cxx b/sd/source/ui/dlg/dlgolbul.cxx
index 87b4df84945f..ac1d4f7b4099 100644
--- a/sd/source/ui/dlg/dlgolbul.cxx
+++ b/sd/source/ui/dlg/dlgolbul.cxx
@@ -151,7 +151,7 @@ const SfxItemSet* 
OutlineBulletDlg::GetBulletOutputItemSet() const
     m_xOutputSet->Put(aSet);
 
     const SfxPoolItem *pItem = nullptr;
-    if( SfxItemState::SET == 
m_xOutputSet->GetItemState(m_xOutputSet->GetPool()->GetWhich(SID_ATTR_NUMBERING_RULE),
 false, &pItem ))
+    if( SfxItemState::SET == 
m_xOutputSet->GetItemState(m_xOutputSet->GetPool()->GetWhichIDFromSlotID(SID_ATTR_NUMBERING_RULE),
 false, &pItem ))
     {
         
SdBulletMapper::MapFontsInNumRule(const_cast<SvxNumRule&>(static_cast<const 
SvxNumBulletItem*>(pItem)->GetNumRule()), *m_xOutputSet);
         // #i35937 - removed EE_PARA_BULLETSTATE setting
diff --git a/sd/source/ui/func/bulmaper.cxx b/sd/source/ui/func/bulmaper.cxx
index 956855279ee3..452203cd65a9 100644
--- a/sd/source/ui/func/bulmaper.cxx
+++ b/sd/source/ui/func/bulmaper.cxx
@@ -37,7 +37,7 @@
 
 #include <bulmaper.hxx>
 
-#define GetWhich(nSlot) rSet.GetPool()->GetWhich( nSlot )
+#define GetWhichIDFromSlotID(nSlot) rSet.GetPool()->GetWhichIDFromSlotID( 
nSlot )
 
 void SdBulletMapper::MapFontsInNumRule( SvxNumRule& aNumRule, const 
SfxItemSet& rSet )
 {
@@ -55,34 +55,34 @@ void SdBulletMapper::MapFontsInNumRule( SvxNumRule& 
aNumRule, const SfxItemSet&
             // to be implemented if module supports CJK
 
             vcl::Font aMyFont;
-            const SvxFontItem& rFItem = rSet.Get(GetWhich( SID_ATTR_CHAR_FONT 
));
+            const SvxFontItem& rFItem = rSet.Get(GetWhichIDFromSlotID( 
SID_ATTR_CHAR_FONT ));
             aMyFont.SetFamily(rFItem.GetFamily());
             aMyFont.SetFamilyName(rFItem.GetFamilyName());
             aMyFont.SetCharSet(rFItem.GetCharSet());
             aMyFont.SetPitch(rFItem.GetPitch());
 
-            const SvxFontHeightItem& rFHItem = rSet.Get(GetWhich( 
SID_ATTR_CHAR_FONTHEIGHT ));
+            const SvxFontHeightItem& rFHItem = rSet.Get(GetWhichIDFromSlotID( 
SID_ATTR_CHAR_FONTHEIGHT ));
             aMyFont.SetFontSize(Size(0, rFHItem.GetHeight()));
 
-            const SvxWeightItem& rWItem = rSet.Get(GetWhich( 
SID_ATTR_CHAR_WEIGHT ));
+            const SvxWeightItem& rWItem = rSet.Get(GetWhichIDFromSlotID( 
SID_ATTR_CHAR_WEIGHT ));
             aMyFont.SetWeight(rWItem.GetWeight());
 
-            const SvxPostureItem& rPItem = 
rSet.Get(GetWhich(SID_ATTR_CHAR_POSTURE));
+            const SvxPostureItem& rPItem = 
rSet.Get(GetWhichIDFromSlotID(SID_ATTR_CHAR_POSTURE));
             aMyFont.SetItalic(rPItem.GetPosture());
 
-            const SvxUnderlineItem& rUItem = 
rSet.Get(GetWhich(SID_ATTR_CHAR_UNDERLINE));
+            const SvxUnderlineItem& rUItem = 
rSet.Get(GetWhichIDFromSlotID(SID_ATTR_CHAR_UNDERLINE));
             aMyFont.SetUnderline(rUItem.GetLineStyle());
 
-            const SvxOverlineItem& rOItem = 
rSet.Get(GetWhich(SID_ATTR_CHAR_OVERLINE));
+            const SvxOverlineItem& rOItem = 
rSet.Get(GetWhichIDFromSlotID(SID_ATTR_CHAR_OVERLINE));
             aMyFont.SetOverline(rOItem.GetLineStyle());
 
-            const SvxCrossedOutItem& rCOItem = 
rSet.Get(GetWhich(SID_ATTR_CHAR_STRIKEOUT));
+            const SvxCrossedOutItem& rCOItem = 
rSet.Get(GetWhichIDFromSlotID(SID_ATTR_CHAR_STRIKEOUT));
             aMyFont.SetStrikeout(rCOItem.GetStrikeout());
 
-            const SvxContourItem& rCItem = 
rSet.Get(GetWhich(SID_ATTR_CHAR_CONTOUR));
+            const SvxContourItem& rCItem = 
rSet.Get(GetWhichIDFromSlotID(SID_ATTR_CHAR_CONTOUR));
             aMyFont.SetOutline(rCItem.GetValue());
 
-            const SvxShadowedItem& rSItem = 
rSet.Get(GetWhich(SID_ATTR_CHAR_SHADOWED));
+            const SvxShadowedItem& rSItem = 
rSet.Get(GetWhichIDFromSlotID(SID_ATTR_CHAR_SHADOWED));
             aMyFont.SetShadow(rSItem.GetValue());
 
             aNewLevel.SetBulletFont(&aMyFont);
diff --git a/sd/source/ui/func/fuolbull.cxx b/sd/source/ui/func/fuolbull.cxx
index 34eb212dc920..5c518d435c35 100644
--- a/sd/source/ui/func/fuolbull.cxx
+++ b/sd/source/ui/func/fuolbull.cxx
@@ -270,7 +270,7 @@ const SvxNumBulletItem* 
FuBulletAndPosition::GetNumBulletItem(SfxItemSet& aNewAt
     if(pTmpItem)
         return pTmpItem;
 
-    nNumItemId = aNewAttr.GetPool()->GetWhich(SID_ATTR_NUMBERING_RULE);
+    nNumItemId = 
aNewAttr.GetPool()->GetWhichIDFromSlotID(SID_ATTR_NUMBERING_RULE);
     pTmpItem = aNewAttr.GetItemIfSet(nNumItemId, false);
     if (pTmpItem)
         return pTmpItem;
diff --git a/sd/source/ui/func/fupage.cxx b/sd/source/ui/func/fupage.cxx
index 6d0a59ac3a42..9bfb188efe62 100644
--- a/sd/source/ui/func/fupage.cxx
+++ b/sd/source/ui/func/fupage.cxx
@@ -211,8 +211,8 @@ const SfxItemSet* FuPage::ExecuteDialog(weld::Window* 
pParent, const SfxRequest&
                   SID_ATTR_PAGE_COLOR, SID_ATTR_PAGE_FILLSTYLE
               >  aNewAttr(mpDoc->GetPool());
     // Keep it sorted
-    aNewAttr.MergeRange(mpDoc->GetPool().GetWhich(SID_ATTR_LRSPACE),
-                        mpDoc->GetPool().GetWhich(SID_ATTR_ULSPACE));
+    
aNewAttr.MergeRange(mpDoc->GetPool().GetWhichIDFromSlotID(SID_ATTR_LRSPACE),
+                        
mpDoc->GetPool().GetWhichIDFromSlotID(SID_ATTR_ULSPACE));
 
     // Retrieve additional data for dialog
 
@@ -247,10 +247,10 @@ const SfxItemSet* FuPage::ExecuteDialog(weld::Window* 
pParent, const SfxRequest&
     SvxPaperBinItem aPaperBinItem( SID_ATTR_PAGE_PAPERBIN, 
static_cast<sal_uInt8>(mpPage->GetPaperBin()) );
     aNewAttr.Put( aPaperBinItem );
 
-    SvxLRSpaceItem aLRSpaceItem( 
static_cast<sal_uInt16>(mpPage->GetLeftBorder()), 
static_cast<sal_uInt16>(mpPage->GetRightBorder()), 0, 
mpDoc->GetPool().GetWhich(SID_ATTR_LRSPACE));
+    SvxLRSpaceItem aLRSpaceItem( 
static_cast<sal_uInt16>(mpPage->GetLeftBorder()), 
static_cast<sal_uInt16>(mpPage->GetRightBorder()), 0, 
mpDoc->GetPool().GetWhichIDFromSlotID(SID_ATTR_LRSPACE));
     aNewAttr.Put( aLRSpaceItem );
 
-    SvxULSpaceItem aULSpaceItem( 
static_cast<sal_uInt16>(mpPage->GetUpperBorder()), 
static_cast<sal_uInt16>(mpPage->GetLowerBorder()), 
mpDoc->GetPool().GetWhich(SID_ATTR_ULSPACE));
+    SvxULSpaceItem aULSpaceItem( 
static_cast<sal_uInt16>(mpPage->GetUpperBorder()), 
static_cast<sal_uInt16>(mpPage->GetLowerBorder()), 
mpDoc->GetPool().GetWhichIDFromSlotID(SID_ATTR_ULSPACE));
     aNewAttr.Put( aULSpaceItem );
 
     // Application
@@ -519,7 +519,7 @@ void FuPage::ApplyItemSet( const SfxItemSet* pArgs )
             bSetPageSizeAndBorder = true;
     }
 
-    if( pArgs->GetItemState(mpDoc->GetPool().GetWhich(SID_ATTR_LRSPACE),
+    if( 
pArgs->GetItemState(mpDoc->GetPool().GetWhichIDFromSlotID(SID_ATTR_LRSPACE),
                             true, &pPoolItem) == SfxItemState::SET )
     {
         nLeft = static_cast<const SvxLRSpaceItem*>(pPoolItem)->GetLeft();
@@ -530,7 +530,7 @@ void FuPage::ApplyItemSet( const SfxItemSet* pArgs )
 
     }
 
-    if( pArgs->GetItemState(mpDoc->GetPool().GetWhich(SID_ATTR_ULSPACE),
+    if( 
pArgs->GetItemState(mpDoc->GetPool().GetWhichIDFromSlotID(SID_ATTR_ULSPACE),
                             true, &pPoolItem) == SfxItemState::SET )
     {
         nUpper = static_cast<const SvxULSpaceItem*>(pPoolItem)->GetUpper();
@@ -540,7 +540,7 @@ void FuPage::ApplyItemSet( const SfxItemSet* pArgs )
             bSetPageSizeAndBorder = true;
     }
 
-    if( pArgs->GetItemState(mpDoc->GetPool().GetWhich(SID_ATTR_PAGE_EXT1), 
true, &pPoolItem) == SfxItemState::SET )
+    if( 
pArgs->GetItemState(mpDoc->GetPool().GetWhichIDFromSlotID(SID_ATTR_PAGE_EXT1), 
true, &pPoolItem) == SfxItemState::SET )
     {
         bScaleAll = static_cast<const SfxBoolItem*>(pPoolItem)->GetValue();
     }
@@ -561,7 +561,7 @@ void FuPage::ApplyItemSet( const SfxItemSet* pArgs )
     }
 
     // Paper Bin
-    if( pArgs->GetItemState(mpDoc->GetPool().GetWhich(SID_ATTR_PAGE_PAPERBIN), 
true, &pPoolItem) == SfxItemState::SET )
+    if( 
pArgs->GetItemState(mpDoc->GetPool().GetWhichIDFromSlotID(SID_ATTR_PAGE_PAPERBIN),
 true, &pPoolItem) == SfxItemState::SET )
     {
         nPaperBin = static_cast<const SvxPaperBinItem*>(pPoolItem)->GetValue();
 
diff --git a/sd/source/ui/view/drtxtob1.cxx b/sd/source/ui/view/drtxtob1.cxx
index 5672f7279a62..b3787fe12edc 100644
--- a/sd/source/ui/view/drtxtob1.cxx
+++ b/sd/source/ui/view/drtxtob1.cxx
@@ -716,7 +716,7 @@ void TextObjectBar::Execute( SfxRequest &rReq )
 
                 SfxItemPool& rPool = mpView->GetDoc().GetPool();
                 SvxScriptSetItem aSvxScriptSetItem( nSlot, rPool );
-                aSvxScriptSetItem.PutItemForScriptType( nScriptType, 
pArgs->Get( rPool.GetWhich( nSlot ) ) );
+                aSvxScriptSetItem.PutItemForScriptType( nScriptType, 
pArgs->Get( rPool.GetWhichIDFromSlotID( nSlot ) ) );
                 aNewAttr.Put( aSvxScriptSetItem.GetItemSet() );
                 rReq.Done( aNewAttr );
                 pArgs = rReq.GetArgs();
@@ -754,7 +754,7 @@ void TextObjectBar::Execute( SfxRequest &rReq )
             }
             else if(nSlot == SID_ATTR_CHAR_KERNING)
             {
-                aNewAttr.Put(pArgs->Get(pArgs->GetPool()->GetWhich(nSlot)));
+                
aNewAttr.Put(pArgs->Get(pArgs->GetPool()->GetWhichIDFromSlotID(nSlot)));
                 rReq.Done( aNewAttr );
                 pArgs = rReq.GetArgs();
             }
diff --git a/sd/source/ui/view/drviews3.cxx b/sd/source/ui/view/drviews3.cxx
index e01f7215fd00..87f0f4e8114d 100644
--- a/sd/source/ui/view/drviews3.cxx
+++ b/sd/source/ui/view/drviews3.cxx
@@ -717,7 +717,7 @@ void  DrawViewShell::ExecRuler(SfxRequest& rReq)
             if (pArgs)
             {
                 SvxLineSpacingItem aParaLineSP = pArgs->Get(
-                    GetPool().GetWhich(SID_ATTR_PARA_LINESPACE));
+                    GetPool().GetWhichIDFromSlotID(SID_ATTR_PARA_LINESPACE));
 
                 SfxItemSetFixed<EE_PARA_SBL, EE_PARA_SBL> aEditAttr( GetPool() 
);
                 aParaLineSP.SetWhich( EE_PARA_SBL );
diff --git a/sd/source/ui/view/viewshel.cxx b/sd/source/ui/view/viewshel.cxx
index 1932dff94fee..6ea4f1062690 100644
--- a/sd/source/ui/view/viewshel.cxx
+++ b/sd/source/ui/view/viewshel.cxx
@@ -871,7 +871,7 @@ const SvxNumBulletItem* 
ViewShell::GetNumBulletItem(SfxItemSet& aNewAttr, TypedW
     if(pTmpItem)
         return pTmpItem;
 
-    nNumItemId = aNewAttr.GetPool()->GetWhich(SID_ATTR_NUMBERING_RULE);
+    nNumItemId = 
aNewAttr.GetPool()->GetWhichIDFromSlotID(SID_ATTR_NUMBERING_RULE);
     pTmpItem = aNewAttr.GetItemIfSet(nNumItemId, false);
     if(pTmpItem)
         return pTmpItem;
diff --git a/sfx2/source/appl/appuno.cxx b/sfx2/source/appl/appuno.cxx
index 386cce711c7c..1c4030bb6070 100644
--- a/sfx2/source/appl/appuno.cxx
+++ b/sfx2/source/appl/appuno.cxx
@@ -195,7 +195,7 @@ void TransformParameters( sal_uInt16 nSlotId, const 
uno::Sequence<beans::Propert
             return;
         }
 
-        sal_uInt16 nWhich = rSet.GetPool()->GetWhich(nSlotId);
+        sal_uInt16 nWhich = rSet.GetPool()->GetWhichIDFromSlotID(nSlotId);
         bool bConvertTwips = ( rSet.GetPool()->GetMetric( nWhich ) == 
MapUnit::MapTwip );
         pItem->SetWhich( nWhich );
         sal_uInt16 nSubCount = pType->nAttribs;
@@ -287,7 +287,7 @@ void TransformParameters( sal_uInt16 nSlotId, const 
uno::Sequence<beans::Propert
             return;
         }
 
-        sal_uInt16 nWhich = rSet.GetPool()->GetWhich(rArg.nSlotId);
+        sal_uInt16 nWhich = rSet.GetPool()->GetWhichIDFromSlotID(rArg.nSlotId);
         bool bConvertTwips = ( rSet.GetPool()->GetMetric( nWhich ) == 
MapUnit::MapTwip );
         pItem->SetWhich( nWhich );
         const SfxType* pType = rArg.pType;
@@ -933,7 +933,7 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& 
rSet, uno::Sequence<b
     if ( !pSlot->IsMode(SfxSlotMode::METHOD) )
     {
         // slot is a property
-        sal_uInt16 nWhich = rSet.GetPool()->GetWhich(nSlotId);
+        sal_uInt16 nWhich = rSet.GetPool()->GetWhichIDFromSlotID(nSlotId);
         if ( rSet.GetItemState( nWhich ) == SfxItemState::SET ) //???
         {
             sal_uInt16 nSubCount = pType->nAttribs;
@@ -965,7 +965,7 @@ void TransformItems( sal_uInt16 nSlotId, const SfxItemSet& 
rSet, uno::Sequence<b
             // check every formal argument of the method
             const SfxFormalArgument &rArg = bIsMediaDescriptor ? 
aFormalArgs[nArg] : pSlot->GetFormalArgument( nArg );
 
-            sal_uInt16 nWhich = rSet.GetPool()->GetWhich( rArg.nSlotId );
+            sal_uInt16 nWhich = rSet.GetPool()->GetWhichIDFromSlotID( 
rArg.nSlotId );
             if ( rSet.GetItemState( nWhich ) == SfxItemState::SET ) //???
             {
                 sal_uInt16 nSubCount = rArg.pType->nAttribs;
@@ -1131,7 +1131,7 @@ void TransformItems( sal_uInt16 nSlotId, const 
SfxItemSet& rSet, uno::Sequence<b
                     // not really set
                     continue;
 
-                if ( !pSlot->IsMode(SfxSlotMode::METHOD) && nId == 
rSet.GetPool()->GetWhich( pSlot->GetSlotId() ) )
+                if ( !pSlot->IsMode(SfxSlotMode::METHOD) && nId == 
rSet.GetPool()->GetWhichIDFromSlotID( pSlot->GetSlotId() ) )
                     continue;
 
                 bool bIsMediaDescriptor = isMediaDescriptor( nSlotId );
@@ -1140,7 +1140,7 @@ void TransformItems( sal_uInt16 nSlotId, const 
SfxItemSet& rSet, uno::Sequence<b
                 for ( nArg=0; nArg<nFormalArgs; ++nArg )
                 {
                     const SfxFormalArgument &rArg = bIsMediaDescriptor ? 
aFormalArgs[nArg] : pSlot->GetFormalArgument( nArg );
-                    sal_uInt16 nWhich = rSet.GetPool()->GetWhich( rArg.nSlotId 
);
+                    sal_uInt16 nWhich = rSet.GetPool()->GetWhichIDFromSlotID( 
rArg.nSlotId );
                     if ( nId == nWhich )
                         break;
                 }
@@ -1294,7 +1294,7 @@ void TransformItems( sal_uInt16 nSlotId, const 
SfxItemSet& rSet, uno::Sequence<b
     if ( !pSlot->IsMode(SfxSlotMode::METHOD) )
     {
         // slot is a property
-        sal_uInt16 nWhich = rSet.GetPool()->GetWhich(nSlotId);
+        sal_uInt16 nWhich = rSet.GetPool()->GetWhichIDFromSlotID(nSlotId);
         bool bConvertTwips = ( rSet.GetPool()->GetMetric( nWhich ) == 
MapUnit::MapTwip );
         const SfxPoolItem* pItem = rSet.GetItem<SfxPoolItem>(nWhich, false);
         if ( pItem ) //???
@@ -1339,7 +1339,7 @@ void TransformItems( sal_uInt16 nSlotId, const 
SfxItemSet& rSet, uno::Sequence<b
     for ( sal_uInt16 nArg=0; nArg<nFormalArgs; ++nArg )
     {
         const SfxFormalArgument &rArg = pSlot->GetFormalArgument( nArg );
-        sal_uInt16 nWhich = rSet.GetPool()->GetWhich( rArg.nSlotId );
+        sal_uInt16 nWhich = rSet.GetPool()->GetWhichIDFromSlotID( rArg.nSlotId 
);
         bool bConvertTwips = ( rSet.GetPool()->GetMetric( nWhich ) == 
MapUnit::MapTwip );
         const SfxPoolItem* pItem = rSet.GetItem<SfxPoolItem>(nWhich, false);
         if ( pItem ) //???
diff --git a/sfx2/source/control/ctrlitem.cxx b/sfx2/source/control/ctrlitem.cxx
index 82ee78cb5dde..ad36e9d9660b 100644
--- a/sfx2/source/control/ctrlitem.cxx
+++ b/sfx2/source/control/ctrlitem.cxx
@@ -326,7 +326,7 @@ MapUnit SfxControllerItem::GetCoreMetric() const
             if (SfxShell *pSh = pDispat->GetShell( pServer->GetShellLevel() ))
             {
                 SfxItemPool &rPool = pSh->GetPool();
-                sal_uInt16 nWhich = rPool.GetWhich( nId );
+                sal_uInt16 nWhich = rPool.GetWhichIDFromSlotID( nId );
 
                 // invalidate slot and its message|slot server as 'global' 
information
                 // about the validated message|slot server is not made 
available
diff --git a/sfx2/source/control/dispatch.cxx b/sfx2/source/control/dispatch.cxx
index 2fa4e52c3e27..ccb0b0802f42 100644
--- a/sfx2/source/control/dispatch.cxx
+++ b/sfx2/source/control/dispatch.cxx
@@ -760,7 +760,7 @@ static void MappedPut_Impl(SfxAllItemSet &rSet, const 
SfxPoolItem &rItem)
 {
     // Put with mapped Which-Id if needed
     if (SfxItemPool::IsSlot(rItem.Which()))
-        rSet.PutAsTargetWhich(rItem, rSet.GetPool()->GetWhich(rItem.Which()));
+        rSet.PutAsTargetWhich(rItem, 
rSet.GetPool()->GetWhichIDFromSlotID(rItem.Which()));
     else
         rSet.Put(rItem);
 }
@@ -2004,7 +2004,7 @@ SfxItemState SfxDispatcher::QueryState( sal_uInt16 nSID, 
css::uno::Any& rAny )
             {
                 sal_uInt16 nSubId( 0 );
                 SfxItemPool& rPool = pShell->GetPool();
-                sal_uInt16 nWhich = rPool.GetWhich( nSID );
+                sal_uInt16 nWhich = rPool.GetWhichIDFromSlotID( nSID );
                 if ( rPool.GetMetric( nWhich ) == MapUnit::MapTwip )
                     nSubId |= CONVERT_TWIPS;
                 aItem.getItem()->QueryValue( aState, 
static_cast<sal_uInt8>(nSubId) );
diff --git a/sfx2/source/control/msg.cxx b/sfx2/source/control/msg.cxx
index 0b484fd614af..c15c46c86f66 100644
--- a/sfx2/source/control/msg.cxx
+++ b/sfx2/source/control/msg.cxx
@@ -39,7 +39,7 @@ SfxSlotKind SfxSlot::GetKind() const
 sal_uInt16 SfxSlot::GetWhich( const SfxItemPool &rPool ) const
 {
     if ( !nMasterSlotId || nMasterSlotId == USHRT_MAX )
-        const_cast<SfxSlot*>(this) -> nMasterSlotId = rPool.GetWhich(nSlotId);
+        const_cast<SfxSlot*>(this) -> nMasterSlotId = 
rPool.GetWhichIDFromSlotID(nSlotId);
     return nMasterSlotId;
 }
 
diff --git a/sfx2/source/control/request.cxx b/sfx2/source/control/request.cxx
index 606399f208f2..f6b7645fef13 100644
--- a/sfx2/source/control/request.cxx
+++ b/sfx2/source/control/request.cxx
@@ -586,7 +586,7 @@ void SfxRequest::Done_Impl
     {
         // get the property as SfxPoolItem
         const SfxPoolItem *pItem(nullptr);
-        const sal_uInt16 nWhich(rPool.GetWhich(pImpl->pSlot->GetSlotId()));
+        const sal_uInt16 
nWhich(rPool.GetWhichIDFromSlotID(pImpl->pSlot->GetSlotId()));
         const bool bItemStateSet(nullptr != pSet);
         const SfxItemState eState(bItemStateSet ? pSet->GetItemState( nWhich, 
false, &pItem ) : SfxItemState::DEFAULT);
         SAL_WARN_IF( !bItemStateSet || SfxItemState::SET != eState, "sfx", 
"Recording property not available: "
diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx
index f138eca95af6..9ab895887033 100644
--- a/sfx2/source/control/unoctitm.cxx
+++ b/sfx2/source/control/unoctitm.cxx
@@ -493,7 +493,7 @@ void SfxDispatchController_Impl::addParametersToArgs( const 
css::util::URL& aURL
 
 MapUnit SfxDispatchController_Impl::GetCoreMetric( SfxItemPool const & rPool, 
sal_uInt16 nSlotId )
 {
-    sal_uInt16 nWhich = rPool.GetWhich( nSlotId );
+    sal_uInt16 nWhich = rPool.GetWhichIDFromSlotID( nSlotId );
     return rPool.GetMetric( nWhich );
 }
 
diff --git a/sfx2/source/dialog/tabdlg.cxx b/sfx2/source/dialog/tabdlg.cxx
index 6a79a50ee291..4e95fa9302cf 100644
--- a/sfx2/source/dialog/tabdlg.cxx
+++ b/sfx2/source/dialog/tabdlg.cxx
@@ -246,7 +246,7 @@ const SfxPoolItem* SfxTabPage::GetItem( const SfxItemSet& 
rSet, sal_uInt16 nSlot
 
 {
     const SfxItemPool* pPool = rSet.GetPool();
-    sal_uInt16 nWh = pPool->GetWhich( nSlot, bDeep );
+    sal_uInt16 nWh = pPool->GetWhichIDFromSlotID( nSlot, bDeep );
     const SfxPoolItem* pItem = nullptr;
     rSet.GetItemState( nWh, true, &pItem );
 
@@ -452,7 +452,7 @@ IMPL_LINK_NOARG(SfxTabDialogController, ResetHdl, 
weld::Button&, void)
         while (nTmp && nTmp <= nTmpEnd)
         {
             // Iterate over the Range and set the Items
-            sal_uInt16 nWh = pPool->GetWhich(nTmp);
+            sal_uInt16 nWh = pPool->GetWhichIDFromSlotID(nTmp);
             const SfxPoolItem* pItem;
             if (SfxItemState::SET == m_pSet->GetItemState(nWh, false, &pItem))
             {
@@ -506,7 +506,7 @@ IMPL_LINK_NOARG(SfxTabDialogController, BaseFmtHdl, 
weld::Button&, void)
         while ( nTmp && nTmp <= nTmpEnd ) // guard against overflow
         {
             // Iterate over the Range and set the Items
-            sal_uInt16 nWh = pPool->GetWhich(nTmp);
+            sal_uInt16 nWh = pPool->GetWhichIDFromSlotID(nTmp);
             m_xExampleSet->ClearItem(nWh);
             aTmpSet.ClearItem(nWh);
             // At the Outset of InvalidateItem,
@@ -712,8 +712,8 @@ const WhichRangesContainer & 
SfxTabDialogController::GetInputRanges(const SfxIte
 
             for (const auto & rPair : pTmpRanges)
             {
-                sal_uInt16 nWidFrom = rPool.GetWhich(rPair.first);
-                sal_uInt16 nWidTo = rPool.GetWhich(rPair.second);
+                sal_uInt16 nWidFrom = rPool.GetWhichIDFromSlotID(rPair.first);
+                sal_uInt16 nWidTo = rPool.GetWhichIDFromSlotID(rPair.second);
                 aUS.MergeRange(nWidFrom, nWidTo); // Keep it valid
             }
         }
diff --git a/svl/source/items/itempool.cxx b/svl/source/items/itempool.cxx
index 8108a72b31c4..19eb792dc85f 100644
--- a/svl/source/items/itempool.cxx
+++ b/svl/source/items/itempool.cxx
@@ -856,7 +856,7 @@ void SfxItemPool::GetItemSurrogates(ItemSurrogates& 
rTarget, sal_uInt16 nWhich)
     rTarget = ItemSurrogates(aNewSurrogates.begin(), aNewSurrogates.end());
 }
 
-sal_uInt16 SfxItemPool::GetWhich(sal_uInt16 nSlotId, bool bDeep) const
+sal_uInt16 SfxItemPool::GetWhichIDFromSlotID(sal_uInt16 nSlotId, bool bDeep) 
const
 {
     if (!IsSlot(nSlotId))
         return nSlotId;
@@ -871,7 +871,7 @@ sal_uInt16 SfxItemPool::GetWhich(sal_uInt16 nSlotId, bool 
bDeep) const
     }
 
     if (mpSecondary && bDeep)
-        return mpSecondary->GetWhich(nSlotId);
+        return mpSecondary->GetWhichIDFromSlotID(nSlotId);
 
     return nSlotId;
 }
@@ -894,7 +894,7 @@ sal_uInt16 SfxItemPool::GetSlotId(sal_uInt16 nWhich) const
 }
 
 
-sal_uInt16 SfxItemPool::GetTrueWhich( sal_uInt16 nSlotId, bool bDeep ) const
+sal_uInt16 SfxItemPool::GetTrueWhichIDFromSlotID( sal_uInt16 nSlotId, bool 
bDeep ) const
 {
     if (!IsSlot(nSlotId))
         return 0;
@@ -909,7 +909,7 @@ sal_uInt16 SfxItemPool::GetTrueWhich( sal_uInt16 nSlotId, 
bool bDeep ) const
     }
 
     if (mpSecondary && bDeep)
-        return mpSecondary->GetTrueWhich(nSlotId);
+        return mpSecondary->GetTrueWhichIDFromSlotID(nSlotId);
 
     return 0;
 }
diff --git a/svl/source/items/itemset.cxx b/svl/source/items/itemset.cxx
index 56cde0aec56c..c23a537b6227 100644
--- a/svl/source/items/itemset.cxx
+++ b/svl/source/items/itemset.cxx
@@ -1504,7 +1504,7 @@ bool SfxItemSet::Set
 const SfxPoolItem* SfxItemSet::GetItem(sal_uInt16 nId, bool bSearchInParent) 
const
 {
     // evtl. Convert from SlotID to WhichId
-    const sal_uInt16 nWhich(GetPool()->GetWhich(nId));
+    const sal_uInt16 nWhich(GetPool()->GetWhichIDFromSlotID(nId));
 
     // Is the Item set or 'bDeep == true' available?
     const SfxPoolItem *pItem(nullptr);
diff --git a/svx/source/dialog/cuicharmap.cxx b/svx/source/dialog/cuicharmap.cxx
index 430bf250fdcd..8eba24f4ace0 100644
--- a/svx/source/dialog/cuicharmap.cxx
+++ b/svx/source/dialog/cuicharmap.cxx
@@ -349,7 +349,7 @@ void SvxCharacterMap::insertCharToDoc(const OUString& 
sGlyph)
         const SfxItemPool* pPool = m_xOutputSet->GetPool();
         m_xOutputSet->Put( SfxStringItem( SID_CHARMAP, sGlyph ) );
         m_xOutputSet->Put( SvxFontItem( aFont.GetFamilyType(), 
aFont.GetFamilyName(),
-            aFont.GetStyleName(), aFont.GetPitch(), aFont.GetCharSet(), 
pPool->GetWhich(SID_ATTR_CHAR_FONT) ) );
+            aFont.GetStyleName(), aFont.GetPitch(), aFont.GetCharSet(), 
pPool->GetWhichIDFromSlotID(SID_ATTR_CHAR_FONT) ) );
         m_xOutputSet->Put( SfxStringItem( SID_FONT_NAME, aFont.GetFamilyName() 
) );
         m_xOutputSet->Put( SfxInt32Item( SID_ATTR_CHAR, cChar ) );
     }
diff --git a/svx/source/dialog/fntctrl.cxx b/svx/source/dialog/fntctrl.cxx
index 534f8129d2c2..b0723c8e65c1 100644
--- a/svx/source/dialog/fntctrl.cxx
+++ b/svx/source/dialog/fntctrl.cxx
@@ -431,7 +431,7 @@ void FontPrevWin_Impl::ScaleFontWidth(vcl::RenderContext 
const & rOutDev)
 
 static bool GetWhich (const SfxItemSet& rSet, sal_uInt16 nSlot, sal_uInt16& 
rWhich)
 {
-    rWhich = rSet.GetPool()->GetWhich(nSlot);
+    rWhich = rSet.GetPool()->GetWhichIDFromSlotID(nSlot);
     return rSet.GetItemState(rWhich) >= SfxItemState::DEFAULT;
 }
 
diff --git a/svx/source/dialog/srchdlg.cxx b/svx/source/dialog/srchdlg.cxx
index b5451643f6c8..4482774a2482 100644
--- a/svx/source/dialog/srchdlg.cxx
+++ b/svx/source/dialog/srchdlg.cxx
@@ -232,7 +232,7 @@ SfxItemSet& SearchAttrItemList::Get( SfxItemSet& rSet )
 
     for ( size_t i = 0; i < size(); ++i )
         if ( IsInvalidItem( (*this)[i].pItemPtr ) )
-            rSet.InvalidateItem( pPool->GetWhich( (*this)[i].nSlot ) );
+            rSet.InvalidateItem( pPool->GetWhichIDFromSlotID( (*this)[i].nSlot 
) );
         else
             rSet.Put( *(*this)[i].pItemPtr );
     return rSet;
@@ -1971,7 +1971,7 @@ IMPL_LINK_NOARG(SvxSearchDialog, FormatHdl_Impl, 
weld::Button&, void)
 
     aSet.MergeRange(SID_ATTR_PARA_MODEL, SID_ATTR_PARA_MODEL);
 
-    sal_uInt16 nBrushWhich = pSh->GetPool().GetWhich(SID_ATTR_BRUSH);
+    sal_uInt16 nBrushWhich = 
pSh->GetPool().GetWhichIDFromSlotID(SID_ATTR_BRUSH);
     aSet.MergeRange(nBrushWhich, nBrushWhich);
 
     aSet.MergeRange(XATTR_FILL_FIRST, XATTR_FILL_LAST);
@@ -1992,8 +1992,8 @@ IMPL_LINK_NOARG(SvxSearchDialog, FormatHdl_Impl, 
weld::Button&, void)
         pReplaceList->Get( aSet );
     }
     aSet.DisableItem(SID_ATTR_PARA_MODEL);
-    aSet.DisableItem(rPool.GetWhich(SID_ATTR_PARA_PAGEBREAK));
-    aSet.DisableItem(rPool.GetWhich(SID_ATTR_PARA_KEEP));
+    aSet.DisableItem(rPool.GetWhichIDFromSlotID(SID_ATTR_PARA_PAGEBREAK));
+    aSet.DisableItem(rPool.GetWhichIDFromSlotID(SID_ATTR_PARA_KEEP));
 
 
     SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
diff --git a/svx/source/form/fmtextcontrolshell.cxx 
b/svx/source/form/fmtextcontrolshell.cxx
index 8520e74cc41f..33915ccf936d 100644
--- a/svx/source/form/fmtextcontrolshell.cxx
+++ b/svx/source/form/fmtextcontrolshell.cxx
@@ -350,7 +350,7 @@ namespace svx
 
         void lcl_translateUnoStateToItem( SfxSlotId _nSlot, const Any& 
_rUnoState, SfxItemSet& _rSet )
         {
-            WhichId nWhich = _rSet.GetPool()->GetWhich( _nSlot );
+            WhichId nWhich = _rSet.GetPool()->GetWhichIDFromSlotID( _nSlot );
             if ( !_rUnoState.hasValue() )
             {
                 if  ( ( _nSlot != SID_CUT )
@@ -586,7 +586,7 @@ namespace svx
                 }
             }
 
-            WhichId nWhich = rPool.GetWhich( nSlotId );
+            WhichId nWhich = rPool.GetWhichIDFromSlotID( nSlotId );
             bool bIsInPool = rPool.IsInRange( nWhich );
             if ( bIsInPool )
             {
@@ -823,7 +823,7 @@ namespace svx
                 SfxItemSet aToggled( *_rReq.GetArgs() );
 
                 lcl_translateUnoStateToItem( nSlot, 
aFeaturePos->second->getFeatureState(), aToggled );
-                WhichId nWhich = aToggled.GetPool()->GetWhich( nSlot );
+                WhichId nWhich = aToggled.GetPool()->GetWhichIDFromSlotID( 
nSlot );
                 const SfxPoolItem* pItem = aToggled.GetItem( nWhich );
                 if ( ( SID_ATTR_CHAR_UNDERLINE == nSlot ) || ( 
SID_ATTR_CHAR_OVERLINE == nSlot ) )
                 {
diff --git a/svx/source/sidebar/nbdtmg.cxx b/svx/source/sidebar/nbdtmg.cxx
index 52fa87c9fe7c..b8c8bccfc19c 100644
--- a/svx/source/sidebar/nbdtmg.cxx
+++ b/svx/source/sidebar/nbdtmg.cxx
@@ -165,13 +165,13 @@ void NBOTypeMgrBase::SetItems(const SfxItemSet* pArg) {
     SfxItemState eState = pSet->GetItemState(SID_ATTR_NUMBERING_RULE, false, 
&pItem);
     if(eState == SfxItemState::SET)
     {
-        eCoreUnit = 
pSet->GetPool()->GetMetric(pSet->GetPool()->GetWhich(SID_ATTR_NUMBERING_RULE));
+        eCoreUnit = 
pSet->GetPool()->GetMetric(pSet->GetPool()->GetWhichIDFromSlotID(SID_ATTR_NUMBERING_RULE));
     } else {
         //sd use different sid for numbering rule
         eState = pSet->GetItemState(EE_PARA_NUMBULLET, false, &pItem);
         if(eState == SfxItemState::SET)
         {
-            eCoreUnit = 
pSet->GetPool()->GetMetric(pSet->GetPool()->GetWhich(EE_PARA_NUMBULLET));
+            eCoreUnit = 
pSet->GetPool()->GetMetric(pSet->GetPool()->GetWhichIDFromSlotID(EE_PARA_NUMBULLET));
         }
     }
 }
diff --git a/svx/source/sidebar/text/TextCharacterSpacingControl.cxx 
b/svx/source/sidebar/text/TextCharacterSpacingControl.cxx
index 28eb699d2d25..866f2edbeebe 100644
--- a/svx/source/sidebar/text/TextCharacterSpacingControl.cxx
+++ b/svx/source/sidebar/text/TextCharacterSpacingControl.cxx
@@ -216,7 +216,7 @@ IMPL_LINK_NOARG(TextCharacterSpacingControl, 
KerningModifyHdl, weld::MetricSpinB
 MapUnit TextCharacterSpacingControl::GetCoreMetric()
 {
     SfxItemPool &rPool = SfxGetpApp()->GetPool();
-    sal_uInt16 nWhich = rPool.GetWhich(SID_ATTR_CHAR_KERNING);
+    sal_uInt16 nWhich = rPool.GetWhichIDFromSlotID(SID_ATTR_CHAR_KERNING);
     return rPool.GetMetric(nWhich);
 }
 
diff --git a/svx/source/styles/CommonStylePreviewRenderer.cxx 
b/svx/source/styles/CommonStylePreviewRenderer.cxx
index c6c0bd1c7059..b517b4437811 100644
--- a/svx/source/styles/CommonStylePreviewRenderer.cxx
+++ b/svx/source/styles/CommonStylePreviewRenderer.cxx
@@ -62,7 +62,7 @@ CommonStylePreviewRenderer::~CommonStylePreviewRenderer()
 
 static bool GetWhich(const SfxItemSet& rSet, sal_uInt16 nSlot, sal_uInt16& 
rWhich)
 {
-    rWhich = rSet.GetPool()->GetWhich(nSlot);
+    rWhich = rSet.GetPool()->GetWhichIDFromSlotID(nSlot);
     return rSet.GetItemState(rWhich) >= SfxItemState::DEFAULT;
 }
 
diff --git a/svx/source/tbxctrls/linewidthctrl.cxx 
b/svx/source/tbxctrls/linewidthctrl.cxx
index 166f4bb451c9..a28c11cbd1c8 100644
--- a/svx/source/tbxctrls/linewidthctrl.cxx
+++ b/svx/source/tbxctrls/linewidthctrl.cxx
@@ -86,7 +86,7 @@ MapUnit SvxLineWidthToolBoxControl::GetCoreMetric()
 {
     SfxObjectShell* pSh = SfxObjectShell::Current();
     SfxItemPool& rPool = pSh ? pSh->GetPool() : SfxGetpApp()->GetPool();
-    sal_uInt16 nWhich = rPool.GetWhich(SID_ATTR_LINE_WIDTH);
+    sal_uInt16 nWhich = rPool.GetWhichIDFromSlotID(SID_ATTR_LINE_WIDTH);
     return rPool.GetMetric(nWhich);
 }
 
diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index d3f89aad706c..a07a1b752d5d 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -1300,7 +1300,7 @@ void SvxStyleBox_Base::UserDrawEntry(vcl::RenderContext& 
rRenderContext, const t
 
 static bool GetWhich(const SfxItemSet& rSet, sal_uInt16 nSlot, sal_uInt16& 
rWhich)
 {
-    rWhich = rSet.GetPool()->GetWhich(nSlot);
+    rWhich = rSet.GetPool()->GetWhichIDFromSlotID(nSlot);
     return rSet.GetItemState(rWhich) >= SfxItemState::DEFAULT;
 }
 
diff --git a/svx/source/unodraw/unopool.cxx b/svx/source/unodraw/unopool.cxx
index 82b362f991eb..c3ab804e1a5c 100644
--- a/svx/source/unodraw/unopool.cxx
+++ b/svx/source/unodraw/unopool.cxx
@@ -104,7 +104,7 @@ void SvxUnoDrawPool::getAny( SfxItemPool const * pPool, 
const comphelper::Proper
 
             // Assure, that ID is a Which-ID (it could be a Slot-ID.)
             // Thus, convert handle to Which-ID.
-            pPool->GetUserOrPoolDefaultItem( pPool->GetWhich( 
static_cast<sal_uInt16>(pEntry->mnHandle) ) ).QueryValue( rValue, nMemberId );
+            pPool->GetUserOrPoolDefaultItem( pPool->GetWhichIDFromSlotID( 
static_cast<sal_uInt16>(pEntry->mnHandle) ) ).QueryValue( rValue, nMemberId );
         }
     }
 
@@ -137,7 +137,7 @@ void SvxUnoDrawPool::putAny( SfxItemPool* pPool, const 
comphelper::PropertyMapEn
 
     // Assure, that ID is a Which-ID (it could be a Slot-ID.)
     // Thus, convert handle to Which-ID.
-    const sal_uInt16 nWhich = pPool->GetWhich( 
static_cast<sal_uInt16>(pEntry->mnHandle) );
+    const sal_uInt16 nWhich = pPool->GetWhichIDFromSlotID( 
static_cast<sal_uInt16>(pEntry->mnHandle) );
     switch( nWhich )
     {
         case OWN_ATTR_FILLBMP_MODE:
@@ -214,7 +214,7 @@ void SvxUnoDrawPool::_getPropertyStates( const 
comphelper::PropertyMapEntry** pp
         {
             //Assure, that ID is a Which-ID (it could be a Slot-ID.)
             // Thus, convert handle to Which-ID.
-            const sal_uInt16 nWhich = pPool->GetWhich( 
static_cast<sal_uInt16>((*ppEntries)->mnHandle) );
+            const sal_uInt16 nWhich = pPool->GetWhichIDFromSlotID( 
static_cast<sal_uInt16>((*ppEntries)->mnHandle) );
 
             switch( nWhich )
             {
@@ -278,7 +278,7 @@ void SvxUnoDrawPool::_setPropertyToDefault( const 
comphelper::PropertyMapEntry*
 
     // Assure, that ID is a Which-ID (it could be a Slot-ID.)
     // Thus, convert handle to Which-ID.
-    const sal_uInt16 nWhich = pPool->GetWhich( 
static_cast<sal_uInt16>(pEntry->mnHandle) );
+    const sal_uInt16 nWhich = pPool->GetWhichIDFromSlotID( 
static_cast<sal_uInt16>(pEntry->mnHandle) );
     if ( pPool && pPool != mpDefaultsPool.get() )
     {
         // use method <ResetUserDefaultItem(..)> instead of using probably 
incompatible item pool <mpDefaultsPool>.
@@ -293,7 +293,7 @@ uno::Any SvxUnoDrawPool::_getPropertyDefault( const 
comphelper::PropertyMapEntry
     // using probably incompatible item pool <mpDefaultsPool>
     uno::Any aAny;
     SfxItemPool* pPool = getModelPool( true );
-    const sal_uInt16 nWhich = pPool->GetWhich( 
static_cast<sal_uInt16>(pEntry->mnHandle) );
+    const sal_uInt16 nWhich = pPool->GetWhichIDFromSlotID( 
static_cast<sal_uInt16>(pEntry->mnHandle) );
     const SfxPoolItem *pItem = pPool->GetUserDefaultItem ( nWhich );
     if (pItem)
     {
diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx
index 120e8394f196..19974139d125 100644
--- a/sw/source/core/doc/docfmt.cxx
+++ b/sw/source/core/doc/docfmt.cxx
@@ -606,7 +606,7 @@ void SwDoc::SetDefault( const SfxItemSet& rSet )
             sal_uInt16 nSlotId = GetAttrPool().GetSlotId( nWhich );
             if( 0 != nSlotId && nSlotId != nWhich )
             {
-                sal_uInt16 nEdtWhich = pSdrPool->GetWhich( nSlotId );
+                sal_uInt16 nEdtWhich = pSdrPool->GetWhichIDFromSlotID( nSlotId 
);
                 if( 0 != nEdtWhich && nSlotId != nEdtWhich )
                 {
                     std::unique_ptr<SfxPoolItem> pCpy(pItem->Clone());
diff --git a/sw/source/core/draw/drawdoc.cxx b/sw/source/core/draw/drawdoc.cxx
index ec1ddd7ee07b..1dd757de4860 100644
--- a/sw/source/core/draw/drawdoc.cxx
+++ b/sw/source/core/draw/drawdoc.cxx
@@ -66,7 +66,7 @@ SwDrawModel::SwDrawModel(SwDoc& rDoc)
                 if( nullptr != (pItem = rDocPool.GetUserDefaultItem( nW )) &&
                     0 != (nSlotId = rDocPool.GetSlotId( nW ) ) &&
                     nSlotId != nW &&
-                    0 != (nEdtWhich = pSdrPool->GetWhich( nSlotId )) &&
+                    0 != (nEdtWhich = pSdrPool->GetWhichIDFromSlotID( nSlotId 
)) &&
                     nSlotId != nEdtWhich )
                 {
                     std::unique_ptr<SfxPoolItem> pCpy(pItem->Clone());
diff --git a/sw/source/core/edit/acorrect.cxx b/sw/source/core/edit/acorrect.cxx
index 75eaf62ee8e0..6f112291bbef 100644
--- a/sw/source/core/edit/acorrect.cxx
+++ b/sw/source/core/edit/acorrect.cxx
@@ -295,7 +295,7 @@ void SwAutoCorrDoc::SetAttr( sal_Int32 nStt, sal_Int32 
nEnd, sal_uInt16 nSlotId,
                pFrame->MapViewToModelPos(TextFrameIndex(nEnd)));
 
     SfxItemPool& rPool = m_rEditSh.GetDoc()->GetAttrPool();
-    sal_uInt16 nWhich = rPool.GetWhich( nSlotId, false );
+    sal_uInt16 nWhich = rPool.GetWhichIDFromSlotID( nSlotId, false );
     if( nWhich )
     {
         rItem.SetWhich( nWhich );
diff --git a/sw/source/filter/html/svxcss1.cxx 
b/sw/source/filter/html/svxcss1.cxx
index d75cc487dab1..d186fc295796 100644
--- a/sw/source/filter/html/svxcss1.cxx
+++ b/sw/source/filter/html/svxcss1.cxx
@@ -711,7 +711,7 @@ SvxCSS1Parser::SvxCSS1Parser( SfxItemPool& rPool, OUString 
aBaseURL,
     // also initialize item IDs
     auto initTrueWhich = [&rPool, this](sal_uInt16 rWid)
     {
-        rWid = rPool.GetTrueWhich(rWid, false);
+        rWid = rPool.GetTrueWhichIDFromSlotID(rWid, false);
         m_aWhichMap = m_aWhichMap.MergeRange(rWid, rWid);
         return rWid;
     };
diff --git a/sw/source/filter/ww8/writerhelper.cxx 
b/sw/source/filter/ww8/writerhelper.cxx
index 3336b7df9b70..73cd0eeab8ac 100644
--- a/sw/source/filter/ww8/writerhelper.cxx
+++ b/sw/source/filter/ww8/writerhelper.cxx
@@ -259,7 +259,7 @@ namespace sw
         {
             sal_uInt16 nSlotId = rSrcPool.GetSlotId(nWhich);
             if (IsValidSlotWhich(nSlotId, nWhich))
-                nWhich = rDestPool.GetWhich(nSlotId);
+                nWhich = rDestPool.GetWhichIDFromSlotID(nSlotId);
             else
                 nWhich = 0;
             return nWhich;
diff --git a/sw/source/filter/ww8/wrtw8esh.cxx 
b/sw/source/filter/ww8/wrtw8esh.cxx
index 19ac50ccf5c9..7931387e32fa 100644
--- a/sw/source/filter/ww8/wrtw8esh.cxx
+++ b/sw/source/filter/ww8/wrtw8esh.cxx
@@ -1164,7 +1164,7 @@ void MSWord_SdrAttrIter::OutAttr( sal_Int32 nSwPos )
             const sal_uInt16 nSlotId = pSrcPool->GetSlotId(nWhich);
             if (nSlotId && nWhich != nSlotId)
             {
-                nWhich = rDstPool.GetWhich(nSlotId);
+                nWhich = rDstPool.GetWhichIDFromSlotID(nSlotId);
                 if (nWhich && nWhich != nSlotId &&
                     nWhich < RES_UNKNOWNATR_BEGIN &&
                     m_rExport.CollapseScriptsforWordOk(m_nScript,nWhich))
@@ -1295,7 +1295,7 @@ void MSWord_SdrAttrIter::OutParaAttr(bool bCharAttr, 
const std::set<sal_uInt16>*
         sal_uInt16 nSlotId = pSrcPool->GetSlotId(nWhich);
 
         if ( nSlotId && nWhich != nSlotId &&
-             0 != ( nWhich = pDstPool->GetWhich( nSlotId ) ) &&
+             0 != ( nWhich = pDstPool->GetWhichIDFromSlotID( nSlotId ) ) &&
              nWhich != nSlotId &&
              ( bCharAttr ? ( nWhich >= RES_CHRATR_BEGIN && nWhich < 
RES_TXTATR_END )
                          : ( nWhich >= RES_PARATR_BEGIN && nWhich < 
RES_FRMATR_END ) ) )
diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx
index 8a9dd1197129..a7c9ec979e09 100644
--- a/sw/source/filter/ww8/ww8graf.cxx
+++ b/sw/source/filter/ww8/ww8graf.cxx
@@ -514,7 +514,7 @@ void SwWW8ImplReader::InsertTxbxStyAttrs( SfxItemSet& rS, 
sal_uInt16 nColl )
             sal_uInt16 nSlotId = m_rDoc.GetAttrPool().GetSlotId(nWhich);
             if (
                 nSlotId && nWhich != nSlotId &&
-                0 != (nWhich = pEditPool->GetWhich(nSlotId)) &&
+                0 != (nWhich = pEditPool->GetWhichIDFromSlotID(nSlotId)) &&
                 nWhich != nSlotId &&
                 ( SfxItemState::SET != rS.GetItemState(nWhich, false) )
                )
@@ -741,7 +741,7 @@ void SwWW8ImplReader::InsertAttrsAsDrawingAttrs(WW8_CP 
nStartCp, WW8_CP nEndCp,
                         }
                         else if (
                             nSlotId && nWhich != nSlotId &&
-                            0 != (nWhich = pEditPool->GetWhich(nSlotId)) &&
+                            0 != (nWhich = 
pEditPool->GetWhichIDFromSlotID(nSlotId)) &&
                             nWhich != nSlotId
                         )
                         {
diff --git a/sw/source/ui/misc/pgfnote.cxx b/sw/source/ui/misc/pgfnote.cxx
index 14eec4b21be1..0316f6251eaa 100644
--- a/sw/source/ui/misc/pgfnote.cxx
+++ b/sw/source/ui/misc/pgfnote.cxx
@@ -262,21 +262,21 @@ void SwFootNotePage::ActivatePage(const SfxItemSet& rSet)
     auto const & rSize = rSet.Get( RES_FRM_SIZE );
     m_lMaxHeight = rSize.GetHeight();
 
-    if( const SvxSetItem* pHeaderSetItem = rSet.GetItemIfSet( 
rSet.GetPool()->GetWhich( SID_ATTR_PAGE_HEADERSET), false ) )
+    if( const SvxSetItem* pHeaderSetItem = rSet.GetItemIfSet( 
rSet.GetPool()->GetWhichIDFromSlotID( SID_ATTR_PAGE_HEADERSET), false ) )
     {
         const SfxItemSet& rHeaderSet = pHeaderSetItem->GetItemSet();
         const SfxBoolItem& rHeaderOn =
-            rHeaderSet.Get( rSet.GetPool()->GetWhich( SID_ATTR_PAGE_ON ) );
+            rHeaderSet.Get( rSet.GetPool()->GetWhichIDFromSlotID( 
SID_ATTR_PAGE_ON ) );
 
         if ( rHeaderOn.GetValue() )
         {
             const SvxSizeItem& rSizeItem =
-                rHeaderSet.Get(rSet.GetPool()->GetWhich(SID_ATTR_PAGE_SIZE));
+                
rHeaderSet.Get(rSet.GetPool()->GetWhichIDFromSlotID(SID_ATTR_PAGE_SIZE));
             m_lMaxHeight -= rSizeItem.GetSize().Height();
         }
     }
 
-    if( const SvxSetItem* pFooterSetItem = rSet.GetItemIfSet( 
rSet.GetPool()->GetWhich( SID_ATTR_PAGE_FOOTERSET),
+    if( const SvxSetItem* pFooterSetItem = rSet.GetItemIfSet( 
rSet.GetPool()->GetWhichIDFromSlotID( SID_ATTR_PAGE_FOOTERSET),
             false ) )
     {
         const SfxItemSet& rFooterSet = pFooterSetItem->GetItemSet();
@@ -285,7 +285,7 @@ void SwFootNotePage::ActivatePage(const SfxItemSet& rSet)
         if ( rFooterOn.GetValue() )
         {
             const SvxSizeItem& rSizeItem =
-                rFooterSet.Get( rSet.GetPool()->GetWhich( SID_ATTR_PAGE_SIZE ) 
);
+                rFooterSet.Get( rSet.GetPool()->GetWhichIDFromSlotID( 
SID_ATTR_PAGE_SIZE ) );
             m_lMaxHeight -= rSizeItem.GetSize().Height();
         }
     }
diff --git a/sw/source/ui/misc/pggrid.cxx b/sw/source/ui/misc/pggrid.cxx
index 3eef17523c51..d50b4a93b172 100644
--- a/sw/source/ui/misc/pggrid.cxx
+++ b/sw/source/ui/misc/pggrid.cxx
@@ -285,12 +285,12 @@ void SwTextGridPage::UpdatePageSize(const SfxItemSet& 
rSet)
         {
             const SfxItemSet& rExtraSet = pItem->GetItemSet();
             const SfxBoolItem& rOn =
-                rExtraSet.Get( rSet.GetPool()->GetWhich( SID_ATTR_PAGE_ON ) );
+                rExtraSet.Get( rSet.GetPool()->GetWhichIDFromSlotID( 
SID_ATTR_PAGE_ON ) );
 
             if ( rOn.GetValue() )
             {
                 const SvxSizeItem& rSizeItem =
-                    
rExtraSet.Get(rSet.GetPool()->GetWhich(SID_ATTR_PAGE_SIZE));
+                    
rExtraSet.Get(rSet.GetPool()->GetWhichIDFromSlotID(SID_ATTR_PAGE_SIZE));
                 nDistanceUL += rSizeItem.GetSize().Height();
             }
         }
diff --git a/sw/source/uibase/app/docst.cxx b/sw/source/uibase/app/docst.cxx
index ba6c850a86d0..2b2c1b340403 100644
--- a/sw/source/uibase/app/docst.cxx
+++ b/sw/source/uibase/app/docst.cxx
@@ -645,7 +645,7 @@ IMPL_LINK_NOARG(ApplyStyle, ApplyHdl, LinkParamNone*, void)
         if( SfxStyleFamily::Page == m_nFamily && 
SvtCTLOptions::IsCTLFontEnabled() )
         {
             const SfxPoolItem *pItem = nullptr;
-e 
... etc. - the rest is truncated

Reply via email to