dbaccess/source/ui/dlg/DBSetupConnectionPages.hxx |    4 +--
 dbaccess/source/ui/dlg/DbAdminImpl.cxx            |    6 ++---
 dbaccess/source/ui/dlg/adminpages.cxx             |    2 -
 dbaccess/source/ui/dlg/adminpages.hxx             |    3 +-
 dbaccess/source/ui/dlg/dbadmin.cxx                |    2 -
 dbaccess/source/ui/dlg/detailpages.hxx            |    2 -
 dbaccess/source/ui/inc/dsitems.hxx                |   21 ++++++++++---------
 include/sfx2/sfxsids.hrc                          |    4 +--
 include/svl/typedwhich.hxx                        |    4 +--
 include/svx/svxids.hrc                            |   24 +++++++++++-----------
 sc/inc/sc.hrc                                     |    4 +--
 sc/source/ui/docshell/docsh4.cxx                  |    2 -
 sc/source/ui/view/cellsh.cxx                      |    6 ++---
 sc/source/ui/view/cellsh2.cxx                     |    6 ++---
 sc/source/ui/view/tabvwsha.cxx                    |    2 -
 sc/source/ui/view/tabvwshh.cxx                    |    2 -
 sd/inc/sdattr.hrc                                 |    7 +++---
 sd/source/ui/dlg/dlgsnap.cxx                      |    4 +--
 sd/source/ui/dlg/present.cxx                      |    2 -
 sd/source/ui/func/fusldlg.cxx                     |    2 -
 sd/source/ui/func/fusnapln.cxx                    |    4 +--
 svx/source/form/fmshell.cxx                       |    4 +--
 svx/source/form/tbxform.cxx                       |    2 -
 svx/source/svdraw/svdedtv1.cxx                    |    4 +--
 sw/source/ui/fldui/fldpage.cxx                    |    2 -
 25 files changed, 64 insertions(+), 61 deletions(-)

New commits:
commit a4d4445e698b78ec0c2eb61a685869bd1d8bfd85
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Fri May 26 12:20:08 2023 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Fri May 26 21:15:43 2023 +0200

    use more TypedWhichId
    
    Change-Id: Iaa7ce9165da835a638bcc1d633bed0a2ff2c4108
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152308
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/dbaccess/source/ui/dlg/DBSetupConnectionPages.hxx 
b/dbaccess/source/ui/dlg/DBSetupConnectionPages.hxx
index cd5d74156d4b..9f47fff7d9c9 100644
--- a/dbaccess/source/ui/dlg/DBSetupConnectionPages.hxx
+++ b/dbaccess/source/ui/dlg/DBSetupConnectionPages.hxx
@@ -143,7 +143,7 @@ namespace dbaui
         DECL_LINK(OnTestJavaClickHdl, weld::Button&, void);
 
         OUString              m_sDefaultJdbcDriverName;
-        sal_uInt16              m_nPortId;
+        TypedWhichId<SfxInt32Item> m_nPortId;
 
         std::unique_ptr<weld::Label> m_xHeaderText;
         std::unique_ptr<weld::Label> m_xFTHelpText;
@@ -238,7 +238,7 @@ namespace dbaui
         virtual void fillWindows(std::vector< 
std::unique_ptr<ISaveValueWrapper> >& _rControlList) override;
         virtual bool commitPage( ::vcl::WizardTypes::CommitPageReason _eReason 
) override;
 
-        sal_uInt16              m_nPortId;
+        TypedWhichId<SfxInt32Item> m_nPortId;
 
         std::unique_ptr<weld::Label> m_xHeaderText;
         std::unique_ptr<weld::Label> m_xFTHelpText;
