include/svl/style.hxx             |    6 +++---
 sd/inc/stlsheet.hxx               |    2 +-
 sd/source/core/stlsheet.cxx       |    4 ++--
 svl/source/items/style.cxx        |    4 ++--
 sw/inc/docstyle.hxx               |    4 ++--
 sw/inc/format.hxx                 |    6 +++---
 sw/inc/numrule.hxx                |    2 +-
 sw/inc/pagedesc.hxx               |    2 +-
 sw/source/uibase/app/docstyle.cxx |   11 +++++------
 9 files changed, 20 insertions(+), 21 deletions(-)

New commits:
commit f5e5e86144152e5f98cbb985939a883936fe86d7
Author:     buldi <dobrakowskira...@gmail.com>
AuthorDate: Thu Jul 6 00:10:57 2023 +0200
Commit:     Hossein <hoss...@libreoffice.org>
CommitDate: Thu Jan 4 12:38:38 2024 +0100

    tdf#114441 sal_uLong to better integer type
    
    At first it seemd that sal_uInt16 may be sufficient for storing possible
    values. But as elsewhere unsigned 32 bit variables are used for such
    purpose, sal_uInt32 is used which allows having more space for bigger 
values.
    
    Change-Id: Ic2834ffc0fcabad91175aba3753e832dc1807fbe
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151006
    Tested-by: Jenkins
    Reviewed-by: Hossein <hoss...@libreoffice.org>

diff --git a/include/svl/style.hxx b/include/svl/style.hxx
index fc12dc0be74e..0e3a09ec442e 100644
--- a/include/svl/style.hxx
+++ b/include/svl/style.hxx
@@ -125,7 +125,7 @@ protected:
     SfxItemSet*             pSet;           // ItemSet
     SfxStyleSearchBits      nMask;          // Flags
 
-    sal_uLong               nHelpId;        // help ID
+    sal_uInt32              nHelpId;        // help ID
 
     bool                    bMySet;         // sal_True: delete Set in dtor
     bool                    bHidden;
@@ -169,8 +169,8 @@ public:
     virtual bool IsHidden() const { return bHidden; }
     virtual void SetHidden( bool bValue );
 
-    virtual sal_uLong GetHelpId( OUString& rFile );
-    virtual void   SetHelpId( const OUString& r, sal_uLong nId );
+    virtual sal_uInt32 GetHelpId( OUString& rFile );
+    virtual void   SetHelpId( const OUString& r, sal_uInt32 nId );
 
     virtual SfxItemSet& GetItemSet();
     /// Due to writer's usual lack of sanity this is a separate function for
diff --git a/sd/inc/stlsheet.hxx b/sd/inc/stlsheet.hxx
index fe1079ffd616..93044bdfd2f2 100644
--- a/sd/inc/stlsheet.hxx
+++ b/sd/inc/stlsheet.hxx
@@ -62,7 +62,7 @@ public:
     virtual bool        HasFollowSupport() const override;
     virtual bool        HasParentSupport() const override;
     virtual bool        HasClearParentSupport() const override;
-    virtual void        SetHelpId( const OUString& r, sal_uLong nId ) override;
+    virtual void        SetHelpId( const OUString& r, sal_uInt32 nId ) 
override;
 
     bool IsEditable();
 
diff --git a/sd/source/core/stlsheet.cxx b/sd/source/core/stlsheet.cxx
index e262e7a713ff..ba058df3f689 100644
--- a/sd/source/core/stlsheet.cxx
+++ b/sd/source/core/stlsheet.cxx
@@ -650,7 +650,7 @@ struct ApiNameMap
         { std::u16string_view(u"Arrow Dashed"), HID_POOLSHEET_LINES_DASHED }
       };
 
-OUString GetApiNameForHelpId(sal_uLong nId)
+OUString GetApiNameForHelpId(sal_uInt32 nId)
 {
     if ((nId >= HID_PSEUDOSHEET_OUTLINE1) && (nId <= HID_PSEUDOSHEET_OUTLINE9))
         return "outline" + OUStringChar(sal_Unicode('1' + (nId - 
HID_PSEUDOSHEET_OUTLINE1)));
@@ -685,7 +685,7 @@ sal_uInt32 GetHelpIdForApiName(std::u16string_view sName)
 }
 }
 
