sc/source/core/data/table4.cxx |   14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

New commits:
commit 8b5fdf155817d516ce40c203ccbade0c64a5d6e6
Author:     Luboš Luňák <l.lu...@collabora.com>
AuthorDate: Thu Apr 21 22:33:26 2022 +0200
Commit:     Luboš Luňák <l.lu...@collabora.com>
CommitDate: Fri Apr 22 07:43:49 2022 +0200

    use range-checked GetCellValue()
    
    Change-Id: Ie02b6be79d1be7481ebcfbc6862295a34e38f7db
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133304
    Tested-by: Jenkins
    Reviewed-by: Luboš Luňák <l.lu...@collabora.com>

diff --git a/sc/source/core/data/table4.cxx b/sc/source/core/data/table4.cxx
index 5105d9c36654..bad81a83dd9a 100644
--- a/sc/source/core/data/table4.cxx
+++ b/sc/source/core/data/table4.cxx
@@ -1887,7 +1887,7 @@ void ScTable::FillAutoSimple(
             {
                 if (bVertical)      // rInner&:=nRow, rOuter&:=nCol
                 {
-                    aSrcCell = aCol[rCol].GetCellValue(nSource);
+                    aSrcCell = GetCellValue(rCol, nSource);
                     if (nISrcStart == nISrcEnd && aSrcCell.meType == 
CELLTYPE_FORMULA)
                     {
                         FillFormulaVertical(*aSrcCell.mpFormula, rInner, rCol, 
nIStart, nIEnd, pProgress, rProgress);
@@ -1901,7 +1901,7 @@ void ScTable::FillAutoSimple(
                 }
                 else                // rInner&:=nCol, rOuter&:=nRow
                 {
-                    aSrcCell = aCol[nSource].GetCellValue(rRow);
+                    aSrcCell = GetCellValue(nSource, rRow);
                     const SvNumFormatType nFormatType = 
rDocument.GetFormatTable()->GetType(
                                 aCol[nSource].GetNumberFormat( 
rDocument.GetNonThreadedContext(), rRow));
                     bBooleanCell = (nFormatType == SvNumFormatType::LOGICAL);
@@ -2226,9 +2226,9 @@ void ScTable::FillSeries( SCCOL nCol1, SCROW nRow1, SCCOL 
nCol2, SCROW nRow2,
         // it is still a good upper estimation.
         ScCellValue aSrcCell;
         if (bVertical)
-            aSrcCell = 
aCol[static_cast<SCCOL>(nOStart)].GetCellValue(static_cast<SCROW>(nISource));
+            aSrcCell = GetCellValue(static_cast<SCCOL>(nOStart), 
static_cast<SCROW>(nISource));
         else
-            aSrcCell = 
aCol[static_cast<SCCOL>(nISource)].GetCellValue(static_cast<SCROW>(nOStart));
+            aSrcCell = GetCellValue(static_cast<SCCOL>(nISource), 
static_cast<SCROW>(nOStart));
         // Same logic as for the actual series.
         if (!aSrcCell.isEmpty() && (aSrcCell.meType == CELLTYPE_VALUE || 
aSrcCell.meType == CELLTYPE_FORMULA))
         {
@@ -2281,7 +2281,7 @@ void ScTable::FillSeries( SCCOL nCol1, SCROW nRow1, SCCOL 
nCol2, SCROW nRow2,
         CreateColumnIfNotExists(nCol);
 
         // Source cell value. We need to clone the value since it may be 
inserted repeatedly.
-        ScCellValue aSrcCell = 
aCol[nCol].GetCellValue(static_cast<SCROW>(nRow));
+        ScCellValue aSrcCell = GetCellValue(nCol, static_cast<SCROW>(nRow));
 
         // Maybe another source cell need to be searched, if the fill is going 
through merged cells,
         // where overlapped parts does not contain any information, so they 
can be skipped.
@@ -2306,9 +2306,9 @@ void ScTable::FillSeries( SCCOL nCol1, SCROW nRow1, SCCOL 
nCol2, SCROW nRow2,
 
             //Set the real source cell
             if (bVertical)
-                aSrcCell = 
aCol[nOStart].GetCellValue(static_cast<SCROW>(nFirstValueIdx));
+                aSrcCell = GetCellValue(nOStart, 
static_cast<SCROW>(nFirstValueIdx));
             else
-                aSrcCell = 
aCol[nFirstValueIdx].GetCellValue(static_cast<SCROW>(nOStart));
+                aSrcCell = GetCellValue(nFirstValueIdx, 
static_cast<SCROW>(nOStart));
         }
 
         const ScPatternAttr* pSrcPattern = 
aCol[nCol].GetPattern(static_cast<SCROW>(nRow));

Reply via email to