diff --git a/dbaccess/source/ui/dlg/DbAdminImpl.cxx 
b/dbaccess/source/ui/dlg/DbAdminImpl.cxx
index 176eb0a9be49..0ce7a06afdb4 100644
--- a/dbaccess/source/ui/dlg/DbAdminImpl.cxx
+++ b/dbaccess/source/ui/dlg/DbAdminImpl.cxx
@@ -946,7 +946,7 @@ void 
ODbDataSourceAdministrationHelper::implTranslateProperty( SfxItemSet& _rSet
             {
                 sal_Int32 nValue = 0;
                 _rValue >>= nValue;
-                _rSet.Put( SfxInt32Item( _nId, nValue ) );
+                _rSet.Put( SfxInt32Item( TypedWhichId<SfxInt32Item>(_nId), 
nValue ) );
             }
             else {
                 SAL_WARN( "dbaccess", 
"ODbDataSourceAdministrationHelper::implTranslateProperty: invalid property 
value ("
@@ -1013,7 +1013,7 @@ void 
ODbDataSourceAdministrationHelper::convertUrl(SfxItemSet& _rDest)
     ::dbaccess::ODsnTypeCollection* pCollection = 
pTypeCollection->getCollection();
     OSL_ENSURE(pCollection, "ODbAdminDialog::getDatasourceType: invalid type 
collection!");
 
-    sal_uInt16 nPortNumberId    = 0;
+    TypedWhichId<SfxInt32Item> nPortNumberId(0);
     sal_Int32 nPortNumber   = -1;
     OUString sNewHostName;
     OUString sUrlPart;
@@ -1056,7 +1056,7 @@ void 
ODbDataSourceAdministrationHelper::convertUrl(SfxItemSet& _rDest)
     if ( !sNewHostName.isEmpty() )
         _rDest.Put(SfxStringItem(DSID_CONN_HOSTNAME, sNewHostName));
 
-    if ( nPortNumber != -1 && nPortNumberId != 0 )
+    if ( nPortNumber != -1 && nPortNumberId != TypedWhichId<SfxInt32Item>(0) )
         _rDest.Put(SfxInt32Item(nPortNumberId, nPortNumber));
 
 }
diff --git a/dbaccess/source/ui/dlg/adminpages.cxx 
b/dbaccess/source/ui/dlg/adminpages.cxx
index e3346d6b9d8a..ec837e803657 100644
--- a/dbaccess/source/ui/dlg/adminpages.cxx
+++ b/dbaccess/source/ui/dlg/adminpages.cxx
@@ -208,7 +208,7 @@ namespace dbaui
 
         _bChangedSomething = true;
     }
-    void OGenericAdministrationPage::fillInt32(SfxItemSet& _rSet, const 
weld::SpinButton* pEdit, sal_uInt16 _nID, bool& _bChangedSomething)
+    void OGenericAdministrationPage::fillInt32(SfxItemSet& _rSet, const 
weld::SpinButton* pEdit, TypedWhichId<SfxInt32Item> _nID, bool& 
_bChangedSomething)
     {
         if (pEdit && pEdit->get_value_changed_from_saved())
         {
diff --git a/dbaccess/source/ui/dlg/adminpages.hxx 
b/dbaccess/source/ui/dlg/adminpages.hxx
index 140f11bc78dd..7d13a3886e44 100644
--- a/dbaccess/source/ui/dlg/adminpages.hxx
+++ b/dbaccess/source/ui/dlg/adminpages.hxx
@@ -23,6 +23,7 @@
 #include <vcl/wizardmachine.hxx>
 #include <curledit.hxx>
 
+class SfxInt32Item;
 class SfxStringItem;
 
 namespace dbaui
@@ -205,7 +206,7 @@ namespace dbaui
             @param  _bChangedSomething
                 <TRUE/> if something changed otherwise <FALSE/>
         */
-        static void fillInt32(SfxItemSet& _rSet,const weld::SpinButton* 
pEdit,sal_uInt16 _nID, bool& _bChangedSomething);
+        static void fillInt32(SfxItemSet& _rSet,const weld::SpinButton* 
pEdit,TypedWhichId<SfxInt32Item> _nID, bool& _bChangedSomething);
 
         /** fills the String value into the item set when the value changed.
             @param  _rSet
diff --git a/dbaccess/source/ui/dlg/dbadmin.cxx 
b/dbaccess/source/ui/dlg/dbadmin.cxx
index cd741e56051b..1744f6929c35 100644
--- a/dbaccess/source/ui/dlg/dbadmin.cxx
+++ b/dbaccess/source/ui/dlg/dbadmin.cxx
@@ -403,7 +403,7 @@ void 
ODbAdminDialog::createItemSet(std::unique_ptr<SfxItemSet>& _rpSet, rtl::Ref
         {0,false},
     };
 
-    OSL_ENSURE(std::size(aItemInfos) == DSID_LAST_ITEM_ID,"Invalid Ids!");
+    OSL_ENSURE(std::size(aItemInfos) == sal_uInt16(DSID_LAST_ITEM_ID),"Invalid 
Ids!");
     _rpPool = new SfxItemPool("DSAItemPool", DSID_FIRST_ITEM_ID, 
DSID_LAST_ITEM_ID,
         aItemInfos, _rpDefaults);
     _rpPool->FreezeIdRanges();
diff --git a/dbaccess/source/ui/dlg/detailpages.hxx 
b/dbaccess/source/ui/dlg/detailpages.hxx
index 3ebfcff1ef26..aa01c12f930e 100644
--- a/dbaccess/source/ui/dlg/detailpages.hxx
+++ b/dbaccess/source/ui/dlg/detailpages.hxx
@@ -165,7 +165,7 @@ namespace dbaui
         DECL_LINK(OnTestJavaClickHdl, weld::Button&, void);
 
         OUString                   m_sDefaultJdbcDriverName;
-        sal_uInt16                 m_nPortId;
+        TypedWhichId<SfxInt32Item> m_nPortId;
         bool                       m_bUseClass;
 
         std::unique_ptr<weld::Entry> m_xEDHostname;
diff --git a/dbaccess/source/ui/inc/dsitems.hxx 
b/dbaccess/source/ui/inc/dsitems.hxx
index 1e7de22389b0..9d2d3544325c 100644
--- a/dbaccess/source/ui/inc/dsitems.hxx
+++ b/dbaccess/source/ui/inc/dsitems.hxx
@@ -24,6 +24,7 @@
 
 class OptionalBoolItem;
 class SfxBoolItem;
+class SfxInt32Item;
 class SfxStringItem;
 
 typedef sal_Int32   ItemID;
@@ -52,27 +53,27 @@ typedef sal_Int32   ItemID;
 #define DSID_TEXTFILEEXTENSION      TypedWhichId<SfxStringItem>(20) // 
extension for text files, SfxStringItem
 #define DSID_TEXTFILEHEADER         TypedWhichId<SfxBoolItem>(21) // the text 
file contains a header?, SfxBoolItem
 #define DSID_PARAMETERNAMESUBST     TypedWhichId<SfxBoolItem>(22)
-#define DSID_CONN_PORTNUMBER        23
+#define DSID_CONN_PORTNUMBER        TypedWhichId<SfxInt32Item>(23)
 #define DSID_SUPPRESSVERSIONCL      TypedWhichId<SfxBoolItem>(24) // meta 
data: sal_True if the data source described by the set is to-be-deleted
 #define DSID_CONN_SHUTSERVICE       TypedWhichId<SfxBoolItem>(25)
-#define DSID_CONN_DATAINC           26
-#define DSID_CONN_CACHESIZE         27
+#define DSID_CONN_DATAINC           TypedWhichId<SfxInt32Item>(26)
+#define DSID_CONN_CACHESIZE         TypedWhichId<SfxInt32Item>(27)
 #define DSID_CONN_CTRLUSER          TypedWhichId<SfxStringItem>(28)
 #define DSID_CONN_CTRLPWD           TypedWhichId<SfxStringItem>(29)
 #define DSID_USECATALOG             TypedWhichId<SfxBoolItem>(30) // should 
the driver use the catalog name when the database is filebased
 #define DSID_CONN_HOSTNAME          TypedWhichId<SfxStringItem>(31)
 #define DSID_CONN_LDAP_BASEDN       TypedWhichId<SfxStringItem>(32)
-#define DSID_CONN_LDAP_PORTNUMBER   33
-#define DSID_CONN_LDAP_ROWCOUNT     34
+#define DSID_CONN_LDAP_PORTNUMBER   TypedWhichId<SfxInt32Item>(33)
+#define DSID_CONN_LDAP_ROWCOUNT     TypedWhichId<SfxInt32Item>(34)
 #define DSID_SQL92CHECK             TypedWhichId<SfxBoolItem>(35)
 #define DSID_AUTOINCREMENTVALUE     TypedWhichId<SfxStringItem>(36)
 #define DSID_AUTORETRIEVEVALUE      TypedWhichId<SfxStringItem>(37)
 #define DSID_AUTORETRIEVEENABLED    TypedWhichId<SfxBoolItem>(38)
 #define DSID_APPEND_TABLE_ALIAS     TypedWhichId<SfxBoolItem>(39)
-#define DSID_MYSQL_PORTNUMBER       40
+#define DSID_MYSQL_PORTNUMBER       TypedWhichId<SfxInt32Item>(40)
 #define DSID_IGNOREDRIVER_PRIV      TypedWhichId<SfxBoolItem>(41)
-#define DSID_BOOLEANCOMPARISON      42
-#define DSID_ORACLE_PORTNUMBER      43
+#define DSID_BOOLEANCOMPARISON      TypedWhichId<SfxInt32Item>(42)
+#define DSID_ORACLE_PORTNUMBER      TypedWhichId<SfxInt32Item>(43)
 #define DSID_ENABLEOUTERJOIN        TypedWhichId<SfxBoolItem>(44)
 #define DSID_CATALOG                TypedWhichId<SfxBoolItem>(45)
 #define DSID_SCHEMA                 TypedWhichId<SfxBoolItem>(46)
@@ -88,9 +89,9 @@ typedef sal_Int32   ItemID;
 #define DSID_ESCAPE_DATETIME        TypedWhichId<SfxBoolItem>(56)
 #define DSID_NAMED_PIPE             TypedWhichId<SfxStringItem>(57)
 #define DSID_PRIMARY_KEY_SUPPORT    TypedWhichId<OptionalBoolItem>(58)
-#define DSID_MAX_ROW_SCAN           59
+#define DSID_MAX_ROW_SCAN           TypedWhichId<SfxInt32Item>(59)
 #define DSID_RESPECTRESULTSETTYPE   TypedWhichId<SfxBoolItem>(60)
-#define DSID_POSTGRES_PORTNUMBER    61
+#define DSID_POSTGRES_PORTNUMBER    TypedWhichId<SfxInt32Item>(61)
     // don't forget to adjust DSID_LAST_ITEM_ID below!
 
 // item range. Adjust this if you introduce new items above
diff --git a/include/sfx2/sfxsids.hrc b/include/sfx2/sfxsids.hrc
index 59b98b15244e..ea60a8507716 100644
--- a/include/sfx2/sfxsids.hrc
+++ b/include/sfx2/sfxsids.hrc
@@ -338,7 +338,7 @@ class SvxZoomItem;
 #define SID_POSTDATA                        
TypedWhichId<SfxUnoAnyItem>(SID_SFX_START + 1536)
 #define SID_DONELINK                        (SID_SFX_START + 646)
 #define SID_REFERER                         
TypedWhichId<SfxStringItem>(SID_SFX_START + 654)
-#define SID_PAGE_NUMBER                     (SID_SFX_START + 655)
+#define SID_PAGE_NUMBER                     
TypedWhichId<SfxInt32Item>(SID_SFX_START + 655)
 #define SID_MODIFIER                        
TypedWhichId<SfxUInt16Item>(SID_SFX_START + 669)
 #define SID_SETOPTIONS                      (SID_SFX_START + 670)
 #define SID_SOURCEVIEW                      (SID_SFX_START + 675)
@@ -387,7 +387,7 @@ class SvxZoomItem;
 
 #define SID_TEMPLATE_NAME                   
TypedWhichId<SfxStringItem>(SID_SFX_START + 660)
 #define SID_TEMPLATE_REGIONNAME             
TypedWhichId<SfxStringItem>(SID_SFX_START + 662)
-#define SID_TEMPLATE_LOAD                   (SID_SFX_START + 663)
+#define SID_TEMPLATE_LOAD                   
TypedWhichId<SfxInt32Item>(SID_SFX_START + 663)
 
 #define SID_INSERT_OBJECT                   (SID_SFX_START + 561)
 #define SID_INSERT_FLOATINGFRAME            (SID_SFX_START + 563)
diff --git a/include/svl/typedwhich.hxx b/include/svl/typedwhich.hxx
index 8cfd4f01a314..e96ad8228d5c 100644
--- a/include/svl/typedwhich.hxx
+++ b/include/svl/typedwhich.hxx
@@ -42,11 +42,11 @@ private:
 
 template <class T> constexpr bool operator==(TypedWhichId<T> const& lhs, 
TypedWhichId<T> rhs)
 {
-    return lhs == rhs;
+    return sal_uInt16(lhs) == sal_uInt16(rhs);
 }
 template <class T> constexpr bool operator!=(TypedWhichId<T> const& lhs, 
TypedWhichId<T> rhs)
 {
-    return lhs != rhs;
+    return sal_uInt16(lhs) != sal_uInt16(rhs);
 }
 template <class T> constexpr bool operator==(sal_uInt16 lhs, TypedWhichId<T> 
const& rhs)
 {
diff --git a/include/svx/svxids.hrc b/include/svx/svxids.hrc
index e7c9b250d718..8625cd425672 100644
--- a/include/svx/svxids.hrc
+++ b/include/svx/svxids.hrc
@@ -421,11 +421,11 @@ class XFillGradientItem;
 
 #define SID_ATTR_LINEEND_STYLE                          ( SID_SVX_START + 301 )
 #define SID_ATTR_TRANSFORM_SHEAR                        
TypedWhichId<SdrAngleItem>( SID_SVX_START + 304 )
-#define SID_ATTR_TRANSFORM_SHEAR_X                      ( SID_SVX_START + 305 )
-#define SID_ATTR_TRANSFORM_SHEAR_Y                      ( SID_SVX_START + 306 )
+#define SID_ATTR_TRANSFORM_SHEAR_X                      
TypedWhichId<SfxInt32Item>( SID_SVX_START + 305 )
+#define SID_ATTR_TRANSFORM_SHEAR_Y                      
TypedWhichId<SfxInt32Item>( SID_SVX_START + 306 )
 #define SID_ATTR_TRANSFORM_SHEAR_VERTICAL               
TypedWhichId<SfxBoolItem>( SID_SVX_START + 307 )
-#define SID_ATTR_TRANSFORM_RESIZE_REF_X                 ( SID_SVX_START + 308 )
-#define SID_ATTR_TRANSFORM_RESIZE_REF_Y                 ( SID_SVX_START + 309 )
+#define SID_ATTR_TRANSFORM_RESIZE_REF_X                 
TypedWhichId<SfxInt32Item>( SID_SVX_START + 308 )
+#define SID_ATTR_TRANSFORM_RESIZE_REF_Y                 
TypedWhichId<SfxInt32Item>( SID_SVX_START + 309 )
 #define SID_ATTR_TRANSFORM_AUTOWIDTH                    
TypedWhichId<SfxBoolItem>( SID_SVX_START + 310 )
 #define SID_ATTR_TRANSFORM_AUTOHEIGHT                   
TypedWhichId<SfxBoolItem>( SID_SVX_START + 311 )
 #define SID_ATTR_TRANSFORM_HORI_RELATION                
TypedWhichId<SfxInt16Item>( SID_SVX_START + 312 )
@@ -606,7 +606,7 @@ class XFillGradientItem;
 #define SID_FM_RECORD_LAST                              ( SID_SVX_START + 619 )
 #define SID_FM_RECORD_NEW                               ( SID_SVX_START + 620 )
 #define SID_FM_RECORD_DELETE                            ( SID_SVX_START + 621 )
-#define SID_FM_RECORD_ABSOLUTE                          ( SID_SVX_START + 622 )
+#define SID_FM_RECORD_ABSOLUTE                          
TypedWhichId<SfxInt32Item>( SID_SVX_START + 622 )
 #define SID_FM_ADD_FIELD                                ( SID_SVX_START + 623 )
 #define SID_FM_RECORD_TEXT                              ( SID_SVX_START + 624 )
 #define SID_FM_RECORD_FROM_TEXT                         ( SID_SVX_START + 625 )
@@ -804,11 +804,11 @@ class XFillGradientItem;
 #define SID_EXTRUSION_SURFACE_FLOATER                   ( SID_SVX_START + 968 )
 #define SID_EXTRUSION_3D_COLOR                          ( SID_SVX_START + 969 )
 #define SID_EXTRUSION_DEPTH                             
TypedWhichId<SvxDoubleItem>( SID_SVX_START + 970 )
-#define SID_EXTRUSION_DIRECTION                         ( SID_SVX_START + 971 )
-#define SID_EXTRUSION_PROJECTION                        ( SID_SVX_START + 972 )
-#define SID_EXTRUSION_LIGHTING_DIRECTION                ( SID_SVX_START + 973 )
-#define SID_EXTRUSION_LIGHTING_INTENSITY                ( SID_SVX_START + 974 )
-#define SID_EXTRUSION_SURFACE                           ( SID_SVX_START + 975 )
+#define SID_EXTRUSION_DIRECTION                         
TypedWhichId<SfxInt32Item>( SID_SVX_START + 971 )
+#define SID_EXTRUSION_PROJECTION                        
TypedWhichId<SfxInt32Item>( SID_SVX_START + 972 )
+#define SID_EXTRUSION_LIGHTING_DIRECTION                
TypedWhichId<SfxInt32Item>( SID_SVX_START + 973 )
+#define SID_EXTRUSION_LIGHTING_INTENSITY                
TypedWhichId<SfxInt32Item>( SID_SVX_START + 974 )
+#define SID_EXTRUSION_SURFACE                           
TypedWhichId<SfxInt32Item>( SID_SVX_START + 975 )
 #define SID_EXTRUSION_DEPTH_DIALOG                      ( SID_SVX_START + 976 )
 #define SID_FONTWORK_GALLERY_FLOATER                    ( SID_SVX_START + 977 )
 #define SID_EDIT_HYPERLINK                              ( SID_SVX_START + 978 )
@@ -817,8 +817,8 @@ class XFillGradientItem;
 #define SID_FONTWORK_ALIGNMENT_FLOATER                  ( SID_SVX_START + 981 )
 #define SID_FONTWORK_CHARACTER_SPACING_FLOATER          ( SID_SVX_START + 982 )
 #define SID_FONTWORK_SHAPE                              ( SID_SVX_START + 983 )
-#define SID_FONTWORK_ALIGNMENT                          ( SID_SVX_START + 984 )
-#define SID_FONTWORK_CHARACTER_SPACING                  ( SID_SVX_START + 985 )
+#define SID_FONTWORK_ALIGNMENT                          
TypedWhichId<SfxInt32Item>( SID_SVX_START + 984 )
+#define SID_FONTWORK_CHARACTER_SPACING                  
TypedWhichId<SfxInt32Item>( SID_SVX_START + 985 )
 #define SID_FONTWORK_KERN_CHARACTER_PAIRS               
TypedWhichId<SfxBoolItem>( SID_SVX_START + 986 )
 #define SID_DRAW_FONTWORK                               ( SID_SVX_START + 987 )
 #define SID_DRAW_FONTWORK_VERTICAL                      ( SID_SVX_START + 988 )
diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc
index cd02a5b891d4..625206b74f8c 100644
--- a/sc/inc/sc.hrc
+++ b/sc/inc/sc.hrc
@@ -233,8 +233,8 @@ class SvxZoomSliderItem;
 #define SID_ZTEST_DIALOG                    (SC_MESSAGE_START + 81)
 #define SID_CHI_SQUARE_TEST_DIALOG          (SC_MESSAGE_START + 82)
 #define SID_SEARCH_RESULTS_DIALOG           (SC_MESSAGE_START + 83)
-#define SID_WINDOW_FIX_ROW                  (SC_MESSAGE_START + 84)
-#define SID_WINDOW_FIX_COL                  (SC_MESSAGE_START + 85)
+#define SID_WINDOW_FIX_ROW                  
TypedWhichId<SfxInt32Item>(SC_MESSAGE_START + 84)
+#define SID_WINDOW_FIX_COL                  
TypedWhichId<SfxInt32Item>(SC_MESSAGE_START + 85)
 #define SID_COLUMN_OPERATIONS               (SC_MESSAGE_START + 86)
 #define SID_ROW_OPERATIONS                  (SC_MESSAGE_START + 87)
 #define SID_FOURIER_ANALYSIS_DIALOG         (SC_MESSAGE_START + 88)
diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx
index 1a344af959fd..cc553c38f067 100644
--- a/sc/source/ui/docshell/docsh4.cxx
+++ b/sc/source/ui/docshell/docsh4.cxx
@@ -869,7 +869,7 @@ void ScDocShell::Execute( SfxRequest& rReq )
                         }
                     }
 
-                    rReq.SetReturnValue( SfxInt32Item( nSlot, 0 ) );        
//! ???????
+                    rReq.SetReturnValue( SfxInt32Item( 
TypedWhichId<SfxInt32Item>(nSlot), 0 ) );        //! ???????
                     rReq.Done();
 
                     if (!bHadTrack)         //  newly turned on -> show as well
diff --git a/sc/source/ui/view/cellsh.cxx b/sc/source/ui/view/cellsh.cxx
index 3b2e69e7364f..ec5914a2224b 100644
--- a/sc/source/ui/view/cellsh.cxx
+++ b/sc/source/ui/view/cellsh.cxx
@@ -733,15 +733,15 @@ void ScCellShell::GetState(SfxItemSet &rSet)
                 break;
 
             case SID_RANGE_ROW:
-                rSet.Put( SfxInt32Item( nWhich, nPosY+1 ) );
+                rSet.Put( SfxInt32Item( SID_RANGE_ROW, nPosY+1 ) );
                 break;
 
             case SID_RANGE_COL:
-                rSet.Put( SfxInt16Item( nWhich, nPosX+1 ) );
+                rSet.Put( SfxInt16Item( SID_RANGE_COL, nPosX+1 ) );
                 break;
 
             case SID_RANGE_TABLE:
-                rSet.Put( SfxInt16Item( nWhich, nTab+1 ) );
+                rSet.Put( SfxInt16Item( SID_RANGE_TABLE, nTab+1 ) );
                 break;
 
             case SID_RANGE_FORMULA:
diff --git a/sc/source/ui/view/cellsh2.cxx b/sc/source/ui/view/cellsh2.cxx
index 3be0428bbc2b..71bcd6cac315 100644
--- a/sc/source/ui/view/cellsh2.cxx
+++ b/sc/source/ui/view/cellsh2.cxx
@@ -551,21 +551,21 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq )
                                         aRequest.AppendItem( SfxUInt16Item( 
SID_SORT_USERDEF, nUser ) );
                                         if ( rOutParam.maKeyState[0].bDoSort )
                                         {
-                                            aRequest.AppendItem( SfxInt32Item( 
FN_PARAM_1,
+                                            aRequest.AppendItem( SfxInt32Item( 
TypedWhichId<SfxInt32Item>(FN_PARAM_1),
                                                 rOutParam.maKeyState[0].nField 
+ 1 ) );
                                             aRequest.AppendItem( SfxBoolItem( 
FN_PARAM_2,
                                                 
rOutParam.maKeyState[0].bAscending ) );
                                         }
                                         if ( rOutParam.maKeyState[1].bDoSort )
                                         {
-                                            aRequest.AppendItem( SfxInt32Item( 
FN_PARAM_3,
+                                            aRequest.AppendItem( SfxInt32Item( 
TypedWhichId<SfxInt32Item>(FN_PARAM_3),
                                                 rOutParam.maKeyState[1].nField 
+ 1 ) );
                                             aRequest.AppendItem( SfxBoolItem( 
FN_PARAM_4,
                                                 
rOutParam.maKeyState[1].bAscending ) );
                                         }
                                         if ( rOutParam.maKeyState[2].bDoSort )
                                         {
-                                            aRequest.AppendItem( SfxInt32Item( 
FN_PARAM_5,
+                                            aRequest.AppendItem( SfxInt32Item( 
TypedWhichId<SfxInt32Item>(FN_PARAM_5),
                                                 rOutParam.maKeyState[2].nField 
+ 1 ) );
                                             aRequest.AppendItem( SfxBoolItem( 
FN_PARAM_6,
                                                 
rOutParam.maKeyState[2].bAscending ) );
diff --git a/sc/source/ui/view/tabvwsha.cxx b/sc/source/ui/view/tabvwsha.cxx
index 41b9892dce1b..4021f1937f91 100644
--- a/sc/source/ui/view/tabvwsha.cxx
+++ b/sc/source/ui/view/tabvwsha.cxx
@@ -474,7 +474,7 @@ void ScTabViewShell::GetState( SfxItemSet& rSet )
                 {
                     bool bIsCol = (nWhich == SID_WINDOW_FIX_COL);
                     sal_Int32 nFreezeIndex = 
rViewData.GetLOKSheetFreezeIndex(bIsCol);
-                    rSet.Put(SfxInt32Item(nWhich, nFreezeIndex));
+                    rSet.Put(SfxInt32Item(TypedWhichId<SfxInt32Item>(nWhich), 
nFreezeIndex));
                 }
                 break;
 
diff --git a/sc/source/ui/view/tabvwshh.cxx b/sc/source/ui/view/tabvwshh.cxx
index 4e45f0153a21..ce38719bde67 100644
--- a/sc/source/ui/view/tabvwshh.cxx
+++ b/sc/source/ui/view/tabvwshh.cxx
@@ -197,7 +197,7 @@ void ScTabViewShell::GetObjectState( SfxItemSet& rSet )
 
                             //! convert from 1/100mm to something else ??????
 
-                            rSet.Put( SfxInt32Item( nWhich, nVal ) );
+                            rSet.Put( SfxInt32Item( 
TypedWhichId<SfxInt32Item>(nWhich), nVal ) );
                         }
                     }
                 }
diff --git a/sd/inc/sdattr.hrc b/sd/inc/sdattr.hrc
index e4c102f46557..8c81c4f13aee 100644
--- a/sd/inc/sdattr.hrc
+++ b/sd/inc/sdattr.hrc
@@ -22,6 +22,7 @@
 #include <svl/solar.hrc>
 
 class SdOptionsPrintItem;
+class SfxInt32Item;
 class SfxStringItem;
 class XColorItem;
 
@@ -52,7 +53,7 @@ class XColorItem;
 #define ATTR_PRESENT_ANIMATION_ALLOWED       ATTR_PRESENT_START + 12
 #define ATTR_PRESENT_PAUSE_TIMEOUT           ATTR_PRESENT_START + 13
 #define ATTR_PRESENT_SHOW_PAUSELOGO          ATTR_PRESENT_START + 14
-#define ATTR_PRESENT_DISPLAY                 ATTR_PRESENT_START + 15
+#define ATTR_PRESENT_DISPLAY                 
TypedWhichId<SfxInt32Item>(ATTR_PRESENT_START + 15)
 #define ATTR_PRESENT_SHOW_NAVIGATION_BUTTONS ATTR_PRESENT_START + 16
 
 #define ATTR_PRESENT_END                ATTR_PRESENT_SHOW_NAVIGATION_BUTTONS
@@ -93,8 +94,8 @@ class XColorItem;
 
 #define ATTR_SNAPLINE_START             ATTR_COPY_END + 1
 #define ATTR_SNAPLINE_KIND              
TypedWhichId<SfxUInt16Item>(ATTR_SNAPLINE_START)
-#define ATTR_SNAPLINE_X                 ATTR_SNAPLINE_START + 1
-#define ATTR_SNAPLINE_Y                 ATTR_SNAPLINE_START + 2
+#define ATTR_SNAPLINE_X                 
TypedWhichId<SfxInt32Item>(ATTR_SNAPLINE_START + 1)
+#define ATTR_SNAPLINE_Y                 
TypedWhichId<SfxInt32Item>(ATTR_SNAPLINE_START + 2)
 #define ATTR_SNAPLINE_END               ATTR_SNAPLINE_Y
 
 #define ATTR_OPTIONS_START              ATTR_SNAPLINE_END + 1
diff --git a/sd/source/ui/dlg/dlgsnap.cxx b/sd/source/ui/dlg/dlgsnap.cxx
index 9b1383089218..9f16a5fa5394 100644
--- a/sd/source/ui/dlg/dlgsnap.cxx
+++ b/sd/source/ui/dlg/dlgsnap.cxx
@@ -88,8 +88,8 @@ SdSnapLineDlg::SdSnapLineDlg(weld::Window* pWindow, const 
SfxItemSet& rInAttrs,
                           FieldUnit::NONE);
 
     // set values
-    nXValue = static_cast<const SfxInt32Item&>( 
rInAttrs.Get(ATTR_SNAPLINE_X)).GetValue();
-    nYValue = static_cast<const SfxInt32Item&>( 
rInAttrs.Get(ATTR_SNAPLINE_Y)).GetValue();
+    nXValue = rInAttrs.Get(ATTR_SNAPLINE_X).GetValue();
+    nYValue = rInAttrs.Get(ATTR_SNAPLINE_Y).GetValue();
     nXValue = sal_Int32(nXValue / aUIScale);
     nYValue = sal_Int32(nYValue / aUIScale);
     SetMetricValue(*m_xMtrFldX, nXValue, MapUnit::Map100thMM);
diff --git a/sd/source/ui/dlg/present.cxx b/sd/source/ui/dlg/present.cxx
index ad5fd2260a6d..8bd7eb30e0bd 100644
--- a/sd/source/ui/dlg/present.cxx
+++ b/sd/source/ui/dlg/present.cxx
@@ -197,7 +197,7 @@ void SdStartPresentationDlg::InitMonitorSettings()
             sal_Int32 nSelectedIndex (-1);
             sal_Int32 nDefaultExternalIndex (-1);
             const sal_Int32 nDefaultSelectedDisplay (
-                static_cast<const SfxInt32Item&>( rOutAttrs.Get( 
ATTR_PRESENT_DISPLAY ) ).GetValue());
+                rOutAttrs.Get( ATTR_PRESENT_DISPLAY ).GetValue());
 
             // Un-conditionally add a version for '0' the default external 
display
             sal_Int32 nInsertedEntry;
diff --git a/sd/source/ui/func/fusldlg.cxx b/sd/source/ui/func/fusldlg.cxx
index 882d9c85af9a..afb8f5294e25 100644
--- a/sd/source/ui/func/fusldlg.cxx
+++ b/sd/source/ui/func/fusldlg.cxx
@@ -222,7 +222,7 @@ void FuSlideShowDlg::DoExecute( SfxRequest& )
         rPresentationSettings.mbShowPauseLogo = bValue;
     }
 
-    pOptions->SetDisplay( ITEMVALUE( aDlgSet, ATTR_PRESENT_DISPLAY, 
SfxInt32Item ) );
+    pOptions->SetDisplay( aDlgSet.Get(ATTR_PRESENT_DISPLAY).GetValue() );
 
     // is something has changed, we set the modified flag
     if ( bValuesChanged )
diff --git a/sd/source/ui/func/fusnapln.cxx b/sd/source/ui/func/fusnapln.cxx
index 323404b5afab..24808e24a91b 100644
--- a/sd/source/ui/func/fusnapln.cxx
+++ b/sd/source/ui/func/fusnapln.cxx
@@ -157,8 +157,8 @@ void FuSnapLine::DoExecute( SfxRequest& rReq )
     }
     Point aHlpPos;
 
-    aHlpPos.setX( static_cast<const SfxInt32Item&>( 
pArgs->Get(ATTR_SNAPLINE_X)).GetValue() );
-    aHlpPos.setY( static_cast<const SfxInt32Item&>( 
pArgs->Get(ATTR_SNAPLINE_Y)).GetValue() );
+    aHlpPos.setX( pArgs->Get(ATTR_SNAPLINE_X).GetValue() );
+    aHlpPos.setY( pArgs->Get(ATTR_SNAPLINE_Y).GetValue() );
     pPV->PagePosToLogic(aHlpPos);
 
     if ( bCreateNew )
diff --git a/svx/source/form/fmshell.cxx b/svx/source/form/fmshell.cxx
index aa15fc1bce07..423bbb7c25fc 100644
--- a/svx/source/form/fmshell.cxx
+++ b/svx/source/form/fmshell.cxx
@@ -710,7 +710,7 @@ void FmFormShell::Execute(SfxRequest &rReq)
                 if ( dlg->Execute() == RET_OK )
                     nRecord = dlg->GetValue();
 
-                rReq.AppendItem( SfxInt32Item( FN_PARAM_1, nRecord ) );
+                rReq.AppendItem( SfxInt32Item( 
TypedWhichId<SfxInt32Item>(FN_PARAM_1), nRecord ) );
             }
 
             if ( nRecord != -1 )
@@ -1072,7 +1072,7 @@ void FmFormShell::GetFormState(SfxItemSet &rSet, 
sal_uInt16 nWhich)
                 {
                     sal_Int32 nPosition = 0;
                     aState.State >>= nPosition;
-                    rSet.Put( SfxInt32Item( nWhich, nPosition ) );
+                    rSet.Put( SfxInt32Item( SID_FM_RECORD_ABSOLUTE, nPosition 
) );
                 }
                 else if ( SID_FM_RECORD_TOTAL == nWhich )
                 {
diff --git a/svx/source/form/tbxform.cxx b/svx/source/form/tbxform.cxx
index 05576133d0cd..96f05670d35d 100644
--- a/svx/source/form/tbxform.cxx
+++ b/svx/source/form/tbxform.cxx
@@ -45,7 +45,7 @@ SvxFmAbsRecWin::SvxFmAbsRecWin(vcl::Window* pParent, 
SfxToolBoxControl* pControl
 
 void SvxFmAbsRecWin::PositionFired(sal_Int64 nRecord)
 {
-    SfxInt32Item aPositionParam( FN_PARAM_1, static_cast<sal_Int32>(nRecord) );
+    SfxInt32Item aPositionParam( TypedWhichId<SfxInt32Item>(FN_PARAM_1), 
static_cast<sal_Int32>(nRecord) );
 
     Any a;
     aPositionParam.QueryValue( a );
diff --git a/svx/source/svdraw/svdedtv1.cxx b/svx/source/svdraw/svdedtv1.cxx
index 708992e5a397..430c655dfb1e 100644
--- a/svx/source/svdraw/svdedtv1.cxx
+++ b/svx/source/svdraw/svdedtv1.cxx
@@ -1682,8 +1682,8 @@ void SdrEditView::SetGeoAttrToMarked(const SfxItemSet& 
rAttr, bool addPageMargin
             }
             bShear=nShearAngle!=0_deg100;
             if (bShear) {
-                nShearX=static_cast<const 
SfxInt32Item&>(rAttr.Get(SID_ATTR_TRANSFORM_SHEAR_X)).GetValue();
-                nShearY=static_cast<const 
SfxInt32Item&>(rAttr.Get(SID_ATTR_TRANSFORM_SHEAR_Y)).GetValue();
+                nShearX = rAttr.Get(SID_ATTR_TRANSFORM_SHEAR_X).GetValue();
+                nShearY = rAttr.Get(SID_ATTR_TRANSFORM_SHEAR_Y).GetValue();
             }
         }
     }
diff --git a/sw/source/ui/fldui/fldpage.cxx b/sw/source/ui/fldui/fldpage.cxx
index 93202d2802d5..7e7f5ade3b86 100644
--- a/sw/source/ui/fldui/fldpage.cxx
+++ b/sw/source/ui/fldui/fldpage.cxx
@@ -152,7 +152,7 @@ void SwFieldPage::InsertField(SwFieldTypesEnum nTypeId, 
sal_uInt16 nSubType, con
                 aReq.AppendItem(SfxStringItem
                         (FN_PARAM_1,rPar1.getToken(0, DB_DELIM, nIdx)));
                 aReq.AppendItem(SfxInt32Item
-                        (FN_PARAM_3, o3tl::toInt32(o3tl::getToken(rPar1, 0, 
DB_DELIM, nIdx))));
+                        (TypedWhichId<SfxInt32Item>(FN_PARAM_3), 
o3tl::toInt32(o3tl::getToken(rPar1, 0, DB_DELIM, nIdx))));
                 aReq.AppendItem(SfxStringItem
                         (FN_PARAM_2,rPar1.getToken(0, DB_DELIM, nIdx)));
             }

Reply via email to