-void SdStyleSheet::SetHelpId( const OUString& r, sal_uLong nId )
+void SdStyleSheet::SetHelpId( const OUString& r, sal_uInt32 nId )
 {
     SfxStyleSheet::SetHelpId( r, nId );
 
diff --git a/svl/source/items/style.cxx b/svl/source/items/style.cxx
index 41551e506498..0b0054984a4c 100644
--- a/svl/source/items/style.cxx
+++ b/svl/source/items/style.cxx
@@ -270,13 +270,13 @@ std::optional<SfxItemSet> 
SfxStyleSheetBase::GetItemSetForPreview()
 /**
  * Set help file and ID and return it
  */
-sal_uLong SfxStyleSheetBase::GetHelpId( OUString& rFile )
+sal_uInt32 SfxStyleSheetBase::GetHelpId( OUString& rFile )
 {
     rFile = aHelpFile;
     return nHelpId;
 }
 
-void SfxStyleSheetBase::SetHelpId( const OUString& rFile, sal_uLong nId )
+void SfxStyleSheetBase::SetHelpId( const OUString& rFile, sal_uInt32 nId )
 {
     aHelpFile = rFile;
     nHelpId = nId;
diff --git a/sw/inc/docstyle.hxx b/sw/inc/docstyle.hxx
index b411bfe4b1ce..d550f98c0386 100644
--- a/sw/inc/docstyle.hxx
+++ b/sw/inc/docstyle.hxx
@@ -111,8 +111,8 @@ public:
     virtual const OUString& GetFollow() const override;
     const OUString& GetLink() const;
 
-    virtual sal_uLong GetHelpId( OUString& rFile ) override;
-    virtual void SetHelpId( const OUString& r, sal_uLong nId ) override;
+    virtual sal_uInt32 GetHelpId( OUString& rFile ) override;
+    virtual void SetHelpId( const OUString& r, sal_uInt32 nId ) override;
 
     /** Preset the members without physical access.
      Used by StyleSheetPool. */
diff --git a/sw/inc/format.hxx b/sw/inc/format.hxx
index 8ded8c6f61f3..91043b1621de 100644
--- a/sw/inc/format.hxx
+++ b/sw/inc/format.hxx
@@ -53,7 +53,7 @@ class SW_DLLPUBLIC SwFormat : public sw::BorderCacheOwner, 
public sw::Broadcasti
     sal_uInt16 m_nWhichId;
     sal_uInt16 m_nPoolFormatId;        /**< Id for "automatically" created 
formats.
                                        (is not hard attribution!!!) */
-    sal_uInt16 m_nPoolHelpId;       ///< HelpId for this Pool-style.
+    sal_uInt32 m_nPoolHelpId;       ///< HelpId for this Pool-style.
     sal_uInt8 m_nPoolHlpFileId;     ///< FilePos to Doc to these style helps.
     bool   m_bAutoFormat : 1;      /**< FALSE: it is a template.
                                        default is true! */
@@ -164,8 +164,8 @@ public:
     void SetPoolFormatId( sal_uInt16 nId ) { m_nPoolFormatId = nId; }
 
     /// Get and set Help-IDs for document templates.
-    sal_uInt16 GetPoolHelpId() const { return m_nPoolHelpId; }
-    void SetPoolHelpId( sal_uInt16 nId ) { m_nPoolHelpId = nId; }
+    sal_uInt32 GetPoolHelpId() const { return m_nPoolHelpId; }
+    void SetPoolHelpId( sal_uInt32 nId ) { m_nPoolHelpId = nId; }
     sal_uInt8 GetPoolHlpFileId() const { return m_nPoolHlpFileId; }
     void SetPoolHlpFileId( sal_uInt8 nId ) { m_nPoolHlpFileId = nId; }
 
diff --git a/sw/inc/numrule.hxx b/sw/inc/numrule.hxx
index b21cc5259656..20ac33bbfc60 100644
--- a/sw/inc/numrule.hxx
+++ b/sw/inc/numrule.hxx
@@ -254,7 +254,7 @@ public:
 
     /// Query and set Help-IDs for document styles.
     sal_uInt16 GetPoolHelpId() const        { return mnPoolHelpId; }
-    void SetPoolHelpId( sal_uInt16 nId )    { mnPoolHelpId = nId; }
+    void SetPoolHelpId( sal_uInt32 nId )    { mnPoolHelpId = nId; }
     sal_uInt8 GetPoolHlpFileId() const      { return mnPoolHlpFileId; }
     void SetPoolHlpFileId( sal_uInt8 nId )  { mnPoolHlpFileId = nId; }
 
diff --git a/sw/inc/pagedesc.hxx b/sw/inc/pagedesc.hxx
index 11bb347aa1fb..136117114b30 100644
--- a/sw/inc/pagedesc.hxx
+++ b/sw/inc/pagedesc.hxx
@@ -275,7 +275,7 @@ public:
     sal_uInt16 GetPoolFormatId() const         { return 
m_Master.GetPoolFormatId(); }
     void SetPoolFormatId(sal_uInt16 const nId) { 
m_Master.SetPoolFormatId(nId); }
     sal_uInt16 GetPoolHelpId() const        { return m_Master.GetPoolHelpId(); 
}
-    void SetPoolHelpId(sal_uInt16 const nId){ m_Master.SetPoolHelpId(nId); }
+    void SetPoolHelpId(sal_uInt32 const nId){ m_Master.SetPoolHelpId(nId); }
     sal_uInt8 GetPoolHlpFileId() const      { return 
m_Master.GetPoolHlpFileId(); }
     void SetPoolHlpFileId(sal_uInt8 const nId) { 
m_Master.SetPoolHlpFileId(nId); }
 
diff --git a/sw/source/uibase/app/docstyle.cxx 
b/sw/source/uibase/app/docstyle.cxx
index a715bef70da1..74b98d788602 100644
--- a/sw/source/uibase/app/docstyle.cxx
+++ b/sw/source/uibase/app/docstyle.cxx
@@ -2468,7 +2468,7 @@ OUString SwDocStyleSheet::GetUsedBy()
     return m_pNumRule ? m_pNumRule->MakeParagraphStyleListString() : 
OUString();
 }
 
-sal_uLong  SwDocStyleSheet::GetHelpId( OUString& rFile )
+sal_uInt32  SwDocStyleSheet::GetHelpId( OUString& rFile )
 {
     sal_uInt16 nId = 0;
     sal_uInt16 nPoolId = 0;
@@ -2567,10 +2567,9 @@ sal_uLong  SwDocStyleSheet::GetHelpId( OUString& rFile )
     return nId;
 }
 
-void  SwDocStyleSheet::SetHelpId( const OUString& r, sal_uLong nId )
+void  SwDocStyleSheet::SetHelpId( const OUString& r, sal_uInt32 nId )
 {
     sal_uInt8 nFileId = static_cast< sal_uInt8 >(m_rDoc.SetDocPattern( r ));
-    sal_uInt16 nHId = static_cast< sal_uInt16 >(nId); //!! SFX changed over to 
ULONG arbitrarily!
 
     SwFormat* pTmpFormat = nullptr;
     switch( nFamily )
@@ -2579,12 +2578,12 @@ void  SwDocStyleSheet::SetHelpId( const OUString& r, 
sal_uLong nId )
     case SfxStyleFamily::Para : pTmpFormat = m_pColl;       break;
     case SfxStyleFamily::Frame: pTmpFormat = m_pFrameFormat;     break;
     case SfxStyleFamily::Page :
-        const_cast<SwPageDesc*>(m_pDesc)->SetPoolHelpId( nHId );
+        const_cast<SwPageDesc*>(m_pDesc)->SetPoolHelpId( nId );
         const_cast<SwPageDesc*>(m_pDesc)->SetPoolHlpFileId( nFileId );
         break;
 
     case SfxStyleFamily::Pseudo:
-        const_cast<SwNumRule*>(m_pNumRule)->SetPoolHelpId( nHId );
+        const_cast<SwNumRule*>(m_pNumRule)->SetPoolHelpId( nId );
         const_cast<SwNumRule*>(m_pNumRule)->SetPoolHlpFileId( nFileId );
         break;
 
@@ -2594,7 +2593,7 @@ void  SwDocStyleSheet::SetHelpId( const OUString& r, 
sal_uLong nId )
     }
     if( pTmpFormat )
     {
-        pTmpFormat->SetPoolHelpId( nHId );
+        pTmpFormat->SetPoolHelpId( nId );
         pTmpFormat->SetPoolHlpFileId( nFileId );
     }
 }

Reply via email to