tdf#114441 Convert sal_uLong to better integer types

This patch changes the usage of type sal_uLong in sc module to sal_Int32.
Looking into ScRefreshTimer constructor in sc/inc/refreshtimer.hxx, it
becomes clear that sal_Int32 is a good choice. The usage is for
communicating the refresh delay, measured in seconds. The reason to use
signed variables is to follow the convention in ScRefreshTimer class.

Change-Id: Ib565fd50ec4e6a46e95e9db06b7798a0b4a38d4b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164957
Tested-by: Hossein <hossein@libreoffice.org>
Reviewed-by: Hossein <hossein@libreoffice.org>
This commit is contained in:
Rafał Dobrakowski 2024-03-18 00:05:44 +01:00 committed by Hossein
parent fa42bdabca
commit 97af15c86c
7 changed files with 17 additions and 13 deletions

View file

@ -24,6 +24,7 @@
#include <com/sun/star/uno/Reference.hxx>
#include <vcl/vclptr.hxx>
#include "patattr.hxx"
#include <sal/types.h>
#include "scdllapi.h"
#include "interpretercontext.hxx"
#include "rangelst.hxx"
@ -1027,10 +1028,10 @@ public:
OUString GetLinkFlt( SCTAB nTab ) const;
OUString GetLinkOpt( SCTAB nTab ) const;
SC_DLLPUBLIC OUString GetLinkTab( SCTAB nTab ) const;
sal_uLong GetLinkRefreshDelay( SCTAB nTab ) const;
sal_Int32 GetLinkRefreshDelay( SCTAB nTab ) const;
void SetLink( SCTAB nTab, ScLinkMode nMode, const OUString& rDoc,
const OUString& rFilter, const OUString& rOptions,
const OUString& rTabName, sal_uLong nRefreshDelay );
const OUString& rTabName, sal_Int32 nRefreshDelay );
bool HasLink( std::u16string_view rDoc,
std::u16string_view rFilter, std::u16string_view rOptions ) const;
SC_DLLPUBLIC bool LinkExternalTab( SCTAB& nTab, const OUString& aDocTab,

View file

@ -24,6 +24,7 @@
#include "attarray.hxx"
#include "column.hxx"
#include "colcontainer.hxx"
#include <sal/types.h>
#include "sortparam.hxx"
#include "types.hxx"
#include <formula/types.hxx>
@ -169,7 +170,7 @@ private:
OUString aLinkFlt;
OUString aLinkOpt;
OUString aLinkTab;
sal_uLong nLinkRefreshDelay;
sal_Int32 nLinkRefreshDelay;
ScLinkMode nLinkMode;
// page style template
@ -377,10 +378,10 @@ public:
const OUString& GetLinkFlt() const { return aLinkFlt; }
const OUString& GetLinkOpt() const { return aLinkOpt; }
const OUString& GetLinkTab() const { return aLinkTab; }
sal_uLong GetLinkRefreshDelay() const { return nLinkRefreshDelay; }
sal_Int32 GetLinkRefreshDelay() const { return nLinkRefreshDelay; }
void SetLink( ScLinkMode nMode, const OUString& rDoc, const OUString& rFlt,
const OUString& rOpt, const OUString& rTab, sal_uLong nRefreshDelay );
const OUString& rOpt, const OUString& rTab, sal_Int32 nRefreshDelay );
sal_Int64 GetHashCode () const;

View file

@ -17,6 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <sal/types.h>
#include <com/sun/star/script/vba/XVBAEventProcessor.hpp>
#include <com/sun/star/sheet/TableValidationVisibility.hpp>
#include <scitems.hxx>
@ -536,7 +537,7 @@ OUString ScDocument::GetLinkTab( SCTAB nTab ) const
return OUString();
}
sal_uLong ScDocument::GetLinkRefreshDelay( SCTAB nTab ) const
sal_Int32 ScDocument::GetLinkRefreshDelay( SCTAB nTab ) const
{
if (const ScTable* pTable = FetchTable(nTab))
return pTable->GetLinkRefreshDelay();
@ -545,7 +546,7 @@ sal_uLong ScDocument::GetLinkRefreshDelay( SCTAB nTab ) const
void ScDocument::SetLink( SCTAB nTab, ScLinkMode nMode, const OUString& rDoc,
const OUString& rFilter, const OUString& rOptions,
const OUString& rTabName, sal_uLong nRefreshDelay )
const OUString& rTabName, sal_Int32 nRefreshDelay )
{
if (ScTable* pTable = FetchTable(nTab))
pTable->SetLink(nMode, rDoc, rFilter, rOptions, rTabName, nRefreshDelay);
@ -604,7 +605,7 @@ bool ScDocument::LinkExternalTab( SCTAB& rTab, const OUString& aDocTab,
else
return false;
sal_uLong nRefreshDelay = 0;
sal_Int32 nRefreshDelay = 0;
bool bWasThere = HasLink( aFileName, aFilterName, aOptions );
SetLink( rTab, ScLinkMode::VALUE, aFileName, aFilterName, aOptions, aTabName, nRefreshDelay );

View file

@ -17,6 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <sal/types.h>
#include <scitems.hxx>
#include <editeng/justifyitem.hxx>
#include <o3tl/safeint.hxx>
@ -416,7 +417,7 @@ void ScTable::SetScenario( bool bFlag )
void ScTable::SetLink( ScLinkMode nMode,
const OUString& rDoc, const OUString& rFlt, const OUString& rOpt,
const OUString& rTab, sal_uLong nRefreshDelay )
const OUString& rTab, sal_Int32 nRefreshDelay )
{
nLinkMode = nMode;
aLinkDoc = rDoc; // File

View file

@ -17,7 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <tools/solar.h>
#include <sal/types.h>
#include <fprogressbar.hxx>
#include <globstr.hrc>
#include <scresid.hxx>
@ -128,7 +128,7 @@ void ScfProgressBar::IncreaseProgressBar( std::size_t nDelta )
if( nNewPos >= mnNextUnitPos )
{
mnNextUnitPos = nNewPos + mnUnitSize;
mxSysProgress->SetState( static_cast< sal_uLong >( nNewPos / mnSysProgressScale ) );
mxSysProgress->SetState( static_cast< sal_uInt64 >( nNewPos / mnSysProgressScale ) );
}
}
else

View file

@ -352,7 +352,7 @@ void ScDocShell::UpdateLinks()
OUString aDocName = m_pDocument->GetLinkDoc(i);
OUString aFltName = m_pDocument->GetLinkFlt(i);
OUString aOptions = m_pDocument->GetLinkOpt(i);
sal_uInt32 nRefresh = m_pDocument->GetLinkRefreshDelay(i);
sal_Int32 nRefresh = m_pDocument->GetLinkRefreshDelay(i);
bool bThere = false;
for (SCTAB j = 0; j < i && !bThere; ++j) // several times in the document?
{

View file

@ -291,7 +291,7 @@ private:
OUString aDocName;
OUString aFltName;
OUString aOptions;
sal_uLong nRefreshDelay;
sal_Int32 nRefreshDelay;
sal_uInt16 nCount;
std::unique_ptr<SCTAB[]>
pTabs;