diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-11-28 14:11:10 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-11-28 19:02:06 +0100 |
commit | c71d886120998884fdd16a862826f59883d9a114 (patch) | |
tree | 6967a263d1af03b6765d68fc9a72ff8b54a0afc0 | |
parent | 523189a32e8d867b71d23f8aa88708ae2757f727 (diff) |
fix a few places using SCROW/SCCOL datatypes incorrectly
Found while looking for problems in another patch.
This will become more important with "jumbo sheets" when using the wrong
datatype can mean overflow
Change-Id: I7370ffd8a6edc33a5e613242735e4c7b9eaf830d
Reviewed-on: https://gerrit.libreoffice.org/83991
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | sc/inc/interpretercontext.hxx | 2 | ||||
-rw-r--r-- | sc/qa/unit/mark_test.cxx | 2 | ||||
-rw-r--r-- | sc/source/core/data/table3.cxx | 2 | ||||
-rw-r--r-- | sc/source/core/tool/token.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/docshell/dbdocfun.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/miscdlgs/datatableview.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/view/viewfun2.cxx | 4 |
7 files changed, 8 insertions, 8 deletions
diff --git a/sc/inc/interpretercontext.hxx b/sc/inc/interpretercontext.hxx index 35b91947405c..7eb1f1415642 100644 --- a/sc/inc/interpretercontext.hxx +++ b/sc/inc/interpretercontext.hxx @@ -30,7 +30,7 @@ enum class SvNumFormatType : sal_Int16; // SetNumberFormat() is not thread-safe, so calls to it need to be delayed to the main thread. struct DelayedSetNumberFormat { - SCROW mCol; + SCCOL mCol; SCROW mRow; sal_uInt32 mnNumberFormat; }; diff --git a/sc/qa/unit/mark_test.cxx b/sc/qa/unit/mark_test.cxx index 6c2d3e870370..6cd63a02de6b 100644 --- a/sc/qa/unit/mark_test.cxx +++ b/sc/qa/unit/mark_test.cxx @@ -307,7 +307,7 @@ void Test::testMultiMark( const MultiMarkTestData& rMarksData ) CPPUNIT_ASSERT( aMark.IsAllMarked( rRange ) ); SCROW nRow1 = rRange.aStart.Row(), nRow2 = rRange.aEnd.Row(); SCCOL nCol1 = rRange.aStart.Col(), nCol2 = rRange.aEnd.Col(); - for ( SCROW nColIter = nCol1; nColIter <= nCol2; ++nColIter ) + for ( SCCOL nColIter = nCol1; nColIter <= nCol2; ++nColIter ) CPPUNIT_ASSERT( aMultiSel.IsAllMarked( nColIter, nRow1, nRow2 ) ); } diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx index 9f4eeb59e6a7..c3d627d09eff 100644 --- a/sc/source/core/data/table3.cxx +++ b/sc/source/core/data/table3.cxx @@ -3443,7 +3443,7 @@ bool ScTable::HasRowHeader( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCR } // First column all text cells, any non-text cell in second column => headers. - SCROW nTestCol = nStartCol + 1; + SCCOL nTestCol = nStartCol + 1; for (SCROW nRow=nStartRow; nRow<=nEndRow; nRow++) { CellType eType = GetCellType( nRow, nTestCol ); diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx index 8bed30a6a57f..d305044afe3f 100644 --- a/sc/source/core/tool/token.cxx +++ b/sc/source/core/tool/token.cxx @@ -3515,7 +3515,7 @@ void ScTokenArray::MoveReferenceRowReorder( const ScAddress& rPos, SCTAB nTab, S if (it != rRowMap.end()) { // This row is reordered. - SCCOL nNewRow = it->second; + SCROW nNewRow = it->second; aAbs.aStart.SetRow(nNewRow); aAbs.aEnd.SetRow(nNewRow); rRef.SetRange(aAbs, rPos); diff --git a/sc/source/ui/docshell/dbdocfun.cxx b/sc/source/ui/docshell/dbdocfun.cxx index b4dff2ee24b8..71507af7bce2 100644 --- a/sc/source/ui/docshell/dbdocfun.cxx +++ b/sc/source/ui/docshell/dbdocfun.cxx @@ -505,7 +505,7 @@ bool ScDBDocFunc::Sort( SCTAB nTab, const ScSortParam& rSortParam, // tdf#119804: If there is a header row/column, it won't be affected by // sorting; so we can exclude it from the test. SCROW nStartingRowToEdit = aLocalParam.nRow1; - SCROW nStartingColToEdit = aLocalParam.nCol1; + SCCOL nStartingColToEdit = aLocalParam.nCol1; if ( aLocalParam.bHasHeader ) { if ( aLocalParam.bByRow ) diff --git a/sc/source/ui/miscdlgs/datatableview.cxx b/sc/source/ui/miscdlgs/datatableview.cxx index 16463598e1fe..2541688a6677 100644 --- a/sc/source/ui/miscdlgs/datatableview.cxx +++ b/sc/source/ui/miscdlgs/datatableview.cxx @@ -277,7 +277,7 @@ void ScDataTableView::Paint(vcl::RenderContext& rRenderContext, const tools::Rec { Size aSize = GetSizePixel(); SCCOL nMaxVisibleCol = findColFromPos(aSize.Width() - nScrollBarSize, mpDoc.get(), mnFirstVisibleCol); - SCCOL nMaxVisibleRow = findRowFromPos(aSize.Height(), mpDoc.get(), mnFirstVisibleRow); + SCROW nMaxVisibleRow = findRowFromPos(aSize.Height(), mpDoc.get(), mnFirstVisibleRow); ScTableInfo aTableInfo; mpDoc->FillInfo(aTableInfo, mnFirstVisibleCol, mnFirstVisibleRow, nMaxVisibleCol, nMaxVisibleRow, 0, 0.06666, 0.06666, false, false); diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx index 5c5302a99517..0b3166bedef4 100644 --- a/sc/source/ui/view/viewfun2.cxx +++ b/sc/source/ui/view/viewfun2.cxx @@ -328,7 +328,7 @@ static bool lcl_FindNextSumEntryInColumn( ScDocument* pDoc, SCCOL nCol, SCROW& n } static bool lcl_FindNextSumEntryInRow( ScDocument* pDoc, SCCOL& nCol, SCROW nRow, - SCTAB nTab, SCCOLROW& nExtend, SCROW nMinCol ) + SCTAB nTab, SCCOLROW& nExtend, SCCOL nMinCol ) { const SCCOL nTmp = nCol; ScAutoSum eSkip = ScAutoSumNone; @@ -1512,7 +1512,7 @@ void ScViewFunc::CopyAutoSpellData( FillDir eDir, SCCOL nStartCol, SCROW nStartR std::vector<std::vector<MisspellRangesType>> aSourceSpellRanges(nRowRepeatSize, std::vector<MisspellRangesType>(nColRepeatSize)); for ( SCROW nRowIdx = 0; nRowIdx < nRowRepeatSize; ++nRowIdx ) - for ( SCROW nColIdx = 0; nColIdx < nColRepeatSize; ++nColIdx ) + for ( SCCOL nColIdx = 0; nColIdx < nColRepeatSize; ++nColIdx ) aSourceSpellRanges[nRowIdx][nColIdx] = pWin->GetAutoSpellData( nStartCol + nColIdx, nStartRow + nRowIdx ); switch( eDir ) |