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 <hossein@libreoffice.org>
This commit is contained in:
buldi
2024-01-04 12:38:38 +01:00
committed by Hossein
parent be14802640
commit f5e5e86144
9 changed files with 20 additions and 21 deletions
+3 -3
View File
@@ -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
+1 -1
View File
@@ -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();
+2 -2
View File
@@ -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 );
+2 -2
View File
@@ -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;
+2 -2
View File
@@ -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. */
+3 -3
View File
@@ -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; }
+1 -1
View File
@@ -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; }
+1 -1
View File
@@ -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); }
+5 -6
View File
@@ -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 );
}
}