sc/inc/document.hxx | 5 +++-- sc/inc/table.hxx | 7 ++++--- sc/source/core/data/documen3.cxx | 7 ++++--- sc/source/core/data/table1.cxx | 3 ++- sc/source/filter/ftools/fprogressbar.cxx | 4 ++-- sc/source/ui/docshell/docsh6.cxx | 2 +- sc/source/ui/inc/undotab.hxx | 2 +- 7 files changed, 17 insertions(+), 13 deletions(-)
New commits: commit 97af15c86ccd4f780d7cf8e79cd49cd2e9aef5f6 Author: Rafał Dobrakowski <[email protected]> AuthorDate: Mon Mar 18 00:05:44 2024 +0100 Commit: Hossein <[email protected]> CommitDate: Wed Apr 10 13:55:11 2024 +0200 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 <[email protected]> Reviewed-by: Hossein <[email protected]> diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx index 593f3f404d42..d9c3f1866947 100644 --- a/sc/inc/document.hxx +++ b/sc/inc/document.hxx @@ -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, diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx index f578926535ae..08f2fbce3015 100644 --- a/sc/inc/table.hxx +++ b/sc/inc/table.hxx @@ -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; diff --git a/sc/source/core/data/documen3.cxx b/sc/source/core/data/documen3.cxx index 7c847fe12254..e31c111a3786 100644 --- a/sc/source/core/data/documen3.cxx +++ b/sc/source/core/data/documen3.cxx @@ -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 ); diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx index 34e40d7882e6..c7539a154204 100644 --- a/sc/source/core/data/table1.cxx +++ b/sc/source/core/data/table1.cxx @@ -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 diff --git a/sc/source/filter/ftools/fprogressbar.cxx b/sc/source/filter/ftools/fprogressbar.cxx index c434154ea4a0..542cd6468466 100644 --- a/sc/source/filter/ftools/fprogressbar.cxx +++ b/sc/source/filter/ftools/fprogressbar.cxx @@ -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 diff --git a/sc/source/ui/docshell/docsh6.cxx b/sc/source/ui/docshell/docsh6.cxx index 02ba51f8d795..34092f13feed 100644 --- a/sc/source/ui/docshell/docsh6.cxx +++ b/sc/source/ui/docshell/docsh6.cxx @@ -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? { diff --git a/sc/source/ui/inc/undotab.hxx b/sc/source/ui/inc/undotab.hxx index ce9a9d190fdb..f0269b317708 100644 --- a/sc/source/ui/inc/undotab.hxx +++ b/sc/source/ui/inc/undotab.hxx @@ -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;
