26#include <osl/diagnose.h>
29#include <document.hxx>
43#include <progress.hxx>
45#include <compiler.hxx>
49#include <tokenarray.hxx>
74 const OUString& sValStr,
double& nX)
88 double fTargetVal = 0.0;
89 sal_uInt32 nFIndex = 0;
93 ScAddress aFormulaAdr( nFCol, nFRow, nFTab );
98 bool bDoneIteration =
false;
99 ScAddress aValueAdr( nVCol, nVRow, nVTab );
102 ScRange aVRange( aValueAdr, aValueAdr );
104 double fSaveVal = *pVCell;
106 const sal_uInt16 nMaxIter = 100;
107 const double fEps = 1
E-10;
108 const double fDelta = 1
E-6;
110 double fBestX, fXPrev;
111 double fBestF, fFPrev;
112 fBestX = fXPrev = fSaveVal;
115 bool bError = ( pFormula->
GetErrCode() != FormulaError::NONE );
118 fFPrev = pFormula->
GetValue() - fTargetVal;
120 fBestF = fabs( fFPrev );
121 if ( fBestF < fDelta )
122 bDoneIteration =
true;
124 double fX = fXPrev + fEps;
128 sal_uInt16 nIter = 0;
130 bool bHorMoveError =
false;
132 while ( !bDoneIteration && ( nIter++ < nMaxIter ) )
137 bError = ( pFormula->
GetErrCode() != FormulaError::NONE );
138 fF = pFormula->
GetValue() - fTargetVal;
140 if ( fF == fFPrev && !bError )
148 sal_uInt16 nHorIter = 0;
149 const double fHorStepAngle = 5.0;
150 const double fHorMaxAngle = 80.0;
151 int const nHorMaxIter =
static_cast<int>( fHorMaxAngle / fHorStepAngle );
152 bool bDoneHorMove =
false;
154 while ( !bDoneHorMove && !bHorMoveError && nHorIter++ < nHorMaxIter )
156 double fHorAngle = fHorStepAngle *
static_cast<double>( nHorIter );
160 while( nIdx++ < 2 && !bDoneHorMove )
164 fHorX = fX + fabs( fF ) * fHorTangent;
166 fHorX = fX - fabs( fF ) * fHorTangent;
171 bHorMoveError = ( pFormula->
GetErrCode() != FormulaError::NONE );
175 fF = pFormula->
GetValue() - fTargetVal;
184 bHorMoveError =
true;
190 double fDiff = ( fXPrev - fX ) / 2;
191 if ( fabs( fDiff ) < fEps )
192 fDiff = ( fDiff < 0.0 ? - fEps : fEps );
195 else if ( bHorMoveError )
197 else if ( fabs(fF) < fDelta )
201 bDoneIteration =
true;
205 if ( fabs(fF) + fDelta < fBestF )
211 if ( ( fXPrev - fX ) != 0 )
213 fSlope = ( fFPrev - fF ) / ( fXPrev - fX );
214 if ( fabs( fSlope ) < fEps )
215 fSlope = fSlope < 0.0 ? -fEps : fEps;
222 fX = fX - ( fF / fSlope );
227 const double fNiceDelta = ( bDoneIteration && fabs( fBestX ) >= 1e-3 ? 1e-3 : fDelta );
228 nX = ::rtl::math::approxFloor( ( fBestX / fNiceDelta ) + 0.5 ) * fNiceDelta;
230 if ( bDoneIteration )
235 if ( fabs( pFormula->
GetValue() - fTargetVal ) > fabs( fF ) )
239 else if ( bError || bHorMoveError )
246 if ( !bDoneIteration )
248 SetError( nVCol, nVRow, nVTab, FormulaError::NotAvailable );
253 SetError( nVCol, nVRow, nVTab, FormulaError::NotAvailable );
262 const OUString& rFormula,
268 nCol2 = std::min<SCCOL>(nCol2,
MaxCol());
269 nRow2 = std::min<SCROW>(nRow2,
MaxRow());
272 SAL_WARN(
"sc",
"ScDocument::InsertMatrixFormula: No table marked");
278 if (nCol2 - nCol1 > 64)
280 if (nRow2 - nRow1 > 64)
295 for (
const auto& rTab : rMark)
305 pCell =
maTabs[rTab]->SetFormulaCell(nCol1, nRow1, pCell);
310 maTabs[rTab]->SetFormulaCell(
325 for (
const SCTAB& nTab : rMark)
337 for (
SCROW nRow = nRow1; nRow <= nRow2; ++nRow)
339 if (nCol == nCol1 && nRow == nRow1)
345 *
t->GetSingleRef() = aRefData;
369 for (
const auto& rTab : rMark)
384 OSL_FAIL(
"ScDocument::InsertTableOp: No table marked");
389 OUStringBuffer aForString(
"="
401 aRef.
Set( nCol1, nRow1, nTab1,
false,
true,
true );
414 aRef.
Set( nCol1, nRow1, nTab1,
true,
false,
true );
426 aRef.
Set( nCol1, nRow1 + 1, nTab1,
false,
true,
true );
431 aRef.
Set( nCol1 + 1, nRow1, nTab1,
true,
false,
true );
439 for( j = nCol1; j <= nCol2; j++ )
440 for( k = nRow1; k <= nRow2; k++ )
443 for (
const auto& rTab : rMark)
448 maTabs[rTab]->SetFormulaCell(
475 OSL_FAIL(
"ScDocument::MarkUsedExternalReferences: implement the svExternalName case!");
492 bool bAllMarked =
false;
498 if (
t->IsExternalRef())
503 bAllMarked = setCacheTableReferenced(*
this, *
t, *pRefMgr, rPos);
517 if (!
t->IsExternalRef())
523 bAllMarked = setCacheTableReferenced(*
this, *
t, *pRefMgr, rPos);
534 return pTable->GetNextSpellingCell( nCol, nRow, bInSel, rMark );
542 return pTable->GetNextMarkedCell( rCol, rRow, rMark );
551 pTable->ReplaceStyle(rSearchItem, nCol, nRow, rMark,
true);
557 for (
auto& rxTab :
maTabs)
560 rxTab->CompileDBFormula(aCxt);
567 for (
auto& rxTab :
maTabs)
570 rxTab->CompileColRowNameFormula(aCxt);
576 for (
auto& rxTab :
maTabs)
580 rxTab->InvalidateTableArea();
581 if ( rxTab->IsScenario() )
582 rxTab->InvalidateScenarioRanges();
587 SCROW nRowStart,
SCROW nRowEnd, rtl_TextEncoding eCharSet )
const
590 return pTable->GetMaxStringLen(nCol, nRowStart, nRowEnd, eCharSet);
598 return pTable->GetMaxNumberStringLen(nPrecision, nCol, nRowStart, nRowEnd);
616 for (; itr != itrEnd && *itr < nMax && !
aData.getError(); ++itr)
618 maTabs[*itr]->UpdateSelectionFunction(
aData, aMark);
620 rResult =
aData.getResult();
621 if (
aData.getError())
624 return !
aData.getError();
634 if (
nType != SvNumFormatType::DATE &&
nType != SvNumFormatType::TIME &&
nType != SvNumFormatType::DATETIME )
639 short nPrecision = 20;
647 case SvNumFormatType::PERCENT:
650 case SvNumFormatType::SCIENTIFIC:
654 nExp =
static_cast<short>(floor( log10( fVal ) ));
655 else if ( fVal < 0.0 )
656 nExp =
static_cast<short>(floor( log10( -fVal ) ));
661 short nIncrement = nExp % nInteger;
662 if ( nIncrement != 0 )
664 nPrecision += nIncrement;
666 nPrecision += nInteger;
671 case SvNumFormatType::FRACTION:
675 case SvNumFormatType::NUMBER:
676 case SvNumFormatType::CURRENCY:
681 bStdPrecision =
true;
696 double fRound = ::rtl::math::round( fVal, nPrecision );
697 if ( ::rtl::math::approxEqual( fVal, fRound ) )
714 return pTable->AddCondFormat(std::move(pNew));
735 if (
pData->EqualEntries( rNew ) )
744 std::unique_ptr<ScValidationData> pInsert(rNew.
Clone(
this));
745 pInsert->SetKey( nNewKey );
762 if (!rIndex.
empty() && pCondFormList)
764 for(
const auto& rItem : rIndex)
771 const OUString& aStyle = pForm->
GetCellStyle(aCell, aPos);
772 if (!aStyle.isEmpty())
775 aStyle, SfxStyleFamily::Para );
778 nWhich,
true, &pItem ) == SfxItemState::SET )
787 OSL_FAIL(
"no pattern");
799 if( pCell ==
nullptr )
815 for (
const auto& rItem : rIndex)
821 const OUString& aStyle = pForm->
GetCellStyle(rCell, rPos);
822 if (!aStyle.isEmpty())
825 mxPoolHelper->GetStylePool()->Find(aStyle, SfxStyleFamily::Para);
843 if(!rCondFormats.
empty())
853 OSL_FAIL(
"pCondFormList is 0");
863 return maTabs[nTab]->GetCondFormList();
870 pTable->SetCondFormList(pList);
884 pTable->DeleteConditionalFormat(nOldIndex);
913#define SC_DOCCOMP_MAXDIFF 256
914#define SC_DOCCOMP_MINGOOD 128
915#define SC_DOCCOMP_COLUMNS 10
916#define SC_DOCCOMP_ROWS 100
924 for (
SCCOL nThisCol=0; nThisCol<=nMaxCol; nThisCol++)
928 nOtherCol =
static_cast<SCCOL>(pOtherCols[nThisCol]);
930 nOtherCol = nThisCol;
950 return static_cast<sal_uInt16
>((nDif*64)/nUsed);
952 OSL_ENSURE(!nDif,
"Diff without Used");
964 sal_uInt64 nUsed = 0;
965 for (
SCROW nThisRow=0; nThisRow<=nMaxRow; nThisRow++)
969 nOtherRow = pOtherRows[nThisRow];
971 nOtherRow = nThisRow;
991 return static_cast<sal_uInt16
>((nDif*64)/nUsed);
993 OSL_ENSURE(!nDif,
"Diff without Used");
1018 bool bUseTotal = bColumns && !pTranslate;
1023 bool bTotal =
false;
1025 for (nThisRow = 0; nThisRow <= nThisEndRow; nThisRow++)
1028 bool bFound =
false;
1030 SCCOLROW nMax = std::min( nOtherEndRow,
static_cast<SCCOLROW>(( nTempOther + nMaxCont + nUnknown )) );
1031 for (
SCCOLROW i=nTempOther; i<=nMax && nBest>0;
i++)
1034 nComp =
ColDifferences(
static_cast<SCCOL>(nThisRow), nThisTab, rOtherDoc,
static_cast<SCCOL>(
i), nOtherTab, nEndCol, pTranslate );
1036 nComp =
RowDifferences( nThisRow, nThisTab, rOtherDoc,
i, nOtherTab,
static_cast<SCCOL>(nEndCol), pTranslate );
1037 if ( nComp < nBest && ( nComp <= nMinGood || bTotal ) )
1045 else if (
i == nTempOther && bUseTotal )
1050 pOtherRows[nThisRow] = nTempOther;
1051 nOtherRow = nTempOther + 1;
1066 SCROW nFillStart = 0;
1068 bool bInFill =
false;
1069 for (nThisRow = 0; nThisRow <= nThisEndRow+1; nThisRow++)
1071 SCROW nThisOther = ( nThisRow <= nThisEndRow ) ? pOtherRows[nThisRow] : (nOtherEndRow+1);
1076 if ( nThisOther > nFillStart )
1078 SCROW nDiff1 = nThisOther - nFillStart;
1079 SCROW nDiff2 = nThisRow - nFillPos;
1080 SCROW nMinDiff = std::min(nDiff1, nDiff2);
1082 pOtherRows[nFillPos+
i] = nFillStart+
i;
1087 nFillStart = nThisOther + 1;
1088 nFillPos = nThisRow + 1;
1102 std::unique_ptr<SCTAB[]> pOtherTabs(
new SCTAB[nThisCount]);
1107 OUString aOtherName;
1108 for (nThisTab=0; nThisTab<nThisCount; nThisTab++)
1113 GetName( nThisTab, aThisName );
1114 for (
SCTAB nTemp=0; nTemp<nOtherCount && nOtherTab>
MAXTAB; nTemp++)
1117 rOtherDoc.
GetName( nTemp, aOtherName );
1118 if ( aThisName == aOtherName )
1122 pOtherTabs[nThisTab] = nOtherTab;
1125 SCTAB nFillStart = 0;
1127 bool bInFill =
false;
1128 for (nThisTab = 0; nThisTab <= nThisCount; nThisTab++)
1130 SCTAB nThisOther = ( nThisTab < nThisCount ) ? pOtherTabs[nThisTab] : nOtherCount;
1135 if ( nThisOther > nFillStart )
1137 SCTAB nDiff1 = nThisOther - nFillStart;
1138 SCTAB nDiff2 = nThisTab - nFillPos;
1139 SCTAB nMinDiff = std::min(nDiff1, nDiff2);
1142 pOtherTabs[nFillPos+
i] = nFillStart+
i;
1147 nFillStart = nThisOther + 1;
1148 nFillPos = nThisTab + 1;
1156 for (nThisTab=0; nThisTab<nThisCount; nThisTab++)
1158 SCTAB nOtherTab = pOtherTabs[nThisTab];
1161 SCCOL nThisEndCol = 0;
1162 SCROW nThisEndRow = 0;
1163 SCCOL nOtherEndCol = 0;
1164 SCROW nOtherEndRow = 0;
1165 GetCellArea( nThisTab, nThisEndCol, nThisEndRow );
1166 rOtherDoc.
GetCellArea( nOtherTab, nOtherEndCol, nOtherEndRow );
1167 SCCOL nEndCol = std::max(nThisEndCol, nOtherEndCol);
1168 SCROW nEndRow = std::max(nThisEndRow, nOtherEndRow);
1176 GetName( nThisTab, aTabName );
1177 OUString aTemplate =
ScResId(STR_PROGRESS_COMPARING);
1185 std::unique_ptr<SCCOLROW[]> pTempRows(
new SCCOLROW[nThisEndRow+1]);
1186 std::unique_ptr<SCCOLROW[]> pOtherRows(
new SCCOLROW[nThisEndRow+1]);
1187 std::unique_ptr<SCCOLROW[]> pOtherCols(
new SCCOLROW[nThisEndCol+1]);
1198 FindOrder( pTempRows.get(), nThisEndRow, nOtherEndRow,
false,
1199 rOtherDoc, nThisTab, nOtherTab, nEndCol,
nullptr, &aProgress, 0 );
1201 FindOrder( pOtherCols.get(), nThisEndCol, nOtherEndCol,
true,
1202 rOtherDoc, nThisTab, nOtherTab, nEndRow,
nullptr,
nullptr, 0 );
1203 FindOrder( pOtherRows.get(), nThisEndRow, nOtherEndRow,
false,
1204 rOtherDoc, nThisTab, nOtherTab, nThisEndCol,
1205 pOtherCols.get(), &aProgress, nThisEndRow );
1208 for (nThisRow = 0; nThisRow<=nThisEndRow; nThisRow++)
1211 RowDifferences( nThisRow, nThisTab, rOtherDoc, pTempRows[nThisRow],
1212 nOtherTab, nEndCol,
nullptr );
1215 for (nThisRow = 0; nThisRow<=nThisEndRow; nThisRow++)
1216 if (
ValidRow(pOtherRows[nThisRow]))
1218 RowDifferences( nThisRow, nThisTab, rOtherDoc, pOtherRows[nThisRow],
1219 nOtherTab, nThisEndCol, pOtherCols.get() );
1221 if ( nMatch1 >= nMatch2 )
1224 for (nThisCol = 0; nThisCol<=nThisEndCol; nThisCol++)
1225 pOtherCols[nThisCol] = nThisCol;
1228 pTempRows.swap(pOtherRows);
1242 SCCOL nLastOtherCol =
static_cast<SCCOL>(nOtherEndCol + 1);
1244 for ( nThisCol = nThisEndCol+1; nThisCol > 0; )
1247 SCCOL nOtherCol =
static_cast<SCCOL>(pOtherCols[nThisCol]);
1248 if (
ValidCol(nOtherCol) && nOtherCol+1 < nLastOtherCol )
1251 ScRange aDelRange( nOtherCol+1, 0, nOtherTab,
1252 nLastOtherCol-1,
MaxRow(), nOtherTab );
1255 if ( nOtherCol >
MaxCol() )
1258 if ( nThisCol == nThisEndCol ||
ValidCol(
static_cast<SCCOL>(pOtherCols[nThisCol+1])) )
1260 SCCOL nFirstNew = nThisCol;
1261 while ( nFirstNew > 0 && pOtherCols[nFirstNew-1] >
MaxCol() )
1263 SCCOL nDiff = nThisCol - nFirstNew;
1264 ScRange aRange( nLastOtherCol, 0, nOtherTab,
1265 nLastOtherCol+nDiff,
MaxRow(), nOtherTab );
1270 nLastOtherCol = nOtherCol;
1272 if ( nLastOtherCol > 0 )
1274 ScRange aDelRange( 0, 0, nOtherTab,
1275 nLastOtherCol-1,
MaxRow(), nOtherTab );
1281 SCROW nLastOtherRow = nOtherEndRow + 1;
1283 for ( nThisRow = nThisEndRow+1; nThisRow > 0; )
1286 SCROW nOtherRow = pOtherRows[nThisRow];
1287 if (
ValidRow(nOtherRow) && nOtherRow+1 < nLastOtherRow )
1290 ScRange aDelRange( 0, nOtherRow+1, nOtherTab,
1291 MaxCol(), nLastOtherRow-1, nOtherTab );
1294 if ( nOtherRow >
MaxRow() )
1297 if ( nThisRow == nThisEndRow ||
ValidRow(pOtherRows[nThisRow+1]) )
1299 SCROW nFirstNew = nThisRow;
1300 while ( nFirstNew > 0 && pOtherRows[nFirstNew-1] >
MaxRow() )
1302 SCROW nDiff = nThisRow - nFirstNew;
1303 ScRange aRange( 0, nLastOtherRow, nOtherTab,
1304 MaxCol(), nLastOtherRow+nDiff, nOtherTab );
1309 nLastOtherRow = nOtherRow;
1311 if ( nLastOtherRow > 0 )
1313 ScRange aDelRange( 0, 0, nOtherTab,
1314 MaxCol(), nLastOtherRow-1, nOtherTab );
1320 for (nThisRow = 0; nThisRow <= nThisEndRow; nThisRow++)
1322 SCROW nOtherRow = pOtherRows[nThisRow];
1323 for (nThisCol = 0; nThisCol <= nThisEndCol; nThisCol++)
1325 SCCOL nOtherCol =
static_cast<SCCOL>(pOtherCols[nThisCol]);
1326 ScAddress aThisPos( nThisCol, nThisRow, nThisTab );
1328 aThisCell.
assign(*
this, aThisPos);
1332 ScAddress aOtherPos( nOtherCol, nOtherRow, nOtherTab );
1333 aOtherCell.
assign(rOtherDoc, aOtherPos);
1340 pAction->
SetOldValue(aOtherCell, &rOtherDoc,
this);
1354 FormulaGrammar::extractRefConvention(
GetGrammar()));
bool ValidTab(SCTAB nTab)
void PutInOrder(T &nStart, T &nEnd)
void SetOldValue(const ScCellValue &rCell, const ScDocument *pFromDoc, ScDocument *pToDoc, sal_uLong nFormat)
void SetNewValue(const ScCellValue &rCell, ScDocument *pDoc)
static const Convention * GetRefConvention(formula::FormulaGrammar::AddressConvention eConv)
sal_uInt16 GetStdPrecision() const
SC_DLLPUBLIC bool IsScenario(SCTAB nTab) const
sal_Int32 GetMaxNumberStringLen(sal_uInt16 &nPrecision, SCTAB nTab, SCCOL nCol, SCROW nRowStart, SCROW nRowEnd) const
Maximum string length of numerical cells of a column, e.g.
SC_DLLPUBLIC ScColumnsRange GetWritableColumnsRange(SCTAB nTab, SCCOL nColBegin, SCCOL nColEnd)
SC_DLLPUBLIC double * GetValueCell(const ScAddress &rPos)
Return a pointer to the double value stored in value cell.
bool ValidRow(SCROW nRow) const
SC_DLLPUBLIC ScRangeName * GetRangeName() const
SC_DLLPUBLIC ScTable * FetchTable(SCTAB nTab)
SC_DLLPUBLIC void InsertMatrixFormula(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, const ScMarkData &rMark, const OUString &rFormula, const ScTokenArray *p=nullptr, const formula::FormulaGrammar::Grammar=formula::FormulaGrammar::GRAM_DEFAULT)
SC_DLLPUBLIC void InsertTableOp(const ScTabOpParam &rParam, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, const ScMarkData &rMark)
void InvalidateTableArea()
SC_DLLPUBLIC SCCOL MaxCol() const
SC_DLLPUBLIC const ScValidationData * GetValidationEntry(sal_uInt32 nIndex) const
sal_uInt16 RowDifferences(SCROW nThisRow, SCTAB nThisTab, ScDocument &rOtherDoc, SCROW nOtherRow, SCTAB nOtherTab, SCCOL nMaxCol, const SCCOLROW *pOtherCols)
rtl::Reference< ScPoolHelper > mxPoolHelper
const SfxPoolItem * GetEffItem(SCCOL nCol, SCROW nRow, SCTAB nTab, sal_uInt16 nWhich) const
SC_DLLPUBLIC SCROW MaxRow() const
SC_DLLPUBLIC void CompareDocument(ScDocument &rOtherDoc)
bool HasDetectiveOperations() const
void AddDetectiveOperation(const ScDetOpData &rData)
bool Solver(SCCOL nFCol, SCROW nFRow, SCTAB nFTab, SCCOL nVCol, SCROW nVRow, SCTAB nVTab, const OUString &sValStr, double &nX)
(Goal Seek) Find a value of x that is a root of f(x)
void DeleteConditionalFormat(sal_uLong nIndex, SCTAB nTab)
SC_DLLPUBLIC double RoundValueAsShown(double fVal, sal_uInt32 nFormat, const ScInterpreterContext *pContext=nullptr) const
std::unique_ptr< ScValidationDataList > pValidationList
SC_DLLPUBLIC ScExternalRefManager * GetExternalRefManager() const
sal_Int32 GetMaxStringLen(SCTAB nTab, SCCOL nCol, SCROW nRowStart, SCROW nRowEnd, rtl_TextEncoding eCharSet) const
Maximum string length of a column, e.g.
std::unique_ptr< ScDetOpList > pDetOpList
void SetCondFormList(ScConditionalFormatList *pList, SCTAB nTab)
void ReplaceStyle(const SvxSearchItem &rSearchItem, SCCOL nCol, SCROW nRow, SCTAB nTab, const ScMarkData &rMark)
void SetDetOpList(std::unique_ptr< ScDetOpList > pNew)
std::unique_ptr< ScChangeTrack > pChangeTrack
SC_DLLPUBLIC ScConditionalFormat * GetCondFormat(SCCOL nCol, SCROW nRow, SCTAB nTab) const
SC_DLLPUBLIC formula::FormulaGrammar::Grammar GetGrammar() const
void MarkUsedExternalReferences()
void SetError(SCCOL nCol, SCROW nRow, SCTAB nTab, const FormulaError nError)
void FindOrder(SCCOLROW *pOtherRows, SCCOLROW nThisEndRow, SCCOLROW nOtherEndRow, bool bColumns, ScDocument &rOtherDoc, SCTAB nThisTab, SCTAB nOtherTab, SCCOLROW nEndCol, const SCCOLROW *pTranslate, ScProgress *pProgress, sal_uInt64 nProAdd)
SfxObjectShell * GetDocumentShell() const
bool ValidCol(SCCOL nCol) const
SC_DLLPUBLIC sal_uLong AddValidationEntry(const ScValidationData &rNew)
SC_DLLPUBLIC bool GetCellArea(SCTAB nTab, SCCOL &rEndCol, SCROW &rEndRow) const
SC_DLLPUBLIC ScConditionalFormatList * GetCondFormList(SCTAB nTab) const
SC_DLLPUBLIC SvNumberFormatter * GetFormatTable() const
bool GetNextSpellingCell(SCCOL &nCol, SCROW &nRow, SCTAB nTab, bool bInSel, const ScMarkData &rMark) const
void ClearDetectiveOperations()
bool GetNextMarkedCell(SCCOL &rCol, SCROW &rRow, SCTAB nTab, const ScMarkData &rMark)
SC_DLLPUBLIC const ScFormulaCell * GetFormulaCell(const ScAddress &rPos) const
SC_DLLPUBLIC CellType GetCellType(SCCOL nCol, SCROW nRow, SCTAB nTab) const
SC_DLLPUBLIC bool HasTable(SCTAB nTab) const
bool GetSelectionFunction(ScSubTotalFunc eFunc, const ScAddress &rCursor, const ScMarkData &rMark, double &rResult)
void SetDirty(const ScRange &, bool bIncludeEmptyCells)
SC_DLLPUBLIC bool GetName(SCTAB nTab, OUString &rName) const
SC_DLLPUBLIC sal_uLong AddCondFormat(std::unique_ptr< ScConditionalFormat > pNew, SCTAB nTab)
SC_DLLPUBLIC const SfxPoolItem * GetAttr(SCCOL nCol, SCROW nRow, SCTAB nTab, sal_uInt16 nWhich) const
SC_DLLPUBLIC sal_Unicode GetSheetSeparator() const
Obtain the sheet separator corresponding to the document's grammar.
SC_DLLPUBLIC const SfxItemSet * GetCondResult(SCCOL nCol, SCROW nRow, SCTAB nTab, ScRefCellValue *pCell=nullptr) const
SC_DLLPUBLIC const ScPatternAttr * GetPattern(SCCOL nCol, SCROW nRow, SCTAB nTab) const
SC_DLLPUBLIC const ScDocOptions & GetDocOptions() const
void CompileColRowNameFormula()
sal_uInt16 ColDifferences(SCCOL nThisCol, SCTAB nThisTab, ScDocument &rOtherDoc, SCCOL nOtherCol, SCTAB nOtherTab, SCROW nMaxRow, const SCCOLROW *pOtherRows)
SC_DLLPUBLIC SCTAB GetTableCount() const
bool ValidColRow(SCCOL nCol, SCROW nRow) const
bool setCacheTableReferenced(sal_uInt16 nFileId, const OUString &rTabName, size_t nSheets)
Set a table as referenced, used only during store-to-file.
To calculate a single subtotal function.
todo: It should be possible to have MarkArrays for each table, in order to enable "search all" across...
const_iterator end() const
bool IsMultiMarked() const
bool IsCellMarked(SCCOL nCol, SCROW nRow, bool bNoSimple=false) const
SCTAB GetSelectCount() const
void SetMarkArea(const ScRange &rRange)
const_iterator begin() const
std::set< SCTAB >::const_iterator const_iterator
SfxItemSet & GetItemSet()
const SfxPoolItem & GetItem(sal_uInt16 nWhichP) const
void SetStateOnPercent(sal_uInt64 nVal)
SC_DLLPUBLIC ScRangeData * findByIndex(sal_uInt16 i) const
OUString GetRefString(const ScDocument &rDocument, SCTAB nActTab, const ScAddress::Details &rDetails=ScAddress::detailsOOOa1) const
const ScAddress & GetAddress() const
void Set(const ScAddress &rAdr, bool bNewRelCol, bool bNewRelRow, bool bNewRelTab)
ScFormulaCell * SetFormulaCell(SCCOL nCol, SCROW nRow, ScFormulaCell *pCell)
Takes ownership of pCell.
ScValidationData * Clone() const
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
virtual SfxItemSet & GetItemSet()
const OUString & getString() const
#define SC_DOCCOMP_MINGOOD
#define SC_DOCCOMP_MAXDIFF
#define SC_DOCCOMP_COLUMNS
@ StartListening
If set, cloned formula cells will start to listen to the document.
#define SAL_WARN(area, stream)
std::unique_ptr< sal_Int32[]> pData
constexpr OUStringLiteral aData
constexpr double deg2rad(double v)
std::basic_string_view< charT, traits > getToken(std::basic_string_view< charT, traits > sv, charT delimiter, std::size_t &position)
OUString ScResId(TranslateId aId)
constexpr TypedWhichId< ScCondFormatItem > ATTR_CONDITIONAL(154)
Store arbitrary cell value of any kind.
void assign(const ScDocument &rDoc, const ScAddress &rPos)
Take cell value from specified position in specified document.
bool equalsWithoutFormat(const ScCellValue &r) const
@ SHEET_SEPARATOR
Character between sheet name and address.
virtual sal_Unicode getSpecialSymbol(SpecialSymbolType eSymType) const =0
Complex reference (a range) into the sheet.
SC_DLLPUBLIC ScRange toAbs(const ScSheetLimits &rLimits, const ScAddress &rPos) const
SvNumberFormatter * GetFormatTable() const
A pretty assertion that checks that the relevant bits in the @nFlags are not set on the document at e...
This is very similar to ScCellValue, except that it references the original value instead of copying ...
void assign(ScDocument &rDoc, const ScAddress &rPos)
Take cell value from specified position in specified document.
bool equalsWithoutFormat(const ScRefCellValue &r) const
Single reference (one address) into the sheet.
void SetRelRow(SCROW nVal)
void SetRelTab(SCTAB nVal)
void SetRelCol(SCCOL nVal)
void InitFlags()
No default ctor, because used in ScRawToken union, set InitFlags!
Parameter for data table aka multiple operations.
ScRefAddress aRefFormulaEnd
ScRefAddress aRefFormulaCell
sal_Int32 SCCOLROW
a type capable of holding either SCCOL or SCROW
#define SV_COUNTRY_LANGUAGE_OFFSET