summaryrefslogtreecommitdiff
path: root/sc/source/ui
diff options
context:
space:
mode:
authorNoel <noelgrandin@gmail.com>2020-10-21 07:49:00 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-10-30 08:57:07 +0100
commitf2be3d31cde821f5c1128deae7f2b95361ac1db9 (patch)
treeaac9582c61cf53e61da4b566c4d10b60af0475ad /sc/source/ui
parent46ecd31445bda45e10d58e937ff468a1a8f17da2 (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/source/ui')
-rw-r--r--sc/source/ui/Accessibility/AccessiblePreviewTable.cxx6
-rw-r--r--sc/source/ui/docshell/dbdocimp.cxx2
-rw-r--r--sc/source/ui/docshell/docfunc.cxx4
-rw-r--r--sc/source/ui/docshell/docsh8.cxx6
-rw-r--r--sc/source/ui/inc/asciiopt.hxx6
-rw-r--r--sc/source/ui/unoobj/cellsuno.cxx30
-rw-r--r--sc/source/ui/unoobj/funcuno.cxx36
-rw-r--r--sc/source/ui/view/tabview.cxx4
8 files changed, 47 insertions, 47 deletions
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;