23#include <editeng/editeng.hxx>
29#include <rtl/math.hxx>
31#include <osl/diagnose.h>
38#include <document.hxx>
45#include <progress.hxx>
57#define D_MAX_LONG_ double(0x7fffffff)
61short lcl_DecompValueString( OUString& rValue, sal_Int32& nVal, sal_uInt16* pMinDigits =
nullptr )
63 if ( rValue.isEmpty() )
71 if (
p[nNum] ==
'-' ||
p[nNum] ==
'+' )
86 if (
p[nSign] ==
'0' && pMinDigits && ( nNum - nSign > *pMinDigits ) )
87 *pMinDigits = nNum - nSign;
88 rValue = rValue.copy(nNum);
94 sal_Int32 nEnd = nNum = rValue.getLength() - 1;
97 if (
p[nNum] ==
'-' ||
p[nNum] ==
'+' )
102 if ( nNum < nEnd - nSign )
106 if (
p[nNum+1+nSign] ==
'0' && pMinDigits && ( nEnd - nNum - nSign > *pMinDigits ) )
107 *pMinDigits = nEnd - nNum - nSign;
108 rValue = rValue.copy(0, nNum + 1);
119OUString lcl_ValueString( sal_Int32
nValue, sal_uInt16 nMinDigits )
121 if ( nMinDigits <= 1 )
122 return OUString::number(
nValue );
125 OUString
aStr = OUString::number( std::abs(
nValue ) );
126 if (
aStr.getLength() < nMinDigits )
128 OUStringBuffer aZero(nMinDigits);
130 aStr = aZero.append(
aStr).makeStringAndClear();
141 std::u16string_view rSuffix,
142 CellType eCellType,
bool bIsOrdinalSuffix )
145 OUString aValue = lcl_ValueString(
nValue, nDigits);
146 if (!bIsOrdinalSuffix)
156 aValue += aOrdinalSuffix;
169 ESelection(0, aValue.getLength(), 0, aValue.getLength() + aOrdinalSuffix.getLength()));
173 ESelection(0, aValue.getLength(), 0, aValue.getLength() + aOrdinalSuffix.getLength()));
187double approxDiff(
double a,
double b )
195 const double c =
a - b;
196 const double aa = fabs(a);
197 const double ab = fabs(b);
198 if (aa < 1e-16 || aa > 1e+16 || ab < 1e-16 || ab > 1e+16)
202 const double q = aa < ab ? b /
a :
a / b;
203 const double d = (
a * q - b * q) / q;
210 const double e = fabs(d - c);
211 const int nExp =
static_cast<int>(floor(log10(e))) + 1;
214 const int nExpArg =
static_cast<int>(floor(log10(std::max(aa, ab)))) - 15;
215 return rtl::math::round(c, -std::max(nExp, nExpArg));
218double approxTimeDiff(
double a,
double b )
232 return rtl::math::round((a - b) * 24, 9) / 24;
235double approxTypedDiff(
double a,
double b,
bool bTime )
237 return bTime ? approxTimeDiff( a, b) : approxDiff(
a, b);
243 double& rInc, sal_uInt16& rMinDigits,
245 bool bHasFiltered,
bool& rSkipOverlappedCells,
246 std::vector<sal_Int32>& rNonOverlappedCellIdx)
248 OSL_ENSURE( nCol1==nCol2 || nRow1==nRow2,
"FillAnalyse: invalid range" );
254 rSkipOverlappedCells =
false;
280 bool bHasOverlappedCells =
false;
281 bool bSkipOverlappedCells =
true;
282 SCCOL nColCurr = nCol1;
283 SCROW nRowCurr = nRow1;
286 rNonOverlappedCellIdx.resize(
nCount);
296 bHasOverlappedCells =
true;
300 rNonOverlappedCellIdx[nValueCount++] =
i;
303 bSkipOverlappedCells =
false;
309 rNonOverlappedCellIdx.resize(nValueCount);
312 if (nValueCount == 0)
316 if (!bHasOverlappedCells)
317 bSkipOverlappedCells =
false;
319 if (bSkipOverlappedCells)
321 nColCurr = nCol1 + rNonOverlappedCellIdx[0] * nAddX;
322 nRowCurr = nRow1 + rNonOverlappedCellIdx[0] * nAddY;
332 if (nCurrCellFormatType == SvNumFormatType::DATE)
334 if (nValueCount >= 2)
340 Date aCurrDate = aNullDate, aPrevDate = aNullDate;
342 for (
SCSIZE i = 1;
i < nValueCount && bVal;
i++)
344 aPrevCell = aCurrCell;
345 aPrevDate = aCurrDate;
346 nColCurr = nCol1 + rNonOverlappedCellIdx[
i] * nAddX;
347 nRowCurr = nRow1 + rNonOverlappedCellIdx[
i] * nAddY;
351 aCurrDate = aNullDate +
static_cast<sal_Int32
>(aCurrCell.
getDouble());
353 nDDiff = aCurrDate.
GetDay()
365 nCmpInc = aCurrDate - aPrevDate;
370 nCmpInc = nMDiff + 12 * nYDiff;
375 if (aCurrDate - aPrevDate != nCmpInc)
380 if (nDDiff || (nMDiff + 12 * nYDiff != nCmpInc))
397 rSkipOverlappedCells =
true;
406 rSkipOverlappedCells =
true;
410 else if (nCurrCellFormatType == SvNumFormatType::LOGICAL
411 && ((fVal = aCurrCell.
getDouble()) == 0.0 || fVal == 1.0))
414 else if (nValueCount >= 2)
416 for (
SCSIZE i = 1;
i < nValueCount && bVal;
i++)
418 aPrevCell = aCurrCell;
419 nColCurr = nCol1 + rNonOverlappedCellIdx[
i] * nAddX;
420 nRowCurr = nRow1 + rNonOverlappedCellIdx[
i] * nAddY;
425 (nCurrCellFormatType == SvNumFormatType::TIME ||
426 nCurrCellFormatType == SvNumFormatType::DATETIME));
429 if (!::rtl::math::approxEqual(nDiff, rInc, 13))
434 == SvNumFormatType::LOGICAL))
443 rSkipOverlappedCells =
true;
456 bool bMatchCase =
false;
459 sal_uInt16 nPrevListIndex, nInc = 1;
460 for (
SCSIZE i = 1;
i < nValueCount && rListData;
i++)
462 nColCurr = nCol1 + rNonOverlappedCellIdx[
i] * nAddX;
463 nRowCurr = nRow1 + rNonOverlappedCellIdx[
i] * nAddY;
466 nPrevListIndex = rListIndex;
467 if (!rListData->GetSubIndex(aStr2, rListIndex, bMatchCase))
471 sal_Int32 nIncCurr = rListIndex - nPrevListIndex;
473 nIncCurr += nListStrCount;
476 else if (nInc != nIncCurr)
482 rSkipOverlappedCells =
true;
486 short nFlag1, nFlag2;
487 sal_Int32 nVal1, nVal2;
488 nFlag1 = lcl_DecompValueString(
aStr, nVal1, &rMinDigits);
493 for (
SCSIZE i = 1;
i < nValueCount && bVal;
i++)
495 nColCurr = nCol1 + rNonOverlappedCellIdx[
i] * nAddX;
496 nRowCurr = nRow1 + rNonOverlappedCellIdx[
i] * nAddY;
502 nFlag2 = lcl_DecompValueString(aStr2, nVal2, &rMinDigits);
503 if (nFlag1 == nFlag2 &&
aStr == aStr2)
505 double nDiff = approxDiff(nVal2, nVal1);
508 else if (!::rtl::math::approxEqual(nDiff, rInc, 13))
521 rSkipOverlappedCells =
true;
543 bool bDate = (nFormatType == SvNumFormatType::DATE);
544 bool bTime = (nFormatType == SvNumFormatType::TIME || nFormatType == SvNumFormatType::DATETIME);
545 bool bBooleanCell = (nFormatType == SvNumFormatType::LOGICAL);
552 Date aDate1 = aNullDate;
555 Date aDate2 = aNullDate;
556 nVal =
GetValue(nCol+nAddX, nRow+nAddY);
558 if ( aDate1 != aDate2 )
568 nCmpInc = nMDiff + 12 * nYDiff;
573 nCmpInc = aDate2 - aDate1;
578 nCmpInc = nMDiff + 12 * nYDiff;
581 nCol = sal::static_int_cast<SCCOL>( nCol + nAddX );
582 nRow = sal::static_int_cast<SCROW>( nRow + nAddY );
590 aDate2 = aNullDate +
static_cast<sal_Int32
>(nVal);
593 if ( aDate2-aDate1 != nCmpInc )
602 || (nMDiff + 12 * nYDiff != nCmpInc))
606 nCol = sal::static_int_cast<SCCOL>( nCol + nAddX );
607 nRow = sal::static_int_cast<SCROW>( nRow + nAddY );
615 && (nCmpInc % 12 == 0))
640 else if (bBooleanCell && ((fVal = aFirstCell.
getDouble()) == 0.0 || fVal == 1.0))
649 double nVal2 =
GetValue(nCol+nAddX, nRow+nAddY);
650 rInc = approxTypedDiff( nVal2, nVal1, bTime);
651 nCol = sal::static_int_cast<SCCOL>( nCol + nAddX );
652 nRow = sal::static_int_cast<SCROW>( nRow + nAddY );
660 double nDiff = approxTypedDiff( nVal2, nVal1, bTime);
661 if ( !::rtl::math::approxEqual( nDiff, rInc, 13 ) )
663 else if ((nVal2 == 0.0 || nVal2 == 1.0) &&
665 SvNumFormatType::LOGICAL))
671 nCol = sal::static_int_cast<SCCOL>( nCol + nAddX );
672 nRow = sal::static_int_cast<SCROW>( nRow + nAddY );
677 else if(nFormatType == SvNumFormatType::PERCENT)
690 bool bMatchCase =
false;
693 sal_uInt16 nPrevListIndex, nInc = 1;
694 nCol = sal::static_int_cast<SCCOL>( nCol + nAddX );
695 nRow = sal::static_int_cast<SCROW>( nRow + nAddY );
698 nPrevListIndex = rListIndex;
700 if (!rListData->GetSubIndex(
aStr, rListIndex, bMatchCase))
704 sal_Int32 nIncCurr = rListIndex - nPrevListIndex;
706 nIncCurr += nListStrCount;
709 else if (nInc != nIncCurr)
712 nCol = sal::static_int_cast<SCCOL>( nCol + nAddX );
713 nRow = sal::static_int_cast<SCROW>( nRow + nAddY );
724 short nFlag1 = lcl_DecompValueString(
aStr, nVal1, &rMinDigits );
729 short nFlag2 = lcl_DecompValueString(
aStr, nVal2, &rMinDigits );
730 if ( nFlag1 == nFlag2 )
732 rInc = approxDiff( nVal2, nVal1);
733 nCol = sal::static_int_cast<SCCOL>( nCol + nAddX );
734 nRow = sal::static_int_cast<SCROW>( nRow + nAddY );
743 nFlag2 = lcl_DecompValueString(
aStr, nVal2, &rMinDigits );
744 if ( nFlag1 == nFlag2 )
746 double nDiff = approxDiff( nVal2, nVal1);
747 if ( !::rtl::math::approxEqual( nDiff, rInc, 13 ) )
756 nCol = sal::static_int_cast<SCCOL>( nCol + nAddX );
757 nRow = sal::static_int_cast<SCROW>( nRow + nAddY );
768 lcl_DecompValueString(
aStr, nDummy, &rMinDigits );
780 aCol[nDestCol].SetFormulaCell(nDestRow, pDestCell);
787 if ( nDestCol >= aOrg.
Col() && nDestRow >= aOrg.
Row() )
793 nDestCol - aOrg.
Col() + 1,
794 nDestRow - aOrg.
Row() + 1 );
798 OSL_FAIL(
"FillFormula: MatrixOrigin no formula cell with ScMatrixMode::Formula" );
803 OSL_FAIL(
"FillFormula: MatrixOrigin bottom right" );
808 OSL_FAIL(
"FillFormula: no MatrixOrigin" );
828 SCCOLROW& rInner = bVertical ? nRow : nCol;
829 SCCOLROW& rOuter = bVertical ? nCol : nRow;
847 nIEnd = nRow2 + nFillCount;
848 aFillRange =
ScRange(nCol1, nRow2+1, 0, nCol2, nRow2 + nFillCount, 0);
855 nIEnd = nRow1 - nFillCount;
856 aFillRange =
ScRange(nCol1, nRow1-1, 0, nCol2, nRow2 - nFillCount, 0);
868 nIEnd = nCol2 + nFillCount;
869 aFillRange =
ScRange(nCol2 + 1, nRow1, 0, nCol2 + nFillCount, nRow2, 0);
876 nIEnd = nCol1 - nFillCount;
877 aFillRange =
ScRange(nCol1 - 1, nRow1, 0, nCol1 - nFillCount, nRow2, 0);
880 sal_uInt64 nIMin = nIStart;
881 sal_uInt64 nIMax = nIEnd;
893 sal_uInt64 nProgress = 0;
898 std::list< sc::DelayStartListeningFormulaCells > delayStartListening;
899 SCCOL delayStartColumn, delayEndColumn;
902 delayStartColumn = std::min( nOStart, nOEnd );
903 delayEndColumn = std::max( nOStart, nOEnd );
907 delayStartColumn = std::min( nIStart, nIEnd );
908 delayEndColumn = std::max( nIStart, nIEnd );
913 delayStartListening.emplace_back( *column,
true );
918 sal_uInt64 nActFormCnt = 0;
919 for (rOuter = nOStart; rOuter <= nOEnd; rOuter++)
921 sal_uInt64 nMaxFormCnt = 0;
928 std::unique_ptr<ScPatternAttr> pNewPattern;
929 bool bGetPattern =
true;
987 if ( nOldValue != nOldValueMerge )
990 SfxItemSet& rNewSet = pNewPattern->GetItemSet();
1000 pNewPattern.reset();
1006 if ( bVertical && nISrcStart == nISrcEnd && !bHasFiltered )
1012 SCROW nY1 =
static_cast<SCROW>(std::min( nIStart, nIEnd ));
1013 SCROW nY2 =
static_cast<SCROW>(std::max( nIStart, nIEnd ));
1015 aCol[nCol].ApplyStyleArea( nY1, nY2, *pStyleSheet );
1017 aCol[nCol].ApplyPatternArea( nY1, nY2, *pNewPattern );
1019 aCol[nCol].ApplyPatternArea( nY1, nY2, *pSrcPattern );
1021 for(
const auto& rIndex : rCondFormatIndex)
1045 aCol[nCol].ApplyStyle(
static_cast<SCROW>(nRow), pStyleSheet );
1049 aCol[nCol].ApplyPattern(
static_cast<SCROW>(nRow), *pNewPattern );
1051 aCol[nCol].ApplyPattern(
static_cast<SCROW>(nRow), *pSrcPattern );
1053 for(
const auto& rIndex : rCondFormatIndex)
1065 if (nAtSrc==nISrcEnd)
1067 if ( nAtSrc != nISrcStart )
1069 nAtSrc = nISrcStart;
1085 if (rInner == nIEnd)
break;
1086 if (bPositive) ++rInner;
else --rInner;
1088 pNewPattern.reset();
1095 sal_uInt16 nMinDigits;
1097 sal_uInt16 nListIndex;
1098 bool bSkipOverlappedCells;
1099 std::vector<sal_Int32> aNonOverlappedCellIdx;
1102 static_cast<SCCOL>(nCol),nRow2, eFillCmd,eDateCmd,
1103 nInc, nMinDigits, pListData, nListIndex,
1104 bHasFiltered, bSkipOverlappedCells, aNonOverlappedCellIdx);
1107 nCol2,
static_cast<SCROW>(nRow), eFillCmd,eDateCmd,
1108 nInc, nMinDigits, pListData, nListIndex,
1109 bHasFiltered, bSkipOverlappedCells, aNonOverlappedCellIdx);
1114 if (bSkipOverlappedCells)
1116 int nFillerCount = 1 + ( nISrcEnd - nISrcStart ) * (bPositive ? 1 : -1);
1117 std::vector<bool> aIsNonEmptyCell(nFillerCount,
false);
1121 nLastValueIdx = nISrcEnd - (nFillerCount - 1 - aNonOverlappedCellIdx.back());
1122 for (
auto i : aNonOverlappedCellIdx)
1123 aIsNonEmptyCell[
i] =
true;
1127 nLastValueIdx = nISrcEnd + aNonOverlappedCellIdx[0];
1128 for (
auto i : aNonOverlappedCellIdx)
1129 aIsNonEmptyCell[nFillerCount - 1 -
i] =
true;
1138 bool bMatchCase =
false;
1141 sal_Int32 nFillerIdx = 0;
1145 if (aIsNonEmptyCell[nFillerIdx])
1150 if (nListIndex >= nListCount) nListIndex -= nListCount;
1154 if (nListIndex < nInc) nListIndex += nListCount;
1160 if (rInner == nIEnd)
break;
1161 nFillerIdx = (nFillerIdx + 1) % nFillerCount;
1173 sal_Int64
nAdjust = nListIndex - (nISrcStart - nISrcEnd) * nInc;
1188 if (nListIndex >= nListCount) nListIndex -= nListCount;
1192 if (nListIndex < nInc) nListIndex += nListCount;
1198 if (rInner == nIEnd)
break;
1199 if (bPositive) ++rInner;
else --rInner;
1204 nProgress += nIMax - nIMin + 1;
1211 nISrcStart, nISrcEnd, nIStart, nIEnd, rInner, nCol, nRow,
1212 nActFormCnt, nMaxFormCnt, bHasFiltered, bVertical, bPositive, pProgress, nProgress);
1221 static_cast<SCCOL>(nCol), nRow2, nFillCount, eFillDir,
1222 eFillCmd, eDateCmd, nInc, nEndVal, nMinDigits,
false,
1223 pProgress, bSkipOverlappedCells, &aNonOverlappedCellIdx);
1226 static_cast<SCROW>(nRow), nFillCount, eFillDir,
1227 eFillCmd, eDateCmd, nInc, nEndVal, nMinDigits,
false,
1228 pProgress, bSkipOverlappedCells, &aNonOverlappedCellIdx);
1234 FillSparkline(bVertical, nCol, nRow1, nRow2, nIStart, nIEnd);
1236 FillSparkline(bVertical, nRow, nCol1, nCol2, nIStart, nIEnd);
1238 nActFormCnt += nMaxFormCnt;
1246 bool bHasSparklines =
false;
1247 std::vector<std::shared_ptr<sc::Sparkline>> aSparklineSeries;
1249 for (
SCROW nCurrent = nStart; nCurrent <= nEnd; nCurrent++)
1252 bHasSparklines = bHasSparklines || pSparkline;
1253 aSparklineSeries.push_back(pSparkline);
1258 for (
SCCOLROW nCurrent = nFillStart; nCurrent <= nFillEnd; nCurrent++)
1260 size_t nIndex = size_t(nFillStart - nCurrent) % aSparklineSeries.size();
1261 if (
auto& rpSparkline = aSparklineSeries[
nIndex])
1263 auto pGroup = rpSparkline->getSparklineGroup();
1265 auto* pNewSparkline = bVertical ?
CreateSparkline(nFixed, nCurrent, pGroup)
1269 SCCOLROW nPosition = bVertical ? rpSparkline->getRow()
1270 : rpSparkline->getColumn();
1271 SCCOLROW nDelta = nCurrent - nPosition;
1272 ScRangeList aRangeList(rpSparkline->getInputRange());
1273 for (
ScRange& rRange : aRangeList)
1277 rRange.aStart.IncRow(nDelta);
1278 rRange.aEnd.IncRow(nDelta);
1282 rRange.aStart.IncCol(nDelta);
1283 rRange.aEnd.IncCol(nDelta);
1286 pNewSparkline->setInputRange(aRangeList);
1303 sal_uInt64 nSrcCount = 0;
1305 if ( nEndX == nCol2 && nEndY == nRow2 )
1307 else if ( nEndX == nCol2 )
1310 nSrcCount = nRow2 - nRow1 + 1;
1312 if ( nEndY >= nRow1 )
1317 else if ( nEndY == nRow2 )
1319 nEndY = nRow2 = nRow1;
1320 nSrcCount = nCol2 - nCol1 + 1;
1322 if ( nEndX >= nCol1 )
1349 nHidden = nEnd + 1 - nBegin - nVisible;
1365 nHidden = nEnd + 1 - nBegin - nVisible;
1378 sal_uInt16 nMinDigits;
1380 sal_uInt16 nListIndex;
1381 bool bSkipOverlappedCells;
1382 std::vector<sal_Int32> aNonOverlappedCellIdx;
1387 FillAnalyse(nCol1, nRow1, nCol2, nRow2, eFillCmd, eDateCmd,
1388 nInc, nMinDigits, pListData, nListIndex,
1389 true, bSkipOverlappedCells, aNonOverlappedCellIdx);
1396 sal_uInt64 nSub = nSrcCount - 1;
1397 while (
nIndex < sal::static_int_cast<tools::Long>(nSub) )
1399 sal_uInt64
nPos = ( nListIndex +
nIndex - nSub ) % nListCount;
1400 aValue = pListData->
GetSubStr(sal::static_int_cast<sal_uInt16>(
nPos));
1406 while ( nPosIndex < 0 )
1407 nPosIndex += nSrcCount;
1408 sal_uInt64
nPos = nPosIndex % nSrcCount;
1409 SCCOL nSrcX = nCol1;
1410 SCROW nSrcY = nRow1;
1412 nSrcY = sal::static_int_cast<SCROW>( nSrcY +
static_cast<SCROW>(
nPos) );
1414 nSrcX = sal::static_int_cast<SCCOL>( nSrcX +
static_cast<SCCOL>(
nPos) );
1421 nDelta =
nIndex / nSrcCount;
1423 nDelta = (
nIndex - nSrcCount + 1 ) / nSrcCount;
1436 sal_uInt16 nCellDigits = 0;
1437 short nFlag = lcl_DecompValueString( aValue, nVal, &nCellDigits );
1442 aValue = lcl_ValueString( nVal + nDelta, nCellDigits ) + aValue;
1444 else if ( nFlag > 0 )
1446 sal_Int32 nNextValue;
1448 nNextValue = nVal - nDelta;
1450 nNextValue = nVal + nDelta;
1451 if ( nFlag == 2 && nNextValue >= 0 )
1453 aValue += lcl_ValueString( nNextValue, nCellDigits );
1466 bool bPercentCell = (nFormatType == SvNumFormatType::PERCENT);
1470 nVal +=
static_cast<double>(nDelta) * 0.01;
1472 else if (nVal == 0.0 || nVal == 1.0)
1474 bool bBooleanCell = (nFormatType == SvNumFormatType::LOGICAL);
1476 nVal +=
static_cast<double>(nDelta);
1480 nVal +=
static_cast<double>(nDelta);
1484 const Color* pColor;
1501 short nHeadNoneTail = 0;
1512 nHeadNoneTail = lcl_DecompValueString( aValue, nVal );
1513 if ( nHeadNoneTail )
1514 nStart =
static_cast<double>(nVal);
1540 sal_uInt16 nDayOfMonth = 0;
1547 IncDate( nStart, nDayOfMonth, nInc, eDateCmd );
1552 if ( nHeadNoneTail )
1554 if ( nHeadNoneTail < 0 )
1559 aValue = lcl_ValueString(
static_cast<sal_Int32
>(nStart), nMinDigits ) + aValue;
1563 if ( nHeadNoneTail == 2 && nStart >= 0 )
1565 aValue += lcl_ValueString(
static_cast<sal_Int32
>(nStart), nMinDigits );
1571 const Color* pColor;
1579 OSL_FAIL(
"GetAutoFillPreview: invalid mode");
1595 const sal_uInt16 nMinYear = 1583;
1596 const sal_uInt16 nMaxYear = 9956;
1600 Date aDate = aNullDate;
1612 else if (eWeekDay ==
SUNDAY)
1619 else if (eWeekDay ==
SUNDAY)
1627 if ( nDayOfMonth == 0 )
1628 nDayOfMonth = aDate.
GetDay();
1639 nMonth -= nYAdd * 12;
1648 nMonth += nYAdd * 12;
1653 if ( nYear < nMinYear )
1654 aDate =
Date( 1,1, nMinYear );
1655 else if ( nYear > nMaxYear )
1656 aDate =
Date( 31,12, nMaxYear );
1659 aDate.
SetMonth(
static_cast<sal_uInt16
>(nMonth));
1660 aDate.
SetYear(
static_cast<sal_uInt16
>(nYear));
1676 if ( nYear < nMinYear )
1677 aDate =
Date( 1,1, nMinYear );
1678 else if ( nYear > nMaxYear )
1679 aDate =
Date( 31,12, nMaxYear );
1681 aDate.
SetYear(
static_cast<sal_uInt16
>(nYear));
1690 rVal = aDate - aNullDate;
1697 bool bHidden =
false;
1701 bHidden = pTable->
RowHidden(nRowColumn,
nullptr, &nLast);
1707 bHidden = pTable->
ColHidden(
static_cast<SCCOL>(nRowColumn),
nullptr, &nLast);
1718 ScProgress* pProgress, sal_uInt64& rProgress )
1724 bool bHidden =
false;
1727 SCCOLROW nRowStart = -1, nRowEnd = -1;
1728 std::vector<sc::RowSpan> aSpans;
1730 for (rInner = nRow1; rInner <= nRow2; ++rInner)
1732 if (rInner > nHiddenLast)
1733 bHidden = HiddenRowColumn(
this, rInner,
true, nHiddenLast);
1739 nRowEnd = rInner - 1;
1740 aSpans.emplace_back(nRowStart, nRowEnd);
1743 rInner = nHiddenLast;
1753 nRowEnd = rInner - 1;
1754 aSpans.emplace_back(nRowStart, nRowEnd);
1763 auto pSet = std::make_shared<sc::ColumnBlockPositionSet>(
rDocument);
1767 SCROW nStartRow = aSpans.front().mnRow1;
1768 SCROW nEndRow = aSpans.back().mnRow2;
1769 aCol[nCol].EndListeningFormulaCells(aEndCxt, nStartRow, nEndRow, &nStartRow, &nEndRow);
1770 aCol[nCol].StartListeningFormulaCells(aStartCxt, aEndCxt, nStartRow, nEndRow);
1772 for (
const auto& rSpan : aSpans)
1775 rProgress += nRow2 - nRow1 + 1;
1784 bool bHidden =
false;
1794 *rSrcCell.
getFormula(), rInner, rCol, nIMin, nIMax, pProgress, rProgress);
1799 for (rInner = nIMin; rInner <= nIMax; ++rInner)
1801 if (rInner > nHiddenLast)
1802 bHidden = HiddenRowColumn(
this, rInner, bVertical, nHiddenLast);
1806 rInner = nHiddenLast;
1813 rProgress += nIMax - nIMin + 1;
1825 for (rInner = nIMin; rInner <= nIMax; ++rInner)
1827 if (rInner > nHiddenLast)
1828 bHidden = HiddenRowColumn(
this, rInner, bVertical, nHiddenLast);
1841 for (rInner = nIMin; rInner <= nIMax; ++rInner)
1843 if (rInner > nHiddenLast)
1844 bHidden = HiddenRowColumn(
this, rInner, bVertical, nHiddenLast);
1852 rProgress += nIMax - nIMin + 1;
1863 sal_uInt64 nMaxFormCnt,
bool bHasFiltered,
bool bVertical,
bool bPositive,
1864 ScProgress* pProgress, sal_uInt64& rProgress )
1870 else if ( bPositive )
1874 sal_uInt64 nFormulaCounter = nActFormCnt;
1875 bool bGetCell =
true;
1876 bool bBooleanCell =
false;
1877 bool bPercentCell =
false;
1878 sal_uInt16 nCellDigits = 0;
1879 short nHeadNoneTail = 0;
1880 sal_Int32 nStringValue = 0;
1883 bool bIsOrdinalSuffix =
false;
1885 bool bColHidden =
false, bRowHidden =
false;
1887 SCCOL nColHiddenLast = -1;
1889 SCROW nRowHiddenLast = -1;
1896 if (rCol > nColHiddenLast)
1897 bColHidden =
ColHidden(rCol,
nullptr, &nColHiddenLast);
1898 if (rRow > nRowHiddenLast)
1899 bRowHidden =
RowHidden(rRow,
nullptr, &nRowHiddenLast);
1903 if (rCol < nColHiddenFirst)
1904 bColHidden =
ColHidden(rCol, &nColHiddenFirst);
1905 if (rRow < nRowHiddenFirst)
1906 bRowHidden =
RowHidden(rRow, &nRowHiddenFirst);
1909 if (!bColHidden && !bRowHidden)
1923 bBooleanCell = (nFormatType == SvNumFormatType::LOGICAL);
1924 bPercentCell = (nFormatType == SvNumFormatType::PERCENT);
1932 bBooleanCell = (nFormatType == SvNumFormatType::LOGICAL);
1933 bPercentCell = (nFormatType == SvNumFormatType::PERCENT);
1950 nHeadNoneTail = lcl_DecompValueString(
1951 aValue, nStringValue, &nCellDigits );
1953 bIsOrdinalSuffix = aValue ==
1970 if (bBooleanCell && ((fVal = aSrcCell.
getDouble()) == 0.0 || fVal == 1.0))
1972 else if(bPercentCell)
1973 aCol[rCol].SetValue(rRow, aSrcCell.
getDouble() + nDelta * 0.01);
1980 if ( nHeadNoneTail )
1982 sal_Int32 nNextValue;
1983 if (nStringValue < 0)
1984 nNextValue = nStringValue -
static_cast<sal_Int32
>(nDelta);
1986 nNextValue = nStringValue +
static_cast<sal_Int32
>(nDelta);
1988 if ( nHeadNoneTail < 0 )
1992 nNextValue, nCellDigits, aValue,
1993 aSrcCell.
getType(), bIsOrdinalSuffix);
1998 if (nHeadNoneTail == 2 && nNextValue >= 0)
1999 aStr = aValue +
"+" + lcl_ValueString(nNextValue, nCellDigits);
2001 aStr = aValue + lcl_ValueString(nNextValue, nCellDigits);
2003 aCol[rCol].SetRawString(rRow,
aStr);
2012 aSrcCell.
getFormula(), rCol, rRow, (rInner == nIEnd));
2013 if (nFormulaCounter - nActFormCnt > nMaxFormCnt)
2014 nMaxFormCnt = nFormulaCounter - nActFormCnt;
2022 if (nSource == nISrcEnd)
2024 if ( nSource != nISrcStart )
2026 nSource = nISrcStart;
2036 nFormulaCounter = nActFormCnt;
2050 if (rInner == nIEnd)
2072inline bool isOverflow(
const double& rVal,
const double& rMax,
const double& rStep,
2073 const double& rStartVal,
FillCmd eFillCmd )
2103 else if (rStep < 0.0)
2142 return rMax < rStartVal;
2143 else if (rMax < 0.0)
2144 return rStartVal < rMax;
2148 assert(!
"eFillCmd");
2156 double nStepValue,
double nMaxValue, sal_uInt16 nArgMinDigits,
2158 bool bSkipOverlappedCells, std::vector<sal_Int32>* pNonOverlappedCellIdx )
2175 SCCOLROW& rInner = bVertical ? nRow : nCol;
2176 SCCOLROW& rOuter = bVertical ? nCol : nRow;
2183 sal_uInt64 nFillerCount;
2184 std::vector<bool> aIsNonEmptyCell;
2188 nFillerCount = (nRow2 - nRow1) + 1;
2189 nFillCount += (nRow2 - nRow1);
2190 if (nFillCount == 0)
2198 nIStart = nRow1 + 1;
2199 nIEnd = nRow1 + nFillCount;
2200 aFillRange =
ScRange(nCol1, nRow1 + 1,
nTab, nCol2, nRow1 + nFillCount,
nTab);
2206 nIStart = nRow2 - 1;
2207 nIEnd = nRow2 - nFillCount;
2208 aFillRange =
ScRange(nCol1, nRow2 -1,
nTab, nCol2, nRow2 - nFillCount,
nTab);
2213 nFillerCount = (nCol2 - nCol1) + 1;
2214 nFillCount += (nCol2 - nCol1);
2215 if (nFillCount == 0)
2223 nIStart = nCol1 + 1;
2224 nIEnd = nCol1 + nFillCount;
2225 aFillRange =
ScRange(nCol1 + 1, nRow1,
nTab, nCol1 + nFillCount, nRow2,
nTab);
2231 nIStart = nCol2 - 1;
2232 nIEnd = nCol2 - nFillCount;
2233 aFillRange =
ScRange(nCol2 - 1, nRow1,
nTab, nCol2 - nFillCount, nRow2,
nTab);
2242 bool bEntireArea = (!bIsFiltered && eFillCmd ==
FILL_SIMPLE);
2244 && (nOEnd - nOStart == 0))
2267 if (nStepValue == 0.0)
2268 bEntireArea = (nStartVal <= nMaxValue);
2269 else if (((nMaxValue - nStartVal) / nStepValue) >= nFillCount)
2274 if (nStepValue == 1.0)
2275 bEntireArea = (nStartVal <= nMaxValue);
2276 else if (nStepValue == -1.0)
2277 bEntireArea = (fabs(nStartVal) <= fabs(nMaxValue));
2278 else if (nStepValue == 0.0)
2279 bEntireArea = (nStartVal == 0.0
2280 || (nStartVal < 0.0 && nMaxValue >= 0.0)
2281 || (nStartVal > 0.0 && nMaxValue <= 0.0));
2295 sal_uInt64 nProgress = 0;
2302 for (rOuter = nOStart; rOuter <= nOEnd; rOuter++)
2313 if (bSkipOverlappedCells)
2316 aIsNonEmptyCell.resize(nFillerCount,
false);
2321 nFirstValueIdx = nISource + (*pNonOverlappedCellIdx)[0];
2322 for (
auto i : (*pNonOverlappedCellIdx))
2323 aIsNonEmptyCell[
i] =
true;
2327 nFirstValueIdx = nISource - (nFillerCount - 1 - (*pNonOverlappedCellIdx).back());
2328 for (
auto i : (*pNonOverlappedCellIdx))
2329 aIsNonEmptyCell[nFillerCount - 1 -
i] =
true;
2353 static_cast<SCROW>(nIMax), *pSrcPattern, rCondFormatIndex);
2357 assert(bIsFiltered);
2358 for(
SCROW nAtRow =
static_cast<SCROW>(nIMin); nAtRow <= static_cast<SCROW>(nIMax); ++nAtRow)
2370 for (
SCCOL nAtCol =
static_cast<SCCOL>(nIMin); nAtCol <= sal::static_int_cast<SCCOL>(nIMax); nAtCol++)
2386 FillSeriesSimple(aSrcCell, rInner, nIMin, nIMax, nCol, nRow, bVertical, pProgress, nProgress);
2392 double nVal = nStartVal;
2395 bool bError =
false;
2396 bool bOverflow =
false;
2397 bool bNonEmpty =
true;
2399 sal_uInt16 nDayOfMonth = 0;
2400 sal_Int32 nFillerIdx = 0;
2401 if (bSkipOverlappedCells && !aIsNonEmptyCell[0])
2406 if (bSkipOverlappedCells)
2408 nFillerIdx = (nFillerIdx + 1) % nFillerCount;
2409 bNonEmpty = aIsNonEmptyCell[nFillerIdx];
2414 if (!bError && bNonEmpty)
2423 double nAdd = nStepValue;
2437 IncDate(nVal, nDayOfMonth, nStepValue, eFillDateCmd);
2446 bOverflow = isOverflow( nVal, nMaxValue, nStepValue, nStartVal, eFillCmd);
2451 aCol[nCol].SetError(
static_cast<SCROW>(nRow), FormulaError::NoValue);
2452 else if (!bOverflow && bNonEmpty)
2453 aCol[nCol].SetValue(
static_cast<SCROW>(nRow), nVal);
2455 if (bAttribs && !bEntireArea && !bOverflow)
2459 if (rInner == nIEnd || bOverflow)
2470 nProgress += nIMax - nIMin + 1;
2476 if ( nStepValue >= 0 )
2478 if ( nMaxValue >=
double(
LONG_MAX) )
2483 if ( nMaxValue <=
double(LONG_MIN) )
2484 nMaxValue = double(LONG_MIN) + 1;
2491 sal_Int32 nStringValue;
2492 sal_uInt16 nMinDigits = nArgMinDigits;
2493 short nHeadNoneTail = lcl_DecompValueString( aValue, nStringValue, &nMinDigits );
2494 if ( nHeadNoneTail )
2496 const double nStartVal =
static_cast<double>(nStringValue);
2497 double nVal = nStartVal;
2499 bool bError =
false;
2500 bool bOverflow =
false;
2501 bool bNonEmpty =
true;
2504 static_cast<sal_Int32
>(nStartVal));
2506 sal_Int32 nFillerIdx = 0;
2507 if (bSkipOverlappedCells && !aIsNonEmptyCell[0])
2512 if (bSkipOverlappedCells)
2514 nFillerIdx = (nFillerIdx + 1) % nFillerCount;
2515 bNonEmpty = aIsNonEmptyCell[nFillerIdx];
2519 if (!bError && bNonEmpty)
2528 double nAdd = nStepValue;
2545 bOverflow = isOverflow( nVal, nMaxValue, nStepValue, nStartVal, eFillCmd);
2549 aCol[nCol].SetError(
static_cast<SCROW>(nRow), FormulaError::NoValue);
2550 else if (!bOverflow && bNonEmpty)
2552 nStringValue =
static_cast<sal_Int32
>(nVal);
2553 if ( nHeadNoneTail < 0 )
2557 nStringValue, nMinDigits, aValue,
2558 eCellType, bIsOrdinalSuffix);
2563 if (nHeadNoneTail == 2 && nStringValue >= 0)
2564 aStr = aValue +
"+";
2567 aStr += lcl_ValueString( nStringValue, nMinDigits );
2572 if (bAttribs && !bEntireArea && !bOverflow)
2576 if (rInner == nIEnd || bOverflow)
2586 nProgress += nIMax - nIMin + 1;
2593 nProgress += nIMax - nIMin + 1;
2601 double nStepValue,
double nMaxValue,
ScProgress* pProgress)
2604 FillAuto(nCol1, nRow1, nCol2, nRow2, nFillCount, eFillDir, pProgress);
2606 FillSeries(nCol1, nRow1, nCol2, nRow2, nFillCount, eFillDir,
2607 eFillCmd, eFillDateCmd, nStepValue, nMaxValue, 0,
true, pProgress);
2622 sal_uInt16 nFormatNo )
2632 std::unique_ptr<ScPatternAttr> pPatternAttrs[16];
2639 SCCOL nCol = nStartCol;
2640 SCROW nRow = nStartRow;
2645 if (
pData->HasSameData(4, 8))
2646 AutoFormatArea(nStartCol, nStartRow + 1, nStartCol, nEndRow - 1, *pPatternAttrs[4], nFormatNo);
2650 for (nRow = nStartRow + 1; nRow < nEndRow; nRow++)
2669 if (
pData->HasSameData(7, 11))
2670 AutoFormatArea(nEndCol, nStartRow + 1, nEndCol, nEndRow - 1, *pPatternAttrs[7], nFormatNo);
2674 for (nRow = nStartRow + 1; nRow < nEndRow; nRow++)
2689 for (nCol = nStartCol + 1; nCol < nEndCol; nCol++)
2700 for (nCol = nStartCol + 1; nCol < nEndCol; nCol++)
2709 if ((
pData->HasSameData(5, 6)) && (
pData->HasSameData(9, 10)) && (
pData->HasSameData(5, 9)))
2710 AutoFormatArea(nStartCol + 1, nStartRow + 1, nEndCol-1, nEndRow - 1, *pPatternAttrs[5], nFormatNo);
2713 if ((
pData->HasSameData(5, 9)) && (
pData->HasSameData(6, 10)))
2716 for (nCol = nStartCol + 1; nCol < nEndCol; nCol++)
2728 for (nCol = nStartCol + 1; nCol < nEndCol; nCol++)
2730 for (nRow = nStartRow + 1; nRow < nEndRow; nRow++)
2768#define LF_ALL (LF_LEFT | LF_TOP | LF_RIGHT | LF_BOTTOM)
2835 if ((nEndCol - nStartCol < 3) || (nEndRow - nStartRow < 3))
2845 if (nEndRow - nStartRow >= 4)
2859 if (nEndRow - nStartRow >= 4)
2870 if (nEndCol - nStartCol >= 4)
2878 if (nEndCol - nStartCol >= 4)
2888 if ((nEndCol - nStartCol >= 4) && (nEndRow - nStartRow >= 4))
2905 aCol[nCol].SetError( nRow, nError );
2969 return aCol[nCol].GetPatternCount();
2977 return aCol[nCol].GetPatternCount( nRow1, nRow2 );
2985 return aCol[nCol].ReservePatternCount( nReserve );
size_t SCSIZE
size_t typedef to be able to find places where code was changed from USHORT to size_t and is used to ...
void PutInOrder(T &nStart, T &nEnd)
bool ScHasPriority(const ::editeng::SvxBorderLine *pThis, const ::editeng::SvxBorderLine *pOther)
General Help Function.
static bool isAsciiNumeric(std::u16string_view rStr)
void AddDays(sal_Int32 nAddDays)
sal_Int16 GetYear() const
sal_uInt16 GetDay() const
sal_uInt16 GetDaysInMonth() const
bool IsEndOfMonth() const
void SetMonth(sal_uInt16 nNewMonth)
void SetYear(sal_Int16 nNewYear)
DayOfWeek GetDayOfWeek() const
void SetDay(sal_uInt16 nNewDay)
sal_uInt16 GetMonth() const
std::unique_ptr< EditTextObject > CreateTextObject()
void SetText(const OUString &rStr)
void SetEditTextObjectPool(SfxItemPool *pPool)
const SfxItemSet & GetEmptyItemSet() const
void QuickSetAttribs(const SfxItemSet &rSet, const ESelection &rSel)
void QuickInsertText(const OUString &rText, const ESelection &rSel)
const ScPatternAttr * GetPattern(SCROW nRow) const
@ BROADCAST_NONE
no broadcasting
void SetEditText(SCROW nRow, std::unique_ptr< EditTextObject > pEditText)
void SetRawString(SCROW nRow, const OUString &rStr)
ScDocument & GetDoc() const
SC_DLLPUBLIC SfxItemPool * GetEnginePool() const
SC_DLLPUBLIC ScPatternAttr * GetDefPattern() const
SC_DLLPUBLIC SCCOL MaxCol() const
SC_DLLPUBLIC ScDocumentPool * GetPool()
SC_DLLPUBLIC SCROW MaxRow() const
ScInterpreterContext & GetNonThreadedContext() const
SC_DLLPUBLIC SfxItemPool * GetEditPool() const
SC_DLLPUBLIC SvNumberFormatter * GetFormatTable() const
SC_DLLPUBLIC const ScFormulaCell * GetFormulaCell(const ScAddress &rPos) const
void SetNoListening(bool bVal)
static SC_DLLPUBLIC OUString GetString(const EditTextObject &rEditText, const ScDocument *pDoc)
Retrieves string with paragraphs delimited by new lines (' ').
static OUString GetOrdinalSuffix(sal_Int32 nNumber)
Obtain the ordinal suffix for a number according to the system locale.
static SC_DLLPUBLIC ScAutoFormat * GetOrCreateAutoFormat()
static SC_DLLPUBLIC ScUserList * GetUserList()
todo: It should be possible to have MarkArrays for each table, in order to enable "search all" across...
const ScStyleSheet * GetStyleSheet() const
SfxItemSet & GetItemSet()
const SfxPoolItem & GetItem(sal_uInt16 nWhichP) const
sal_uInt64 GetState() const
void SetStateOnPercent(sal_uInt64 nVal)
void Join(const ScRange &, bool bIsInList=false)
bool ValidCol(SCCOL nCol) const
SCCOL CountVisibleCols(SCCOL nStartCol, SCCOL nEndCol) const
ScRefCellValue GetCellValue(SCCOL nCol, sc::ColumnBlockPosition &rBlockPos, SCROW nRow)
sal_uInt32 GetNumberFormat(const ScInterpreterContext &rContext, const ScAddress &rPos) const
void CompileDBFormula(sc::CompileFormulaContext &rCxt)
ScColumn * FetchColumn(SCCOL nCol)
void GetAutoFormatFrame(SCCOL nCol, SCROW nRow, sal_uInt16 nFlags, sal_uInt16 nIndex, ScAutoFormatData &rData)
std::unique_ptr< ScConditionalFormatList > mpCondFormatList
void AutoFormat(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, sal_uInt16 nFormatNo)
bool IsDataFiltered(SCCOL nColStart, SCROW nRowStart, SCCOL nColEnd, SCROW nRowEnd) const
void FillAuto(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, sal_uInt64 nFillCount, FillDir eFillDir, ScProgress *pProgress)
void FillSeriesSimple(const ScCellValue &rSrcCell, SCCOLROW &rInner, SCCOLROW nIMin, SCCOLROW nIMax, const SCCOLROW &rCol, const SCCOLROW &rRow, bool bVertical, ScProgress *pProgress, sal_uInt64 &rProgress)
SCSIZE GetPatternCount(SCCOL nCol) const
bool ValidColRow(SCCOL nCol, SCROW nRow) const
void GetAutoFormatAttr(SCCOL nCol, SCROW nRow, sal_uInt16 nIndex, ScAutoFormatData &rData)
void UpdateInsertTabAbs(SCTAB nNewPos)
OUString GetString(SCCOL nCol, SCROW nRow, const ScInterpreterContext *pContext=nullptr) const
ScColumn & CreateColumnIfNotExists(const SCCOL nScCol)
void FillAutoSimple(SCCOLROW nISrcStart, SCCOLROW nISrcEnd, SCCOLROW nIStart, SCCOLROW nIEnd, SCCOLROW &rInner, const SCCOLROW &rCol, const SCCOLROW &rRow, sal_uInt64 nActFormCnt, sal_uInt64 nMaxFormCnt, bool bHasFiltered, bool bVertical, bool bPositive, ScProgress *pProgress, sal_uInt64 &rProgress)
void FillAnalyse(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, FillCmd &rCmd, FillDateCmd &rDateCmd, double &rInc, sal_uInt16 &rMinDigits, ScUserListData *&rListData, sal_uInt16 &rListIndex, bool bHasFiltered, bool &rSkipOverlappedCells, std::vector< sal_Int32 > &rNonOverlappedCellIdx)
void SetPatternAreaCondFormat(SCCOL nCol, SCROW nStartRow, SCROW nEndRow, const ScPatternAttr &rAttr, const ScCondFormatIndexes &rCondFormatIndexes)
bool ColHidden(SCCOL nCol, SCCOL *pFirstCol=nullptr, SCCOL *pLastCol=nullptr) const
bool ReservePatternCount(SCCOL nCol, SCSIZE nReserve)
OUString GetAutoFillPreview(const ScRange &rSource, SCCOL nEndX, SCROW nEndY)
void FillFormulaVertical(const ScFormulaCell &rSrcCell, SCCOLROW &rInner, SCCOL nCol, SCROW nRow1, SCROW nRow2, ScProgress *pProgress, sal_uInt64 &rProgress)
void SetError(SCCOL nCol, SCROW nRow, FormulaError nError)
bool GetNextSpellingCell(SCCOL &rCol, SCROW &rRow, bool bInSel, const ScMarkData &rMark) const
void FillSparkline(bool bVertical, SCCOLROW nFixed, SCCOLROW nIteratingStart, SCCOLROW nIteratingEnd, SCCOLROW nFillStart, SCCOLROW nFillEnd)
std::shared_ptr< sc::Sparkline > GetSparkline(SCCOL nCol, SCROW nRow)
ScColumnData & GetColumnData(SCCOL nCol)
bool RowHidden(SCROW nRow, SCROW *pFirstRow=nullptr, SCROW *pLastRow=nullptr) const
void FillFormula(const ScFormulaCell *pSrcCell, SCCOL nDestCol, SCROW nDestRow, bool bLast)
void FillSeries(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, sal_uInt64 nFillCount, FillDir eFillDir, FillCmd eFillCmd, FillDateCmd eFillDateCmd, double nStepValue, double nMaxValue, sal_uInt16 nMinDigits, bool bAttribs, ScProgress *pProgress, bool bSkipOverlappedCells=false, std::vector< sal_Int32 > *pNonOverlappedCellIdx=nullptr)
sc::Sparkline * CreateSparkline(SCCOL nCol, SCROW nRow, std::shared_ptr< sc::SparklineGroup > const &pSparklineGroup)
SCCOL GetAllocatedColumnsCount() const
void CompileColRowNameFormula(sc::CompileFormulaContext &rCxt)
SCROW CountVisibleRows(SCROW nStartRow, SCROW nEndRow) const
void AutoFormatArea(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, const ScPatternAttr &rAttr, sal_uInt16 nFormatNo)
const ScPatternAttr * GetPattern(SCCOL nCol, SCROW nRow) const
const SfxPoolItem * GetAttr(SCCOL nCol, SCROW nRow, sal_uInt16 nWhich) const
void Fill(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, sal_uInt64 nFillCount, FillDir eFillDir, FillCmd eFillCmd, FillDateCmd eFillDateCmd, double nStepValue, double nMaxValue, ScProgress *pProgress)
double GetValue(SCCOL nCol, SCROW nRow) const
void DeleteArea(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, InsertDeleteFlags nDelFlag, bool bBroadcast=true, sc::ColumnSpanSet *pBroadcastSpans=nullptr)
void TestTabRefAbs(SCTAB nTable) const
void IncDate(double &rVal, sal_uInt16 &nDayOfMonth, double nStep, FillDateCmd eCmd)
void GetAutoFormatData(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, ScAutoFormatData &rData)
bool ValidRow(SCROW nRow) const
void ApplyPatternArea(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, const ScPatternAttr &rAttr, ScEditDataArray *pDataArray=nullptr, bool *const pIsChanged=nullptr)
Stores individual user-defined sort list.
OUString GetSubStr(sal_uInt16 nIndex) const
size_t GetSubCount() const
bool GetSubIndex(const OUString &rSubStr, sal_uInt16 &rIndex, bool &bMatchCase) const
const ScUserListData * GetData(const OUString &rSubStr) const
sal_uInt16 ClearItem(sal_uInt16 nWhich=0)
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
static bool SafePlus(double &fVal1, double fVal2)
static bool SafeMult(double &fVal1, double fVal2)
const editeng::SvxBorderLine * GetTop() const
const editeng::SvxBorderLine * GetRight() const
void SetLine(const editeng::SvxBorderLine *pNew, SvxBoxItemLine nLine)
const editeng::SvxBorderLine * GetLeft() const
const editeng::SvxBorderLine * GetBottom() const
const OUString & getString() const
constexpr TypedWhichId< SvxEscapementItem > EE_CHAR_ESCAPEMENT(EE_CHAR_START+10)
sal_uInt16 nScFillModeMouseModifier
@ AUTOFILL
Copy flags for auto/series fill functions: do not touch notes and drawing objects.
@ STRING
Dates, times, datetime values.
@ OUTLINE
Rich-text attributes.
@ DATETIME
Numeric values (and numeric results if InsertDeleteFlags::FORMULA is not set).
constexpr sal_uInt16 KEY_MOD1
std::unique_ptr< sal_Int32[]> pData
RttiCompleteObjectLocator col
OStringBuffer & padToLength(OStringBuffer &rBuffer, sal_Int32 nLength, char cFill='\0')
sal_Int32 toInt32(std::u16string_view str, sal_Int16 radix=10)
bool getType(BSTR name, Type &type)
constexpr TypedWhichId< ScMergeFlagAttr > ATTR_MERGE_FLAG(145)
constexpr TypedWhichId< SvxBoxItem > ATTR_BORDER(150)
constexpr TypedWhichId< SfxUInt32Item > ATTR_VALUE_FORMAT(146)
constexpr TypedWhichId< ScCondFormatItem > ATTR_CONDITIONAL(154)
Store arbitrary cell value of any kind.
const svl::SharedString * getSharedString() const
ScFormulaCell * getFormula() const
EditTextObject * getEditText() const
void commit(ScDocument &rDoc, const ScAddress &rPos) const
Set cell value at specified position in specified document.
This is very similar to ScCellValue, except that it references the original value instead of copying ...
ScFormulaCell * getFormula() const
OUString getString(const ScDocument *pDoc) const
Retrieve string value.
sal_Int32 SCCOLROW
a type capable of holding either SCCOL or SCROW