23 #include <editeng/editeng.hxx>
28 #include <rtl/math.hxx>
36 #include <document.hxx>
43 #include <progress.hxx>
52 #include <string_view>
54 #define D_MAX_LONG_ double(0x7fffffff)
58 short lcl_DecompValueString( OUString&
rValue, sal_Int32& nVal, sal_uInt16* pMinDigits =
nullptr )
60 if ( rValue.isEmpty() )
68 if ( p[nNum] ==
'-' || p[nNum] ==
'+' )
81 nVal = rValue.copy( 0, nNum ).toInt32();
83 if ( p[nSign] ==
'0' && pMinDigits && ( nNum - nSign > *pMinDigits ) )
84 *pMinDigits = nNum - nSign;
85 rValue = rValue.copy(nNum);
91 sal_Int32 nEnd = nNum = rValue.getLength() - 1;
94 if ( p[nNum] ==
'-' || p[nNum] ==
'+' )
99 if ( nNum < nEnd - nSign )
101 nVal = rValue.copy( nNum + 1 ).toInt32();
103 if ( p[nNum+1+nSign] ==
'0' && pMinDigits && ( nEnd - nNum - nSign > *pMinDigits ) )
104 *pMinDigits = nEnd - nNum - nSign;
105 rValue = rValue.copy(0, nNum + 1);
116 OUString lcl_ValueString( sal_Int32
nValue, sal_uInt16 nMinDigits )
118 if ( nMinDigits <= 1 )
119 return OUString::number( nValue );
122 OUString
aStr = OUString::number( std::abs( nValue ) );
123 if ( aStr.getLength() < nMinDigits )
125 OUStringBuffer aZero;
127 aStr = aZero.makeStringAndClear() + aStr;
137 ScColumn& rColumn,
SCROW nRow, sal_Int32 nValue, sal_uInt16 nDigits,
138 std::u16string_view rSuffix,
139 CellType eCellType,
bool bIsOrdinalSuffix )
142 OUString aValue = lcl_ValueString(nValue, nDigits);
143 if (!bIsOrdinalSuffix)
153 aValue += aOrdinalSuffix;
163 aEngine.SetText( aValue );
164 aEngine.QuickInsertText(
166 ESelection(0, aValue.getLength(), 0, aValue.getLength() + aOrdinalSuffix.getLength()));
168 aEngine.QuickSetAttribs(
170 ESelection(0, aValue.getLength(), 0, aValue.getLength() + aOrdinalSuffix.getLength()));
173 rColumn.
SetEditText(nRow, aEngine.CreateTextObject());
184 double approxDiff(
double a,
double b )
192 const double c = a - b;
193 const double aa = fabs(a);
194 const double ab = fabs(b);
195 if (aa < 1e-16 || aa > 1e+16 || ab < 1e-16 || ab > 1e+16)
199 const double q = aa < ab ? b / a : a / b;
200 const double d = (a * q - b * q) / q;
207 const double e = fabs(d - c);
208 const int nExp =
static_cast<int>(floor(log10(e))) + 1;
211 const int nExpArg =
static_cast<int>(floor(log10(std::max(aa, ab)))) - 15;
213 return rtl::math::round((c + d) / 2, -std::max(nExp, nExpArg));
219 double& rInc, sal_uInt16& rMinDigits,
221 bool bHasFiltered,
bool& rSkipOverlappedCells,
222 std::vector<sal_Int32>& rNonOverlappedCellIdx)
224 OSL_ENSURE( nCol1==nCol2 || nRow1==nRow2,
"FillAnalyse: invalid range" );
230 rSkipOverlappedCells =
false;
241 nCount =
static_cast<SCSIZE>(nRow2 - nRow1 + 1);
247 nCount =
static_cast<SCSIZE>(nCol2 - nCol1 + 1);
256 bool bHasOverlappedCells =
false;
257 bool bSkipOverlappedCells =
true;
258 SCCOL nColCurr = nCol1;
259 SCROW nRowCurr = nRow1;
262 rNonOverlappedCellIdx.resize(nCount);
272 bHasOverlappedCells =
true;
276 rNonOverlappedCellIdx[nValueCount++] =
i;
279 bSkipOverlappedCells =
false;
285 rNonOverlappedCellIdx.resize(nValueCount);
288 if (nValueCount == 0)
292 if (!bHasOverlappedCells)
293 bSkipOverlappedCells =
false;
295 if (bSkipOverlappedCells)
297 nColCurr = nCol1 + rNonOverlappedCellIdx[0] * nAddX;
298 nRowCurr = nRow1 + rNonOverlappedCellIdx[0] * nAddY;
308 if (nCurrCellFormatType == SvNumFormatType::DATE)
310 if (nValueCount >= 2)
316 Date aCurrDate = aNullDate, aPrevDate = aNullDate;
318 for (
SCSIZE i = 1;
i < nValueCount && bVal;
i++)
320 aPrevCell = aCurrCell;
321 aPrevDate = aCurrDate;
322 nColCurr = nCol1 + rNonOverlappedCellIdx[
i] * nAddX;
323 nRowCurr = nRow1 + rNonOverlappedCellIdx[
i] * nAddY;
327 aCurrDate = aNullDate +
static_cast<sal_Int32
>(aCurrCell.
mfValue);
329 nDDiff = aCurrDate.
GetDay()
341 nCmpInc = aCurrDate - aPrevDate;
346 nCmpInc = nMDiff + 12 * nYDiff;
351 if (aCurrDate - aPrevDate != nCmpInc)
356 if (nDDiff || (nMDiff + 12 * nYDiff != nCmpInc))
365 if (eType ==
FILL_MONTH && (nCmpInc % 12 == 0))
373 rSkipOverlappedCells =
true;
382 rSkipOverlappedCells =
true;
386 else if (nCurrCellFormatType == SvNumFormatType::LOGICAL
387 && ((fVal = aCurrCell.
mfValue) == 0.0 || fVal == 1.0))
390 else if (nValueCount >= 2)
392 for (
SCSIZE i = 1;
i < nValueCount && bVal;
i++)
394 aPrevCell = aCurrCell;
395 nColCurr = nCol1 + rNonOverlappedCellIdx[
i] * nAddX;
396 nRowCurr = nRow1 + rNonOverlappedCellIdx[
i] * nAddY;
403 if (!::rtl::math::approxEqual(nDiff, rInc, 13))
408 == SvNumFormatType::LOGICAL))
417 rSkipOverlappedCells =
true;
430 bool bMatchCase =
false;
433 sal_uInt16 nPrevListIndex, nInc = 1;
434 for (
SCSIZE i = 1;
i < nValueCount && rListData;
i++)
436 nColCurr = nCol1 + rNonOverlappedCellIdx[
i] * nAddX;
437 nRowCurr = nRow1 + rNonOverlappedCellIdx[
i] * nAddY;
440 nPrevListIndex = rListIndex;
441 if (!rListData->GetSubIndex(aStr2, rListIndex, bMatchCase))
445 sal_Int32 nIncCurr = rListIndex - nPrevListIndex;
447 nIncCurr += nListStrCount;
450 else if (nInc != nIncCurr)
456 rSkipOverlappedCells =
true;
460 short nFlag1, nFlag2;
461 sal_Int32 nVal1, nVal2;
462 nFlag1 = lcl_DecompValueString(aStr, nVal1, &rMinDigits);
467 for (
SCSIZE i = 1;
i < nValueCount && bVal;
i++)
469 nColCurr = nCol1 + rNonOverlappedCellIdx[
i] * nAddX;
470 nRowCurr = nRow1 + rNonOverlappedCellIdx[
i] * nAddY;
476 nFlag2 = lcl_DecompValueString(aStr2, nVal2, &rMinDigits);
477 if (nFlag1 == nFlag2 && aStr == aStr2)
479 double nDiff = approxDiff(nVal2, nVal1);
482 else if (!::rtl::math::approxEqual(nDiff, rInc, 13))
495 rSkipOverlappedCells =
true;
517 bool bDate = (nFormatType == SvNumFormatType::DATE );
518 bool bBooleanCell = (!bDate && nFormatType == SvNumFormatType::LOGICAL);
525 Date aDate1 = aNullDate;
528 Date aDate2 = aNullDate;
529 nVal =
GetValue(nCol+nAddX, nRow+nAddY);
531 if ( aDate1 != aDate2 )
541 nCmpInc = aDate2 - aDate1;
546 nCmpInc = nMDiff + 12 * nYDiff;
549 nCol = sal::static_int_cast<
SCCOL>( nCol + nAddX );
550 nRow = sal::static_int_cast<
SCROW>( nRow + nAddY );
558 aDate2 = aNullDate +
static_cast<sal_Int32
>(nVal);
561 if ( aDate2-aDate1 != nCmpInc )
569 if (nDDiff || ( nMDiff + 12 * nYDiff != nCmpInc ))
573 nCol = sal::static_int_cast<
SCCOL>( nCol + nAddX );
574 nRow = sal::static_int_cast<
SCROW>( nRow + nAddY );
581 if ( eType ==
FILL_MONTH && ( nCmpInc % 12 == 0 ) )
599 else if (bBooleanCell && ((fVal = aFirstCell.
mfValue) == 0.0 || fVal == 1.0))
607 double nVal1 = aFirstCell.
mfValue;
608 double nVal2 =
GetValue(nCol+nAddX, nRow+nAddY);
609 rInc = approxDiff( nVal2, nVal1);
610 nCol = sal::static_int_cast<
SCCOL>( nCol + nAddX );
611 nRow = sal::static_int_cast<
SCROW>( nRow + nAddY );
619 double nDiff = approxDiff( nVal2, nVal1);
620 if ( !::rtl::math::approxEqual( nDiff, rInc, 13 ) )
622 else if ((nVal2 == 0.0 || nVal2 == 1.0) &&
624 SvNumFormatType::LOGICAL))
630 nCol = sal::static_int_cast<
SCCOL>( nCol + nAddX );
631 nRow = sal::static_int_cast<
SCROW>( nRow + nAddY );
636 else if(nFormatType == SvNumFormatType::PERCENT)
650 bool bMatchCase =
false;
653 sal_uInt16 nPrevListIndex, nInc = 1;
654 nCol = sal::static_int_cast<
SCCOL>( nCol + nAddX );
655 nRow = sal::static_int_cast<
SCROW>( nRow + nAddY );
656 for (
SCSIZE i=1;
i<nCount && rListData;
i++)
658 nPrevListIndex = rListIndex;
660 if (!rListData->GetSubIndex(aStr, rListIndex, bMatchCase))
664 sal_Int32 nIncCurr = rListIndex - nPrevListIndex;
666 nIncCurr += nListStrCount;
669 else if (nInc != nIncCurr)
672 nCol = sal::static_int_cast<
SCCOL>( nCol + nAddX );
673 nRow = sal::static_int_cast<
SCROW>( nRow + nAddY );
678 else if ( nCount > 1 )
684 short nFlag1 = lcl_DecompValueString( aStr, nVal1, &rMinDigits );
688 GetString( nCol+nAddX, nRow+nAddY, aStr );
689 short nFlag2 = lcl_DecompValueString( aStr, nVal2, &rMinDigits );
690 if ( nFlag1 == nFlag2 )
692 rInc = approxDiff( nVal2, nVal1);
693 nCol = sal::static_int_cast<
SCCOL>( nCol + nAddX );
694 nRow = sal::static_int_cast<
SCROW>( nRow + nAddY );
703 nFlag2 = lcl_DecompValueString( aStr, nVal2, &rMinDigits );
704 if ( nFlag1 == nFlag2 )
706 double nDiff = approxDiff( nVal2, nVal1);
707 if ( !::rtl::math::approxEqual( nDiff, rInc, 13 ) )
716 nCol = sal::static_int_cast<
SCCOL>( nCol + nAddX );
717 nRow = sal::static_int_cast<
SCROW>( nRow + nAddY );
728 lcl_DecompValueString( aStr, nDummy, &rMinDigits );
740 aCol[nDestCol].SetFormulaCell(nDestRow, pDestCell);
747 if ( nDestCol >= aOrg.
Col() && nDestRow >= aOrg.
Row() )
753 nDestCol - aOrg.
Col() + 1,
754 nDestRow - aOrg.
Row() + 1 );
758 OSL_FAIL(
"FillFormula: MatrixOrigin no formula cell with ScMatrixMode::Formula" );
763 OSL_FAIL(
"FillFormula: MatrixOrigin bottom right" );
768 OSL_FAIL(
"FillFormula: no MatrixOrigin" );
788 SCCOLROW& rInner = bVertical ? nRow : nCol;
789 SCCOLROW& rOuter = bVertical ? nCol : nRow;
807 nIEnd = nRow2 + nFillCount;
808 aFillRange =
ScRange(nCol1, nRow2+1, 0, nCol2, nRow2 + nFillCount, 0);
815 nIEnd = nRow1 - nFillCount;
816 aFillRange =
ScRange(nCol1, nRow1-1, 0, nCol2, nRow2 - nFillCount, 0);
828 nIEnd = nCol2 + nFillCount;
829 aFillRange =
ScRange(nCol2 + 1, nRow1, 0, nCol2 + nFillCount, nRow2, 0);
836 nIEnd = nCol1 - nFillCount;
837 aFillRange =
ScRange(nCol1 - 1, nRow1, 0, nCol1 - nFillCount, nRow2, 0);
858 std::list< sc::DelayStartListeningFormulaCells > delayStartListening;
859 SCCOL delayStartColumn, delayEndColumn;
862 delayStartColumn = std::min( nOStart, nOEnd );
863 delayEndColumn = std::max( nOStart, nOEnd );
867 delayStartColumn = std::min( nIStart, nIEnd );
868 delayEndColumn = std::max( nIStart, nIEnd );
870 for(
SCROW col = delayStartColumn; col <= delayEndColumn; ++col )
873 delayStartListening.emplace_back( *column,
true );
879 for (rOuter = nOStart; rOuter <= nOEnd; rOuter++)
888 std::unique_ptr<ScPatternAttr> pNewPattern;
889 bool bGetPattern =
true;
898 pSrcPattern =
aCol[nCol].GetPattern(static_cast<SCROW>(nAtSrc));
900 pSrcPattern =
aCol[nAtSrc].GetPattern(static_cast<SCROW>(nRow));
947 if ( nOldValue != nOldValueMerge )
950 SfxItemSet& rNewSet = pNewPattern->GetItemSet();
966 if ( bVertical && nISrcStart == nISrcEnd && !bHasFiltered )
972 SCROW nY1 =
static_cast<SCROW>(std::min( nIStart, nIEnd ));
973 SCROW nY2 =
static_cast<SCROW>(std::max( nIStart, nIEnd ));
975 aCol[nCol].ApplyStyleArea( nY1, nY2, *pStyleSheet );
977 aCol[nCol].ApplyPatternArea( nY1, nY2, *pNewPattern );
979 aCol[nCol].ApplyPatternArea( nY1, nY2, *pSrcPattern );
981 for(
const auto& rIndex : rCondFormatIndex)
997 DeleteArea(static_cast<SCCOL>(nCol), static_cast<SCROW>(nRow),
1000 if ( pSrcPattern !=
aCol[nCol].
GetPattern( static_cast<SCROW>(nRow) ) )
1005 aCol[nCol].ApplyStyle( static_cast<SCROW>(nRow), pStyleSheet );
1009 aCol[nCol].ApplyPattern( static_cast<SCROW>(nRow), *pNewPattern );
1011 aCol[nCol].ApplyPattern( static_cast<SCROW>(nRow), *pSrcPattern );
1013 for(
const auto& rIndex : rCondFormatIndex)
1025 if (nAtSrc==nISrcEnd)
1027 if ( nAtSrc != nISrcStart )
1029 nAtSrc = nISrcStart;
1045 if (rInner == nIEnd)
break;
1046 if (bPositive) ++rInner;
else --rInner;
1048 pNewPattern.reset();
1055 sal_uInt16 nMinDigits;
1057 sal_uInt16 nListIndex;
1058 bool bSkipOverlappedCells;
1059 std::vector<sal_Int32> aNonOverlappedCellIdx;
1062 static_cast<SCCOL>(nCol),nRow2, eFillCmd,eDateCmd,
1063 nInc, nMinDigits, pListData, nListIndex,
1064 bHasFiltered, bSkipOverlappedCells, aNonOverlappedCellIdx);
1067 nCol2,static_cast<SCROW>(nRow), eFillCmd,eDateCmd,
1068 nInc, nMinDigits, pListData, nListIndex,
1069 bHasFiltered, bSkipOverlappedCells, aNonOverlappedCellIdx);
1074 if (bSkipOverlappedCells)
1076 int nFillerCount = 1 + ( nISrcEnd - nISrcStart ) * (bPositive ? 1 : -1);
1077 std::vector<bool> aIsNonEmptyCell(nFillerCount,
false);
1081 nLastValueIdx = nISrcEnd - (nFillerCount - 1 - aNonOverlappedCellIdx.back());
1082 for (
auto i : aNonOverlappedCellIdx)
1083 aIsNonEmptyCell[
i] =
true;
1087 nLastValueIdx = nISrcEnd + aNonOverlappedCellIdx[0];
1088 for (
auto i : aNonOverlappedCellIdx)
1089 aIsNonEmptyCell[nFillerCount - 1 -
i] =
true;
1098 bool bMatchCase =
false;
1101 sal_Int32 nFillerIdx = 0;
1105 if (aIsNonEmptyCell[nFillerIdx])
1110 if (nListIndex >= nListCount) nListIndex -= nListCount;
1114 if (nListIndex < nInc) nListIndex += nListCount;
1117 aCol[nCol].SetRawString(static_cast<SCROW>(nRow), pListData->
GetSubStr(nListIndex));
1120 if (rInner == nIEnd)
break;
1121 nFillerIdx = (nFillerIdx + 1) % nFillerCount;
1133 sal_Int64 nAdjust = nListIndex - (nISrcStart - nISrcEnd) * nInc;
1134 nAdjust = nAdjust % nListCount;
1136 nAdjust += nListCount;
1137 nListIndex = nAdjust;
1148 if (nListIndex >= nListCount) nListIndex -= nListCount;
1152 if (nListIndex < nInc) nListIndex += nListCount;
1155 aCol[nCol].SetRawString(static_cast<SCROW>(nRow), pListData->
GetSubStr(nListIndex));
1158 if (rInner == nIEnd)
break;
1159 if (bPositive) ++rInner;
else --rInner;
1164 nProgress += nIMax - nIMin + 1;
1171 nISrcStart, nISrcEnd, nIStart, nIEnd, rInner, nCol, nRow,
1172 nActFormCnt, nMaxFormCnt, bHasFiltered, bVertical, bPositive, pProgress, nProgress);
1181 static_cast<SCCOL>(nCol), nRow2, nFillCount, eFillDir,
1182 eFillCmd, eDateCmd, nInc, nEndVal, nMinDigits,
false,
1183 pProgress, bSkipOverlappedCells, &aNonOverlappedCellIdx);
1185 FillSeries( nCol1, static_cast<SCROW>(nRow), nCol2,
1186 static_cast<SCROW>(nRow), nFillCount, eFillDir,
1187 eFillCmd, eDateCmd, nInc, nEndVal, nMinDigits,
false,
1188 pProgress, bSkipOverlappedCells, &aNonOverlappedCellIdx);
1193 nActFormCnt += nMaxFormCnt;
1209 if ( nEndX == nCol2 && nEndY == nRow2 )
1211 else if ( nEndX == nCol2 )
1214 nSrcCount = nRow2 - nRow1 + 1;
1216 if ( nEndY >= nRow1 )
1221 else if ( nEndY == nRow2 )
1223 nEndY = nRow2 = nRow1;
1224 nSrcCount = nCol2 - nCol1 + 1;
1226 if ( nEndX >= nCol1 )
1239 sal_uInt16 nMinDigits;
1241 sal_uInt16 nListIndex;
1242 bool bSkipOverlappedCells;
1243 std::vector<sal_Int32> aNonOverlappedCellIdx;
1248 FillAnalyse(nCol1, nRow1, nCol2, nRow2, eFillCmd, eDateCmd,
1249 nInc, nMinDigits, pListData, nListIndex,
1250 true, bSkipOverlappedCells, aNonOverlappedCellIdx);
1258 while ( nIndex < sal::static_int_cast<tools::Long>(nSub) )
1259 nIndex += nListCount;
1260 sal_uLong nPos = ( nListIndex + nIndex - nSub ) % nListCount;
1261 aValue = pListData->
GetSubStr(sal::static_int_cast<sal_uInt16>(nPos));
1282 tools::Long nFiltered = nEnd + 1 - nBegin - nNonFiltered;
1285 nIndex = nIndex - nFiltered;
1287 nIndex = nIndex + nFiltered;
1291 while ( nPosIndex < 0 )
1292 nPosIndex += nSrcCount;
1294 SCCOL nSrcX = nCol1;
1295 SCROW nSrcY = nRow1;
1297 nSrcY = sal::static_int_cast<
SCROW>( nSrcY +
static_cast<SCROW>(nPos) );
1299 nSrcX = sal::static_int_cast<
SCCOL>( nSrcX +
static_cast<SCCOL>(nPos) );
1306 nDelta = nIndex / nSrcCount;
1308 nDelta = ( nIndex - nSrcCount + 1 ) / nSrcCount;
1321 sal_uInt16 nCellDigits = 0;
1322 short nFlag = lcl_DecompValueString( aValue, nVal, &nCellDigits );
1327 aValue = lcl_ValueString( nVal + nDelta, nCellDigits ) + aValue;
1329 else if ( nFlag > 0 )
1331 sal_Int32 nNextValue;
1333 nNextValue = nVal - nDelta;
1335 nNextValue = nVal + nDelta;
1336 if ( nFlag == 2 && nNextValue >= 0 )
1338 aValue += lcl_ValueString( nNextValue, nCellDigits );
1351 bool bPercentCell = (nFormatType == SvNumFormatType::PERCENT);
1355 nVal +=
static_cast<double>(nDelta) * 0.01;
1357 else if (nVal == 0.0 || nVal == 1.0)
1359 bool bBooleanCell = (nFormatType == SvNumFormatType::LOGICAL);
1361 nVal +=
static_cast<double>(nDelta);
1365 nVal +=
static_cast<double>(nDelta);
1369 const Color* pColor;
1386 short nHeadNoneTail = 0;
1397 nHeadNoneTail = lcl_DecompValueString( aValue, nVal );
1398 if ( nHeadNoneTail )
1399 nStart =
static_cast<double>(nVal);
1425 sal_uInt16 nDayOfMonth = 0;
1432 IncDate( nStart, nDayOfMonth, nInc, eDateCmd );
1437 if ( nHeadNoneTail )
1439 if ( nHeadNoneTail < 0 )
1444 aValue = lcl_ValueString( static_cast<sal_Int32>(nStart), nMinDigits ) + aValue;
1448 if ( nHeadNoneTail == 2 && nStart >= 0 )
1450 aValue += lcl_ValueString( static_cast<sal_Int32>(nStart), nMinDigits );
1456 const Color* pColor;
1464 OSL_FAIL(
"GetAutoFillPreview: invalid mode");
1480 const sal_uInt16 nMinYear = 1583;
1481 const sal_uInt16 nMaxYear = 9956;
1485 Date aDate = aNullDate;
1497 else if (eWeekDay ==
SUNDAY)
1504 else if (eWeekDay ==
SUNDAY)
1511 if ( nDayOfMonth == 0 )
1512 nDayOfMonth = aDate.
GetDay();
1523 nMonth -= nYAdd * 12;
1532 nMonth += nYAdd * 12;
1537 if ( nYear < nMinYear )
1538 aDate =
Date( 1,1, nMinYear );
1539 else if ( nYear > nMaxYear )
1540 aDate =
Date( 31,12, nMaxYear );
1543 aDate.
SetMonth(static_cast<sal_uInt16>(nMonth));
1544 aDate.
SetYear(static_cast<sal_uInt16>(nYear));
1553 if ( nYear < nMinYear )
1554 aDate =
Date( 1,1, nMinYear );
1555 else if ( nYear > nMaxYear )
1556 aDate =
Date( 31,12, nMaxYear );
1558 aDate.
SetYear(static_cast<sal_uInt16>(nYear));
1567 rVal = aDate - aNullDate;
1574 bool bHidden =
false;
1578 bHidden = pTable->
RowHidden(nRowColumn,
nullptr, &nLast);
1584 bHidden = pTable->
ColHidden(static_cast<SCCOL>(nRowColumn),
nullptr, &nLast);
1601 bool bHidden =
false;
1604 SCCOLROW nRowStart = -1, nRowEnd = -1;
1605 std::vector<sc::RowSpan> aSpans;
1607 for (rInner = nRow1; rInner <= nRow2; ++rInner)
1609 if (rInner > nHiddenLast)
1610 bHidden = HiddenRowColumn(
this, rInner,
true, nHiddenLast);
1616 nRowEnd = rInner - 1;
1617 aSpans.emplace_back(nRowStart, nRowEnd);
1620 rInner = nHiddenLast;
1630 nRowEnd = rInner - 1;
1631 aSpans.emplace_back(nRowStart, nRowEnd);
1640 auto pSet = std::make_shared<sc::ColumnBlockPositionSet>(
rDocument);
1644 SCROW nStartRow = aSpans.front().mnRow1;
1645 SCROW nEndRow = aSpans.back().mnRow2;
1646 aCol[nCol].EndListeningFormulaCells(aEndCxt, nStartRow, nEndRow, &nStartRow, &nEndRow);
1647 aCol[nCol].StartListeningFormulaCells(aStartCxt, aEndCxt, nStartRow, nEndRow);
1649 for (
const auto& rSpan : aSpans)
1652 rProgress += nRow2 - nRow1 + 1;
1661 bool bHidden =
false;
1671 *rSrcCell.
mpFormula, rInner, rCol, nIMin, nIMax, pProgress, rProgress);
1676 for (rInner = nIMin; rInner <= nIMax; ++rInner)
1678 if (rInner > nHiddenLast)
1679 bHidden = HiddenRowColumn(
this, rInner, bVertical, nHiddenLast);
1683 rInner = nHiddenLast;
1690 rProgress += nIMax - nIMin + 1;
1702 for (rInner = nIMin; rInner <= nIMax; ++rInner)
1704 if (rInner > nHiddenLast)
1705 bHidden = HiddenRowColumn(
this, rInner, bVertical, nHiddenLast);
1718 for (rInner = nIMin; rInner <= nIMax; ++rInner)
1720 if (rInner > nHiddenLast)
1721 bHidden = HiddenRowColumn(
this, rInner, bVertical, nHiddenLast);
1729 rProgress += nIMax - nIMin + 1;
1740 sal_uLong nMaxFormCnt,
bool bHasFiltered,
bool bVertical,
bool bPositive,
1747 else if ( bPositive )
1751 sal_uLong nFormulaCounter = nActFormCnt;
1752 bool bGetCell =
true;
1753 bool bBooleanCell =
false;
1754 bool bPercentCell =
false;
1755 sal_uInt16 nCellDigits = 0;
1756 short nHeadNoneTail = 0;
1757 sal_Int32 nStringValue = 0;
1760 bool bIsOrdinalSuffix =
false;
1762 bool bColHidden =
false, bRowHidden =
false;
1763 SCCOL nColHiddenLast = -1;
1764 SCROW nRowHiddenLast = -1;
1769 if (rCol > nColHiddenLast)
1770 bColHidden =
ColHidden(rCol,
nullptr, &nColHiddenLast);
1771 if (rRow > nRowHiddenLast)
1772 bRowHidden =
RowHidden(rRow,
nullptr, &nRowHiddenLast);
1774 if (!bColHidden && !bRowHidden)
1780 aSrcCell =
aCol[rCol].GetCellValue(nSource);
1788 bBooleanCell = (nFormatType == SvNumFormatType::LOGICAL);
1789 bPercentCell = (nFormatType == SvNumFormatType::PERCENT);
1794 aSrcCell =
aCol[nSource].GetCellValue(rRow);
1797 bBooleanCell = (nFormatType == SvNumFormatType::LOGICAL);
1798 bPercentCell = (nFormatType == SvNumFormatType::PERCENT);
1815 nHeadNoneTail = lcl_DecompValueString(
1816 aValue, nStringValue, &nCellDigits );
1818 bIsOrdinalSuffix = aValue ==
1835 if (bBooleanCell && ((fVal = aSrcCell.
mfValue) == 0.0 || fVal == 1.0))
1837 else if(bPercentCell)
1838 aCol[rCol].SetValue(rRow, aSrcCell.
mfValue + nDelta * 0.01);
1840 aCol[rCol].SetValue(rRow, aSrcCell.
mfValue + nDelta);
1845 if ( nHeadNoneTail )
1847 sal_Int32 nNextValue;
1848 if (nStringValue < 0)
1849 nNextValue = nStringValue -
static_cast<sal_Int32
>(nDelta);
1851 nNextValue = nStringValue +
static_cast<sal_Int32
>(nDelta);
1853 if ( nHeadNoneTail < 0 )
1857 nNextValue, nCellDigits, aValue,
1858 aSrcCell.
meType, bIsOrdinalSuffix);
1863 if (nHeadNoneTail == 2 && nNextValue >= 0)
1864 aStr = aValue +
"+" + lcl_ValueString(nNextValue, nCellDigits);
1866 aStr = aValue + lcl_ValueString(nNextValue, nCellDigits);
1868 aCol[rCol].SetRawString(rRow, aStr);
1877 aSrcCell.
mpFormula, rCol, rRow, (rInner == nIEnd));
1878 if (nFormulaCounter - nActFormCnt > nMaxFormCnt)
1879 nMaxFormCnt = nFormulaCounter - nActFormCnt;
1887 if (nSource == nISrcEnd)
1889 if ( nSource != nISrcStart )
1891 nSource = nISrcStart;
1901 nFormulaCounter = nActFormCnt;
1915 if (rInner == nIEnd)
1937 inline bool isOverflow(
const double& rVal,
const double& rMax,
const double& rStep,
1938 const double& rStartVal,
FillCmd eFillCmd )
1969 else if (rStep < 0.0)
2008 return rMax < rStartVal;
2009 else if (rMax < 0.0)
2010 return rStartVal < rMax;
2022 double nStepValue,
double nMaxValue, sal_uInt16 nArgMinDigits,
2024 bool bSkipOverlappedCells, std::vector<sal_Int32>* pNonOverlappedCellIdx )
2041 SCCOLROW& rInner = bVertical ? nRow : nCol;
2042 SCCOLROW& rOuter = bVertical ? nCol : nRow;
2050 std::vector<bool> aIsNonEmptyCell;
2054 nFillerCount = (nRow2 - nRow1) + 1;
2055 nFillCount += (nRow2 - nRow1);
2056 if (nFillCount == 0)
2064 nIStart = nRow1 + 1;
2065 nIEnd = nRow1 + nFillCount;
2066 aFillRange =
ScRange(nCol1, nRow1 + 1,
nTab, nCol2, nRow1 + nFillCount,
nTab);
2072 nIStart = nRow2 - 1;
2073 nIEnd = nRow2 - nFillCount;
2074 aFillRange =
ScRange(nCol1, nRow2 -1,
nTab, nCol2, nRow2 - nFillCount,
nTab);
2079 nFillerCount = (nCol2 - nCol1) + 1;
2080 nFillCount += (nCol2 - nCol1);
2081 if (nFillCount == 0)
2089 nIStart = nCol1 + 1;
2090 nIEnd = nCol1 + nFillCount;
2091 aFillRange =
ScRange(nCol1 + 1, nRow1,
nTab, nCol1 + nFillCount, nRow2,
nTab);
2097 nIStart = nCol2 - 1;
2098 nIEnd = nCol2 - nFillCount;
2099 aFillRange =
ScRange(nCol2 - 1, nRow1,
nTab, nCol2 - nFillCount, nRow2,
nTab);
2108 bool bEntireArea = (!bIsFiltered && eFillCmd ==
FILL_SIMPLE);
2110 && (nOEnd - nOStart == 0))
2130 nStartVal = aSrcCell.mpFormula->GetValue();
2133 if (nStepValue == 0.0)
2134 bEntireArea = (nStartVal <= nMaxValue);
2135 else if (((nMaxValue - nStartVal) / nStepValue) >= nFillCount)
2140 if (nStepValue == 1.0)
2141 bEntireArea = (nStartVal <= nMaxValue);
2142 else if (nStepValue == -1.0)
2143 bEntireArea = (fabs(nStartVal) <= fabs(nMaxValue));
2144 else if (nStepValue == 0.0)
2145 bEntireArea = (nStartVal == 0.0
2146 || (nStartVal < 0.0 && nMaxValue >= 0.0)
2147 || (nStartVal > 0.0 && nMaxValue <= 0.0));
2156 DeleteArea(nCol1, static_cast<SCROW>(nIMin), nCol2, static_cast<SCROW>(nIMax), nDel);
2158 DeleteArea(static_cast<SCCOL>(nIMin), nRow1, static_cast<SCCOL>(nIMax), nRow2, nDel);
2169 for (rOuter = nOStart; rOuter <= nOEnd; rOuter++)
2176 ScCellValue aSrcCell =
aCol[nCol].GetCellValue(static_cast<SCROW>(nRow));
2180 if (bSkipOverlappedCells)
2183 aIsNonEmptyCell.
resize(nFillerCount,
false);
2188 nFirstValueIdx = nISource + (*pNonOverlappedCellIdx)[0];
2189 for (
auto i : (*pNonOverlappedCellIdx))
2190 aIsNonEmptyCell[
i] =
true;
2194 nFirstValueIdx = nISource - (nFillerCount - 1 - (*pNonOverlappedCellIdx).back());
2195 for (
auto i : (*pNonOverlappedCellIdx))
2196 aIsNonEmptyCell[nFillerCount - 1 -
i] =
true;
2201 aSrcCell =
aCol[nOStart].GetCellValue(static_cast<SCROW>(nFirstValueIdx));
2203 aSrcCell =
aCol[nFirstValueIdx].GetCellValue(static_cast<SCROW>(nOStart));
2206 const ScPatternAttr* pSrcPattern =
aCol[nCol].GetPattern(static_cast<SCROW>(nRow));
2220 static_cast<SCROW>(nIMax), *pSrcPattern, rCondFormatIndex);
2225 for(
SCROW nAtRow = static_cast<SCROW>(nIMin); nAtRow <= static_cast<SCROW>(nIMax); ++nAtRow)
2237 for (
SCCOL nAtCol = static_cast<SCCOL>(nIMin); nAtCol <= sal::static_int_cast<SCCOL>(nIMax); nAtCol++)
2253 FillSeriesSimple(aSrcCell, rInner, nIMin, nIMax, nCol, nRow, bVertical, pProgress, nProgress);
2259 double nVal = nStartVal;
2262 bool bError =
false;
2263 bool bOverflow =
false;
2264 bool bNonEmpty =
true;
2266 sal_uInt16 nDayOfMonth = 0;
2267 sal_Int32 nFillerIdx = 0;
2268 if (bSkipOverlappedCells && !aIsNonEmptyCell[0])
2273 if (bSkipOverlappedCells)
2275 nFillerIdx = (nFillerIdx + 1) % nFillerCount;
2276 bNonEmpty = aIsNonEmptyCell[nFillerIdx];
2281 if (!bError && bNonEmpty)
2290 double nAdd = nStepValue;
2304 IncDate(nVal, nDayOfMonth, nStepValue, eFillDateCmd);
2313 bOverflow = isOverflow( nVal, nMaxValue, nStepValue, nStartVal, eFillCmd);
2317 aCol[nCol].SetError(static_cast<SCROW>(nRow), FormulaError::NoValue);
2318 else if (!bOverflow && bNonEmpty)
2319 aCol[nCol].SetValue(static_cast<SCROW>(nRow), nVal);
2321 if (bAttribs && !bEntireArea && !bOverflow)
2325 if (rInner == nIEnd || bOverflow)
2336 nProgress += nIMax - nIMin + 1;
2342 if ( nStepValue >= 0 )
2344 if ( nMaxValue >=
double(
LONG_MAX) )
2349 if ( nMaxValue <=
double(LONG_MIN) )
2350 nMaxValue = double(LONG_MIN) + 1;
2357 sal_Int32 nStringValue;
2358 sal_uInt16 nMinDigits = nArgMinDigits;
2359 short nHeadNoneTail = lcl_DecompValueString( aValue, nStringValue, &nMinDigits );
2360 if ( nHeadNoneTail )
2362 const double nStartVal =
static_cast<double>(nStringValue);
2363 double nVal = nStartVal;
2365 bool bError =
false;
2366 bool bOverflow =
false;
2367 bool bNonEmpty =
true;
2370 static_cast<sal_Int32>(nStartVal));
2372 sal_Int32 nFillerIdx = 0;
2373 if (bSkipOverlappedCells && !aIsNonEmptyCell[0])
2378 if (bSkipOverlappedCells)
2380 nFillerIdx = (nFillerIdx + 1) % nFillerCount;
2381 bNonEmpty = aIsNonEmptyCell[nFillerIdx];
2385 if (!bError && bNonEmpty)
2394 double nAdd = nStepValue;
2411 bOverflow = isOverflow( nVal, nMaxValue, nStepValue, nStartVal, eFillCmd);
2415 aCol[nCol].SetError(static_cast<SCROW>(nRow), FormulaError::NoValue);
2416 else if (!bOverflow && bNonEmpty)
2418 nStringValue =
static_cast<sal_Int32
>(nVal);
2419 if ( nHeadNoneTail < 0 )
2422 aCol[nCol], static_cast<SCROW>(nRow),
2423 nStringValue, nMinDigits, aValue,
2424 eCellType, bIsOrdinalSuffix);
2429 if (nHeadNoneTail == 2 && nStringValue >= 0)
2430 aStr = aValue +
"+";
2433 aStr += lcl_ValueString( nStringValue, nMinDigits );
2434 aCol[nCol].SetRawString(static_cast<SCROW>(nRow), aStr);
2438 if (bAttribs && !bEntireArea && !bOverflow)
2442 if (rInner == nIEnd || bOverflow)
2452 nProgress += nIMax - nIMin + 1;
2459 nProgress += nIMax - nIMin + 1;
2468 double nStepValue,
double nMaxValue,
ScProgress* pProgress)
2471 FillAuto(nCol1, nRow1, nCol2, nRow2, nFillCount, eFillDir, pProgress);
2473 FillSeries(nCol1, nRow1, nCol2, nRow2, nFillCount, eFillDir,
2474 eFillCmd, eFillDateCmd, nStepValue, nMaxValue, 0,
true, pProgress);
2489 sal_uInt16 nFormatNo )
2499 std::unique_ptr<ScPatternAttr> pPatternAttrs[16];
2506 SCCOL nCol = nStartCol;
2507 SCROW nRow = nStartRow;
2510 AutoFormatArea(nCol, nRow, nCol, nRow, *pPatternAttrs[nIndex], nFormatNo);
2513 AutoFormatArea(nStartCol, nStartRow + 1, nStartCol, nEndRow - 1, *pPatternAttrs[4], nFormatNo);
2517 for (nRow = nStartRow + 1; nRow < nEndRow; nRow++)
2519 AutoFormatArea(nCol, nRow, nCol, nRow, *pPatternAttrs[nIndex], nFormatNo);
2529 AutoFormatArea(nCol, nRow, nCol, nRow, *pPatternAttrs[nIndex], nFormatNo);
2534 AutoFormatArea(nCol, nRow, nCol, nRow, *pPatternAttrs[nIndex], nFormatNo);
2537 AutoFormatArea(nEndCol, nStartRow + 1, nEndCol, nEndRow - 1, *pPatternAttrs[7], nFormatNo);
2541 for (nRow = nStartRow + 1; nRow < nEndRow; nRow++)
2543 AutoFormatArea(nCol, nRow, nCol, nRow, *pPatternAttrs[nIndex], nFormatNo);
2553 AutoFormatArea(nCol, nRow, nCol, nRow, *pPatternAttrs[nIndex], nFormatNo);
2556 for (nCol = nStartCol + 1; nCol < nEndCol; nCol++)
2558 AutoFormatArea(nCol, nRow, nCol, nRow, *pPatternAttrs[nIndex], nFormatNo);
2567 for (nCol = nStartCol + 1; nCol < nEndCol; nCol++)
2569 AutoFormatArea(nCol, nRow, nCol, nRow, *pPatternAttrs[nIndex], nFormatNo);
2577 AutoFormatArea(nStartCol + 1, nStartRow + 1, nEndCol-1, nEndRow - 1, *pPatternAttrs[5], nFormatNo);
2583 for (nCol = nStartCol + 1; nCol < nEndCol; nCol++)
2585 AutoFormatArea(nCol, nStartRow + 1, nCol, nEndRow - 1, *pPatternAttrs[nIndex], nFormatNo);
2595 for (nCol = nStartCol + 1; nCol < nEndCol; nCol++)
2597 for (nRow = nStartRow + 1; nRow < nEndRow; nRow++)
2599 AutoFormatArea(nCol, nRow, nCol, nRow, *pPatternAttrs[nIndex], nFormatNo);
2600 if ((nIndex == 5) || (nIndex == 9))
2615 if ((nIndex == 5) || (nIndex == 9))
2635 #define LF_ALL (LF_LEFT | LF_TOP | LF_RIGHT | LF_BOTTOM)
2694 rData.
PutItem( nIndex, aBox );
2702 if ((nEndCol - nStartCol < 3) || (nEndRow - nStartRow < 3))
2712 if (nEndRow - nStartRow >= 4)
2726 if (nEndRow - nStartRow >= 4)
2737 if (nEndCol - nStartCol >= 4)
2745 if (nEndCol - nStartCol >= 4)
2755 if ((nEndCol - nStartCol >= 4) && (nEndRow - nStartRow >= 4))
2772 aCol[nCol].SetError( nRow, nError );
2836 return aCol[nCol].GetPatternCount();
2844 return aCol[nCol].GetPatternCount( nRow1, nRow2 );
2852 return aCol[nCol].ReservePatternCount( nReserve );
OUString GetAutoFillPreview(const ScRange &rSource, SCCOL nEndX, SCROW nEndY)
Numeric values (and numeric results if InsertDeleteFlags::FORMULA is not set).
const ScPatternAttr * GetPattern(SCCOL nCol, SCROW nRow) const
void Fill(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, sal_uLong nFillCount, FillDir eFillDir, FillCmd eFillCmd, FillDateCmd eFillDateCmd, double nStepValue, double nMaxValue, ScProgress *pProgress)
OUString getString() const
todo: It should be possible to have MarkArrays for each table, in order to enable "search all" across...
DayOfWeek GetDayOfWeek() const
void CompileColRowNameFormula(sc::CompileFormulaContext &rCxt)
constexpr sal_uInt16 KEY_MOD1
ScDocument & GetDoc() const
constexpr TypedWhichId< SvxBoxItem > ATTR_BORDER(150)
void SetPatternAreaCondFormat(SCCOL nCol, SCROW nStartRow, SCROW nEndRow, const ScPatternAttr &rAttr, const ScCondFormatIndexes &rCondFormatIndexes)
OUString getString(const ScDocument *pDoc) const
Retrieve string value.
void TestTabRefAbs(SCTAB nTable) const
std::unique_ptr< ContentProperties > pData
bool GetNextSpellingCell(SCCOL &rCol, SCROW &rRow, bool bInSel, const ScMarkData &rMark) const
bool IsDataFiltered(SCCOL nColStart, SCROW nRowStart, SCCOL nColEnd, SCROW nRowEnd) const
ScColumn * FetchColumn(SCCOL nCol)
SC_DLLPUBLIC const ScFormulaCell * GetFormulaCell(const ScAddress &rPos) const
void FillAutoSimple(SCCOLROW nISrcStart, SCCOLROW nISrcEnd, SCCOLROW nIStart, SCCOLROW nIEnd, SCCOLROW &rInner, const SCCOLROW &rCol, const SCCOLROW &rRow, sal_uLong nActFormCnt, sal_uLong nMaxFormCnt, bool bHasFiltered, bool bVertical, bool bPositive, ScProgress *pProgress, sal_uLong &rProgress)
static OUString GetOrdinalSuffix(sal_Int32 nNumber)
Obtain the ordinal suffix for a number according to the system locale.
void SetEditText(SCROW nRow, std::unique_ptr< EditTextObject > pEditText)
void GetString(SCCOL nCol, SCROW nRow, OUString &rString, const ScInterpreterContext *pContext=nullptr) const
void SetStateOnPercent(sal_uLong nVal)
const SfxItemSet & GetItemSet() const
This is very similar to ScCellValue, except that it references the original value instead of copying ...
const editeng::SvxBorderLine * GetRight() const
bool GetSubIndex(const OUString &rSubStr, sal_uInt16 &rIndex, bool &bMatchCase) const
void FillFormula(const ScFormulaCell *pSrcCell, SCCOL nDestCol, SCROW nDestRow, bool bLast)
bool ValidRow(SCROW nRow) const
SC_DLLPUBLIC ScDocumentPool * GetPool()
ScColumn & CreateColumnIfNotExists(const SCCOL nScCol) const
css::uno::Any const & rValue
Store arbitrary cell value of any kind.
Stores individual user-defined sort list.
ScFormulaCell * mpFormula
SC_DLLPUBLIC SCROW MaxRow() const
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 ...
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
sal_Int32 SCCOLROW
a type capable of holding either SCCOL or SCROW
sal_uInt16 GetMonth() const
void SetNoListening(bool bVal)
static bool SafeMult(double &fVal1, double fVal2)
ScFormulaCell * mpFormula
void SetYear(sal_Int16 nNewYear)
Copy flags for auto/series fill functions: do not touch notes and drawing objects.
size_t GetSubCount() const
const SfxPoolItem & GetItem(sal_uInt16 nWhichP) const
void PutInOrder(T &nStart, T &nEnd)
sal_Int16 GetYear() const
void FillAuto(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, sal_uLong nFillCount, FillDir eFillDir, ScProgress *pProgress)
void IncDate(double &rVal, sal_uInt16 &nDayOfMonth, double nStep, FillDateCmd eCmd)
const editeng::SvxBorderLine * GetTop() const
SC_DLLPUBLIC SCCOL MaxCol() const
bool ColHidden(SCCOL nCol, SCCOL *pFirstCol=nullptr, SCCOL *pLastCol=nullptr) const
SC_DLLPUBLIC SvNumberFormatter * GetFormatTable() const
sal_uInt16 GetDaysInMonth() const
sal_uInt16 ClearItem(sal_uInt16 nWhich=0)
bool ValidCol(SCCOL nCol) const
const editeng::SvxBorderLine * GetLeft() const
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
void SetRawString(SCROW nRow, const OUString &rStr)
void SetDay(sal_uInt16 nNewDay)
void GetAutoFormatFrame(SCCOL nCol, SCROW nRow, sal_uInt16 nFlags, sal_uInt16 nIndex, ScAutoFormatData &rData)
bool ScHasPriority(const ::editeng::SvxBorderLine *pThis, const ::editeng::SvxBorderLine *pOther)
General Help Function.
svl::SharedString * mpString
const SfxPoolItem * GetAttr(SCCOL nCol, SCROW nRow, sal_uInt16 nWhich) const
const ScStyleSheet * GetStyleSheet() const
void AutoFormatArea(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, const ScPatternAttr &rAttr, sal_uInt16 nFormatNo)
SC_DLLPUBLIC SfxItemPool * GetEnginePool() const
void AutoFormat(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, sal_uInt16 nFormatNo)
void GetAutoFormatData(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, ScAutoFormatData &rData)
static SC_DLLPUBLIC ScUserList * GetUserList()
constexpr TypedWhichId< SfxUInt32Item > ATTR_VALUE_FORMAT(146)
sal_uInt16 GetDay() const
void AddDays(sal_Int32 nAddDays)
sal_uLong GetState() const
std::unique_ptr< ScConditionalFormatList > mpCondFormatList
bool ReservePatternCount(SCCOL nCol, SCSIZE nReserve)
void DeleteArea(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, InsertDeleteFlags nDelFlag, bool bBroadcast=true, sc::ColumnSpanSet *pBroadcastSpans=nullptr)
static bool SafePlus(double &fVal1, double fVal2)
SCSIZE GetPatternCount(SCCOL nCol) const
void FillSeriesSimple(const ScCellValue &rSrcCell, SCCOLROW &rInner, SCCOLROW nIMin, SCCOLROW nIMax, const SCCOLROW &rCol, const SCCOLROW &rRow, bool bVertical, ScProgress *pProgress, sal_uLong &rProgress)
void GetAutoFormatAttr(SCCOL nCol, SCROW nRow, sal_uInt16 nIndex, ScAutoFormatData &rData)
bool RowHidden(SCROW nRow, SCROW *pFirstRow=nullptr, SCROW *pLastRow=nullptr) const
constexpr TypedWhichId< ScMergeFlagAttr > ATTR_MERGE_FLAG(145)
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
void UpdateInsertTabAbs(SCTAB nNewPos)
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 Join(const ScRange &, bool bIsInList=false)
ScRefCellValue GetCellValue(SCCOL nCol, SCROW nRow) const
sal_uInt16 nScFillModeMouseModifier
constexpr TypedWhichId< SvxEscapementItem > EE_CHAR_ESCAPEMENT(EE_CHAR_START+10)
bool ValidColRow(SCCOL nCol, SCROW nRow) const
Dates, times, datetime values.
SCROW CountNonFilteredRows(SCROW nStartRow, SCROW nEndRow) const
constexpr TypedWhichId< ScCondFormatItem > ATTR_CONDITIONAL(154)
SC_DLLPUBLIC ScPatternAttr * GetDefPattern() const
void FillSeries(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, sal_uLong 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)
EditTextObject * mpEditText
static bool isAsciiNumeric(const OUString &rStr)
SC_DLLPUBLIC SfxItemPool * GetEditPool() const
static SC_DLLPUBLIC OUString GetString(const EditTextObject &rEditText, const ScDocument *pDoc)
Retrieves string with paragraphs delimited by new lines (' ').
ScInterpreterContext & GetNonThreadedContext() const
void resize(ScSheetLimits const &, const size_t aNewSize)
void FillFormulaVertical(const ScFormulaCell &rSrcCell, SCCOLROW &rInner, SCCOL nCol, SCROW nRow1, SCROW nRow2, ScProgress *pProgress, sal_uLong &rProgress)
sal_uInt32 GetNumberFormat(const ScInterpreterContext &rContext, const ScAddress &rPos) const
static SC_DLLPUBLIC ScAutoFormat * GetOrCreateAutoFormat()
SCCOL GetAllocatedColumnsCount() const
void ApplyPatternArea(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, const ScPatternAttr &rAttr, ScEditDataArray *pDataArray=nullptr, bool *const pIsChanged=nullptr)
void commit(ScDocument &rDoc, const ScAddress &rPos) const
Set cell value at specified position in specified document.
void CompileDBFormula(sc::CompileFormulaContext &rCxt)
double GetValue(SCCOL nCol, SCROW nRow) const
void SetError(SCCOL nCol, SCROW nRow, FormulaError nError)
const editeng::SvxBorderLine * GetBottom() const
void SetMonth(sal_uInt16 nNewMonth)
void SetEditTextObjectPool(SfxItemPool *pPool)
OUString GetSubStr(sal_uInt16 nIndex) const
const ScUserListData * GetData(const OUString &rSubStr) const
void SetLine(const editeng::SvxBorderLine *pNew, SvxBoxItemLine nLine)
OStringBuffer & padToLength(OStringBuffer &rBuffer, sal_Int32 nLength, char cFill= '\0')