22#include <rtl/math.hxx>
26#include <com/sun/star/sheet/ConditionOperator2.hpp>
31#include <document.hxx>
32#include <compiler.hxx>
39#include <tokenarray.hxx>
89 switch(
t->GetType() )
111 if( (nRecursion < 42) &&
lcl_HasRelRef( pDoc, pRangeData->GetCode(), nRecursion + 1 ) )
119 switch(
t->GetOpCode() )
148 size_t n = rRangeList.
size();
149 for (
size_t i = 0;
i <
n; ++
i)
151 const ScRange & rRange = rRangeList[
i];
180 nOptions(r.nOptions),
183 aStrVal1(r.aStrVal1),
184 aStrVal2(r.aStrVal2),
185 aStrNmsp1(r.aStrNmsp1),
186 aStrNmsp2(r.aStrNmsp2),
187 eTempGrammar1(r.eTempGrammar1),
188 eTempGrammar2(r.eTempGrammar2),
192 aSrcString(r.aSrcString),
193 bRelRef1(r.bRelRef1),
194 bRelRef2(r.bRelRef2),
197 eConditionType( r.eConditionType ),
198 pCondFormat(r.pCondFormat)
213 nOptions(r.nOptions),
216 aStrVal1(r.aStrVal1),
217 aStrVal2(r.aStrVal2),
218 aStrNmsp1(r.aStrNmsp1),
219 aStrNmsp2(r.aStrNmsp2),
220 eTempGrammar1(r.eTempGrammar1),
221 eTempGrammar2(r.eTempGrammar2),
225 aSrcString(r.aSrcString),
226 bRelRef1(r.bRelRef1),
227 bRelRef2(r.bRelRef2),
230 eConditionType( r.eConditionType),
231 pCondFormat(r.pCondFormat)
244 const OUString& rExpr1,
const OUString& rExpr2,
ScDocument& rDocument,
const ScAddress& rPos,
245 const OUString& rExprNmsp1,
const OUString& rExprNmsp2,
253 aStrNmsp1(rExprNmsp1),
254 aStrNmsp2(rExprNmsp2),
255 eTempGrammar1(eGrammar1),
256 eTempGrammar2(eGrammar2),
264 eConditionType(
eType),
267 Compile( rExpr1, rExpr2, rExprNmsp1, rExprNmsp2, eGrammar1, eGrammar2,
false );
319 if ( rFormula->GetLen() != 1 )
346 const OUString& rExprNmsp1,
const OUString& rExprNmsp2,
349 if ( !rExpr1.isEmpty() || !rExpr2.isEmpty() )
353 if ( !rExpr1.isEmpty() )
361 pFormula1->AssignXMLString( rExpr1, rExprNmsp1 );
372 if ( !rExpr2.isEmpty() )
380 pFormula2->AssignXMLString( rExpr2, rExprNmsp2 );
506 bool bChangedPos =
false;
512 assert(!
"can't move ScConditionEntry");
514 bChangedPos =
aSrcPos != aOldSrcPos;
523 aRes =
pFormula1->AdjustReferenceOnShift(rCxt, aOldSrcPos);
542 aRes =
pFormula2->AdjustReferenceOnShift(rCxt, aOldSrcPos);
610static bool lcl_IsEqual(
const std::unique_ptr<ScTokenArray>& pArr1,
const std::unique_ptr<ScTokenArray>& pArr2 )
613 if ( pArr1 && pArr2 )
614 return pArr1->EqualTokens( pArr2.get() );
616 return !pArr1 && !pArr2;
658 std::optional<ScFormulaCell> oTemp;
665 oTemp.emplace(*
mpDoc, rPos);
698 oTemp.emplace(*
mpDoc, rPos);
779 size_t nListCount = rRanges.
size();
780 for(
size_t i = 0;
i < nListCount;
i++ )
782 const ScRange & rRange = rRanges[
i];
793 bool bShrunk =
false;
798 for(
SCROW r = nRowStart; r <= nRow; r++ )
799 for(
SCCOL c = nColStart; c <= nCol; c++ )
809 std::pair<ScConditionEntryCache::StringCacheType::iterator, bool> aResult =
813 aResult.first->second++;
817 std::pair<ScConditionEntryCache::ValueCacheType::iterator, bool> aResult =
818 mpCache->maValues.emplace(nVal, 1);
821 aResult.first->second++;
835 ScConditionEntryCache::ValueCacheType::iterator itr =
mpCache->maValues.find(nArg);
836 if(itr ==
mpCache->maValues.end())
840 return itr->second > 1;
845 ScConditionEntryCache::StringCacheType::iterator itr =
mpCache->maStrings.find(rStr);
846 if(itr ==
mpCache->maStrings.end())
850 return itr->second > 1;
863 for(ScConditionEntryCache::ValueCacheType::const_reverse_iterator itr =
mpCache->maValues.rbegin(),
864 itrEnd =
mpCache->maValues.rend(); itr != itrEnd; ++itr)
868 if(itr->first <= nArg)
870 nCells += itr->second;
884 for(
const auto& [rVal, rCount] :
mpCache->maValues)
901 size_t nLimitCells =
static_cast<size_t>(
mpCache->nValueItems*
nVal1/100);
902 for(ScConditionEntryCache::ValueCacheType::const_reverse_iterator itr =
mpCache->maValues.rbegin(),
903 itrEnd =
mpCache->maValues.rend(); itr != itrEnd; ++itr)
905 if(nCells >= nLimitCells)
907 if(itr->first <= nArg)
909 nCells += itr->second;
920 size_t nLimitCells =
static_cast<size_t>(
mpCache->nValueItems*
nVal1/100);
921 for(
const auto& [rVal, rCount] :
mpCache->maValues)
923 if(nCells >= nLimitCells)
937 double nSum = std::accumulate(
mpCache->maValues.begin(),
mpCache->maValues.end(),
double(0),
938 [](
const double& rSum,
const ScConditionEntryCache::ValueCacheType::value_type& rEntry) {
939 return rSum + rEntry.first * rEntry.second; });
942 return (nArg <= nSum/mpCache->nValueItems);
944 return (nArg < nSum/mpCache->nValueItems);
951 double nSum = std::accumulate(
mpCache->maValues.begin(),
mpCache->maValues.end(),
double(0),
952 [](
const double& rSum,
const ScConditionEntryCache::ValueCacheType::value_type& rEntry) {
953 return rSum + rEntry.first * rEntry.second; });
956 return (nArg >= nSum/
mpCache->nValueItems);
958 return (nArg > nSum/
mpCache->nValueItems);
997 double nComp1 =
nVal1;
998 double nComp2 =
nVal2;
1001 if ( nComp1 > nComp2 )
1003 std::swap( nComp1, nComp2 );
1006 bool bValid =
false;
1012 bValid = ::rtl::math::approxEqual( nArg, nComp1 );
1015 bValid = !::rtl::math::approxEqual( nArg, nComp1 );
1018 bValid = ( nArg > nComp1 ) && !::rtl::math::approxEqual( nArg, nComp1 );
1021 bValid = ( nArg >= nComp1 ) || ::rtl::math::approxEqual( nArg, nComp1 );
1024 bValid = ( nArg < nComp1 ) && !::rtl::math::approxEqual( nArg, nComp1 );
1027 bValid = ( nArg <= nComp1 ) || ::rtl::math::approxEqual( nArg, nComp1 );
1030 bValid = ( nArg >= nComp1 && nArg <= nComp2 ) ||
1031 ::rtl::math::approxEqual( nArg, nComp1 ) || ::rtl::math::approxEqual( nArg, nComp2 );
1034 bValid = ( nArg < nComp1 || nArg > nComp2 ) &&
1035 !::rtl::math::approxEqual( nArg, nComp1 ) && !::rtl::math::approxEqual( nArg, nComp2 );
1047 bValid = nComp1 != 0.0;
1078 OUString
aStr = OUString::number(
nVal1);
1079 OUString aStr2 = OUString::number(nArg);
1080 bValid = aStr2.startsWith(
aStr);
1084 OUString aStr2 = OUString::number(nArg);
1085 bValid = aStr2.startsWith(
aStrVal1);
1091 OUString
aStr = OUString::number(
nVal1);
1092 OUString aStr2 = OUString::number(nArg);
1093 bValid = aStr2.endsWith(
aStr);
1097 OUString aStr2 = OUString::number(nArg);
1105 OUString
aStr = OUString::number(
nVal1);
1106 OUString aStr2 = OUString::number(nArg);
1107 bValid = aStr2.indexOf(
aStr) != -1;
1111 OUString aStr2 = OUString::number(nArg);
1112 bValid = aStr2.indexOf(
aStrVal1) != -1;
1119 SAL_WARN(
"sc",
"unknown operation at ScConditionEntry");
1127 bool bValid =
false;
1130 return nVal1 != 0.0;
1178 sal_Int32 nStart = rArg.getLength();
1179 const sal_Int32 nLen = aUpVal1.getLength();
1184 nStart = nStart - nLen;
1185 sal_Int32 nMatch1(0), nMatch2(0);
1187 aUpVal1, 0, nLen, nMatch2);
1196 bValid = aArgStr.indexOf(aValStr) != -1;
1209 bValid = ( nCompare > 0 );
1212 bValid = ( nCompare >= 0 );
1215 bValid = ( nCompare < 0 );
1218 bValid = ( nCompare <= 0 );
1225 bValid = (nCompare > 0 && nCompare2 > 0) || (nCompare < 0 && nCompare2 < 0);
1231 SAL_WARN(
"sc",
"unknown operation in ScConditionEntry");
1245 return nVal1 != 0.0;
1263 if ( FormulaGrammar::isEnglish( eGrammar) && nNumFmt == 0 )
1273 aRet =
aBuffer.makeStringAndClear();
1289 aRet =
aBuffer.makeStringAndClear();
1305 std::unique_ptr<ScTokenArray> pRet;
1320 pRet->AddDouble(
nVal1 );
1336 pRet->AddDouble(
nVal2 );
1350 SCTAB nMaxTab = nMinTab;
1352 for (sal_uInt16 nPass = 0; nPass < 2; nPass++)
1363 if (aAbs.
Tab() < nMinTab)
1364 nMinTab = aAbs.
Tab();
1365 if (aAbs.
Tab() > nMaxTab)
1366 nMaxTab = aAbs.
Tab();
1374 if (aAbs.
Tab() < nMinTab)
1375 nMinTab = aAbs.
Tab();
1376 if (aAbs.
Tab() > nMaxTab)
1377 nMaxTab = aAbs.
Tab();
1386 if ( nMaxTab >= nTabCount && nMinTab > 0 )
1389 if ( aValidPos.
Tab() >= nTabCount )
1390 aValidPos.
SetTab( nTabCount - 1 );
1402 bool bAllMarked =
false;
1403 for (sal_uInt16 nPass = 0; !bAllMarked && nPass < 2; nPass++)
1420 switch (
static_cast<sal_Int32
>(nOperation))
1422 case css::sheet::ConditionOperator2::EQUAL:
1425 case css::sheet::ConditionOperator2::LESS:
1428 case css::sheet::ConditionOperator2::GREATER:
1431 case css::sheet::ConditionOperator2::LESS_EQUAL:
1434 case css::sheet::ConditionOperator2::GREATER_EQUAL:
1437 case css::sheet::ConditionOperator2::NOT_EQUAL:
1440 case css::sheet::ConditionOperator2::BETWEEN:
1443 case css::sheet::ConditionOperator2::NOT_BETWEEN:
1449 case css::sheet::ConditionOperator2::DUPLICATE:
1452 case css::sheet::ConditionOperator2::NOT_DUPLICATE:
1477 const OUString& rExpr1,
const OUString& rExpr2,
1480 const OUString& rExprNmsp1,
const OUString& rExprNmsp2,
1484 ScConditionEntry( eOper, rExpr1, rExpr2, rDocument, rPos, rExprNmsp1, rExprNmsp2, eGrammar1, eGrammar2,
eType ),
1485 aStyleName(
std::move( aStyle )),
1486 eCondFormatType(
eType )
1495 aStyleName(
std::move( aStyle ))
1501 aStyleName( r.aStyleName ),
1502 eCondFormatType( r.eCondFormatType)
1508 aStyleName( r.aStyleName ),
1509 eCondFormatType( r.eCondFormatType)
1556 maStyleName( rFormat.maStyleName )
1573 sal_Int32 nCurrentDate = rActDate - pFormatter->
GetNullDate();
1576 sal_Int32 nCellDate =
static_cast<sal_Int32
>(::rtl::math::approxFloor(nVal));
1583 if( nCurrentDate == nCellDate )
1587 if( nCurrentDate == nCellDate -1 )
1591 if( nCurrentDate == nCellDate + 1)
1595 if( nCurrentDate >= nCellDate && nCurrentDate - 7 < nCellDate )
1603 Date aBegin(rActDate - (8 +
static_cast<sal_Int32
>(eDay)));
1604 Date aEnd(rActDate - (2 +
static_cast<sal_Int32
>(eDay)));
1605 return aCellDate.
IsBetween( aBegin, aEnd );
1609 Date aBegin(rActDate - 8);
1610 Date aEnd(rActDate - 1);
1611 return aCellDate.
IsBetween( aBegin, aEnd );
1620 Date aBegin(rActDate - (1 +
static_cast<sal_Int32
>(eDay)));
1621 Date aEnd(rActDate + (5 -
static_cast<sal_Int32
>(eDay)));
1622 return aCellDate.
IsBetween( aBegin, aEnd );
1626 Date aEnd( rActDate + 6);
1627 return aCellDate.
IsBetween( rActDate, aEnd );
1636 return aCellDate.
IsBetween( rActDate + (6 -
static_cast<sal_Int32
>(eDay)),
1637 rActDate + (12 -
static_cast<sal_Int32
>(eDay)) );
1641 return aCellDate.
IsBetween( rActDate + 7, rActDate + 13 );
1736 pNew->maEntries.push_back( std::unique_ptr<ScFormatEntry>(pNewEntry) );
1750 [&bIgnoreSrcPos](
const std::unique_ptr<ScFormatEntry>& p1,
const std::unique_ptr<ScFormatEntry>& p2) ->
bool
1752 return p1->IsEqual(*p2, bIgnoreSrcPos);
1770 maEntries.push_back( std::unique_ptr<ScFormatEntry>(pNew));
1839 aData.aStyleName.isEmpty())
1901 rxEntry->UpdateReference(rCxt);
1906 rxEntry->UpdateReference(rCxt);
1938 rxEntry->UpdateInsertTab(rCxt);
1967 rxEntry->UpdateDeleteTab(rCxt);
1975 for(
size_t i = 0;
i <
n; ++
i)
1979 if(nTab < nMinTab || nTab > nMaxTab)
2004 rxEntry->UpdateMoveTab(rCxt);
2030 bool bAllMarked =
false;
2048 rxEntry->startRendering();
2056 rxEntry->endRendering();
2064 rxEntry->updateValues();
2083 for(
const auto& rxFormat : rList)
2089 for(
const auto& rxFormat : rList)
2104 SAL_WARN(
"sc",
"ScConditionalFormatList: Entry not found");
2114 SAL_WARN(
"sc",
"ScConditionalFormatList: Entry not found");
2138 it->UpdateReference(rCxt);
2152 it->InsertRow(nTab, nColStart, nColEnd, nRowPos, nSize);
2160 it->InsertCol(nTab, nRowStart, nRowEnd, nColPos, nSize);
2168 it->UpdateInsertTab(rCxt);
2176 it->UpdateDeleteTab(rCxt);
2184 it->UpdateMoveTab(rCxt);
2192 it->RenameCellStyle(rOld, rNew);
2204 if ((*itr)->GetRange().empty())
2208 rLink.
Call(itr->get());
2221 rxFormat->DeleteArea( nCol1, nRow1, nCol2, nRow2 );
2252 for (
size_t i = 0,
n = rRange.
size();
i <
n; ++
i)
2254 aRange.
Join(rRange[
i]);
2303 it->startRendering();
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 ...
sal_Int32 compareString(const OUString &s1, const OUString &s2) const
sal_Int16 GetNextYear() const
void AddDays(sal_Int32 nAddDays)
bool IsBetween(const Date &rFrom, const Date &rTo) const
sal_Int16 GetYear() const
DayOfWeek GetDayOfWeek() const
sal_uInt16 GetMonth() const
void IncTab(SCTAB nDelta=1)
SC_DLLPUBLIC bool Move(SCCOL nDeltaX, SCROW nDeltaY, SCTAB nDeltaZ, ScAddress &rErrorPos, const ScDocument &rDoc)
SC_DLLPUBLIC ScRefFlags Parse(const OUString &, const ScDocument &, const Details &rDetails=detailsOOOa1, ExternalInfo *pExtInfo=nullptr, const css::uno::Sequence< css::sheet::ExternalLinkInfo > *pExternalLinks=nullptr, sal_Int32 *pSheetEndPos=nullptr, const OUString *pErrRef=nullptr)
void SetGrammar(const formula::FormulaGrammar::Grammar eGrammar)
std::unique_ptr< ScTokenArray > CompileString(const OUString &rFormula)
Tokenize formula expression string into an array of tokens.
void SetDateType(condformat::ScCondFormatDateType eType)
std::unique_ptr< Date > mpCache
void SetStyleName(const OUString &rStyleName)
bool IsValid(const ScAddress &rPos) const
ScCondDateFormatEntry(ScDocument *pDoc)
condformat::ScCondFormatDateType meType
virtual ScFormatEntry * Clone(ScDocument *pDoc) const override
virtual void endRendering() override
virtual void startRendering() override
const OUString & GetStyleName() const
virtual void DataChanged() const override
const OUString & GetStyle() const
virtual ~ScCondFormatEntry() override
bool IsEqual(const ScFormatEntry &r, bool bIgnoreSrcPos) const override
virtual ScFormatEntry * Clone(ScDocument *pDoc) const override
ScCondFormatEntry(ScConditionMode eOper, const OUString &rExpr1, const OUString &rExpr2, ScDocument &rDocument, const ScAddress &rPos, OUString aStyle, const OUString &rExprNmsp1=OUString(), const OUString &rExprNmsp2=OUString(), formula::FormulaGrammar::Grammar eGrammar1=formula::FormulaGrammar::GRAM_DEFAULT, formula::FormulaGrammar::Grammar eGrammar2=formula::FormulaGrammar::GRAM_DEFAULT, Type eType=Type::Condition)
void UpdateStyleName(const OUString &rNew)
bool IsDuplicate(double nArg, const OUString &rStr) const
ScConditionEntry(ScConditionMode eOper, const OUString &rExpr1, const OUString &rExpr2, ScDocument &rDocument, const ScAddress &rPos, const OUString &rExprNmsp1, const OUString &rExprNmsp2, formula::FormulaGrammar::Grammar eGrammar1, formula::FormulaGrammar::Grammar eGrammar2, Type eType=Type::Condition)
bool IsTopNPercent(double nArg) const
virtual void UpdateDeleteTab(sc::RefUpdateDeleteTabContext &rCxt) override
ScAddress GetValidSrcPos() const
Return a position that's adjusted to allow textual representation of expressions if possible.
virtual void DataChanged() const
bool MarkUsedExternalReferences() const
void SetIgnoreBlank(bool bSet)
bool IsTopNElement(double nArg) const
void SetFormula1(const ScTokenArray &rArray)
bool IsBelowAverage(double nArg, bool bEqual) const
const formula::FormulaGrammar::Grammar eTempGrammar1
virtual void UpdateMoveTab(sc::RefUpdateMoveTabContext &rCxt) override
const formula::FormulaGrammar::Grammar eTempGrammar2
static ScConditionMode GetModeFromApi(css::sheet::ConditionOperator nOperator)
bool IsAboveAverage(double nArg, bool bEqual) const
std::unique_ptr< ScFormulaCell > pFCell1
virtual Type GetType() const override
std::unique_ptr< ScFormulaCell > pFCell2
virtual void UpdateInsertTab(sc::RefUpdateInsertTabContext &rCxt) override
std::unique_ptr< ScFormulaListener > mpListener
std::unique_ptr< ScConditionEntryCache > mpCache
bool NeedsRepaint() const
static void SimplifyCompiledFormula(std::unique_ptr< ScTokenArray > &rFormula, double &rVal, bool &rIsStr, OUString &rStrVal)
bool IsValidStr(const OUString &rArg, const ScAddress &rPos) const
std::unique_ptr< ScTokenArray > pFormula1
ScConditionalFormat * pCondFormat
void CompileAll()
Delete formula cells, so we re-compile at the next IsValid.
virtual ~ScConditionEntry() override
bool IsEqual(const ScFormatEntry &r, bool bIgnoreSrcPos) const override
std::unique_ptr< ScTokenArray > CreateFlatCopiedTokenArray(sal_uInt16 nPos) const
Create a flat copy using ScTokenArray copy-ctor with shared tokens.
void Compile(const OUString &rExpr1, const OUString &rExpr2, const OUString &rExprNmsp1, const OUString &rExprNmsp2, formula::FormulaGrammar::Grammar eGrammar1, formula::FormulaGrammar::Grammar eGrammar2, bool bTextToReal)
virtual void SetParent(ScConditionalFormat *pNew) override
bool IsBottomNElement(double nArg) const
virtual ScFormatEntry * Clone(ScDocument *pDoc) const override
std::unique_ptr< ScTokenArray > pFormula2
void SetFormula2(const ScTokenArray &rArray)
bool IsBottomNPercent(double nArg) const
bool IsCellValid(ScRefCellValue &rCell, const ScAddress &rPos) const
void MakeCells(const ScAddress &rPos)
Create formula cells.
virtual void endRendering() override
void Interpret(const ScAddress &rPos)
void SetSrcString(const OUString &rNew)
bool IsError(const ScAddress &rPos) const
virtual void UpdateReference(sc::RefUpdateContext &rCxt) override
OUString GetExpression(const ScAddress &rCursor, sal_uInt16 nPos, sal_uInt32 nNumFmt=0, const formula::FormulaGrammar::Grammar eGrammar=formula::FormulaGrammar::GRAM_DEFAULT) const
bool IsValid(double nArg, const ScAddress &rPos) const
void SetOperation(ScConditionMode eMode)
virtual void startRendering() override
ScSheetLimits & GetSheetLimits() const
ScRangeData * FindRangeNameBySheetAndIndex(SCTAB nTab, sal_uInt16 nIndex) const
Find a named expression / range name in either global or a local scope.
SC_DLLPUBLIC SCROW MaxRow() const
SC_DLLPUBLIC void CheckLinkFormulaNeedingCheck(const ScTokenArray &rCode)
Check token array and set link check if ocDde/ocWebservice is contained.
void RepaintRange(const ScRange &rRange)
bool ShrinkToUsedDataArea(bool &o_bShrunk, SCTAB nTab, SCCOL &rStartCol, SCROW &rStartRow, SCCOL &rEndCol, SCROW &rEndRow, bool bColumnsOnly, bool bStickyTopRow=false, bool bStickyLeftCol=false, ScDataAreaExtras *pDataAreaExtras=nullptr) const
Shrink a range to only include used data area.
SC_DLLPUBLIC bool GetAutoCalc() const
void MarkUsedExternalReferences()
bool IsClipOrUndo() const
void ClearSelectionItems(const sal_uInt16 *pWhich, const ScMarkData &rMark)
SC_DLLPUBLIC svl::SharedStringPool & GetSharedStringPool()
SC_DLLPUBLIC void AddCondFormatData(const ScRangeList &rRange, SCTAB nTab, sal_uInt32 nIndex)
SC_DLLPUBLIC SvNumberFormatter * GetFormatTable() const
bool IsImportingXML() const
SC_DLLPUBLIC SCTAB GetTableCount() const
static SC_DLLPUBLIC OUString GetString(const EditTextObject &rEditText, const ScDocument *pDoc)
Retrieves string with paragraphs delimited by new lines (' ').
virtual Type GetType() const =0
virtual void updateValues()
virtual ScFormatEntry * Clone(ScDocument *pDoc) const =0
virtual void SetParent(ScConditionalFormat *pNew)=0
virtual void endRendering()
bool operator==(const ScFormatEntry &) const
ScFormatEntry(ScDocument *pDoc)
virtual bool IsEqual(const ScFormatEntry &, bool bIgnoreSrcPos) const
virtual void startRendering()
static SC_DLLPUBLIC CollatorWrapper & GetCollator()
case-insensitive collator
static SC_DLLPUBLIC ::utl::TransliterationWrapper & GetTransliteration()
static SC_DLLPUBLIC const CharClass & getCharClass()
todo: It should be possible to have MarkArrays for each table, in order to enable "search all" across...
void MarkFromRangeList(const ScRangeList &rList, bool bReset)
void InsertRow(SCTAB nTab, SCCOL nColStart, SCCOL nColEnd, SCROW nRowPos, SCSIZE nSize)
void InsertCol(SCTAB nTab, SCROW nRowStart, SCROW nRowEnd, SCCOL nColPos, SCSIZE nSize)
void Join(const ScRange &, bool bIsInList=false)
bool DeleteArea(SCCOL nCol1, SCROW nRow1, SCTAB nTab1, SCCOL nCol2, SCROW nRow2, SCTAB nTab2)
For now this method assumes that nTab1 == nTab2 The algorithm will be much more complicated if nTab1 ...
bool UpdateReference(UpdateRefMode, const ScDocument *, const ScRange &rWhere, SCCOL nDx, SCROW nDy, SCTAB nDz)
bool Contains(const ScAddress &) const
is Address& fully in Range?
SharedString intern(const OUString &rStr)
const OUString & getString() const
bool isMatch(const OUString &rStr1, const OUString &rStr2) const
bool isEqual(const OUString &rStr1, const OUString &rStr2) const
bool equals(const OUString &rStr1, sal_Int32 nPos1, sal_Int32 nCount1, sal_Int32 &nMatch1, const OUString &rStr2, sal_Int32 nPos2, sal_Int32 nCount2, sal_Int32 &nMatch2) const
static bool lcl_IsEqual(const std::unique_ptr< ScTokenArray > &pArr1, const std::unique_ptr< ScTokenArray > &pArr2)
static bool lcl_HasRelRef(ScDocument *pDoc, const ScTokenArray *pFormula, sal_uInt16 nRecursion=0)
static bool lcl_GetCellContent(ScRefCellValue &rCell, bool bIsStr1, double &rArg, OUString &rArgStr, const ScDocument *pDoc)
#define LANGUAGE_ENGLISH_US
#define SAL_WARN_IF(condition, area, stream)
#define SAL_WARN(area, stream)
constexpr OUStringLiteral aData
constexpr TypedWhichId< ScCondFormatItem > ATTR_CONDITIONAL(154)
static void UpdateDeleteTab(ScAddress &rAddr, const sc::RefUpdateDeleteTabContext &rCxt)
This is for the base-cell-address of a defined name or conditional format, not for references.
static void UpdateInsertTab(ScAddress &rAddr, const sc::RefUpdateInsertTabContext &rCxt)
This is very similar to ScCellValue, except that it references the original value instead of copying ...
ScFormulaCell * getFormula() const
const EditTextObject * getEditText() const
const svl::SharedString * getSharedString() const
Single reference (one address) into the sheet.
ScAddress toAbs(const ScSheetLimits &rLimits, const ScAddress &rPos) const
bool IsTabDeleted() const
Context for reference update during shifting, moving or copying of cell ranges.
SCROW mnRowDelta
Amount and direction of movement in the row direction.
UpdateRefMode meMode
update mode - insert/delete, copy, or move.
SCCOL mnColDelta
Amount and direction of movement in the column direction.
SCTAB mnTabDelta
Amount and direction of movement in the sheet direction.
ScRange maRange
Range of cells that are about to be moved for insert/delete/move modes.
bool mbReferenceModified
This flag indicates whether any reference in the token array has been modified.
std::unique_ptr< char[]> aBuffer