diff options
author | Noel <noelgrandin@gmail.com> | 2020-10-21 07:49:00 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-10-30 08:57:07 +0100 |
commit | f2be3d31cde821f5c1128deae7f2b95361ac1db9 (patch) | |
tree | aac9582c61cf53e61da4b566c4d10b60af0475ad /sc | |
parent | 46ecd31445bda45e10d58e937ff468a1a8f17da2 (diff) |
convert some tools::Long->sal_Int32
in places where it is obvious we only need a sal_Int32, because
we are dealing with rows and columns, and not even calc needs
more than 32 bits for that.
Change-Id: I114417e639c224d45bfd9fc6838122ab195eefa3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104584
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc')
34 files changed, 352 insertions, 354 deletions
diff --git a/sc/inc/cellsuno.hxx b/sc/inc/cellsuno.hxx index 267c68899972..ee6b59eec1ab 100644 --- a/sc/inc/cellsuno.hxx +++ b/sc/inc/cellsuno.hxx @@ -198,7 +198,7 @@ private: private: void PaintGridRanges_Impl(); - ScRangeListRef GetLimitedChartRanges_Impl( tools::Long nDataColumns, tools::Long nDataRows ) const; + ScRangeListRef GetLimitedChartRanges_Impl( sal_Int32 nDataColumns, sal_Int32 nDataRows ) const; void ForceChartListener_Impl(); std::unique_ptr<ScMemChart> CreateMemChart_Impl() const; diff --git a/sc/inc/dbdocutl.hxx b/sc/inc/dbdocutl.hxx index a5600cc282a8..f4779bdffae7 100644 --- a/sc/inc/dbdocutl.hxx +++ b/sc/inc/dbdocutl.hxx @@ -43,7 +43,7 @@ public: }; static void PutData( ScDocument& rDoc, SCCOL nCol, SCROW nRow, SCTAB nTab, const css::uno::Reference< css::sdbc::XRow>& xRow, - tools::Long nRowPos, + sal_Int32 nRowPos, tools::Long nType, bool bCurrency, StrData* pStrData = nullptr ); }; diff --git a/sc/inc/dpgroup.hxx b/sc/inc/dpgroup.hxx index 720e07a3c8da..eaf560437b8d 100644 --- a/sc/inc/dpgroup.hxx +++ b/sc/inc/dpgroup.hxx @@ -115,15 +115,15 @@ public: class ScDPGroupTableData final : public ScDPTableData { std::shared_ptr<ScDPTableData> pSourceData; - tools::Long nSourceCount; + sal_Int32 nSourceCount; std::vector<ScDPGroupDimension> aGroups; std::unique_ptr<ScDPNumGroupDimension[]> pNumGroups; // array[nSourceCount] ScDocument* pDoc; - void FillGroupValues(std::vector<SCROW>& rItems, const std::vector<tools::Long>& rDims); - virtual tools::Long GetSourceDim( tools::Long nDim ) override; + void FillGroupValues(std::vector<SCROW>& rItems, const std::vector<sal_Int32>& rDims); + virtual sal_Int32 GetSourceDim( sal_Int32 nDim ) override; bool IsNumGroupDimension( tools::Long nDimension ) const; void GetNumGroupInfo(tools::Long nDimension, ScDPNumGroupInfo& rInfo); @@ -138,19 +138,19 @@ public: const std::shared_ptr<ScDPTableData>& GetSourceTableData() const { return pSourceData;} void AddGroupDimension( const ScDPGroupDimension& rGroup ); - void SetNumGroupDimension( tools::Long nIndex, const ScDPNumGroupDimension& rGroup ); - tools::Long GetDimensionIndex( const OUString& rName ); - - virtual tools::Long GetColumnCount() override; - virtual tools::Long GetMembersCount( tools::Long nDim ) override; - virtual const std::vector< SCROW >& GetColumnEntries( tools::Long nColumn ) override ; - virtual const ScDPItemData* GetMemberById( tools::Long nDim, tools::Long nId) override; - virtual tools::Long Compare( tools::Long nDim, tools::Long nDataId1, tools::Long nDataId2) override; - - virtual OUString getDimensionName(tools::Long nColumn) override; - virtual bool getIsDataLayoutDimension(tools::Long nColumn) override; - virtual bool IsDateDimension(tools::Long nDim) override; - virtual sal_uInt32 GetNumberFormat(tools::Long nDim) override; + void SetNumGroupDimension( sal_Int32 nIndex, const ScDPNumGroupDimension& rGroup ); + sal_Int32 GetDimensionIndex( const OUString& rName ); + + virtual sal_Int32 GetColumnCount() override; + virtual sal_Int32 GetMembersCount( sal_Int32 nDim ) override; + virtual const std::vector< SCROW >& GetColumnEntries( sal_Int32 nColumn ) override ; + virtual const ScDPItemData* GetMemberById( sal_Int32 nDim, sal_Int32 nId) override; + virtual sal_Int32 Compare( sal_Int32 nDim, sal_Int32 nDataId1, sal_Int32 nDataId2) override; + + virtual OUString getDimensionName(sal_Int32 nColumn) override; + virtual bool getIsDataLayoutDimension(sal_Int32 nColumn) override; + virtual bool IsDateDimension(sal_Int32 nDim) override; + virtual sal_uInt32 GetNumberFormat(sal_Int32 nDim) override; virtual void DisposeData() override; virtual void SetEmptyFlags( bool bIgnoreEmptyRows, bool bRepeatIfEmpty ) override; @@ -165,13 +165,13 @@ public: virtual const ScDPFilteredCache& GetCacheTable() const override; virtual void ReloadCacheTable() override; - virtual bool IsBaseForGroup(tools::Long nDim) const override; - virtual tools::Long GetGroupBase(tools::Long nGroupDim) const override; - virtual bool IsNumOrDateGroup(tools::Long nDim) const override; - virtual bool IsInGroup( const ScDPItemData& rGroupData, tools::Long nGroupIndex, - const ScDPItemData& rBaseData, tools::Long nBaseIndex ) const override; - virtual bool HasCommonElement( const ScDPItemData& rFirstData, tools::Long nFirstIndex, - const ScDPItemData& rSecondData, tools::Long nSecondIndex ) const override; + virtual bool IsBaseForGroup(sal_Int32 nDim) const override; + virtual sal_Int32 GetGroupBase(sal_Int32 nGroupDim) const override; + virtual bool IsNumOrDateGroup(sal_Int32 nDim) const override; + virtual bool IsInGroup( const ScDPItemData& rGroupData, sal_Int32 nGroupIndex, + const ScDPItemData& rBaseData, sal_Int32 nBaseIndex ) const override; + virtual bool HasCommonElement( const ScDPItemData& rFirstData, sal_Int32 nFirstIndex, + const ScDPItemData& rSecondData, sal_Int32 nSecondIndex ) const override; #if DUMP_PIVOT_TABLE virtual void Dump() const override; diff --git a/sc/inc/dpobject.hxx b/sc/inc/dpobject.hxx index e487fd80d3fc..81b87eead430 100644 --- a/sc/inc/dpobject.hxx +++ b/sc/inc/dpobject.hxx @@ -101,7 +101,7 @@ private: // see PivotTable::putToInteropGrabBag in sc/source/filter/oox/pivottablebuffer.cxx for details std::map<OUString, css::uno::Any> maInteropGrabBag; - tools::Long nHeaderRows; // page fields plus filter button + sal_Int32 nHeaderRows; // page fields plus filter button bool mbHeaderLayout:1; // true : grid, false : standard bool bAllowMove:1; bool bSettingsChanged:1; diff --git a/sc/inc/dpoutput.hxx b/sc/inc/dpoutput.hxx index 0f2267156ef7..230b289c00fd 100644 --- a/sc/inc/dpoutput.hxx +++ b/sc/inc/dpoutput.hxx @@ -59,14 +59,14 @@ private: pColNumFmt; std::unique_ptr<sal_uInt32[]> pRowNumFmt; - tools::Long nColFmtCount; - tools::Long nRowFmtCount; + sal_Int32 nColFmtCount; + sal_Int32 nRowFmtCount; sal_uInt32 nSingleNumFmt; // Output geometry related parameters - tools::Long nColCount; - tools::Long nRowCount; - tools::Long nHeaderSize; + sal_Int32 nColCount; + sal_Int32 nRowCount; + sal_Int32 nHeaderSize; SCCOL nTabStartCol; SCROW nTabStartRow; SCCOL nMemberStartCol; @@ -106,7 +106,7 @@ public: void Output(); //! Refresh? ScRange GetOutputRange( sal_Int32 nRegionType = css::sheet::DataPilotOutputRangeType::WHOLE ); - tools::Long GetHeaderRows() const; + sal_Int32 GetHeaderRows() const; bool HasError(); // range overflow or exception from source void GetPositionData(const ScAddress& rPos, css::sheet::DataPilotTablePositionData& rPosData); diff --git a/sc/inc/dpresfilter.hxx b/sc/inc/dpresfilter.hxx index 2f283837200a..5b68fdb28daa 100644 --- a/sc/inc/dpresfilter.hxx +++ b/sc/inc/dpresfilter.hxx @@ -134,8 +134,8 @@ struct ScDPResultFilterContext { ScDPResultTree maFilterSet; std::vector<ScDPResultFilter> maFilters; - tools::Long mnCol; - tools::Long mnRow; + sal_Int32 mnCol; + sal_Int32 mnRow; ScDPResultFilterContext(); }; diff --git a/sc/inc/dpsdbtab.hxx b/sc/inc/dpsdbtab.hxx index 4498407acdaa..3d7ecac4d5c4 100644 --- a/sc/inc/dpsdbtab.hxx +++ b/sc/inc/dpsdbtab.hxx @@ -63,10 +63,10 @@ public: ScDatabaseDPData(const ScDocument* pDoc, const ScDPCache& rCache); virtual ~ScDatabaseDPData() override; - virtual tools::Long GetColumnCount() override; - virtual OUString getDimensionName(tools::Long nColumn) override; - virtual bool getIsDataLayoutDimension(tools::Long nColumn) override; - virtual bool IsDateDimension(tools::Long nDim) override; + virtual sal_Int32 GetColumnCount() override; + virtual OUString getDimensionName(sal_Int32 nColumn) override; + virtual bool getIsDataLayoutDimension(sal_Int32 nColumn) override; + virtual bool IsDateDimension(sal_Int32 nDim) override; virtual void DisposeData() override; virtual void SetEmptyFlags( bool bIgnoreEmptyRows, bool bRepeatIfEmpty ) override; diff --git a/sc/inc/dpshttab.hxx b/sc/inc/dpshttab.hxx index 71e7786a4ec3..f39665c95e52 100644 --- a/sc/inc/dpshttab.hxx +++ b/sc/inc/dpshttab.hxx @@ -96,11 +96,11 @@ public: ScSheetDPData(const ScDocument* pD, const ScSheetSourceDesc& rDesc, const ScDPCache& rCache); virtual ~ScSheetDPData() override; - virtual tools::Long GetColumnCount() override; - virtual OUString getDimensionName(tools::Long nColumn) override; - virtual bool getIsDataLayoutDimension(tools::Long nColumn) override; - virtual bool IsDateDimension(tools::Long nDim) override; - virtual sal_uInt32 GetNumberFormat(tools::Long nDim) override; + virtual sal_Int32 GetColumnCount() override; + virtual OUString getDimensionName(sal_Int32 nColumn) override; + virtual bool getIsDataLayoutDimension(sal_Int32 nColumn) override; + virtual bool IsDateDimension(sal_Int32 nDim) override; + virtual sal_uInt32 GetNumberFormat(sal_Int32 nDim) override; virtual void DisposeData() override; virtual void SetEmptyFlags( bool bIgnoreEmptyRows, bool bRepeatIfEmpty ) override; diff --git a/sc/inc/dptabdat.hxx b/sc/inc/dptabdat.hxx index 8ab4eb167b7f..2fd4064495aa 100644 --- a/sc/inc/dptabdat.hxx +++ b/sc/inc/dptabdat.hxx @@ -69,14 +69,14 @@ public: should be passed as a const instance. */ struct SAL_DLLPRIVATE CalcInfo { - ::std::vector<tools::Long> aColLevelDims; + ::std::vector<sal_Int32> aColLevelDims; ::std::vector<ScDPDimension*> aColDims; ::std::vector<ScDPLevel*> aColLevels; - ::std::vector<tools::Long> aRowLevelDims; + ::std::vector<sal_Int32> aRowLevelDims; ::std::vector<ScDPDimension*> aRowDims; ::std::vector<ScDPLevel*> aRowLevels; - ::std::vector<tools::Long> aPageDims; - ::std::vector<tools::Long> aDataSrcCols; + ::std::vector<sal_Int32> aPageDims; + ::std::vector<sal_Int32> aDataSrcCols; ScDPInitState* pInitState; ScDPResultMember* pColRoot; @@ -90,19 +90,19 @@ public: ScDPTableData(const ScDocument* pDoc); virtual ~ScDPTableData(); - OUString GetFormattedString(tools::Long nDim, const ScDPItemData& rItem, bool bLocaleIndependent) const; + OUString GetFormattedString(sal_Int32 nDim, const ScDPItemData& rItem, bool bLocaleIndependent) const; tools::Long GetDatePart( tools::Long nDateVal, tools::Long nHierarchy, tools::Long nLevel ); //! use (new) typed collection instead of ScStrCollection //! or separate Str and ValueCollection - virtual tools::Long GetColumnCount() = 0; - virtual const std::vector< SCROW >& GetColumnEntries( tools::Long nColumn ) ; - virtual OUString getDimensionName(tools::Long nColumn) = 0; - virtual bool getIsDataLayoutDimension(tools::Long nColumn) = 0; - virtual bool IsDateDimension(tools::Long nDim) = 0; - virtual sal_uInt32 GetNumberFormat(tools::Long nDim); + virtual sal_Int32 GetColumnCount() = 0; + virtual const std::vector< SCROW >& GetColumnEntries( sal_Int32 nColumn ) ; + virtual OUString getDimensionName(sal_Int32 nColumn) = 0; + virtual bool getIsDataLayoutDimension(sal_Int32 nColumn) = 0; + virtual bool IsDateDimension(sal_Int32 nDim) = 0; + virtual sal_uInt32 GetNumberFormat(sal_Int32 nDim); sal_uInt32 GetNumberFormatByIdx( NfIndexTableOffset ); virtual void DisposeData() = 0; virtual void SetEmptyFlags( bool bIgnoreEmptyRows, bool bRepeatIfEmpty ) = 0; @@ -119,19 +119,19 @@ public: virtual void ReloadCacheTable() = 0; // override in ScDPGroupTableData: - virtual bool IsBaseForGroup(tools::Long nDim) const; - virtual tools::Long GetGroupBase(tools::Long nGroupDim) const; - virtual bool IsNumOrDateGroup(tools::Long nDim) const; - virtual bool IsInGroup( const ScDPItemData& rGroupData, tools::Long nGroupIndex, - const ScDPItemData& rBaseData, tools::Long nBaseIndex ) const; - virtual bool HasCommonElement( const ScDPItemData& rFirstData, tools::Long nFirstIndex, - const ScDPItemData& rSecondData, tools::Long nSecondIndex ) const; - - virtual tools::Long GetMembersCount( tools::Long nDim ); - const ScDPItemData* GetMemberByIndex( tools::Long nDim, tools::Long nIndex ); - virtual const ScDPItemData* GetMemberById( tools::Long nDim, tools::Long nId); - virtual tools::Long GetSourceDim( tools::Long nDim ); - virtual tools::Long Compare( tools::Long nDim, tools::Long nDataId1, tools::Long nDataId2); + virtual bool IsBaseForGroup(sal_Int32 nDim) const; + virtual sal_Int32 GetGroupBase(sal_Int32 nGroupDim) const; + virtual bool IsNumOrDateGroup(sal_Int32 nDim) const; + virtual bool IsInGroup( const ScDPItemData& rGroupData, sal_Int32 nGroupIndex, + const ScDPItemData& rBaseData, sal_Int32 nBaseIndex ) const; + virtual bool HasCommonElement( const ScDPItemData& rFirstData, sal_Int32 nFirstIndex, + const ScDPItemData& rSecondData, sal_Int32 nSecondIndex ) const; + + virtual sal_Int32 GetMembersCount( sal_Int32 nDim ); + const ScDPItemData* GetMemberByIndex( sal_Int32 nDim, sal_Int32 nIndex ); + virtual const ScDPItemData* GetMemberById( sal_Int32 nDim, sal_Int32 nId); + virtual sal_Int32 GetSourceDim( sal_Int32 nDim ); + virtual sal_Int32 Compare( sal_Int32 nDim, sal_Int32 nDataId1, sal_Int32 nDataId2); #if DUMP_PIVOT_TABLE virtual void Dump() const; @@ -154,7 +154,7 @@ protected: private: void GetItemData(const ScDPFilteredCache& rCacheTable, sal_Int32 nRow, - const ::std::vector<tools::Long>& rDims, ::std::vector< SCROW >& rItemData); + const ::std::vector<sal_Int32>& rDims, ::std::vector< SCROW >& rItemData); }; #endif diff --git a/sc/inc/dptabres.hxx b/sc/inc/dptabres.hxx index 7a8f23564720..8e2ea36f1b42 100644 --- a/sc/inc/dptabres.hxx +++ b/sc/inc/dptabres.hxx @@ -105,7 +105,7 @@ struct ScDPSubTotalState class ScDPRunningTotalState { public: - typedef std::vector<tools::Long> IndexArray; /// array of long integers terminated by -1. + typedef std::vector<sal_Int32> IndexArray; /// array of sal_Int32 terminated by -1. ScDPRunningTotalState( ScDPResultMember* pColRoot, ScDPResultMember* pRowRoot ); @@ -117,8 +117,8 @@ public: const IndexArray& GetRowVisible() const { return maRowVisible;} const IndexArray& GetRowSorted() const { return maRowSorted;} - void AddColIndex( tools::Long nVisible, tools::Long nSorted ); - void AddRowIndex( tools::Long nVisible, tools::Long nSorted ); + void AddColIndex( sal_Int32 nVisible, tools::Long nSorted ); + void AddRowIndex( sal_Int32 nVisible, tools::Long nSorted ); void RemoveColIndex(); void RemoveRowIndex(); @@ -562,12 +562,12 @@ public: // called for the reference dimension ScDPDataMember* GetRowReferenceMember( const ScDPRelativePos* pMemberPos, const OUString* pName, - const tools::Long* pRowIndexes, const tools::Long* pColIndexes ) const; + const sal_Int32* pRowIndexes, const sal_Int32* pColIndexes ) const; // uses row root member from ScDPRunningTotalState static ScDPDataMember* GetColReferenceMember( const ScDPRelativePos* pMemberPos, const OUString* pName, - tools::Long nRefDimPos, const ScDPRunningTotalState& rRunning ); + sal_Int32 nRefDimPos, const ScDPRunningTotalState& rRunning ); #if DUMP_PIVOT_TABLE void DumpState( const ScDPResultMember* pRefMember, ScDocument* pDoc, ScAddress& rPos ) const; diff --git a/sc/inc/dptabsrc.hxx b/sc/inc/dptabsrc.hxx index 106c6cd74b66..c12d80a80e66 100644 --- a/sc/inc/dptabsrc.hxx +++ b/sc/inc/dptabsrc.hxx @@ -85,10 +85,10 @@ private: rtl::Reference<ScDPDimensions> pDimensions; // api objects // settings: - std::vector<tools::Long> maColDims; - std::vector<tools::Long> maRowDims; - std::vector<tools::Long> maDataDims; - std::vector<tools::Long> maPageDims; + std::vector<sal_Int32> maColDims; + std::vector<sal_Int32> maRowDims; + std::vector<sal_Int32> maDataDims; + std::vector<sal_Int32> maPageDims; ScDPResultTree maResFilterSet; bool bColumnGrand; @@ -96,7 +96,7 @@ private: bool bIgnoreEmptyRows; bool bRepeatIfEmpty; - tools::Long nDupCount; + sal_Int32 nDupCount; // results: std::unique_ptr<ScDPResultData> pResData; // keep the rest in this! @@ -148,27 +148,27 @@ public: GetGrandTotalName() const; css::sheet::DataPilotFieldOrientation - GetOrientation(tools::Long nColumn); - void SetOrientation(tools::Long nColumn, css::sheet::DataPilotFieldOrientation nNew); - tools::Long GetPosition(tools::Long nColumn); + GetOrientation(sal_Int32 nColumn); + void SetOrientation(sal_Int32 nColumn, css::sheet::DataPilotFieldOrientation nNew); + sal_Int32 GetPosition(sal_Int32 nColumn); - tools::Long GetDataDimensionCount() const; - ScDPDimension* GetDataDimension(tools::Long nIndex); - OUString GetDataDimName(tools::Long nIndex); + sal_Int32 GetDataDimensionCount() const; + ScDPDimension* GetDataDimension(sal_Int32 nIndex); + OUString GetDataDimName(sal_Int32 nIndex); const ScDPCache* GetCache(); - const ScDPItemData* GetItemDataById( tools::Long nDim, tools::Long nId ); - bool IsDataLayoutDimension(tools::Long nDim); + const ScDPItemData* GetItemDataById( sal_Int32 nDim, sal_Int32 nId ); + bool IsDataLayoutDimension(sal_Int32 nDim); css::sheet::DataPilotFieldOrientation GetDataLayoutOrientation(); - bool IsDateDimension(tools::Long nDim); + bool IsDateDimension(sal_Int32 nDim); - bool SubTotalAllowed(tools::Long nColumn); //! move to ScDPResultData + bool SubTotalAllowed(sal_Int32 nColumn); //! move to ScDPResultData ScDPDimension* AddDuplicated(const OUString& rNewName); - tools::Long GetDupCount() const { return nDupCount; } + sal_Int32 GetDupCount() const { return nDupCount; } - tools::Long GetSourceDim(tools::Long nDim); + sal_Int32 GetSourceDim(sal_Int32 nDim); const css::uno::Sequence<css::sheet::MemberResult>* GetMemberResults( const ScDPLevel* pLevel ); @@ -228,7 +228,7 @@ class ScDPDimensions : public cppu::WeakImplHelper< { private: ScDPSource* pSource; - tools::Long nDimCount; + sal_Int32 nDimCount; std::unique_ptr<rtl::Reference<ScDPDimension>[]> ppDims; @@ -264,13 +264,13 @@ class ScDPDimension : public cppu::WeakImplHelper< css::lang::XServiceInfo > { ScDPSource* pSource; - tools::Long nDim; // dimension index (== column ID) + sal_Int32 nDim; // dimension index (== column ID) rtl::Reference<ScDPHierarchies> mxHierarchies; ScGeneralFunction nFunction; OUString aName; // if empty, take from source std::optional<OUString> mpLayoutName; std::optional<OUString> mpSubtotalName; - tools::Long nSourceDim; // >=0 if dup'ed + sal_Int32 nSourceDim; // >=0 if dup'ed css::sheet::DataPilotFieldReference aReferenceValue; // settings for "show data as" / "displayed value" bool bHasSelectedPage; @@ -285,8 +285,8 @@ public: ScDPDimension(const ScDPDimension&) = delete; ScDPDimension& operator=(const ScDPDimension&) = delete; - tools::Long GetDimension() const { return nDim; } // dimension index in source - tools::Long GetSourceDim() const { return nSourceDim; } // >=0 if dup'ed + sal_Int32 GetDimension() const { return nDim; } // dimension index in source + sal_Int32 GetSourceDim() const { return nSourceDim; } // >=0 if dup'ed ScDPDimension* CreateCloneObject(); ScDPHierarchies* GetHierarchiesObject(); @@ -346,7 +346,7 @@ class ScDPHierarchies : public cppu::WeakImplHelper< { private: ScDPSource* pSource; - tools::Long nDim; + sal_Int32 nDim; // date columns have 3 hierarchies (flat/quarter/week), other columns only one // #i52547# don't offer the incomplete date hierarchy implementation static const tools::Long nHierCount = 1; @@ -371,7 +371,7 @@ public: virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override; virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override; - static tools::Long getCount(); + static sal_Int32 getCount(); ScDPHierarchy* getByIndex(tools::Long nIndex) const; }; @@ -382,12 +382,12 @@ class ScDPHierarchy : public cppu::WeakImplHelper< { private: ScDPSource* pSource; - tools::Long nDim; - tools::Long nHier; + sal_Int32 nDim; + sal_Int32 nHier; rtl::Reference<ScDPLevels> mxLevels; public: - ScDPHierarchy( ScDPSource* pSrc, tools::Long nD, tools::Long nH ); + ScDPHierarchy( ScDPSource* pSrc, sal_Int32 nDim, sal_Int32 nHier ); virtual ~ScDPHierarchy() override; ScDPLevels* GetLevelsObject(); @@ -412,14 +412,14 @@ class ScDPLevels : public cppu::WeakImplHelper< { private: ScDPSource* pSource; - tools::Long nDim; - tools::Long nHier; - tools::Long nLevCount; + sal_Int32 nDim; + sal_Int32 nHier; + sal_Int32 nLevCount; std::unique_ptr<rtl::Reference<ScDPLevel>[]> ppLevs; public: - ScDPLevels( ScDPSource* pSrc, tools::Long nD, tools::Long nH ); + ScDPLevels( ScDPSource* pSrc, sal_Int32 nDim, sal_Int32 nHier ); virtual ~ScDPLevels() override; // XNameAccess @@ -436,8 +436,8 @@ public: virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override; virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override; - tools::Long getCount() const; - ScDPLevel* getByIndex(tools::Long nIndex) const; + sal_Int32 getCount() const; + ScDPLevel* getByIndex(sal_Int32 nIndex) const; }; class ScDPLevel : public cppu::WeakImplHelper< @@ -449,9 +449,9 @@ class ScDPLevel : public cppu::WeakImplHelper< { private: ScDPSource* pSource; - tools::Long nDim; - tools::Long nHier; - tools::Long nLev; + sal_Int32 nDim; + sal_Int32 nHier; + sal_Int32 nLev; rtl::Reference<ScDPMembers> mxMembers; css::uno::Sequence<sal_Int16> aSubTotals; css::sheet::DataPilotFieldSortInfo aSortInfo; // stored user settings @@ -459,14 +459,14 @@ private: css::sheet::DataPilotFieldLayoutInfo aLayoutInfo; // stored user settings // valid only from result calculation: ::std::vector<sal_Int32> aGlobalOrder; // result of sorting by name or position - tools::Long nSortMeasure; // measure (index of data dimension) to sort by - tools::Long nAutoMeasure; // measure (index of data dimension) for AutoShow + sal_Int32 nSortMeasure; // measure (index of data dimension) to sort by + sal_Int32 nAutoMeasure; // measure (index of data dimension) for AutoShow bool bShowEmpty:1; bool bEnableLayout:1; // enabled only for row fields, not for the innermost one bool bRepeatItemLabels:1; public: - ScDPLevel( ScDPSource* pSrc, tools::Long nD, tools::Long nH, tools::Long nL ); + ScDPLevel( ScDPSource* pSrc, sal_Int32 nDim, sal_Int32 nHier, sal_Int32 nLevel ); virtual ~ScDPLevel() override; ScDPMembers* GetMembersObject(); @@ -516,8 +516,8 @@ public: const ::std::vector<sal_Int32>& GetGlobalOrder() const { return aGlobalOrder; } ::std::vector<sal_Int32>& GetGlobalOrder() { return aGlobalOrder; } - tools::Long GetSortMeasure() const { return nSortMeasure; } - tools::Long GetAutoMeasure() const { return nAutoMeasure; } + sal_Int32 GetSortMeasure() const { return nSortMeasure; } + sal_Int32 GetAutoMeasure() const { return nAutoMeasure; } bool IsOutlineLayout() const { @@ -551,15 +551,15 @@ class ScDPMembers : public cppu::WeakImplHelper< private: typedef std::vector<rtl::Reference<ScDPMember> > MembersType; ScDPSource* pSource; - tools::Long nDim; - tools::Long nHier; - tools::Long nLev; - tools::Long nMbrCount; + sal_Int32 nDim; + sal_Int32 nHier; + sal_Int32 nLev; + sal_Int32 nMbrCount; mutable MembersType maMembers; mutable ScDPMembersHashMap aHashMap; public: - ScDPMembers( ScDPSource* pSrc, tools::Long nD, tools::Long nH, tools::Long nL ); + ScDPMembers( ScDPSource* pSrc, sal_Int32 nDim, sal_Int32 nHier, sal_Int32 nLev ); virtual ~ScDPMembers() override; // XMembersAccess @@ -579,10 +579,10 @@ public: virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override; virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override; - tools::Long getCount() const { return nMbrCount;} - ScDPMember* getByIndex(tools::Long nIndex) const; + sal_Int32 getCount() const { return nMbrCount;} + ScDPMember* getByIndex(sal_Int32 nIndex) const; - tools::Long getMinMembers() const; + sal_Int32 getMinMembers() const; sal_Int32 GetIndexFromName( const OUString& rName ) const; // <0 if not found const ScDPItemData* GetSrcItemDataByIndex( SCROW nIndex); @@ -599,9 +599,9 @@ class ScDPMember : public cppu::WeakImplHelper< { private: ScDPSource* pSource; - tools::Long nDim; - tools::Long nHier; - tools::Long nLev; + sal_Int32 nDim; + sal_Int32 nHier; + sal_Int32 nLev; SCROW mnDataId; std::optional<OUString> mpLayoutName; @@ -611,7 +611,7 @@ private: bool bShowDet; public: - ScDPMember(ScDPSource* pSrc, tools::Long nD, tools::Long nH, tools::Long nL, SCROW nIndex); + ScDPMember(ScDPSource* pSrc, sal_Int32 nDim, sal_Int32 nHier, sal_Int32 nLev, SCROW nIndex); virtual ~ScDPMember() override; ScDPMember(const ScDPMember&) = delete; ScDPMember& operator=(const ScDPMember&) = delete; diff --git a/sc/inc/markdata.hxx b/sc/inc/markdata.hxx index af4379f26485..b1444b5dba35 100644 --- a/sc/inc/markdata.hxx +++ b/sc/inc/markdata.hxx @@ -142,8 +142,8 @@ public: void InsertTab( SCTAB nTab ); void DeleteTab( SCTAB nTab ); - void ShiftCols(const ScDocument& rDoc, SCCOL nStartCol, tools::Long nColOffset); - void ShiftRows(const ScDocument& rDoc, SCROW nStartRow, tools::Long nRowOffset); + void ShiftCols(const ScDocument& rDoc, SCCOL nStartCol, sal_Int32 nColOffset); + void ShiftRows(const ScDocument& rDoc, SCROW nStartRow, sal_Int32 nRowOffset); // Generate envelopes if multimarked and fills the passed ScRange object with // the smallest range that includes the marked area plus its envelopes. diff --git a/sc/inc/markmulti.hxx b/sc/inc/markmulti.hxx index 7af1ce788a62..27e61ca6b136 100644 --- a/sc/inc/markmulti.hxx +++ b/sc/inc/markmulti.hxx @@ -64,8 +64,8 @@ public: void Clear(); void MarkAllCols( SCROW nStartRow, SCROW nEndRow ); bool HasAnyMarks() const; - void ShiftCols(SCCOL nStartCol, tools::Long nColOffset); - void ShiftRows(SCROW nStartRow, tools::Long nRowOffset); + void ShiftCols(SCCOL nStartCol, sal_Int32 nColOffset); + void ShiftRows(SCROW nStartRow, sal_Int32 nRowOffset); // For faster access from within ScMarkData, instead of creating // ScMultiSelIter with ScFlatBoolRowSegments bottleneck. diff --git a/sc/source/core/data/dbdocutl.cxx b/sc/source/core/data/dbdocutl.cxx index ff01e867c5fa..d2fd0b8db01a 100644 --- a/sc/source/core/data/dbdocutl.cxx +++ b/sc/source/core/data/dbdocutl.cxx @@ -35,7 +35,7 @@ ScDatabaseDocUtil::StrData::StrData() : } void ScDatabaseDocUtil::PutData(ScDocument& rDoc, SCCOL nCol, SCROW nRow, SCTAB nTab, - const uno::Reference<sdbc::XRow>& xRow, tools::Long nRowPos, + const uno::Reference<sdbc::XRow>& xRow, sal_Int32 nRowPos, tools::Long nType, bool bCurrency, StrData* pStrData) { OUString aString; diff --git a/sc/source/core/data/dpgroup.cxx b/sc/source/core/data/dpgroup.cxx index a54e91fe4274..4ac9114337d8 100644 --- a/sc/source/core/data/dpgroup.cxx +++ b/sc/source/core/data/dpgroup.cxx @@ -483,7 +483,7 @@ void ScDPGroupTableData::AddGroupDimension( const ScDPGroupDimension& rGroup ) aGroups.push_back( aNewGroup ); } -void ScDPGroupTableData::SetNumGroupDimension( tools::Long nIndex, const ScDPNumGroupDimension& rGroup ) +void ScDPGroupTableData::SetNumGroupDimension( sal_Int32 nIndex, const ScDPNumGroupDimension& rGroup ) { if ( nIndex < nSourceCount ) { @@ -493,7 +493,7 @@ void ScDPGroupTableData::SetNumGroupDimension( tools::Long nIndex, const ScDPNum } } -tools::Long ScDPGroupTableData::GetDimensionIndex( const OUString& rName ) +sal_Int32 ScDPGroupTableData::GetDimensionIndex( const OUString& rName ) { for (tools::Long i = 0; i < nSourceCount; ++i) // nSourceCount excludes data layout if (pSourceData->getDimensionName(i) == rName) //TODO: ignore case? @@ -501,7 +501,7 @@ tools::Long ScDPGroupTableData::GetDimensionIndex( const OUString& rName ) return -1; // none } -tools::Long ScDPGroupTableData::GetColumnCount() +sal_Int32 ScDPGroupTableData::GetColumnCount() { return nSourceCount + aGroups.size(); } @@ -516,12 +516,12 @@ void ScDPGroupTableData::GetNumGroupInfo(tools::Long nDimension, ScDPNumGroupInf if ( nDimension < nSourceCount ) rInfo = pNumGroups[nDimension].GetInfo(); } -tools::Long ScDPGroupTableData::GetMembersCount( tools::Long nDim ) +sal_Int32 ScDPGroupTableData::GetMembersCount( sal_Int32 nDim ) { const std::vector< SCROW >& members = GetColumnEntries( nDim ); return members.size(); } -const std::vector< SCROW >& ScDPGroupTableData::GetColumnEntries( tools::Long nColumn ) +const std::vector< SCROW >& ScDPGroupTableData::GetColumnEntries( sal_Int32 nColumn ) { if ( nColumn >= nSourceCount ) { @@ -544,12 +544,12 @@ const std::vector< SCROW >& ScDPGroupTableData::GetColumnEntries( tools::Long n return pSourceData->GetColumnEntries( nColumn ); } -const ScDPItemData* ScDPGroupTableData::GetMemberById( tools::Long nDim, tools::Long nId ) +const ScDPItemData* ScDPGroupTableData::GetMemberById( sal_Int32 nDim, sal_Int32 nId ) { return pSourceData->GetMemberById( nDim, nId ); } -OUString ScDPGroupTableData::getDimensionName(tools::Long nColumn) +OUString ScDPGroupTableData::getDimensionName(sal_Int32 nColumn) { if ( nColumn >= nSourceCount ) { @@ -562,13 +562,13 @@ OUString ScDPGroupTableData::getDimensionName(tools::Long nColumn) return pSourceData->getDimensionName( nColumn ); } -bool ScDPGroupTableData::getIsDataLayoutDimension(tools::Long nColumn) +bool ScDPGroupTableData::getIsDataLayoutDimension(sal_Int32 nColumn) { // position of data layout dimension is moved from source data return ( nColumn == sal::static_int_cast<tools::Long>( nSourceCount + aGroups.size() ) ); // data layout dimension? } -bool ScDPGroupTableData::IsDateDimension(tools::Long nDim) +bool ScDPGroupTableData::IsDateDimension(sal_Int32 nDim) { if ( nDim >= nSourceCount ) { @@ -581,7 +581,7 @@ bool ScDPGroupTableData::IsDateDimension(tools::Long nDim) return pSourceData->IsDateDimension( nDim ); } -sal_uInt32 ScDPGroupTableData::GetNumberFormat(tools::Long nDim) +sal_uInt32 ScDPGroupTableData::GetNumberFormat(sal_Int32 nDim) { if ( nDim >= nSourceCount ) { @@ -801,9 +801,9 @@ void ScDPGroupTableData::ReloadCacheTable() pSourceData->ReloadCacheTable(); } -void ScDPGroupTableData::FillGroupValues(vector<SCROW>& rItems, const vector<tools::Long>& rDims) +void ScDPGroupTableData::FillGroupValues(vector<SCROW>& rItems, const vector<sal_Int32>& rDims) { - tools::Long nGroupedColumns = aGroups.size(); + sal_Int32 nGroupedColumns = aGroups.size(); const ScDPCache& rCache = GetCacheTable().getCache(); size_t i = 0; @@ -811,7 +811,7 @@ void ScDPGroupTableData::FillGroupValues(vector<SCROW>& rItems, const vector<too { bool bDateDim = false; - tools::Long nSourceDim = nColumn; + sal_Int32 nSourceDim = nColumn; if ( nColumn >= nSourceCount && nColumn < nSourceCount + nGroupedColumns ) { const ScDPGroupDimension& rGroupDim = aGroups[nColumn - nSourceCount]; @@ -871,13 +871,13 @@ void ScDPGroupTableData::FillGroupValues(vector<SCROW>& rItems, const vector<too } } -bool ScDPGroupTableData::IsBaseForGroup(tools::Long nDim) const +bool ScDPGroupTableData::IsBaseForGroup(sal_Int32 nDim) const { return std::any_of(aGroups.begin(), aGroups.end(), [&nDim](const ScDPGroupDimension& rDim) { return rDim.GetSourceDim() == nDim; }); } -tools::Long ScDPGroupTableData::GetGroupBase(tools::Long nGroupDim) const +sal_Int32 ScDPGroupTableData::GetGroupBase(sal_Int32 nGroupDim) const { auto aIter = std::find_if(aGroups.begin(), aGroups.end(), [&nGroupDim](const ScDPGroupDimension& rDim) { return rDim.GetGroupDim() == nGroupDim; }); @@ -887,7 +887,7 @@ tools::Long ScDPGroupTableData::GetGroupBase(tools::Long nGroupDim) const return -1; // none } -bool ScDPGroupTableData::IsNumOrDateGroup(tools::Long nDimension) const +bool ScDPGroupTableData::IsNumOrDateGroup(sal_Int32 nDimension) const { // Virtual method from ScDPTableData, used in result data to force text labels. @@ -905,8 +905,8 @@ bool ScDPGroupTableData::IsNumOrDateGroup(tools::Long nDimension) const return false; } -bool ScDPGroupTableData::IsInGroup( const ScDPItemData& rGroupData, tools::Long nGroupIndex, - const ScDPItemData& rBaseData, tools::Long nBaseIndex ) const +bool ScDPGroupTableData::IsInGroup( const ScDPItemData& rGroupData, sal_Int32 nGroupIndex, + const ScDPItemData& rBaseData, sal_Int32 nBaseIndex ) const { auto aIter = std::find_if(aGroups.begin(), aGroups.end(), [&nGroupIndex, &nBaseIndex](const ScDPGroupDimension& rDim) { @@ -933,8 +933,8 @@ bool ScDPGroupTableData::IsInGroup( const ScDPItemData& rGroupData, tools::Long return true; } -bool ScDPGroupTableData::HasCommonElement( const ScDPItemData& rFirstData, tools::Long nFirstIndex, - const ScDPItemData& rSecondData, tools::Long nSecondIndex ) const +bool ScDPGroupTableData::HasCommonElement( const ScDPItemData& rFirstData, sal_Int32 nFirstIndex, + const ScDPItemData& rSecondData, sal_Int32 nSecondIndex ) const { const ScDPGroupDimension* pFirstDim = nullptr; const ScDPGroupDimension* pSecondDim = nullptr; @@ -990,7 +990,7 @@ bool ScDPGroupTableData::HasCommonElement( const ScDPItemData& rFirstData, tools return true; } -tools::Long ScDPGroupTableData::GetSourceDim( tools::Long nDim ) +sal_Int32 ScDPGroupTableData::GetSourceDim( sal_Int32 nDim ) { if ( getIsDataLayoutDimension( nDim ) ) return nSourceCount; @@ -1002,7 +1002,7 @@ tools::Long ScDPGroupTableData::GetSourceDim( tools::Long nDim ) return nDim; } -tools::Long ScDPGroupTableData::Compare(tools::Long nDim, tools::Long nDataId1, tools::Long nDataId2) +sal_Int32 ScDPGroupTableData::Compare(sal_Int32 nDim, sal_Int32 nDataId1, sal_Int32 nDataId2) { if ( getIsDataLayoutDimension(nDim) ) return 0; diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx index 883913949fe1..52700061b1a2 100644 --- a/sc/source/core/data/dpobject.cxx +++ b/sc/source/core/data/dpobject.cxx @@ -528,19 +528,19 @@ void ScDPObject::CreateOutput() pOutput.reset( new ScDPOutput( pDoc, xSource, aOutRange.aStart, bFilterButton ) ); pOutput->SetHeaderLayout ( mbHeaderLayout ); - tools::Long nOldRows = nHeaderRows; + sal_Int32 nOldRows = nHeaderRows; nHeaderRows = pOutput->GetHeaderRows(); if ( !(bAllowMove && nHeaderRows != nOldRows) ) return; - tools::Long nDiff = nOldRows - nHeaderRows; + sal_Int32 nDiff = nOldRows - nHeaderRows; if ( nOldRows == 0 ) --nDiff; if ( nHeaderRows == 0 ) ++nDiff; - tools::Long nNewRow = aOutRange.aStart.Row() + nDiff; + sal_Int32 nNewRow = aOutRange.aStart.Row() + nDiff; if ( nNewRow < 0 ) nNewRow = 0; diff --git a/sc/source/core/data/dpoutput.cxx b/sc/source/core/data/dpoutput.cxx index 718a032978ba..a80a3e6cd777 100644 --- a/sc/source/core/data/dpoutput.cxx +++ b/sc/source/core/data/dpoutput.cxx @@ -330,7 +330,7 @@ void lcl_SetFrame( ScDocument* pDoc, SCTAB nTab, pDoc->ApplyFrameAreaTab(ScRange(nCol1, nRow1, nTab, nCol2, nRow2, nTab), aBox, aBoxInfo); } -void lcl_FillNumberFormats( std::unique_ptr<sal_uInt32[]>& rFormats, tools::Long& rCount, +void lcl_FillNumberFormats( std::unique_ptr<sal_uInt32[]>& rFormats, sal_Int32& rCount, const uno::Reference<sheet::XDataPilotMemberResults>& xLevRes, const uno::Reference<container::XIndexAccess>& xDims ) { @@ -1054,9 +1054,9 @@ void ScDPOutput::Output() SCCOL nColPos = nMemberStartCol + static_cast<SCCOL>(nField); //TODO: check for overflow const uno::Sequence<sheet::MemberResult> rSequence = pRowFields[nField].maResult; const sheet::MemberResult* pArray = rSequence.getConstArray(); - tools::Long nThisRowCount = rSequence.getLength(); + sal_Int32 nThisRowCount = rSequence.getLength(); OSL_ENSURE( nThisRowCount == nRowCount, "count mismatch" ); //TODO: ??? - for (tools::Long nRow=0; nRow<nThisRowCount; nRow++) + for (sal_Int32 nRow=0; nRow<nThisRowCount; nRow++) { SCROW nRowPos = nDataStartRow + static_cast<SCROW>(nRow); //TODO: check for overflow HeaderCell( nColPos, nRowPos, nTab, pArray[nRow], false, nField ); @@ -1104,13 +1104,13 @@ void ScDPOutput::Output() // output data results: - for (tools::Long nRow=0; nRow<nRowCount; nRow++) + for (sal_Int32 nRow=0; nRow<nRowCount; nRow++) { SCROW nRowPos = nDataStartRow + static_cast<SCROW>(nRow); //TODO: check for overflow const sheet::DataResult* pColAry = pRowAry[nRow].getConstArray(); - tools::Long nThisColCount = pRowAry[nRow].getLength(); + sal_Int32 nThisColCount = pRowAry[nRow].getLength(); OSL_ENSURE( nThisColCount == nColCount, "count mismatch" ); //TODO: ??? - for (tools::Long nCol=0; nCol<nThisColCount; nCol++) + for (sal_Int32 nCol=0; nCol<nThisColCount; nCol++) { SCCOL nColPos = nDataStartCol + static_cast<SCCOL>(nCol); //TODO: check for overflow DataCell( nColPos, nRowPos, nTab, pColAry[nCol] ); @@ -1147,7 +1147,7 @@ bool ScDPOutput::HasError() return bSizeOverflow || bResultsError; } -tools::Long ScDPOutput::GetHeaderRows() const +sal_Int32 ScDPOutput::GetHeaderRows() const { return pPageFields.size() + ( bDoFilter ? 1 : 0 ); } diff --git a/sc/source/core/data/dpsdbtab.cxx b/sc/source/core/data/dpsdbtab.cxx index 910e9171723e..0eaa46dc6422 100644 --- a/sc/source/core/data/dpsdbtab.cxx +++ b/sc/source/core/data/dpsdbtab.cxx @@ -77,13 +77,13 @@ void ScDatabaseDPData::DisposeData() aCacheTable.clear(); } -tools::Long ScDatabaseDPData::GetColumnCount() +sal_Int32 ScDatabaseDPData::GetColumnCount() { CreateCacheTable(); return GetCacheTable().getColSize(); } -OUString ScDatabaseDPData::getDimensionName(tools::Long nColumn) +OUString ScDatabaseDPData::getDimensionName(sal_Int32 nColumn) { if (getIsDataLayoutDimension(nColumn)) { @@ -96,12 +96,12 @@ OUString ScDatabaseDPData::getDimensionName(tools::Long nColumn) return aCacheTable.getFieldName(static_cast<SCCOL>(nColumn)); } -bool ScDatabaseDPData::getIsDataLayoutDimension(tools::Long nColumn) +bool ScDatabaseDPData::getIsDataLayoutDimension(sal_Int32 nColumn) { return ( nColumn == GetCacheTable().getColSize()); } -bool ScDatabaseDPData::IsDateDimension(tools::Long /* nDim */) +bool ScDatabaseDPData::IsDateDimension(sal_Int32 /* nDim */) { //TODO: later... return false; diff --git a/sc/source/core/data/dpshttab.cxx b/sc/source/core/data/dpshttab.cxx index 607c55879224..c15ba043fffe 100644 --- a/sc/source/core/data/dpshttab.cxx +++ b/sc/source/core/data/dpshttab.cxx @@ -73,13 +73,13 @@ void ScSheetDPData::DisposeData() aCacheTable.clear(); } -tools::Long ScSheetDPData::GetColumnCount() +sal_Int32 ScSheetDPData::GetColumnCount() { CreateCacheTable(); return aCacheTable.getColSize(); } -OUString ScSheetDPData::getDimensionName(tools::Long nColumn) +OUString ScSheetDPData::getDimensionName(sal_Int32 nColumn) { CreateCacheTable(); if (getIsDataLayoutDimension(nColumn)) @@ -99,7 +99,7 @@ OUString ScSheetDPData::getDimensionName(tools::Long nColumn) } } -bool ScSheetDPData::IsDateDimension(tools::Long nDim) +bool ScSheetDPData::IsDateDimension(sal_Int32 nDim) { CreateCacheTable(); tools::Long nColCount = aCacheTable.getColSize(); @@ -118,7 +118,7 @@ bool ScSheetDPData::IsDateDimension(tools::Long nDim) } } -sal_uInt32 ScSheetDPData::GetNumberFormat(tools::Long nDim) +sal_uInt32 ScSheetDPData::GetNumberFormat(sal_Int32 nDim) { CreateCacheTable(); if (getIsDataLayoutDimension(nDim)) @@ -146,7 +146,7 @@ sal_uInt32 ScDPTableData::GetNumberFormatByIdx( NfIndexTableOffset eIdx ) return 0; } -bool ScSheetDPData::getIsDataLayoutDimension(tools::Long nColumn) +bool ScSheetDPData::getIsDataLayoutDimension(sal_Int32 nColumn) { CreateCacheTable(); return (nColumn ==static_cast<tools::Long>( aCacheTable.getColSize())); diff --git a/sc/source/core/data/dptabdat.cxx b/sc/source/core/data/dptabdat.cxx index 1e547a6a6242..7b3c80712404 100644 --- a/sc/source/core/data/dptabdat.cxx +++ b/sc/source/core/data/dptabdat.cxx @@ -48,7 +48,7 @@ ScDPTableData::~ScDPTableData() { } -OUString ScDPTableData::GetFormattedString(tools::Long nDim, const ScDPItemData& rItem, bool bLocaleIndependent) const +OUString ScDPTableData::GetFormattedString(sal_Int32 nDim, const ScDPItemData& rItem, bool bLocaleIndependent) const { const ScDPCache& rCache = GetCacheTable().getCache(); return rCache.GetFormattedString(nDim, rItem, bLocaleIndependent); @@ -104,35 +104,35 @@ bool ScDPTableData::IsRepeatIfEmpty() return false; } -sal_uInt32 ScDPTableData::GetNumberFormat(tools::Long) +sal_uInt32 ScDPTableData::GetNumberFormat(sal_Int32) { return 0; // default format } -bool ScDPTableData::IsBaseForGroup(tools::Long) const +bool ScDPTableData::IsBaseForGroup(sal_Int32) const { return false; // always false } -tools::Long ScDPTableData::GetGroupBase(tools::Long) const +sal_Int32 ScDPTableData::GetGroupBase(sal_Int32) const { return -1; // always none } -bool ScDPTableData::IsNumOrDateGroup(tools::Long) const +bool ScDPTableData::IsNumOrDateGroup(sal_Int32) const { return false; // always false } -bool ScDPTableData::IsInGroup( const ScDPItemData&, tools::Long, - const ScDPItemData&, tools::Long ) const +bool ScDPTableData::IsInGroup( const ScDPItemData&, sal_Int32, + const ScDPItemData&, sal_Int32 ) const { OSL_FAIL("IsInGroup shouldn't be called for non-group data"); return false; } -bool ScDPTableData::HasCommonElement( const ScDPItemData&, tools::Long, - const ScDPItemData&, tools::Long ) const +bool ScDPTableData::HasCommonElement( const ScDPItemData&, sal_Int32, + const ScDPItemData&, sal_Int32 ) const { OSL_FAIL("HasCommonElement shouldn't be called for non-group data"); return false; @@ -215,13 +215,13 @@ void ScDPTableData::CalcResultsFromCacheTable(const ScDPFilteredCache& rCacheTab } void ScDPTableData::GetItemData(const ScDPFilteredCache& rCacheTable, sal_Int32 nRow, - const vector<tools::Long>& rDims, vector<SCROW>& rItemData) + const vector<sal_Int32>& rDims, vector<SCROW>& rItemData) { sal_Int32 nDimSize = rDims.size(); rItemData.reserve(rItemData.size() + nDimSize); for (sal_Int32 i = 0; i < nDimSize; ++i) { - tools::Long nDim = rDims[i]; + sal_Int32 nDim = rDims[i]; if (getIsDataLayoutDimension(nDim)) { @@ -238,14 +238,14 @@ void ScDPTableData::GetItemData(const ScDPFilteredCache& rCacheTable, sal_Int32 } } -tools::Long ScDPTableData::GetMembersCount( tools::Long nDim ) +sal_Int32 ScDPTableData::GetMembersCount( sal_Int32 nDim ) { if ( nDim > MAXCOL ) return 0; return GetCacheTable().getFieldEntries( nDim ).size(); } -const ScDPItemData* ScDPTableData::GetMemberByIndex( tools::Long nDim, tools::Long nIndex ) +const ScDPItemData* ScDPTableData::GetMemberByIndex( sal_Int32 nDim, sal_Int32 nIndex ) { if ( nIndex >= GetMembersCount( nDim ) ) return nullptr; @@ -255,23 +255,22 @@ const ScDPItemData* ScDPTableData::GetMemberByIndex( tools::Long nDim, tools::Lo return GetCacheTable().getCache().GetItemDataById( static_cast<SCCOL>(nDim), static_cast<SCROW>(nMembers[nIndex]) ); } -const ScDPItemData* ScDPTableData::GetMemberById( tools::Long nDim, tools::Long nId) +const ScDPItemData* ScDPTableData::GetMemberById( sal_Int32 nDim, sal_Int32 nId) { return GetCacheTable().getCache().GetItemDataById(nDim, static_cast<SCROW>(nId)); } -const std::vector< SCROW >& ScDPTableData::GetColumnEntries( tools::Long nColumn ) +const std::vector< SCROW >& ScDPTableData::GetColumnEntries( sal_Int32 nColumn ) { return GetCacheTable().getFieldEntries( nColumn ); } -tools::Long ScDPTableData::GetSourceDim( tools::Long nDim ) +sal_Int32 ScDPTableData::GetSourceDim( sal_Int32 nDim ) { return nDim; - } -tools::Long ScDPTableData::Compare( tools::Long nDim, tools::Long nDataId1, tools::Long nDataId2) +sal_Int32 ScDPTableData::Compare( sal_Int32 nDim, sal_Int32 nDataId1, sal_Int32 nDataId2) { if ( getIsDataLayoutDimension(nDim) ) return 0; diff --git a/sc/source/core/data/dptabres.cxx b/sc/source/core/data/dptabres.cxx index 4fa7764531eb..263db7ea5a2b 100644 --- a/sc/source/core/data/dptabres.cxx +++ b/sc/source/core/data/dptabres.cxx @@ -314,7 +314,7 @@ ScDPRunningTotalState::ScDPRunningTotalState( ScDPResultMember* pColRoot, ScDPRe maRowSorted.push_back(-1); } -void ScDPRunningTotalState::AddColIndex( tools::Long nVisible, tools::Long nSorted ) +void ScDPRunningTotalState::AddColIndex( sal_Int32 nVisible, tools::Long nSorted ) { maColVisible.back() = nVisible; maColVisible.push_back(-1); @@ -323,7 +323,7 @@ void ScDPRunningTotalState::AddColIndex( tools::Long nVisible, tools::Long nSort maColSorted.push_back(-1); } -void ScDPRunningTotalState::AddRowIndex( tools::Long nVisible, tools::Long nSorted ) +void ScDPRunningTotalState::AddRowIndex( sal_Int32 nVisible, tools::Long nSorted ) { maRowVisible.back() = nVisible; maRowVisible.push_back(-1); @@ -1551,7 +1551,7 @@ void ScDPResultMember::FillDataResults( // IsVisible() test is in ScDPResultDimension::FillDataResults // (not on data layout dimension) const ScDPLevel* pParentLevel = GetParentLevel(); - tools::Long nStartRow = rFilterCxt.mnRow; + sal_Int32 nStartRow = rFilterCxt.mnRow; tools::Long nExtraSpace = 0; if ( pParentLevel && pParentLevel->IsAddEmpty() ) @@ -1569,7 +1569,7 @@ void ScDPResultMember::FillDataResults( if ( bTitleLine ) // in tabular layout the title is on a separate row ++rFilterCxt.mnRow; // -> fill child dimension one row below - tools::Long nOldRow = rFilterCxt.mnRow; + sal_Int32 nOldRow = rFilterCxt.mnRow; pChildDimension->FillDataResults(pRefMember, rFilterCxt, rSequence, nMeasure); rFilterCxt.mnRow = nOldRow; // Revert to the original row before the call. @@ -2348,8 +2348,8 @@ void ScDPDataMember::UpdateRunningTotals( bool bRefDimInRow = ( nRefOrient == sheet::DataPilotFieldOrientation_ROW ); ScDPResultDimension* pSelectDim = nullptr; - tools::Long nRowPos = 0; - tools::Long nColPos = 0; + sal_Int32 nRowPos = 0; + sal_Int32 nColPos = 0; // find the reference field in column or row dimensions @@ -2447,8 +2447,8 @@ void ScDPDataMember::UpdateRunningTotals( nColPos, rRunning ); else { - const tools::Long* pRowSorted = rRowSorted.data(); - const tools::Long* pColSorted = rColSorted.data(); + const sal_Int32* pRowSorted = rRowSorted.data(); + const sal_Int32* pColSorted = rColSorted.data(); pRowSorted += nRowPos + 1; // including the reference dimension pSelectMember = pSelectDim->GetRowReferenceMember( nullptr, nullptr, pRowSorted, pColSorted); @@ -2506,8 +2506,8 @@ void ScDPDataMember::UpdateRunningTotals( else { aRefItemPos.nBasePos = rRowVisible[nRowPos]; // without sort order applied - const tools::Long* pRowSorted = rRowSorted.data(); - const tools::Long* pColSorted = rColSorted.data(); + const sal_Int32* pRowSorted = rRowSorted.data(); + const sal_Int32* pColSorted = rColSorted.data(); pRowSorted += nRowPos + 1; // including the reference dimension pSelectMember = pSelectDim->GetRowReferenceMember( pRefPos, pRefName, pRowSorted, pColSorted); @@ -3247,7 +3247,7 @@ void ScDPResultDimension::UpdateRunningTotals( const ScDPResultMember* pRefMembe ScDPDataMember* ScDPResultDimension::GetRowReferenceMember( const ScDPRelativePos* pRelativePos, const OUString* pName, - const tools::Long* pRowIndexes, const tools::Long* pColIndexes ) const + const sal_Int32* pRowIndexes, const sal_Int32* pColIndexes ) const { // get named, previous/next, or first member of this dimension (first existing if pRelativePos and pName are NULL) @@ -3290,7 +3290,7 @@ ScDPDataMember* ScDPResultDimension::GetRowReferenceMember( // get child members by given indexes - const tools::Long* pNextRowIndex = pRowIndexes; + const sal_Int32* pNextRowIndex = pRowIndexes; while ( *pNextRowIndex >= 0 && pRowMember ) { const ScDPResultDimension* pRowChild = pRowMember->GetChildDimension(); @@ -3315,7 +3315,7 @@ ScDPDataMember* ScDPResultDimension::GetRowReferenceMember( { pColMember = pRowMember->GetDataRoot(); - const tools::Long* pNextColIndex = pColIndexes; + const sal_Int32* pNextColIndex = pColIndexes; while ( *pNextColIndex >= 0 && pColMember ) { ScDPDataDimension* pColChild = pColMember->GetChildDimension(); @@ -3337,19 +3337,19 @@ ScDPDataMember* ScDPResultDimension::GetRowReferenceMember( ScDPDataMember* ScDPResultDimension::GetColReferenceMember( const ScDPRelativePos* pRelativePos, const OUString* pName, - tools::Long nRefDimPos, const ScDPRunningTotalState& rRunning ) + sal_Int32 nRefDimPos, const ScDPRunningTotalState& rRunning ) { OSL_ENSURE( pRelativePos == nullptr || pName == nullptr, "can't use position and name" ); - const tools::Long* pColIndexes = rRunning.GetColSorted().data(); - const tools::Long* pRowIndexes = rRunning.GetRowSorted().data(); + const sal_Int32* pColIndexes = rRunning.GetColSorted().data(); + const sal_Int32* pRowIndexes = rRunning.GetRowSorted().data(); // get own row member using all indexes const ScDPResultMember* pRowMember = rRunning.GetRowResRoot(); ScDPDataMember* pColMember = nullptr; - const tools::Long* pNextRowIndex = pRowIndexes; + const sal_Int32* pNextRowIndex = pRowIndexes; while ( *pNextRowIndex >= 0 && pRowMember ) { const ScDPResultDimension* pRowChild = pRowMember->GetChildDimension(); @@ -3367,8 +3367,8 @@ ScDPDataMember* ScDPResultDimension::GetColReferenceMember( { pColMember = pRowMember->GetDataRoot(); - const tools::Long* pNextColIndex = pColIndexes; - tools::Long nColSkipped = 0; + const sal_Int32* pNextColIndex = pColIndexes; + sal_Int32 nColSkipped = 0; while ( *pNextColIndex >= 0 && pColMember && nColSkipped < nRefDimPos ) { ScDPDataDimension* pColChild = pColMember->GetChildDimension(); @@ -3423,7 +3423,7 @@ ScDPDataMember* ScDPResultDimension::GetColReferenceMember( // get column members below the reference field - const tools::Long* pNextColIndex = pColIndexes + nRefDimPos + 1; + const sal_Int32* pNextColIndex = pColIndexes + nRefDimPos + 1; while ( *pNextColIndex >= 0 && pColMember ) { ScDPDataDimension* pColChild = pColMember->GetChildDimension(); @@ -3909,8 +3909,8 @@ void ScDPResultVisibilityData::fillFieldFilters(vector<ScDPFilteredCache::Criter typedef std::unordered_map<OUString, long> FieldNameMapType; FieldNameMapType aFieldNames; ScDPTableData* pData = mpSource->GetData(); - tools::Long nColumnCount = pData->GetColumnCount(); - for (tools::Long i = 0; i < nColumnCount; ++i) + sal_Int32 nColumnCount = pData->GetColumnCount(); + for (sal_Int32 i = 0; i < nColumnCount; ++i) { aFieldNames.emplace(pData->getDimensionName(i), i); } diff --git a/sc/source/core/data/dptabsrc.cxx b/sc/source/core/data/dptabsrc.cxx index 62ef223a8eeb..56f5256929a0 100644 --- a/sc/source/core/data/dptabsrc.cxx +++ b/sc/source/core/data/dptabsrc.cxx @@ -123,7 +123,7 @@ const std::optional<OUString> & ScDPSource::GetGrandTotalName() const return mpGrandTotalName; } -sheet::DataPilotFieldOrientation ScDPSource::GetOrientation(tools::Long nColumn) +sheet::DataPilotFieldOrientation ScDPSource::GetOrientation(sal_Int32 nColumn) { if (std::find(maColDims.begin(), maColDims.end(), nColumn) != maColDims.end()) return sheet::DataPilotFieldOrientation_COLUMN; @@ -140,21 +140,21 @@ sheet::DataPilotFieldOrientation ScDPSource::GetOrientation(tools::Long nColumn) return sheet::DataPilotFieldOrientation_HIDDEN; } -tools::Long ScDPSource::GetDataDimensionCount() const +sal_Int32 ScDPSource::GetDataDimensionCount() const { return maDataDims.size(); } -ScDPDimension* ScDPSource::GetDataDimension(tools::Long nIndex) +ScDPDimension* ScDPSource::GetDataDimension(sal_Int32 nIndex) { if (nIndex < 0 || o3tl::make_unsigned(nIndex) >= maDataDims.size()) return nullptr; - tools::Long nDimIndex = maDataDims[nIndex]; + sal_Int32 nDimIndex = maDataDims[nIndex]; return GetDimensionsObject()->getByIndex(nDimIndex); } -OUString ScDPSource::GetDataDimName(tools::Long nIndex) +OUString ScDPSource::GetDataDimName(sal_Int32 nIndex) { OUString aRet; ScDPDimension* pDim = GetDataDimension(nIndex); @@ -163,9 +163,9 @@ OUString ScDPSource::GetDataDimName(tools::Long nIndex) return aRet; } -tools::Long ScDPSource::GetPosition(tools::Long nColumn) +sal_Int32 ScDPSource::GetPosition(sal_Int32 nColumn) { - std::vector<tools::Long>::const_iterator it, itBeg = maColDims.begin(), itEnd = maColDims.end(); + std::vector<sal_Int32>::const_iterator it, itBeg = maColDims.begin(), itEnd = maColDims.end(); it = std::find(itBeg, itEnd, nColumn); if (it != itEnd) return std::distance(itBeg, it); @@ -193,10 +193,10 @@ tools::Long ScDPSource::GetPosition(tools::Long nColumn) namespace { -bool testSubTotal( bool& rAllowed, tools::Long nColumn, const std::vector<tools::Long>& rDims, ScDPSource* pSource ) +bool testSubTotal( bool& rAllowed, sal_Int32 nColumn, const std::vector<sal_Int32>& rDims, ScDPSource* pSource ) { rAllowed = true; - std::vector<tools::Long>::const_iterator it = rDims.begin(), itEnd = rDims.end(); + std::vector<sal_Int32>::const_iterator it = rDims.begin(), itEnd = rDims.end(); for (; it != itEnd; ++it) { if (*it != nColumn) @@ -222,16 +222,16 @@ bool testSubTotal( bool& rAllowed, tools::Long nColumn, const std::vector<tools: return false; } -void removeDim( tools::Long nRemove, std::vector<tools::Long>& rDims ) +void removeDim( sal_Int32 nRemove, std::vector<sal_Int32>& rDims ) { - std::vector<tools::Long>::iterator it = std::find(rDims.begin(), rDims.end(), nRemove); + std::vector<sal_Int32>::iterator it = std::find(rDims.begin(), rDims.end(), nRemove); if (it != rDims.end()) rDims.erase(it); } } -bool ScDPSource::SubTotalAllowed(tools::Long nColumn) +bool ScDPSource::SubTotalAllowed(sal_Int32 nColumn) { //TODO: cache this at ScDPResultData bool bAllowed = true; @@ -242,7 +242,7 @@ bool ScDPSource::SubTotalAllowed(tools::Long nColumn) return bAllowed; } -void ScDPSource::SetOrientation(tools::Long nColumn, sheet::DataPilotFieldOrientation nNew) +void ScDPSource::SetOrientation(sal_Int32 nColumn, sheet::DataPilotFieldOrientation nNew) { //TODO: change to no-op if new orientation is equal to old? @@ -276,7 +276,7 @@ void ScDPSource::SetOrientation(tools::Long nColumn, sheet::DataPilotFieldOrient } } -bool ScDPSource::IsDataLayoutDimension(tools::Long nDim) +bool ScDPSource::IsDataLayoutDimension(sal_Int32 nDim) { return nDim == pData->GetColumnCount(); } @@ -286,7 +286,7 @@ sheet::DataPilotFieldOrientation ScDPSource::GetDataLayoutOrientation() return GetOrientation(pData->GetColumnCount()); } -bool ScDPSource::IsDateDimension(tools::Long nDim) +bool ScDPSource::IsDateDimension(sal_Int32 nDim) { return pData->IsDateDimension(nDim); } @@ -333,7 +333,7 @@ ScDPDimension* ScDPSource::AddDuplicated(const OUString& rNewName) return pDimensions->getByIndex( pDimensions->getCount() - 1 ); } -tools::Long ScDPSource::GetSourceDim(tools::Long nDim) +sal_Int32 ScDPSource::GetSourceDim(sal_Int32 nDim) { // original source dimension or data layout dimension? if ( nDim <= pData->GetColumnCount() ) @@ -364,15 +364,15 @@ uno::Sequence< uno::Sequence<sheet::DataResult> > SAL_CALL ScDPSource::getResult throw uno::RuntimeException(); } - tools::Long nColCount = pColResRoot->GetSize(pResData->GetColStartMeasure()); - tools::Long nRowCount = pRowResRoot->GetSize(pResData->GetRowStartMeasure()); + sal_Int32 nColCount = pColResRoot->GetSize(pResData->GetColStartMeasure()); + sal_Int32 nRowCount = pRowResRoot->GetSize(pResData->GetRowStartMeasure()); // allocate full sequence //TODO: leave out empty rows??? uno::Sequence< uno::Sequence<sheet::DataResult> > aSeq( nRowCount ); uno::Sequence<sheet::DataResult>* pRowAry = aSeq.getArray(); - for (tools::Long nRow = 0; nRow < nRowCount; nRow++) + for (sal_Int32 nRow = 0; nRow < nRowCount; nRow++) { uno::Sequence<sheet::DataResult> aColSeq( nColCount ); // use default values of DataResult @@ -438,13 +438,13 @@ void SAL_CALL ScDPSource::removeRefreshListener( const uno::Reference<util::XRef Sequence< Sequence<Any> > SAL_CALL ScDPSource::getDrillDownData(const Sequence<sheet::DataPilotFieldFilter>& aFilters) { - tools::Long nColumnCount = GetData()->GetColumnCount(); + sal_Int32 nColumnCount = GetData()->GetColumnCount(); vector<ScDPFilteredCache::Criterion> aFilterCriteria; for (const sheet::DataPilotFieldFilter& rFilter : aFilters) { const OUString& aFieldName = rFilter.FieldName; - for (tools::Long nCol = 0; nCol < nColumnCount; ++nCol) + for (sal_Int32 nCol = 0; nCol < nColumnCount; ++nCol) { if (aFieldName == pData->getDimensionName(nCol)) { @@ -598,7 +598,7 @@ static tools::Long lcl_CountMinMembers(const vector<ScDPDimension*>& ppDim, cons void ScDPSource::FillCalcInfo(bool bIsRow, ScDPTableData::CalcInfo& rInfo, bool &rHasAutoShow) { - const std::vector<tools::Long>& rDims = bIsRow ? maRowDims : maColDims; + const std::vector<sal_Int32>& rDims = bIsRow ? maRowDims : maColDims; for (const auto& rDimIndex : rDims) { ScDPDimension* pDim = GetDimensionsObject()->getByIndex(rDimIndex); @@ -606,14 +606,14 @@ void ScDPSource::FillCalcInfo(bool bIsRow, ScDPTableData::CalcInfo& rInfo, bool if ( nHierarchy >= ScDPHierarchies::getCount() ) nHierarchy = 0; ScDPLevels* pLevels = pDim->GetHierarchiesObject()->getByIndex(nHierarchy)->GetLevelsObject(); - tools::Long nCount = pLevels->getCount(); + sal_Int32 nCount = pLevels->getCount(); //TODO: Test if (pDim->getIsDataLayoutDimension() && maDataDims.size() < 2) nCount = 0; //TODO: Test - for (tools::Long j = 0; j < nCount; ++j) + for (sal_Int32 j = 0; j < nCount; ++j) { ScDPLevel* pLevel = pLevels->getByIndex(j); pLevel->EvaluateSortOrder(); @@ -792,7 +792,7 @@ void ScDPSource::CreateRes_Impl() eRefType == sheet::DataPilotFieldReferenceType::ITEM_PERCENTAGE_DIFFERENCE || eRefType == sheet::DataPilotFieldReferenceType::RUNNING_TOTAL ) { - tools::Long nColumn = comphelper::findValue( + sal_Int32 nColumn = comphelper::findValue( GetDimensionsObject()->getElementNames(), aDataRefValues.back().ReferenceField); if ( nColumn >= 0 ) { @@ -957,7 +957,7 @@ void ScDPSource::FillLevelList( sheet::DataPilotFieldOrientation nOrientation, s { rList.clear(); - std::vector<tools::Long>* pDimIndex = nullptr; + std::vector<sal_Int32>* pDimIndex = nullptr; switch (nOrientation) { case sheet::DataPilotFieldOrientation_COLUMN: @@ -989,13 +989,13 @@ void ScDPSource::FillLevelList( sheet::DataPilotFieldOrientation nOrientation, s OSL_ENSURE( pDim->getOrientation() == nOrientation, "orientations are wrong" ); ScDPHierarchies* pHiers = pDim->GetHierarchiesObject(); - tools::Long nHierarchy = ScDPDimension::getUsedHierarchy(); + sal_Int32 nHierarchy = ScDPDimension::getUsedHierarchy(); if ( nHierarchy >= ScDPHierarchies::getCount() ) nHierarchy = 0; ScDPHierarchy* pHier = pHiers->getByIndex(nHierarchy); ScDPLevels* pLevels = pHier->GetLevelsObject(); - tools::Long nLevCount = pLevels->getCount(); - for (tools::Long nLev=0; nLev<nLevCount; nLev++) + sal_Int32 nLevCount = pLevels->getCount(); + for (sal_Int32 nLev=0; nLev<nLevCount; nLev++) { ScDPLevel* pLevel = pLevels->getByIndex(nLev); rList.push_back(pLevel); @@ -1018,7 +1018,7 @@ void ScDPSource::FillMemberResults() } FillLevelList( sheet::DataPilotFieldOrientation_COLUMN, aColLevelList ); - tools::Long nColLevelCount = aColLevelList.size(); + sal_Int32 nColLevelCount = aColLevelList.size(); if (nColLevelCount) { tools::Long nColDimSize = pColResRoot->GetSize(pResData->GetColStartMeasure()); @@ -1050,15 +1050,15 @@ const uno::Sequence<sheet::MemberResult>* ScDPSource::GetMemberResults( const Sc { FillMemberResults(); - tools::Long i = 0; - tools::Long nColCount = aColLevelList.size(); + sal_Int32 i = 0; + sal_Int32 nColCount = aColLevelList.size(); for (i=0; i<nColCount; i++) { ScDPLevel* pColLevel = aColLevelList[i]; if ( pColLevel == pLevel ) return &pColResults[i]; } - tools::Long nRowCount = aRowLevelList.size(); + sal_Int32 nRowCount = aRowLevelList.size(); for (i=0; i<nRowCount; i++) { ScDPLevel* pRowLevel = aRowLevelList[i]; @@ -1177,11 +1177,11 @@ ScDPDimensions::~ScDPDimensions() void ScDPDimensions::CountChanged() { // include data layout dimension and duplicated dimensions - tools::Long nNewCount = pSource->GetData()->GetColumnCount() + 1 + pSource->GetDupCount(); + sal_Int32 nNewCount = pSource->GetData()->GetColumnCount() + 1 + pSource->GetDupCount(); if ( ppDims ) { - tools::Long i; - tools::Long nCopy = std::min( nNewCount, nDimCount ); + sal_Int32 i; + sal_Int32 nCopy = std::min( nNewCount, nDimCount ); rtl::Reference<ScDPDimension>* ppNew = new rtl::Reference<ScDPDimension>[nNewCount]; for (i=0; i<nCopy; i++) // copy existing dims @@ -1198,8 +1198,8 @@ void ScDPDimensions::CountChanged() uno::Any SAL_CALL ScDPDimensions::getByName( const OUString& aName ) { - tools::Long nCount = getCount(); - for (tools::Long i=0; i<nCount; i++) + sal_Int32 nCount = getCount(); + for (sal_Int32 i=0; i<nCount; i++) if ( getByIndex(i)->getName() == aName ) { uno::Reference<container::XNamed> xNamed = getByIndex(i); @@ -1512,7 +1512,7 @@ uno::Any SAL_CALL ScDPDimension::getPropertyValue( const OUString& aPropertyName { uno::Any aRet; if ( aPropertyName == SC_UNO_DP_POSITION ) - aRet <<= static_cast<sal_Int32>(pSource->GetPosition( nDim )); + aRet <<= pSource->GetPosition( nDim ); else if ( aPropertyName == SC_UNO_DP_USEDHIERARCHY ) aRet <<= static_cast<sal_Int32>(getUsedHierarchy()); else if ( aPropertyName == SC_UNO_DP_ORIENTATION ) @@ -1574,8 +1574,7 @@ uno::Any SAL_CALL ScDPDimension::getPropertyValue( const OUString& aPropertyName } else if (aPropertyName == SC_UNO_DP_ORIGINAL_POS) { - sal_Int32 nPos = static_cast<sal_Int32>(nSourceDim); - aRet <<= nPos; + aRet <<= nSourceDim; } else if ( aPropertyName == SC_UNO_DP_FILTER ) { @@ -1669,7 +1668,7 @@ sal_Bool SAL_CALL ScDPHierarchies::hasElements() // end of XNameAccess implementation -tools::Long ScDPHierarchies::getCount() +sal_Int32 ScDPHierarchies::getCount() { return nHierCount; } @@ -1684,7 +1683,7 @@ ScDPHierarchy* ScDPHierarchies::getByIndex(tools::Long nIndex) const if ( !ppHiers ) { const_cast<ScDPHierarchies*>(this)->ppHiers.reset( new rtl::Reference<ScDPHierarchy>[nHierCount] ); - for (tools::Long i=0; i<nHierCount; i++) + for (sal_Int32 i=0; i<nHierCount; i++) ppHiers[i] = nullptr; } if ( !ppHiers[nIndex].is() ) @@ -1698,7 +1697,7 @@ ScDPHierarchy* ScDPHierarchies::getByIndex(tools::Long nIndex) const return nullptr; //TODO: exception? } -ScDPHierarchy::ScDPHierarchy( ScDPSource* pSrc, tools::Long nD, tools::Long nH ) : +ScDPHierarchy::ScDPHierarchy( ScDPSource* pSrc, sal_Int32 nD, sal_Int32 nH ) : pSource( pSrc ), nDim( nD ), nHier( nH ) @@ -1751,7 +1750,7 @@ void SAL_CALL ScDPHierarchy::setName( const OUString& /* rNewName */ ) OSL_FAIL("not implemented"); //TODO: exception? } -ScDPLevels::ScDPLevels( ScDPSource* pSrc, tools::Long nD, tools::Long nH ) : +ScDPLevels::ScDPLevels( ScDPSource* pSrc, sal_Int32 nD, sal_Int32 nH ) : pSource( pSrc ), nDim( nD ), nHier( nH ) @@ -1830,12 +1829,12 @@ sal_Bool SAL_CALL ScDPLevels::hasElements() // end of XNameAccess implementation -tools::Long ScDPLevels::getCount() const +sal_Int32 ScDPLevels::getCount() const { return nLevCount; } -ScDPLevel* ScDPLevels::getByIndex(tools::Long nIndex) const +ScDPLevel* ScDPLevels::getByIndex(sal_Int32 nIndex) const { if ( nIndex >= 0 && nIndex < nLevCount ) { @@ -1888,7 +1887,7 @@ bool ScDPGlobalMembersOrder::operator()( sal_Int32 nIndex1, sal_Int32 nIndex2 ) return bAscending ? (nCompare < 0) : (nCompare > 0); } -ScDPLevel::ScDPLevel( ScDPSource* pSrc, tools::Long nD, tools::Long nH, tools::Long nL ) : +ScDPLevel::ScDPLevel( ScDPSource* pSrc, sal_Int32 nD, sal_Int32 nH, sal_Int32 nL ) : pSource( pSrc ), nDim( nD ), nHier( nH ), @@ -2174,7 +2173,7 @@ uno::Any SAL_CALL ScDPLevel::getPropertyValue( const OUString& aPropertyName ) SC_IMPL_DUMMY_PROPERTY_LISTENER( ScDPLevel ) -ScDPMembers::ScDPMembers( ScDPSource* pSrc, tools::Long nD, tools::Long nH, tools::Long nL ) : +ScDPMembers::ScDPMembers( ScDPSource* pSrc, sal_Int32 nD, sal_Int32 nH, sal_Int32 nL ) : pSource( pSrc ), nDim( nD ), nHier( nH ), @@ -2337,11 +2336,11 @@ uno::Sequence<OUString> ScDPMembers::getElementNames( bool bLocaleIndependent ) return aSeq; } -tools::Long ScDPMembers::getMinMembers() const +sal_Int32 ScDPMembers::getMinMembers() const { // used in lcl_CountMinMembers - tools::Long nVisCount = 0; + sal_Int32 nVisCount = 0; if (!maMembers.empty()) { nVisCount = std::count_if(maMembers.begin(), maMembers.end(), [](const rtl::Reference<ScDPMember>& pMbr) { @@ -2354,7 +2353,7 @@ tools::Long ScDPMembers::getMinMembers() const return nVisCount; } -ScDPMember* ScDPMembers::getByIndex(tools::Long nIndex) const +ScDPMember* ScDPMembers::getByIndex(sal_Int32 nIndex) const { // result of GetColumnEntries must not change between ScDPMembers ctor // and all calls to getByIndex @@ -2367,7 +2366,7 @@ ScDPMember* ScDPMembers::getByIndex(tools::Long nIndex) const if (!maMembers[nIndex]) { rtl::Reference<ScDPMember> pNew; - tools::Long nSrcDim = pSource->GetSourceDim( nDim ); + sal_Int32 nSrcDim = pSource->GetSourceDim( nDim ); if ( pSource->IsDataLayoutDimension(nSrcDim) ) { // empty name (never shown, not used for lookup) @@ -2448,7 +2447,7 @@ ScDPMember* ScDPMembers::getByIndex(tools::Long nIndex) const } ScDPMember::ScDPMember( - ScDPSource* pSrc, tools::Long nD, tools::Long nH, tools::Long nL, SCROW nIndex) : + ScDPSource* pSrc, sal_Int32 nD, sal_Int32 nH, sal_Int32 nL, SCROW nIndex) : pSource( pSrc ), nDim( nD ), nHier( nH ), @@ -2468,7 +2467,7 @@ ScDPMember::~ScDPMember() bool ScDPMember::IsNamedItem(SCROW nIndex) const { - tools::Long nSrcDim = pSource->GetSourceDim( nDim ); + sal_Int32 nSrcDim = pSource->GetSourceDim( nDim ); if ( nHier != SC_DAPI_HIERARCHY_FLAT && pSource->IsDateDimension( nSrcDim ) ) { const ScDPItemData* pData = pSource->GetCache()->GetItemDataById(nDim, nIndex); @@ -2614,7 +2613,7 @@ const ScDPItemData* ScDPMember::GetItemData() const return pData; } -const ScDPItemData* ScDPSource::GetItemDataById(tools::Long nDim, tools::Long nId) +const ScDPItemData* ScDPSource::GetItemDataById(sal_Int32 nDim, sal_Int32 nId) { return GetData()->GetMemberById(nDim, nId); } diff --git a/sc/source/core/data/markdata.cxx b/sc/source/core/data/markdata.cxx index 937fdf80c52a..7b45c51ecbea 100644 --- a/sc/source/core/data/markdata.cxx +++ b/sc/source/core/data/markdata.cxx @@ -648,7 +648,7 @@ void ScMarkData::DeleteTab( SCTAB nTab ) maTabMarked.swap(tabMarked); } -void ScMarkData::ShiftCols(const ScDocument& rDoc, SCCOL nStartCol, tools::Long nColOffset) +void ScMarkData::ShiftCols(const ScDocument& rDoc, SCCOL nStartCol, sal_Int32 nColOffset) { if (bMarked) { @@ -661,7 +661,7 @@ void ScMarkData::ShiftCols(const ScDocument& rDoc, SCCOL nStartCol, tools::Long } } -void ScMarkData::ShiftRows(const ScDocument& rDoc, SCROW nStartRow, tools::Long nRowOffset) +void ScMarkData::ShiftRows(const ScDocument& rDoc, SCROW nStartRow, sal_Int32 nRowOffset) { if (bMarked) { diff --git a/sc/source/core/data/markmulti.cxx b/sc/source/core/data/markmulti.cxx index d3e323c9c2d6..e0296a8808d7 100644 --- a/sc/source/core/data/markmulti.cxx +++ b/sc/source/core/data/markmulti.cxx @@ -341,7 +341,7 @@ bool ScMultiSel::HasAnyMarks() const return false; } -void ScMultiSel::ShiftCols(SCCOL nStartCol, tools::Long nColOffset) +void ScMultiSel::ShiftCols(SCCOL nStartCol, sal_Int32 nColOffset) { if (nStartCol > mrSheetLimits.mnMaxCol) return; @@ -392,7 +392,7 @@ void ScMultiSel::ShiftCols(SCCOL nStartCol, tools::Long nColOffset) aMultiSelContainer[nStartCol + i] = rNewCol; } -void ScMultiSel::ShiftRows(SCROW nStartRow, tools::Long nRowOffset) +void ScMultiSel::ShiftRows(SCROW nStartRow, sal_Int32 nRowOffset) { for (auto& aPair: aMultiSelContainer) aPair.Shift(nStartRow, nRowOffset); diff --git a/sc/source/core/tool/addincol.cxx b/sc/source/core/tool/addincol.cxx index daba6086d1f8..fba985930b78 100644 --- a/sc/source/core/tool/addincol.cxx +++ b/sc/source/core/tool/addincol.cxx @@ -1424,7 +1424,7 @@ void ScUnoAddInCall::ExecuteCallWithArgs(uno::Sequence<uno::Any>& rCallArgs) } template <typename T> -static tools::Long lcl_GetMaxColCount(const uno::Sequence< uno::Sequence<T> >* pRowSeq) +static sal_Int32 lcl_GetMaxColCount(const uno::Sequence< uno::Sequence<T> >* pRowSeq) { if (!pRowSeq->hasElements()) return 0; @@ -1499,23 +1499,23 @@ void ScUnoAddInCall::SetResult( const uno::Any& rNewRes ) if ( pRowSeq ) { - tools::Long nRowCount = pRowSeq->getLength(); - tools::Long nMaxColCount = lcl_GetMaxColCount(pRowSeq); + sal_Int32 nRowCount = pRowSeq->getLength(); + sal_Int32 nMaxColCount = lcl_GetMaxColCount(pRowSeq); if ( nMaxColCount && nRowCount ) { const uno::Sequence<sal_Int32>* pRowArr = pRowSeq->getConstArray(); xMatrix = new ScMatrix( static_cast<SCSIZE>(nMaxColCount), static_cast<SCSIZE>(nRowCount), 0.0); - for (tools::Long nRow=0; nRow<nRowCount; nRow++) + for (sal_Int32 nRow=0; nRow<nRowCount; nRow++) { - tools::Long nColCount = pRowArr[nRow].getLength(); + sal_Int32 nColCount = pRowArr[nRow].getLength(); const sal_Int32* pColArr = pRowArr[nRow].getConstArray(); - for (tools::Long nCol=0; nCol<nColCount; nCol++) + for (sal_Int32 nCol=0; nCol<nColCount; nCol++) xMatrix->PutDouble( pColArr[nCol], static_cast<SCSIZE>(nCol), static_cast<SCSIZE>(nRow) ); - for (tools::Long nCol=nColCount; nCol<nMaxColCount; nCol++) + for (sal_Int32 nCol=nColCount; nCol<nMaxColCount; nCol++) xMatrix->PutDouble( 0.0, static_cast<SCSIZE>(nCol), static_cast<SCSIZE>(nRow) ); @@ -1534,23 +1534,23 @@ void ScUnoAddInCall::SetResult( const uno::Any& rNewRes ) if ( pRowSeq ) { - tools::Long nRowCount = pRowSeq->getLength(); - tools::Long nMaxColCount = lcl_GetMaxColCount(pRowSeq); + sal_Int32 nRowCount = pRowSeq->getLength(); + sal_Int32 nMaxColCount = lcl_GetMaxColCount(pRowSeq); if ( nMaxColCount && nRowCount ) { const uno::Sequence<double>* pRowArr = pRowSeq->getConstArray(); xMatrix = new ScMatrix( static_cast<SCSIZE>(nMaxColCount), static_cast<SCSIZE>(nRowCount), 0.0); - for (tools::Long nRow=0; nRow<nRowCount; nRow++) + for (sal_Int32 nRow=0; nRow<nRowCount; nRow++) { - tools::Long nColCount = pRowArr[nRow].getLength(); + sal_Int32 nColCount = pRowArr[nRow].getLength(); const double* pColArr = pRowArr[nRow].getConstArray(); - for (tools::Long nCol=0; nCol<nColCount; nCol++) + for (sal_Int32 nCol=0; nCol<nColCount; nCol++) xMatrix->PutDouble( pColArr[nCol], static_cast<SCSIZE>(nCol), static_cast<SCSIZE>(nRow) ); - for (tools::Long nCol=nColCount; nCol<nMaxColCount; nCol++) + for (sal_Int32 nCol=nColCount; nCol<nMaxColCount; nCol++) xMatrix->PutDouble( 0.0, static_cast<SCSIZE>(nCol), static_cast<SCSIZE>(nRow) ); @@ -1569,25 +1569,25 @@ void ScUnoAddInCall::SetResult( const uno::Any& rNewRes ) if ( pRowSeq ) { - tools::Long nRowCount = pRowSeq->getLength(); - tools::Long nMaxColCount = lcl_GetMaxColCount(pRowSeq); + sal_Int32 nRowCount = pRowSeq->getLength(); + sal_Int32 nMaxColCount = lcl_GetMaxColCount(pRowSeq); if ( nMaxColCount && nRowCount ) { const uno::Sequence<OUString>* pRowArr = pRowSeq->getConstArray(); xMatrix = new ScMatrix( static_cast<SCSIZE>(nMaxColCount), static_cast<SCSIZE>(nRowCount), 0.0); - for (tools::Long nRow=0; nRow<nRowCount; nRow++) + for (sal_Int32 nRow=0; nRow<nRowCount; nRow++) { - tools::Long nColCount = pRowArr[nRow].getLength(); + sal_Int32 nColCount = pRowArr[nRow].getLength(); const OUString* pColArr = pRowArr[nRow].getConstArray(); - for (tools::Long nCol=0; nCol<nColCount; nCol++) + for (sal_Int32 nCol=0; nCol<nColCount; nCol++) { xMatrix->PutString( svl::SharedString(pColArr[nCol]), static_cast<SCSIZE>(nCol), static_cast<SCSIZE>(nRow)); } - for (tools::Long nCol=nColCount; nCol<nMaxColCount; nCol++) + for (sal_Int32 nCol=nColCount; nCol<nMaxColCount; nCol++) { xMatrix->PutString( svl::SharedString(EMPTY_OUSTRING), diff --git a/sc/source/core/tool/rangeseq.cxx b/sc/source/core/tool/rangeseq.cxx index 45b3aeb43d8d..54a6c6943074 100644 --- a/sc/source/core/tool/rangeseq.cxx +++ b/sc/source/core/tool/rangeseq.cxx @@ -64,16 +64,16 @@ bool ScRangeToSequence::FillLongArray( uno::Any& rAny, ScDocument& rDoc, const S SCTAB nTab = rRange.aStart.Tab(); SCCOL nStartCol = rRange.aStart.Col(); SCROW nStartRow = rRange.aStart.Row(); - tools::Long nColCount = rRange.aEnd.Col() + 1 - rRange.aStart.Col(); - tools::Long nRowCount = rRange.aEnd.Row() + 1 - rRange.aStart.Row(); + sal_Int32 nColCount = rRange.aEnd.Col() + 1 - rRange.aStart.Col(); + sal_Int32 nRowCount = rRange.aEnd.Row() + 1 - rRange.aStart.Row(); uno::Sequence< uno::Sequence<sal_Int32> > aRowSeq( nRowCount ); uno::Sequence<sal_Int32>* pRowAry = aRowSeq.getArray(); - for (tools::Long nRow = 0; nRow < nRowCount; nRow++) + for (sal_Int32 nRow = 0; nRow < nRowCount; nRow++) { uno::Sequence<sal_Int32> aColSeq( nColCount ); sal_Int32* pColAry = aColSeq.getArray(); - for (tools::Long nCol = 0; nCol < nColCount; nCol++) + for (sal_Int32 nCol = 0; nCol < nColCount; nCol++) pColAry[nCol] = lcl_DoubleToLong( rDoc.GetValue( ScAddress( static_cast<SCCOL>(nStartCol+nCol), static_cast<SCROW>(nStartRow+nRow), nTab ) ) ); @@ -117,16 +117,16 @@ bool ScRangeToSequence::FillDoubleArray( uno::Any& rAny, ScDocument& rDoc, const SCTAB nTab = rRange.aStart.Tab(); SCCOL nStartCol = rRange.aStart.Col(); SCROW nStartRow = rRange.aStart.Row(); - tools::Long nColCount = rRange.aEnd.Col() + 1 - rRange.aStart.Col(); - tools::Long nRowCount = rRange.aEnd.Row() + 1 - rRange.aStart.Row(); + sal_Int32 nColCount = rRange.aEnd.Col() + 1 - rRange.aStart.Col(); + sal_Int32 nRowCount = rRange.aEnd.Row() + 1 - rRange.aStart.Row(); uno::Sequence< uno::Sequence<double> > aRowSeq( nRowCount ); uno::Sequence<double>* pRowAry = aRowSeq.getArray(); - for (tools::Long nRow = 0; nRow < nRowCount; nRow++) + for (sal_Int32 nRow = 0; nRow < nRowCount; nRow++) { uno::Sequence<double> aColSeq( nColCount ); double* pColAry = aColSeq.getArray(); - for (tools::Long nCol = 0; nCol < nColCount; nCol++) + for (sal_Int32 nCol = 0; nCol < nColCount; nCol++) pColAry[nCol] = rDoc.GetValue( ScAddress( static_cast<SCCOL>(nStartCol+nCol), static_cast<SCROW>(nStartRow+nRow), nTab ) ); @@ -170,18 +170,18 @@ bool ScRangeToSequence::FillStringArray( uno::Any& rAny, ScDocument& rDoc, const SCTAB nTab = rRange.aStart.Tab(); SCCOL nStartCol = rRange.aStart.Col(); SCROW nStartRow = rRange.aStart.Row(); - tools::Long nColCount = rRange.aEnd.Col() + 1 - rRange.aStart.Col(); - tools::Long nRowCount = rRange.aEnd.Row() + 1 - rRange.aStart.Row(); + sal_Int32 nColCount = rRange.aEnd.Col() + 1 - rRange.aStart.Col(); + sal_Int32 nRowCount = rRange.aEnd.Row() + 1 - rRange.aStart.Row(); bool bHasErrors = false; uno::Sequence< uno::Sequence<OUString> > aRowSeq( nRowCount ); uno::Sequence<OUString>* pRowAry = aRowSeq.getArray(); - for (tools::Long nRow = 0; nRow < nRowCount; nRow++) + for (sal_Int32 nRow = 0; nRow < nRowCount; nRow++) { uno::Sequence<OUString> aColSeq( nColCount ); OUString* pColAry = aColSeq.getArray(); - for (tools::Long nCol = 0; nCol < nColCount; nCol++) + for (sal_Int32 nCol = 0; nCol < nColCount; nCol++) { FormulaError nErrCode = rDoc.GetStringForFormula( ScAddress(static_cast<SCCOL>(nStartCol+nCol), static_cast<SCROW>(nStartRow+nRow), nTab), @@ -242,18 +242,18 @@ bool ScRangeToSequence::FillMixedArray( uno::Any& rAny, ScDocument& rDoc, const SCTAB nTab = rRange.aStart.Tab(); SCCOL nStartCol = rRange.aStart.Col(); SCROW nStartRow = rRange.aStart.Row(); - tools::Long nColCount = rRange.aEnd.Col() + 1 - rRange.aStart.Col(); - tools::Long nRowCount = rRange.aEnd.Row() + 1 - rRange.aStart.Row(); + sal_Int32 nColCount = rRange.aEnd.Col() + 1 - rRange.aStart.Col(); + sal_Int32 nRowCount = rRange.aEnd.Row() + 1 - rRange.aStart.Row(); bool bHasErrors = false; uno::Sequence< uno::Sequence<uno::Any> > aRowSeq( nRowCount ); uno::Sequence<uno::Any>* pRowAry = aRowSeq.getArray(); - for (tools::Long nRow = 0; nRow < nRowCount; nRow++) + for (sal_Int32 nRow = 0; nRow < nRowCount; nRow++) { uno::Sequence<uno::Any> aColSeq( nColCount ); uno::Any* pColAry = aColSeq.getArray(); - for (tools::Long nCol = 0; nCol < nColCount; nCol++) + for (sal_Int32 nCol = 0; nCol < nColCount; nCol++) { uno::Any& rElement = pColAry[nCol]; diff --git a/sc/source/ui/Accessibility/AccessiblePreviewTable.cxx b/sc/source/ui/Accessibility/AccessiblePreviewTable.cxx index 5db9a2097972..aced9a883d98 100644 --- a/sc/source/ui/Accessibility/AccessiblePreviewTable.cxx +++ b/sc/source/ui/Accessibility/AccessiblePreviewTable.cxx @@ -476,12 +476,12 @@ uno::Reference< XAccessible > SAL_CALL ScAccessiblePreviewTable::getAccessibleCh uno::Reference<XAccessible> xRet; if ( mpTableInfo ) { - tools::Long nColumns = mpTableInfo->GetCols(); + sal_Int32 nColumns = mpTableInfo->GetCols(); if ( nColumns > 0 ) { // nCol, nRow are within the visible table, not the document - tools::Long nCol = nIndex % nColumns; - tools::Long nRow = nIndex / nColumns; + sal_Int32 nCol = nIndex % nColumns; + sal_Int32 nRow = nIndex / nColumns; xRet = getAccessibleCellAt( nRow, nCol ); } diff --git a/sc/source/ui/docshell/dbdocimp.cxx b/sc/source/ui/docshell/dbdocimp.cxx index 7a5036dd9812..edc242b8ccc5 100644 --- a/sc/source/ui/docshell/dbdocimp.cxx +++ b/sc/source/ui/docshell/dbdocimp.cxx @@ -233,7 +233,7 @@ bool ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam, // get column descriptions - tools::Long nColCount = 0; + sal_Int32 nColCount = 0; uno::Reference<sdbc::XResultSetMetaData> xMeta; uno::Reference<sdbc::XResultSetMetaDataSupplier> xMetaSupp( xRowSet, uno::UNO_QUERY ); if ( xMetaSupp.is() ) diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx index d98e2773b97d..755a563cc43a 100644 --- a/sc/source/ui/docshell/docfunc.cxx +++ b/sc/source/ui/docshell/docfunc.cxx @@ -2704,8 +2704,8 @@ bool ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMark, { ScRange aRange = qDecreaseRange.back(); - tools::Long nDecreaseRowCount = 0; - tools::Long nDecreaseColCount = 0; + sal_Int32 nDecreaseRowCount = 0; + sal_Int32 nDecreaseColCount = 0; if( eCmd == DelCellCmd::CellsUp || eCmd == DelCellCmd::Rows ) { if( nStartRow >= aRange.aStart.Row() && nStartRow <= aRange.aEnd.Row() && nEndRow>= aRange.aStart.Row() && nEndRow <= aRange.aEnd.Row() ) diff --git a/sc/source/ui/docshell/docsh8.cxx b/sc/source/ui/docshell/docsh8.cxx index b4a7faf5cc18..cb2f0586e5ab 100644 --- a/sc/source/ui/docshell/docsh8.cxx +++ b/sc/source/ui/docshell/docsh8.cxx @@ -287,7 +287,7 @@ ErrCode ScDocShell::DBaseImport( const OUString& rFullFileName, rtl_TextEncoding try { tools::Long i; - tools::Long nColCount = 0; + sal_Int32 nColCount = 0; OUString aTabName; uno::Reference<sdbc::XDriverManager2> xDrvMan; uno::Reference<sdbc::XConnection> xConnection; @@ -762,7 +762,7 @@ ErrCode ScDocShell::DBaseExport( const OUString& rFullFileName, rtl_TextEncoding bHasFieldNames = false; } - tools::Long nColCount = nLastCol - nFirstCol + 1; + sal_Int32 nColCount = nLastCol - nFirstCol + 1; uno::Sequence<OUString> aColNames( nColCount ); uno::Sequence<sal_Int32> aColTypes( nColCount ); uno::Sequence<sal_Int32> aColLengths( nColCount ); @@ -838,7 +838,7 @@ ErrCode ScDocShell::DBaseExport( const OUString& rFullFileName, rtl_TextEncoding const sal_Int32* pColTypes = aColTypes.getConstArray(); const sal_Int32* pColLengths = aColLengths.getConstArray(); const sal_Int32* pColScales = aColScales.getConstArray(); - tools::Long nCol; + sal_Int32 nCol; for (nCol=0; nCol<nColCount; nCol++) { diff --git a/sc/source/ui/inc/asciiopt.hxx b/sc/source/ui/inc/asciiopt.hxx index ad8b91981792..708a5b7df4f5 100644 --- a/sc/source/ui/inc/asciiopt.hxx +++ b/sc/source/ui/inc/asciiopt.hxx @@ -41,7 +41,7 @@ private: rtl_TextEncoding eCharSet; LanguageType eLang; bool bCharSetSystem; - tools::Long nStartRow; + sal_Int32 nStartRow; std::vector<sal_Int32> mvColStart; std::vector<sal_uInt8> mvColFormat; @@ -65,7 +65,7 @@ public: sal_uInt16 GetInfoCount() const { return mvColStart.size(); } const sal_Int32* GetColStart() const { return mvColStart.data(); } const sal_uInt8* GetColFormat() const { return mvColFormat.data(); } - tools::Long GetStartRow() const { return nStartRow; } + sal_Int32 GetStartRow() const { return nStartRow; } LanguageType GetLanguage() const { return eLang; } void SetCharSet( rtl_TextEncoding eNew ) { eCharSet = eNew; } @@ -78,7 +78,7 @@ public: void SetDetectSpecialNumber(bool bSet) { bDetectSpecialNumber = bSet; } void SetSkipEmptyCells(bool bSet) { bSkipEmptyCells = bSet; } void SetTextSep( sal_Unicode c ) { cTextSep = c; } - void SetStartRow( tools::Long nRow) { nStartRow= nRow; } + void SetStartRow( sal_Int32 nRow) { nStartRow= nRow; } void SetLanguage(LanguageType e) { eLang = e; } void SetColumnInfo( const ScCsvExpDataVec& rDataVec ); diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx index f760656f4467..e72686fe2422 100644 --- a/sc/source/ui/unoobj/cellsuno.cxx +++ b/sc/source/ui/unoobj/cellsuno.cxx @@ -1115,8 +1115,8 @@ static bool lcl_PutDataArray( ScDocShell& rDocShell, const ScRange& rRange, return false; } - tools::Long nCols = 0; - tools::Long nRows = aData.getLength(); + sal_Int32 nCols = 0; + sal_Int32 nRows = aData.getLength(); if ( nRows ) nCols = aData[0].getLength(); @@ -1250,8 +1250,8 @@ static bool lcl_PutFormulaArray( ScDocShell& rDocShell, const ScRange& rRange, return false; } - tools::Long nCols = 0; - tools::Long nRows = aData.getLength(); + sal_Int32 nCols = 0; + sal_Int32 nRows = aData.getLength(); if ( nRows ) nCols = aData[0].getLength(); @@ -2985,7 +2985,7 @@ uno::Sequence< uno::Sequence<double> > SAL_CALL ScCellRangesBase::getData() return uno::Sequence< uno::Sequence<double> >(0); } -ScRangeListRef ScCellRangesBase::GetLimitedChartRanges_Impl( tools::Long nDataColumns, tools::Long nDataRows ) const +ScRangeListRef ScCellRangesBase::GetLimitedChartRanges_Impl( sal_Int32 nDataColumns, sal_Int32 nDataRows ) const { if ( aRanges.size() == 1 ) { @@ -2998,13 +2998,13 @@ ScRangeListRef ScCellRangesBase::GetLimitedChartRanges_Impl( tools::Long nDataCo SCTAB nTab = rRange.aStart.Tab(); - tools::Long nEndColumn = nDataColumns - 1 + ( bChartColAsHdr ? 1 : 0 ); + sal_Int32 nEndColumn = nDataColumns - 1 + ( bChartColAsHdr ? 1 : 0 ); if ( nEndColumn < 0 ) nEndColumn = 0; if ( nEndColumn > rDoc.MaxCol() ) nEndColumn = rDoc.MaxCol(); - tools::Long nEndRow = nDataRows - 1 + ( bChartRowAsHdr ? 1 : 0 ); + sal_Int32 nEndRow = nDataRows - 1 + ( bChartRowAsHdr ? 1 : 0 ); if ( nEndRow < 0 ) nEndRow = 0; if ( nEndRow > rDoc.MaxRow() ) @@ -3022,8 +3022,8 @@ void SAL_CALL ScCellRangesBase::setData( const uno::Sequence< uno::Sequence<doub { SolarMutexGuard aGuard; bool bDone = false; - tools::Long nRowCount = aData.getLength(); - tools::Long nColCount = nRowCount ? aData[0].getLength() : 0; + sal_Int32 nRowCount = aData.getLength(); + sal_Int32 nColCount = nRowCount ? aData[0].getLength() : 0; ScRangeListRef xChartRanges = GetLimitedChartRanges_Impl( nColCount, nRowCount ); if ( pDocShell && xChartRanges.is() ) { @@ -3036,12 +3036,12 @@ void SAL_CALL ScCellRangesBase::setData( const uno::Sequence< uno::Sequence<doub if ( pPosMap->GetColCount() == static_cast<SCCOL>(nColCount) && pPosMap->GetRowCount() == static_cast<SCROW>(nRowCount) ) { - for (tools::Long nRow=0; nRow<nRowCount; nRow++) + for (sal_Int32 nRow=0; nRow<nRowCount; nRow++) { const uno::Sequence<double>& rRowSeq = aData[nRow]; const double* pArray = rRowSeq.getConstArray(); nColCount = rRowSeq.getLength(); - for (tools::Long nCol=0; nCol<nColCount; nCol++) + for (sal_Int32 nCol=0; nCol<nColCount; nCol++) { const ScAddress* pPos = pPosMap->GetPosition( sal::static_int_cast<SCCOL>(nCol), @@ -3094,7 +3094,7 @@ void SAL_CALL ScCellRangesBase::setRowDescriptions( bool bDone = false; if ( bChartColAsHdr ) { - tools::Long nRowCount = aRowDescriptions.getLength(); + sal_Int32 nRowCount = aRowDescriptions.getLength(); ScRangeListRef xChartRanges = GetLimitedChartRanges_Impl( 1, nRowCount ); if ( pDocShell && xChartRanges.is() ) { @@ -3107,7 +3107,7 @@ void SAL_CALL ScCellRangesBase::setRowDescriptions( if ( pPosMap->GetRowCount() == static_cast<SCROW>(nRowCount) ) { const OUString* pArray = aRowDescriptions.getConstArray(); - for (tools::Long nRow=0; nRow<nRowCount; nRow++) + for (sal_Int32 nRow=0; nRow<nRowCount; nRow++) { const ScAddress* pPos = pPosMap->GetRowHeaderPosition( static_cast<SCSIZE>(nRow) ); @@ -3163,7 +3163,7 @@ void SAL_CALL ScCellRangesBase::setColumnDescriptions( bool bDone = false; if ( bChartRowAsHdr ) { - tools::Long nColCount = aColumnDescriptions.getLength(); + sal_Int32 nColCount = aColumnDescriptions.getLength(); ScRangeListRef xChartRanges = GetLimitedChartRanges_Impl( nColCount, 1 ); if ( pDocShell && xChartRanges.is() ) { @@ -3176,7 +3176,7 @@ void SAL_CALL ScCellRangesBase::setColumnDescriptions( if ( pPosMap->GetColCount() == static_cast<SCCOL>(nColCount) ) { const OUString* pArray = aColumnDescriptions.getConstArray(); - for (tools::Long nCol=0; nCol<nColCount; nCol++) + for (sal_Int32 nCol=0; nCol<nColCount; nCol++) { const ScAddress* pPos = pPosMap->GetColHeaderPosition( sal::static_int_cast<SCCOL>(nCol) ); diff --git a/sc/source/ui/unoobj/funcuno.cxx b/sc/source/ui/unoobj/funcuno.cxx index 34de49629045..87cc9279ca00 100644 --- a/sc/source/ui/unoobj/funcuno.cxx +++ b/sc/source/ui/unoobj/funcuno.cxx @@ -309,7 +309,7 @@ static bool lcl_AddFunctionToken( ScTokenArray& rArray, const OUString& rName,co return false; // no valid function name } -static void lcl_AddRef( ScTokenArray& rArray, tools::Long nStartRow, tools::Long nColCount, tools::Long nRowCount ) +static void lcl_AddRef( ScTokenArray& rArray, sal_Int32 nStartRow, sal_Int32 nColCount, sal_Int32 nRowCount ) { ScComplexRefData aRef; aRef.InitRange(ScRange(0,nStartRow,0,nColCount-1,nStartRow+nRowCount-1,0)); @@ -332,19 +332,19 @@ public: // the other types methods are here just to reflect the orig code and for // completeness. - void visitElem( tools::Long nCol, tools::Long nRow, sal_Int16 elem ) + void visitElem( sal_Int32 nCol, sal_Int32 nRow, sal_Int16 elem ) { mpDoc->SetValue( static_cast<SCCOL>(nCol), static_cast<SCROW>(nRow), 0, elem ); } - void visitElem( tools::Long nCol, tools::Long nRow, sal_Int32 elem ) + void visitElem( sal_Int32 nCol, sal_Int32 nRow, sal_Int32 elem ) { mpDoc->SetValue( static_cast<SCCOL>(nCol), static_cast<SCROW>(nRow), 0, elem ); } - void visitElem( tools::Long nCol, tools::Long nRow, const double& elem ) + void visitElem( sal_Int32 nCol, sal_Int32 nRow, const double& elem ) { mpDoc->SetValue( static_cast<SCCOL>(nCol), static_cast<SCROW>(nRow), 0, elem ); } - void visitElem( tools::Long nCol, tools::Long nRow, const OUString& elem ) + void visitElem( sal_Int32 nCol, sal_Int32 nRow, const OUString& elem ) { if (!elem.isEmpty()) { @@ -353,7 +353,7 @@ public: mpDoc->SetString(ScAddress(nCol,nRow,0), elem, &aParam); } } - void visitElem( tools::Long nCol, tools::Long nRow, const uno::Any& rElement ) + void visitElem( sal_Int32 nCol, sal_Int32 nRow, const uno::Any& rElement ) { uno::TypeClass eElemClass = rElement.getValueTypeClass(); if ( eElemClass == uno::TypeClass_VOID ) @@ -391,14 +391,14 @@ class SequencesContainer { uno::Sequence< uno::Sequence< seq > > maSeq; - tools::Long& mrDocRow; + sal_Int32& mrDocRow; bool mbOverflow; bool mbArgError; ScDocument* mpDoc; ScTokenArray& mrTokenArr; public: - SequencesContainer( const uno::Any& rArg, ScTokenArray& rTokenArr, tools::Long& rDocRow, ScDocument* pDoc ) : + SequencesContainer( const uno::Any& rArg, ScTokenArray& rTokenArr, sal_Int32& rDocRow, ScDocument* pDoc ) : mrDocRow( rDocRow ), mbOverflow(false), mbArgError(false), mpDoc( pDoc ), mrTokenArr( rTokenArr ) { rArg >>= maSeq; @@ -407,16 +407,16 @@ public: void process() { SimpleVisitor aVisitor(mpDoc); - tools::Long nStartRow = mrDocRow; - tools::Long nRowCount = maSeq.getLength(); - tools::Long nMaxColCount = 0; + sal_Int32 nStartRow = mrDocRow; + sal_Int32 nRowCount = maSeq.getLength(); + sal_Int32 nMaxColCount = 0; for ( const uno::Sequence< seq >& rRow : maSeq ) { - tools::Long nColCount = rRow.getLength(); + sal_Int32 nColCount = rRow.getLength(); if ( nColCount > nMaxColCount ) nMaxColCount = nColCount; const seq* pColArr = rRow.getConstArray(); - for (tools::Long nCol=0; nCol<nColCount; nCol++) + for (sal_Int32 nCol=0; nCol<nColCount; nCol++) if ( nCol <= mpDoc->MaxCol() && mrDocRow <= mpDoc->MaxRow() ) aVisitor.visitElem( nCol, mrDocRow, pColArr[ nCol ] ); else @@ -436,7 +436,7 @@ class ArrayOfArrayProc { public: static void processSequences( ScDocument* pDoc, const uno::Any& rArg, ScTokenArray& rTokenArr, - tools::Long& rDocRow, bool& rArgErr, bool& rOverflow ) + sal_Int32& rDocRow, bool& rArgErr, bool& rOverflow ) { SequencesContainer< T > aContainer( rArg, rTokenArr, rDocRow, pDoc ); aContainer.process(); @@ -487,7 +487,7 @@ uno::Any SAL_CALL ScFunctionAccess::callFunction( const OUString& aName, bool bArgErr = false; bool bOverflow = false; - tools::Long nDocRow = 0; + sal_Int32 nDocRow = 0; tools::Long nArgCount = aArguments.getLength(); const uno::Any* pArgArr = aArguments.getConstArray(); @@ -557,9 +557,9 @@ uno::Any SAL_CALL ScFunctionAccess::callFunction( const OUString& aName, { ScRange const & rSrcRange = rRanges[ 0 ]; - tools::Long nStartRow = nDocRow; - tools::Long nColCount = rSrcRange.aEnd.Col() - rSrcRange.aStart.Col() + 1; - tools::Long nRowCount = rSrcRange.aEnd.Row() - rSrcRange.aStart.Row() + 1; + sal_Int32 nStartRow = nDocRow; + sal_Int32 nColCount = rSrcRange.aEnd.Col() - rSrcRange.aStart.Col() + 1; + sal_Int32 nRowCount = rSrcRange.aEnd.Row() - rSrcRange.aStart.Row() + 1; if ( nStartRow + nRowCount > pDoc->GetSheetLimits().GetMaxRowCount() ) bOverflow = true; diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx index dd7e152f0e93..d9eaab465ca4 100644 --- a/sc/source/ui/view/tabview.cxx +++ b/sc/source/ui/view/tabview.cxx @@ -2643,7 +2643,7 @@ void ScTabView::getRowColumnHeaders(const tools::Rectangle& rRectangle, tools::J mnLOKEndHeaderRow = nEndRow; } - tools::Long nVisibleRows = nEndRow - nStartRow; + sal_Int32 nVisibleRows = nEndRow - nStartRow; if (nVisibleRows < 25) nVisibleRows = 25; @@ -2741,7 +2741,7 @@ void ScTabView::getRowColumnHeaders(const tools::Rectangle& rRectangle, tools::J mnLOKEndHeaderCol = nEndCol; } - tools::Long nVisibleCols = nEndCol - nStartCol; + sal_Int32 nVisibleCols = nEndCol - nStartCol; if (nVisibleCols < 10) nVisibleCols = 10; |