23#include <editeng/editeng.hxx>
29#include <rtl/math.hxx>
32#include <osl/diagnose.h>
39#include <document.hxx>
46#include <progress.hxx>
58#define D_MAX_LONG_ double(0x7fffffff)
62short lcl_DecompValueString( OUString& rValue, sal_Int32& nVal, sal_uInt16* pMinDigits =
nullptr )
64 if ( rValue.isEmpty() )
72 if (
p[nNum] ==
'-' ||
p[nNum] ==
'+' )
87 if (
p[nSign] ==
'0' && pMinDigits && ( nNum - nSign > *pMinDigits ) )
88 *pMinDigits = nNum - nSign;
89 rValue = rValue.copy(nNum);
95 sal_Int32 nEnd = nNum = rValue.getLength() - 1;
98 if (
p[nNum] ==
'-' ||
p[nNum] ==
'+' )
103 if ( nNum < nEnd - nSign )
107 if (
p[nNum+1+nSign] ==
'0' && pMinDigits && ( nEnd - nNum - nSign > *pMinDigits ) )
108 *pMinDigits = nEnd - nNum - nSign;
109 rValue = rValue.copy(0, nNum + 1);
120OUString lcl_ValueString( sal_Int32
nValue, sal_uInt16 nMinDigits )
122 if ( nMinDigits <= 1 )
123 return OUString::number(
nValue );
126 OUString
aStr = OUString::number( std::abs(
nValue ) );
127 if (
aStr.getLength() < nMinDigits )
129 OUStringBuffer aZero(nMinDigits);
131 aStr = aZero.append(
aStr).makeStringAndClear();
142 std::u16string_view rSuffix,
143 CellType eCellType,
bool bIsOrdinalSuffix )
146 OUString aValue = lcl_ValueString(
nValue, nDigits);
147 if (!bIsOrdinalSuffix)
157 aValue += aOrdinalSuffix;
170 ESelection(0, aValue.getLength(), 0, aValue.getLength() + aOrdinalSuffix.getLength()));
174 ESelection(0, aValue.getLength(), 0, aValue.getLength() + aOrdinalSuffix.getLength()));
188double approxDiff(
double a,
double b )
196 const double c =
a - b;
197 const double aa = fabs(a);
198 const double ab = fabs(b);
199 if (aa < 1e-16 || aa > 1e+16 || ab < 1e-16 || ab > 1e+16)
203 const double q = aa < ab ? b /
a :
a / b;
204 const double d = (
a * q - b * q) / q;
211 const double e = fabs(d - c);
212 const int nExp =
static_cast<int>(floor(log10(e))) + 1;
215 const int nExpArg =
static_cast<int>(floor(log10(std::max(aa, ab)))) - 15;
216 return rtl::math::round(c, -std::max(nExp, nExpArg));
219double approxTypedDiff(
double a,
double b,
bool bTime,
tools::Duration& rDuration )
226 return approxDiff( a, b);
234 bool bHasFiltered,
bool& rSkipOverlappedCells,
235 std::vector<sal_Int32>& rNonOverlappedCellIdx)
237 OSL_ENSURE( nCol1==nCol2 || nRow1==nRow2,
"FillAnalyse: invalid range" );
244 rSkipOverlappedCells =
false;
270 bool bHasOverlappedCells =
false;
271 bool bSkipOverlappedCells =
true;
272 SCCOL nColCurr = nCol1;
273 SCROW nRowCurr = nRow1;
276 rNonOverlappedCellIdx.resize(
nCount);
286 bHasOverlappedCells =
true;
290 rNonOverlappedCellIdx[nValueCount++] =
i;
293 bSkipOverlappedCells =
false;
299 rNonOverlappedCellIdx.resize(nValueCount);
302 if (nValueCount == 0)
306 if (!bHasOverlappedCells)
307 bSkipOverlappedCells =
false;
309 if (bSkipOverlappedCells)
311 nColCurr = nCol1 + rNonOverlappedCellIdx[0] * nAddX;
312 nRowCurr = nRow1 + rNonOverlappedCellIdx[0] * nAddY;
322 if (nCurrCellFormatType == SvNumFormatType::DATE)
324 if (nValueCount >= 2)
330 Date aCurrDate = aNullDate, aPrevDate = aNullDate;
332 for (
SCSIZE i = 1;
i < nValueCount && bVal;
i++)
334 aPrevCell = aCurrCell;
335 aPrevDate = aCurrDate;
336 nColCurr = nCol1 + rNonOverlappedCellIdx[
i] * nAddX;
337 nRowCurr = nRow1 + rNonOverlappedCellIdx[
i] * nAddY;
341 aCurrDate = aNullDate +
static_cast<sal_Int32
>(aCurrCell.
getDouble());
343 nDDiff = aCurrDate.
GetDay()
355 nCmpInc = aCurrDate - aPrevDate;
360 nCmpInc = nMDiff + 12 * nYDiff;
365 if (aCurrDate - aPrevDate != nCmpInc)
370 if (nDDiff || (nMDiff + 12 * nYDiff != nCmpInc))
387 rSkipOverlappedCells =
true;
396 rSkipOverlappedCells =
true;
400 else if (nCurrCellFormatType == SvNumFormatType::LOGICAL
401 && ((fVal = aCurrCell.
getDouble()) == 0.0 || fVal == 1.0))
404 else if (nValueCount >= 2)
407 for (
SCSIZE i = 1;
i < nValueCount && bVal;
i++)
409 aPrevCell = aCurrCell;
410 nColCurr = nCol1 + rNonOverlappedCellIdx[
i] * nAddX;
411 nRowCurr = nRow1 + rNonOverlappedCellIdx[
i] * nAddY;
415 const bool bTime = (nCurrCellFormatType == SvNumFormatType::TIME ||
416 nCurrCellFormatType == SvNumFormatType::DATETIME);
423 rDuration = aDuration;
425 if (!::rtl::math::approxEqual(nDiff, rInc, 13))
430 == SvNumFormatType::LOGICAL))
439 rSkipOverlappedCells =
true;
452 bool bMatchCase =
false;
455 sal_uInt16 nPrevListIndex, nInc = 1;
456 for (
SCSIZE i = 1;
i < nValueCount && rListData;
i++)
458 nColCurr = nCol1 + rNonOverlappedCellIdx[
i] * nAddX;
459 nRowCurr = nRow1 + rNonOverlappedCellIdx[
i] * nAddY;
462 nPrevListIndex = rListIndex;
463 if (!rListData->GetSubIndex(aStr2, rListIndex, bMatchCase))
467 sal_Int32 nIncCurr = rListIndex - nPrevListIndex;
469 nIncCurr += nListStrCount;
472 else if (nInc != nIncCurr)
478 rSkipOverlappedCells =
true;
482 short nFlag1, nFlag2;
483 sal_Int32 nVal1, nVal2;
484 nFlag1 = lcl_DecompValueString(
aStr, nVal1, &rMinDigits);
489 for (
SCSIZE i = 1;
i < nValueCount && bVal;
i++)
491 nColCurr = nCol1 + rNonOverlappedCellIdx[
i] * nAddX;
492 nRowCurr = nRow1 + rNonOverlappedCellIdx[
i] * nAddY;
498 nFlag2 = lcl_DecompValueString(aStr2, nVal2, &rMinDigits);
499 if (nFlag1 == nFlag2 &&
aStr == aStr2)
501 double nDiff = approxDiff(nVal2, nVal1);
504 else if (!::rtl::math::approxEqual(nDiff, rInc, 13))
517 rSkipOverlappedCells =
true;
539 bool bDate = (nFormatType == SvNumFormatType::DATE);
540 bool bTime = (nFormatType == SvNumFormatType::TIME || nFormatType == SvNumFormatType::DATETIME);
541 bool bBooleanCell = (nFormatType == SvNumFormatType::LOGICAL);
548 Date aDate1 = aNullDate;
551 Date aDate2 = aNullDate;
552 nVal =
GetValue(nCol+nAddX, nRow+nAddY);
554 if ( aDate1 != aDate2 )
564 nCmpInc = nMDiff + 12 * nYDiff;
569 nCmpInc = aDate2 - aDate1;
574 nCmpInc = nMDiff + 12 * nYDiff;
577 nCol = sal::static_int_cast<SCCOL>( nCol + nAddX );
578 nRow = sal::static_int_cast<SCROW>( nRow + nAddY );
586 aDate2 = aNullDate +
static_cast<sal_Int32
>(nVal);
589 if ( aDate2-aDate1 != nCmpInc )
598 || (nMDiff + 12 * nYDiff != nCmpInc))
602 nCol = sal::static_int_cast<SCCOL>( nCol + nAddX );
603 nRow = sal::static_int_cast<SCROW>( nRow + nAddY );
611 && (nCmpInc % 12 == 0))
636 else if (bBooleanCell && ((fVal = aFirstCell.
getDouble()) == 0.0 || fVal == 1.0))
646 double nVal2 =
GetValue(nCol+nAddX, nRow+nAddY);
647 rInc = approxTypedDiff( nVal2, nVal1, bTime, aDuration);
648 nCol = sal::static_int_cast<SCCOL>( nCol + nAddX );
649 nRow = sal::static_int_cast<SCROW>( nRow + nAddY );
657 double nDiff = approxTypedDiff( nVal2, nVal1, bTime, aDuration);
658 if ( !::rtl::math::approxEqual( nDiff, rInc, 13 ) )
660 else if ((nVal2 == 0.0 || nVal2 == 1.0) &&
662 SvNumFormatType::LOGICAL))
668 nCol = sal::static_int_cast<SCCOL>( nCol + nAddX );
669 nRow = sal::static_int_cast<SCROW>( nRow + nAddY );
671 rDuration = aDuration;
676 else if(nFormatType == SvNumFormatType::PERCENT)
689 bool bMatchCase =
false;
692 sal_uInt16 nPrevListIndex, nInc = 1;
693 nCol = sal::static_int_cast<SCCOL>( nCol + nAddX );
694 nRow = sal::static_int_cast<SCROW>( nRow + nAddY );
697 nPrevListIndex = rListIndex;
699 if (!rListData->GetSubIndex(
aStr, rListIndex, bMatchCase))
703 sal_Int32 nIncCurr = rListIndex - nPrevListIndex;
705 nIncCurr += nListStrCount;
708 else if (nInc != nIncCurr)
711 nCol = sal::static_int_cast<SCCOL>( nCol + nAddX );
712 nRow = sal::static_int_cast<SCROW>( nRow + nAddY );
723 short nFlag1 = lcl_DecompValueString(
aStr, nVal1, &rMinDigits );
728 short nFlag2 = lcl_DecompValueString(
aStr, nVal2, &rMinDigits );
729 if ( nFlag1 == nFlag2 )
731 rInc = approxDiff( nVal2, nVal1);
732 nCol = sal::static_int_cast<SCCOL>( nCol + nAddX );
733 nRow = sal::static_int_cast<SCROW>( nRow + nAddY );
742 nFlag2 = lcl_DecompValueString(
aStr, nVal2, &rMinDigits );
743 if ( nFlag1 == nFlag2 )
745 double nDiff = approxDiff( nVal2, nVal1);
746 if ( !::rtl::math::approxEqual( nDiff, rInc, 13 ) )
755 nCol = sal::static_int_cast<SCCOL>( nCol + nAddX );
756 nRow = sal::static_int_cast<SCROW>( nRow + nAddY );
767 lcl_DecompValueString(
aStr, nDummy, &rMinDigits );
779 aCol[nDestCol].SetFormulaCell(nDestRow, pDestCell);
786 if ( nDestCol >= aOrg.
Col() && nDestRow >= aOrg.
Row() )
792 nDestCol - aOrg.
Col() + 1,
793 nDestRow - aOrg.
Row() + 1 );
797 OSL_FAIL(
"FillFormula: MatrixOrigin no formula cell with ScMatrixMode::Formula" );
802 OSL_FAIL(
"FillFormula: MatrixOrigin bottom right" );
807 OSL_FAIL(
"FillFormula: no MatrixOrigin" );
827 SCCOLROW& rInner = bVertical ? nRow : nCol;
828 SCCOLROW& rOuter = bVertical ? nCol : nRow;
846 nIEnd = nRow2 + nFillCount;
847 aFillRange =
ScRange(nCol1, nRow2+1, 0, nCol2, nRow2 + nFillCount, 0);
854 nIEnd = nRow1 - nFillCount;
855 aFillRange =
ScRange(nCol1, nRow1-1, 0, nCol2, nRow2 - nFillCount, 0);
867 nIEnd = nCol2 + nFillCount;
868 aFillRange =
ScRange(nCol2 + 1, nRow1, 0, nCol2 + nFillCount, nRow2, 0);
875 nIEnd = nCol1 - nFillCount;
876 aFillRange =
ScRange(nCol1 - 1, nRow1, 0, nCol1 - nFillCount, nRow2, 0);
879 sal_uInt64 nIMin = nIStart;
880 sal_uInt64 nIMax = nIEnd;
892 sal_uInt64 nProgress = 0;
897 std::list< sc::DelayStartListeningFormulaCells > delayStartListening;
898 SCCOL delayStartColumn, delayEndColumn;
901 delayStartColumn = std::min( nOStart, nOEnd );
902 delayEndColumn = std::max( nOStart, nOEnd );
906 delayStartColumn = std::min( nIStart, nIEnd );
907 delayEndColumn = std::max( nIStart, nIEnd );
912 delayStartListening.emplace_back( *column,
true );
917 sal_uInt64 nActFormCnt = 0;
918 for (rOuter = nOStart; rOuter <= nOEnd; rOuter++)
920 sal_uInt64 nMaxFormCnt = 0;
927 std::unique_ptr<ScPatternAttr> pNewPattern;
928 bool bGetPattern =
true;
986 if ( nOldValue != nOldValueMerge )
989 SfxItemSet& rNewSet = pNewPattern->GetItemSet();
1005 if ( bVertical && nISrcStart == nISrcEnd && !bHasFiltered )
1011 SCROW nY1 =
static_cast<SCROW>(std::min( nIStart, nIEnd ));
1012 SCROW nY2 =
static_cast<SCROW>(std::max( nIStart, nIEnd ));
1014 aCol[nCol].ApplyStyleArea( nY1, nY2, *pStyleSheet );
1016 aCol[nCol].ApplyPatternArea( nY1, nY2, *pNewPattern );
1018 aCol[nCol].ApplyPatternArea( nY1, nY2, *pSrcPattern );
1020 for(
const auto& rIndex : rCondFormatIndex)
1044 aCol[nCol].ApplyStyle(
static_cast<SCROW>(nRow), pStyleSheet );
1048 aCol[nCol].ApplyPattern(
static_cast<SCROW>(nRow), *pNewPattern );
1050 aCol[nCol].ApplyPattern(
static_cast<SCROW>(nRow), *pSrcPattern );
1052 for(
const auto& rIndex : rCondFormatIndex)
1064 if (nAtSrc==nISrcEnd)
1066 if ( nAtSrc != nISrcStart )
1068 nAtSrc = nISrcStart;
1084 if (rInner == nIEnd)
break;
1085 if (bPositive) ++rInner;
else --rInner;
1087 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, aDurationInc, nMinDigits, pListData, nListIndex,
1104 bHasFiltered, bSkipOverlappedCells, aNonOverlappedCellIdx);
1107 nCol2,
static_cast<SCROW>(nRow), eFillCmd,eDateCmd,
1108 nInc, aDurationInc, 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);
1219 aDurationInc = -aDurationInc;
1224 static_cast<SCCOL>(nCol), nRow2, nFillCount, eFillDir,
1225 eFillCmd, eDateCmd, nInc, aDurationInc, nEndVal, nMinDigits,
false,
1226 pProgress, bSkipOverlappedCells, &aNonOverlappedCellIdx);
1229 static_cast<SCROW>(nRow), nFillCount, eFillDir,
1230 eFillCmd, eDateCmd, nInc, aDurationInc, nEndVal, nMinDigits,
false,
1231 pProgress, bSkipOverlappedCells, &aNonOverlappedCellIdx);
1237 FillSparkline(bVertical, nCol, nRow1, nRow2, nIStart, nIEnd);
1239 FillSparkline(bVertical, nRow, nCol1, nCol2, nIStart, nIEnd);
1241 nActFormCnt += nMaxFormCnt;
1249 bool bHasSparklines =
false;
1250 std::vector<std::shared_ptr<sc::Sparkline>> aSparklineSeries;
1252 for (
SCROW nCurrent = nStart; nCurrent <= nEnd; nCurrent++)
1255 bHasSparklines = bHasSparklines || pSparkline;
1256 aSparklineSeries.push_back(pSparkline);
1261 for (
SCCOLROW nCurrent = nFillStart; nCurrent <= nFillEnd; nCurrent++)
1263 size_t nIndex = size_t(nFillStart - nCurrent) % aSparklineSeries.size();
1264 if (
auto& rpSparkline = aSparklineSeries[
nIndex])
1266 auto pGroup = rpSparkline->getSparklineGroup();
1268 auto* pNewSparkline = bVertical ?
CreateSparkline(nFixed, nCurrent, pGroup)
1272 SCCOLROW nPosition = bVertical ? rpSparkline->getRow()
1273 : rpSparkline->getColumn();
1274 SCCOLROW nDelta = nCurrent - nPosition;
1275 ScRangeList aRangeList(rpSparkline->getInputRange());
1276 for (
ScRange& rRange : aRangeList)
1280 rRange.aStart.IncRow(nDelta);
1281 rRange.aEnd.IncRow(nDelta);
1285 rRange.aStart.IncCol(nDelta);
1286 rRange.aEnd.IncCol(nDelta);
1289 pNewSparkline->setInputRange(aRangeList);
1306 sal_uInt64 nSrcCount = 0;
1308 if ( nEndX == nCol2 && nEndY == nRow2 )
1310 else if ( nEndX == nCol2 )
1313 nSrcCount = nRow2 - nRow1 + 1;
1315 if ( nEndY >= nRow1 )
1320 else if ( nEndY == nRow2 )
1322 nEndY = nRow2 = nRow1;
1323 nSrcCount = nCol2 - nCol1 + 1;
1325 if ( nEndX >= nCol1 )
1352 nHidden = nEnd + 1 - nBegin - nVisible;
1368 nHidden = nEnd + 1 - nBegin - nVisible;
1382 sal_uInt16 nMinDigits;
1384 sal_uInt16 nListIndex;
1385 bool bSkipOverlappedCells;
1386 std::vector<sal_Int32> aNonOverlappedCellIdx;
1391 FillAnalyse(nCol1, nRow1, nCol2, nRow2, eFillCmd, eDateCmd,
1392 nInc, aDurationInc, nMinDigits, pListData, nListIndex,
1393 true, bSkipOverlappedCells, aNonOverlappedCellIdx);
1400 sal_uInt64 nSub = nSrcCount - 1;
1401 while (
nIndex < sal::static_int_cast<tools::Long>(nSub) )
1403 sal_uInt64
nPos = ( nListIndex +
nIndex - nSub ) % nListCount;
1404 aValue = pListData->
GetSubStr(sal::static_int_cast<sal_uInt16>(
nPos));
1410 while ( nPosIndex < 0 )
1411 nPosIndex += nSrcCount;
1412 sal_uInt64
nPos = nPosIndex % nSrcCount;
1413 SCCOL nSrcX = nCol1;
1414 SCROW nSrcY = nRow1;
1416 nSrcY = sal::static_int_cast<SCROW>( nSrcY +
static_cast<SCROW>(
nPos) );
1418 nSrcX = sal::static_int_cast<SCCOL>( nSrcX +
static_cast<SCCOL>(
nPos) );
1425 nDelta =
nIndex / nSrcCount;
1427 nDelta = (
nIndex - nSrcCount + 1 ) / nSrcCount;
1440 sal_uInt16 nCellDigits = 0;
1441 short nFlag = lcl_DecompValueString( aValue, nVal, &nCellDigits );
1446 aValue = lcl_ValueString( nVal + nDelta, nCellDigits ) + aValue;
1448 else if ( nFlag > 0 )
1450 sal_Int32 nNextValue;
1452 nNextValue = nVal - nDelta;
1454 nNextValue = nVal + nDelta;
1455 if ( nFlag == 2 && nNextValue >= 0 )
1457 aValue += lcl_ValueString( nNextValue, nCellDigits );
1470 bool bPercentCell = (nFormatType == SvNumFormatType::PERCENT);
1474 nVal +=
static_cast<double>(nDelta) * 0.01;
1476 else if (nVal == 0.0 || nVal == 1.0)
1478 bool bBooleanCell = (nFormatType == SvNumFormatType::LOGICAL);
1480 nVal +=
static_cast<double>(nDelta);
1484 nVal +=
static_cast<double>(nDelta);
1488 const Color* pColor;
1505 short nHeadNoneTail = 0;
1516 nHeadNoneTail = lcl_DecompValueString( aValue, nVal );
1517 if ( nHeadNoneTail )
1518 nStart =
static_cast<double>(nVal);
1553 sal_uInt16 nDayOfMonth = 0;
1560 IncDate( nStart, nDayOfMonth, nInc, eDateCmd );
1565 if ( nHeadNoneTail )
1567 if ( nHeadNoneTail < 0 )
1572 aValue = lcl_ValueString(
static_cast<sal_Int32
>(nStart), nMinDigits ) + aValue;
1576 if ( nHeadNoneTail == 2 && nStart >= 0 )
1578 aValue += lcl_ValueString(
static_cast<sal_Int32
>(nStart), nMinDigits );
1584 const Color* pColor;
1592 OSL_FAIL(
"GetAutoFillPreview: invalid mode");
1608 const sal_uInt16 nMinYear = 1583;
1609 const sal_uInt16 nMaxYear = 9956;
1613 Date aDate = aNullDate;
1625 else if (eWeekDay ==
SUNDAY)
1632 else if (eWeekDay ==
SUNDAY)
1640 if ( nDayOfMonth == 0 )
1641 nDayOfMonth = aDate.
GetDay();
1652 nMonth -= nYAdd * 12;
1661 nMonth += nYAdd * 12;
1666 if ( nYear < nMinYear )
1667 aDate =
Date( 1,1, nMinYear );
1668 else if ( nYear > nMaxYear )
1669 aDate =
Date( 31,12, nMaxYear );
1672 aDate.
SetMonth(
static_cast<sal_uInt16
>(nMonth));
1673 aDate.
SetYear(
static_cast<sal_uInt16
>(nYear));
1689 if ( nYear < nMinYear )
1690 aDate =
Date( 1,1, nMinYear );
1691 else if ( nYear > nMaxYear )
1692 aDate =
Date( 31,12, nMaxYear );
1694 aDate.
SetYear(
static_cast<sal_uInt16
>(nYear));
1703 rVal = aDate - aNullDate;
1710 bool bHidden =
false;
1714 bHidden = pTable->
RowHidden(nRowColumn,
nullptr, &nLast);
1720 bHidden = pTable->
ColHidden(
static_cast<SCCOL>(nRowColumn),
nullptr, &nLast);
1731 ScProgress* pProgress, sal_uInt64& rProgress )
1737 bool bHidden =
false;
1740 SCCOLROW nRowStart = -1, nRowEnd = -1;
1741 std::vector<sc::RowSpan> aSpans;
1743 for (rInner = nRow1; rInner <= nRow2; ++rInner)
1745 if (rInner > nHiddenLast)
1746 bHidden = HiddenRowColumn(
this, rInner,
true, nHiddenLast);
1752 nRowEnd = rInner - 1;
1753 aSpans.emplace_back(nRowStart, nRowEnd);
1756 rInner = nHiddenLast;
1766 nRowEnd = rInner - 1;
1767 aSpans.emplace_back(nRowStart, nRowEnd);
1776 auto pSet = std::make_shared<sc::ColumnBlockPositionSet>(
rDocument);
1780 SCROW nStartRow = aSpans.front().mnRow1;
1781 SCROW nEndRow = aSpans.back().mnRow2;
1782 aCol[nCol].EndListeningFormulaCells(aEndCxt, nStartRow, nEndRow, &nStartRow, &nEndRow);
1783 aCol[nCol].StartListeningFormulaCells(aStartCxt, aEndCxt, nStartRow, nEndRow);
1785 for (
const auto& rSpan : aSpans)
1788 rProgress += nRow2 - nRow1 + 1;
1797 bool bHidden =
false;
1807 *rSrcCell.
getFormula(), rInner, rCol, nIMin, nIMax, pProgress, rProgress);
1812 for (rInner = nIMin; rInner <= nIMax; ++rInner)
1814 if (rInner > nHiddenLast)
1815 bHidden = HiddenRowColumn(
this, rInner, bVertical, nHiddenLast);
1819 rInner = nHiddenLast;
1826 rProgress += nIMax - nIMin + 1;
1838 for (rInner = nIMin; rInner <= nIMax; ++rInner)
1840 if (rInner > nHiddenLast)
1841 bHidden = HiddenRowColumn(
this, rInner, bVertical, nHiddenLast);
1854 for (rInner = nIMin; rInner <= nIMax; ++rInner)
1856 if (rInner > nHiddenLast)
1857 bHidden = HiddenRowColumn(
this, rInner, bVertical, nHiddenLast);
1865 rProgress += nIMax - nIMin + 1;
1876 sal_uInt64 nMaxFormCnt,
bool bHasFiltered,
bool bVertical,
bool bPositive,
1877 ScProgress* pProgress, sal_uInt64& rProgress )
1883 else if ( bPositive )
1887 sal_uInt64 nFormulaCounter = nActFormCnt;
1888 bool bGetCell =
true;
1889 bool bBooleanCell =
false;
1890 bool bPercentCell =
false;
1891 sal_uInt16 nCellDigits = 0;
1892 short nHeadNoneTail = 0;
1893 sal_Int32 nStringValue = 0;
1896 bool bIsOrdinalSuffix =
false;
1898 bool bColHidden =
false, bRowHidden =
false;
1900 SCCOL nColHiddenLast = -1;
1902 SCROW nRowHiddenLast = -1;
1909 if (rCol > nColHiddenLast)
1910 bColHidden =
ColHidden(rCol,
nullptr, &nColHiddenLast);
1911 if (rRow > nRowHiddenLast)
1912 bRowHidden =
RowHidden(rRow,
nullptr, &nRowHiddenLast);
1916 if (rCol < nColHiddenFirst)
1917 bColHidden =
ColHidden(rCol, &nColHiddenFirst);
1918 if (rRow < nRowHiddenFirst)
1919 bRowHidden =
RowHidden(rRow, &nRowHiddenFirst);
1922 if (!bColHidden && !bRowHidden)
1936 bBooleanCell = (nFormatType == SvNumFormatType::LOGICAL);
1937 bPercentCell = (nFormatType == SvNumFormatType::PERCENT);
1945 bBooleanCell = (nFormatType == SvNumFormatType::LOGICAL);
1946 bPercentCell = (nFormatType == SvNumFormatType::PERCENT);
1963 nHeadNoneTail = lcl_DecompValueString(
1964 aValue, nStringValue, &nCellDigits );
1966 bIsOrdinalSuffix = aValue ==
1983 if (bBooleanCell && ((fVal = aSrcCell.
getDouble()) == 0.0 || fVal == 1.0))
1985 else if(bPercentCell)
1986 aCol[rCol].SetValue(rRow, aSrcCell.
getDouble() + nDelta * 0.01);
1993 if ( nHeadNoneTail )
1995 sal_Int32 nNextValue;
1996 if (nStringValue < 0)
1997 nNextValue = nStringValue -
static_cast<sal_Int32
>(nDelta);
1999 nNextValue = nStringValue +
static_cast<sal_Int32
>(nDelta);
2001 if ( nHeadNoneTail < 0 )
2005 nNextValue, nCellDigits, aValue,
2006 aSrcCell.
getType(), bIsOrdinalSuffix);
2011 if (nHeadNoneTail == 2 && nNextValue >= 0)
2012 aStr = aValue +
"+" + lcl_ValueString(nNextValue, nCellDigits);
2014 aStr = aValue + lcl_ValueString(nNextValue, nCellDigits);
2016 aCol[rCol].SetRawString(rRow,
aStr);
2025 aSrcCell.
getFormula(), rCol, rRow, (rInner == nIEnd));
2026 if (nFormulaCounter - nActFormCnt > nMaxFormCnt)
2027 nMaxFormCnt = nFormulaCounter - nActFormCnt;
2035 if (nSource == nISrcEnd)
2037 if ( nSource != nISrcStart )
2039 nSource = nISrcStart;
2049 nFormulaCounter = nActFormCnt;
2063 if (rInner == nIEnd)
2085inline bool isOverflow(
const double& rVal,
const double& rMax,
const double& rStep,
2086 const double& rStartVal,
FillCmd eFillCmd )
2116 else if (rStep < 0.0)
2155 return rMax < rStartVal;
2156 else if (rMax < 0.0)
2157 return rStartVal < rMax;
2161 assert(!
"eFillCmd");
2170 double nMaxValue, sal_uInt16 nArgMinDigits,
2172 bool bSkipOverlappedCells, std::vector<sal_Int32>* pNonOverlappedCellIdx )
2189 SCCOLROW& rInner = bVertical ? nRow : nCol;
2190 SCCOLROW& rOuter = bVertical ? nCol : nRow;
2197 sal_uInt64 nFillerCount;
2198 std::vector<bool> aIsNonEmptyCell;
2202 nFillerCount = (nRow2 - nRow1) + 1;
2203 nFillCount += (nRow2 - nRow1);
2204 if (nFillCount == 0)
2212 nIStart = nRow1 + 1;
2213 nIEnd = nRow1 + nFillCount;
2214 aFillRange =
ScRange(nCol1, nRow1 + 1,
nTab, nCol2, nRow1 + nFillCount,
nTab);
2220 nIStart = nRow2 - 1;
2221 nIEnd = nRow2 - nFillCount;
2222 aFillRange =
ScRange(nCol1, nRow2 -1,
nTab, nCol2, nRow2 - nFillCount,
nTab);
2227 nFillerCount = (nCol2 - nCol1) + 1;
2228 nFillCount += (nCol2 - nCol1);
2229 if (nFillCount == 0)
2237 nIStart = nCol1 + 1;
2238 nIEnd = nCol1 + nFillCount;
2239 aFillRange =
ScRange(nCol1 + 1, nRow1,
nTab, nCol1 + nFillCount, nRow2,
nTab);
2245 nIStart = nCol2 - 1;
2246 nIEnd = nCol2 - nFillCount;
2247 aFillRange =
ScRange(nCol2 - 1, nRow1,
nTab, nCol2 - nFillCount, nRow2,
nTab);
2256 bool bEntireArea = (!bIsFiltered && eFillCmd ==
FILL_SIMPLE);
2258 && (nOEnd - nOStart == 0))
2281 if (nStepValue == 0.0)
2282 bEntireArea = (nStartVal <= nMaxValue);
2283 else if (((nMaxValue - nStartVal) / nStepValue) >= nFillCount)
2288 if (nStepValue == 1.0)
2289 bEntireArea = (nStartVal <= nMaxValue);
2290 else if (nStepValue == -1.0)
2291 bEntireArea = (fabs(nStartVal) <= fabs(nMaxValue));
2292 else if (nStepValue == 0.0)
2293 bEntireArea = (nStartVal == 0.0
2294 || (nStartVal < 0.0 && nMaxValue >= 0.0)
2295 || (nStartVal > 0.0 && nMaxValue <= 0.0));
2309 sal_uInt64 nProgress = 0;
2316 for (rOuter = nOStart; rOuter <= nOEnd; rOuter++)
2327 if (bSkipOverlappedCells)
2330 aIsNonEmptyCell.resize(nFillerCount,
false);
2335 nFirstValueIdx = nISource + (*pNonOverlappedCellIdx)[0];
2336 for (
auto i : (*pNonOverlappedCellIdx))
2337 aIsNonEmptyCell[
i] =
true;
2341 nFirstValueIdx = nISource - (nFillerCount - 1 - (*pNonOverlappedCellIdx).back());
2342 for (
auto i : (*pNonOverlappedCellIdx))
2343 aIsNonEmptyCell[nFillerCount - 1 -
i] =
true;
2367 static_cast<SCROW>(nIMax), *pSrcPattern, rCondFormatIndex);
2371 assert(bIsFiltered);
2372 for(
SCROW nAtRow =
static_cast<SCROW>(nIMin); nAtRow <= static_cast<SCROW>(nIMax); ++nAtRow)
2384 for (
SCCOL nAtCol =
static_cast<SCCOL>(nIMin); nAtCol <= sal::static_int_cast<SCCOL>(nIMax); nAtCol++)
2400 FillSeriesSimple(aSrcCell, rInner, nIMin, nIMax, nCol, nRow, bVertical, pProgress, nProgress);
2406 double nVal = nStartVal;
2409 bool bError =
false;
2410 bool bOverflow =
false;
2411 bool bNonEmpty =
true;
2413 sal_uInt16 nDayOfMonth = 0;
2414 sal_Int32 nFillerIdx = 0;
2415 if (bSkipOverlappedCells && !aIsNonEmptyCell[0])
2420 if (bSkipOverlappedCells)
2422 nFillerIdx = (nFillerIdx + 1) % nFillerCount;
2423 bNonEmpty = aIsNonEmptyCell[nFillerIdx];
2428 if (!bError && bNonEmpty)
2444 double nAdd = nStepValue;
2459 IncDate(nVal, nDayOfMonth, nStepValue, eFillDateCmd);
2468 bOverflow = isOverflow( nVal, nMaxValue, nStepValue, nStartVal, eFillCmd);
2473 aCol[nCol].SetError(
static_cast<SCROW>(nRow), FormulaError::NoValue);
2474 else if (!bOverflow && bNonEmpty)
2475 aCol[nCol].SetValue(
static_cast<SCROW>(nRow), nVal);
2477 if (bAttribs && !bEntireArea && !bOverflow)
2481 if (rInner == nIEnd || bOverflow)
2492 nProgress += nIMax - nIMin + 1;
2498 if ( nStepValue >= 0 )
2500 if ( nMaxValue >=
double(
LONG_MAX) )
2505 if ( nMaxValue <=
double(LONG_MIN) )
2506 nMaxValue = double(LONG_MIN) + 1;
2513 sal_Int32 nStringValue;
2514 sal_uInt16 nMinDigits = nArgMinDigits;
2515 short nHeadNoneTail = lcl_DecompValueString( aValue, nStringValue, &nMinDigits );
2516 if ( nHeadNoneTail )
2518 const double nStartVal =
static_cast<double>(nStringValue);
2519 double nVal = nStartVal;
2521 bool bError =
false;
2522 bool bOverflow =
false;
2523 bool bNonEmpty =
true;
2526 static_cast<sal_Int32
>(nStartVal));
2528 sal_Int32 nFillerIdx = 0;
2529 if (bSkipOverlappedCells && !aIsNonEmptyCell[0])
2534 if (bSkipOverlappedCells)
2536 nFillerIdx = (nFillerIdx + 1) % nFillerCount;
2537 bNonEmpty = aIsNonEmptyCell[nFillerIdx];
2541 if (!bError && bNonEmpty)
2557 double nAdd = nStepValue;
2575 bOverflow = isOverflow( nVal, nMaxValue, nStepValue, nStartVal, eFillCmd);
2579 aCol[nCol].SetError(
static_cast<SCROW>(nRow), FormulaError::NoValue);
2580 else if (!bOverflow && bNonEmpty)
2582 nStringValue =
static_cast<sal_Int32
>(nVal);
2583 if ( nHeadNoneTail < 0 )
2587 nStringValue, nMinDigits, aValue,
2588 eCellType, bIsOrdinalSuffix);
2593 if (nHeadNoneTail == 2 && nStringValue >= 0)
2594 aStr = aValue +
"+";
2597 aStr += lcl_ValueString( nStringValue, nMinDigits );
2602 if (bAttribs && !bEntireArea && !bOverflow)
2606 if (rInner == nIEnd || bOverflow)
2616 nProgress += nIMax - nIMin + 1;
2623 nProgress += nIMax - nIMin + 1;
2635 FillAuto(nCol1, nRow1, nCol2, nRow2, nFillCount, eFillDir, pProgress);
2637 FillSeries(nCol1, nRow1, nCol2, nRow2, nFillCount, eFillDir,
2638 eFillCmd, eFillDateCmd, nStepValue, rDurationStep, nMaxValue, 0,
true, pProgress);
2653 sal_uInt16 nFormatNo )
2663 std::unique_ptr<ScPatternAttr> pPatternAttrs[16];
2670 SCCOL nCol = nStartCol;
2671 SCROW nRow = nStartRow;
2676 if (
pData->HasSameData(4, 8))
2677 AutoFormatArea(nStartCol, nStartRow + 1, nStartCol, nEndRow - 1, *pPatternAttrs[4], nFormatNo);
2681 for (nRow = nStartRow + 1; nRow < nEndRow; nRow++)
2700 if (
pData->HasSameData(7, 11))
2701 AutoFormatArea(nEndCol, nStartRow + 1, nEndCol, nEndRow - 1, *pPatternAttrs[7], nFormatNo);
2705 for (nRow = nStartRow + 1; nRow < nEndRow; nRow++)
2720 for (nCol = nStartCol + 1; nCol < nEndCol; nCol++)
2731 for (nCol = nStartCol + 1; nCol < nEndCol; nCol++)
2740 if ((
pData->HasSameData(5, 6)) && (
pData->HasSameData(9, 10)) && (
pData->HasSameData(5, 9)))
2741 AutoFormatArea(nStartCol + 1, nStartRow + 1, nEndCol-1, nEndRow - 1, *pPatternAttrs[5], nFormatNo);
2744 if ((
pData->HasSameData(5, 9)) && (
pData->HasSameData(6, 10)))
2747 for (nCol = nStartCol + 1; nCol < nEndCol; nCol++)
2759 for (nCol = nStartCol + 1; nCol < nEndCol; nCol++)
2761 for (nRow = nStartRow + 1; nRow < nEndRow; nRow++)
2799#define LF_ALL (LF_LEFT | LF_TOP | LF_RIGHT | LF_BOTTOM)
2866 if ((nEndCol - nStartCol < 3) || (nEndRow - nStartRow < 3))
2876 if (nEndRow - nStartRow >= 4)
2890 if (nEndRow - nStartRow >= 4)
2901 if (nEndCol - nStartCol >= 4)
2909 if (nEndCol - nStartCol >= 4)
2919 if ((nEndCol - nStartCol >= 4) && (nEndRow - nStartRow >= 4))
2936 aCol[nCol].SetError( nRow, nError );
3000 return aCol[nCol].GetPatternCount();
3008 return aCol[nCol].GetPatternCount( nRow1, nRow2 );
3016 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)
void Fill(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, sal_uInt64 nFillCount, FillDir eFillDir, FillCmd eFillCmd, FillDateCmd eFillDateCmd, double nStepValue, const tools::Duration &rDurationStep, double nMaxValue, ScProgress *pProgress)
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 FillAnalyse(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, FillCmd &rCmd, FillDateCmd &rDateCmd, double &rInc, tools::Duration &rDuration, sal_uInt16 &rMinDigits, ScUserListData *&rListData, sal_uInt16 &rListIndex, bool bHasFiltered, bool &rSkipOverlappedCells, std::vector< sal_Int32 > &rNonOverlappedCellIdx)
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 FillSeries(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, sal_uInt64 nFillCount, FillDir eFillDir, FillCmd eFillCmd, FillDateCmd eFillDateCmd, double nStepValue, const tools::Duration &rDurationStep, double nMaxValue, sal_uInt16 nMinDigits, bool bAttribs, ScProgress *pProgress, bool bSkipOverlappedCells=false, std::vector< sal_Int32 > *pNonOverlappedCellIdx=nullptr)
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 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)
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
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