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;
390 aForString.append(
'=');
399 aForString.append(sSep);
401 aForString.append(sSep);
402 aRef.
Set( nCol1, nRow1, nTab1,
false,
true,
true );
412 aForString.append(sSep);
414 aForString.append(sSep);
415 aRef.
Set( nCol1, nRow1, nTab1,
true,
false,
true );
424 aForString.append(sSep);
426 aForString.append(sSep);
427 aRef.
Set( nCol1, nRow1 + 1, nTab1,
false,
true,
true );
429 aForString.append(sSep);
431 aForString.append(sSep);
432 aRef.
Set( nCol1 + 1, nRow1, nTab1,
true,
false,
true );
440 for( j = nCol1; j <= nCol2; j++ )
441 for( k = nRow1; k <= nRow2; k++ )
442 for (
i = 0; i < static_cast<SCTAB>(
maTabs.size());
i++)
444 for (
const auto& rTab : rMark)
449 maTabs[rTab]->SetFormulaCell(
476 OSL_FAIL(
"ScDocument::MarkUsedExternalReferences: implement the svExternalName case!");
493 bool bAllMarked =
false;
499 if (
t->IsExternalRef())
504 bAllMarked = setCacheTableReferenced(*
this, *
t, *pRefMgr, rPos);
518 if (!
t->IsExternalRef())
524 bAllMarked = setCacheTableReferenced(*
this, *
t, *pRefMgr, rPos);
535 return maTabs[nTab]->GetNextSpellingCell( nCol, nRow, bInSel, rMark );
544 return maTabs[nTab]->GetNextMarkedCell( rCol, rRow, rMark );
554 maTabs[nTab]->ReplaceStyle(rSearchItem, nCol, nRow, rMark,
true);
560 for (
auto& rxTab :
maTabs)
563 rxTab->CompileDBFormula(aCxt);
570 for (
auto& rxTab :
maTabs)
573 rxTab->CompileColRowNameFormula(aCxt);
579 for (
auto& rxTab :
maTabs)
583 rxTab->InvalidateTableArea();
584 if ( rxTab->IsScenario() )
585 rxTab->InvalidateScenarioRanges();
590 SCROW nRowStart,
SCROW nRowEnd, rtl_TextEncoding eCharSet )
const
593 return maTabs[nTab]->GetMaxStringLen( nCol, nRowStart, nRowEnd, eCharSet );
603 return maTabs[nTab]->GetMaxNumberStringLen( nPrecision, nCol,
604 nRowStart, nRowEnd );
623 for (; itr != itrEnd && *itr < nMax && !
aData.getError(); ++itr)
625 maTabs[*itr]->UpdateSelectionFunction(
aData, aMark);
627 rResult =
aData.getResult();
628 if (
aData.getError())
631 return !
aData.getError();
641 if (
nType != SvNumFormatType::DATE &&
nType != SvNumFormatType::TIME &&
nType != SvNumFormatType::DATETIME )
646 short nPrecision = 20;
654 case SvNumFormatType::PERCENT:
657 case SvNumFormatType::SCIENTIFIC:
661 nExp =
static_cast<short>(floor( log10( fVal ) ));
662 else if ( fVal < 0.0 )
663 nExp =
static_cast<short>(floor( log10( -fVal ) ));
668 short nIncrement = nExp % nInteger;
669 if ( nIncrement != 0 )
671 nPrecision += nIncrement;
673 nPrecision += nInteger;
678 case SvNumFormatType::FRACTION:
682 case SvNumFormatType::NUMBER:
683 case SvNumFormatType::CURRENCY:
688 bStdPrecision =
true;
703 double fRound = ::rtl::math::round( fVal, nPrecision );
704 if ( ::rtl::math::approxEqual( fVal, fRound ) )
721 return maTabs[nTab]->AddCondFormat( std::move(pNew) );
742 if (
pData->EqualEntries( rNew ) )
751 std::unique_ptr<ScValidationData> pInsert(rNew.
Clone(
this));
752 pInsert->SetKey( nNewKey );
769 if (!rIndex.
empty() && pCondFormList)
771 for(
const auto& rItem : rIndex)
778 const OUString& aStyle = pForm->
GetCellStyle(aCell, aPos);
779 if (!aStyle.isEmpty())
782 aStyle, SfxStyleFamily::Para );
785 nWhich,
true, &pItem ) == SfxItemState::SET )
794 OSL_FAIL(
"no pattern");
806 if( pCell ==
nullptr )
822 for (
const auto& rItem : rIndex)
828 const OUString& aStyle = pForm->
GetCellStyle(rCell, rPos);
829 if (!aStyle.isEmpty())
832 mxPoolHelper->GetStylePool()->Find(aStyle, SfxStyleFamily::Para);
850 if(!rCondFormats.
empty())
860 OSL_FAIL(
"pCondFormList is 0");
870 return maTabs[nTab]->GetCondFormList();
878 maTabs[nTab]->SetCondFormList(pList);
892 maTabs[nTab]->DeleteConditionalFormat(nOldIndex);
921#define SC_DOCCOMP_MAXDIFF 256
922#define SC_DOCCOMP_MINGOOD 128
923#define SC_DOCCOMP_COLUMNS 10
924#define SC_DOCCOMP_ROWS 100
932 for (
SCCOL nThisCol=0; nThisCol<=nMaxCol; nThisCol++)
936 nOtherCol =
static_cast<SCCOL>(pOtherCols[nThisCol]);
938 nOtherCol = nThisCol;
958 return static_cast<sal_uInt16
>((nDif*64)/nUsed);
960 OSL_ENSURE(!nDif,
"Diff without Used");
972 sal_uInt64 nUsed = 0;
973 for (
SCROW nThisRow=0; nThisRow<=nMaxRow; nThisRow++)
977 nOtherRow = pOtherRows[nThisRow];
979 nOtherRow = nThisRow;
999 return static_cast<sal_uInt16
>((nDif*64)/nUsed);
1001 OSL_ENSURE(!nDif,
"Diff without Used");
1026 bool bUseTotal = bColumns && !pTranslate;
1031 bool bTotal =
false;
1033 for (nThisRow = 0; nThisRow <= nThisEndRow; nThisRow++)
1036 bool bFound =
false;
1038 SCCOLROW nMax = std::min( nOtherEndRow,
static_cast<SCCOLROW>(( nTempOther + nMaxCont + nUnknown )) );
1039 for (
SCCOLROW i=nTempOther; i<=nMax && nBest>0;
i++)
1042 nComp =
ColDifferences(
static_cast<SCCOL>(nThisRow), nThisTab, rOtherDoc,
static_cast<SCCOL>(
i), nOtherTab, nEndCol, pTranslate );
1044 nComp =
RowDifferences( nThisRow, nThisTab, rOtherDoc,
i, nOtherTab,
static_cast<SCCOL>(nEndCol), pTranslate );
1045 if ( nComp < nBest && ( nComp <= nMinGood || bTotal ) )
1053 else if (
i == nTempOther && bUseTotal )
1058 pOtherRows[nThisRow] = nTempOther;
1059 nOtherRow = nTempOther + 1;
1074 SCROW nFillStart = 0;
1076 bool bInFill =
false;
1077 for (nThisRow = 0; nThisRow <= nThisEndRow+1; nThisRow++)
1079 SCROW nThisOther = ( nThisRow <= nThisEndRow ) ? pOtherRows[nThisRow] : (nOtherEndRow+1);
1084 if ( nThisOther > nFillStart )
1086 SCROW nDiff1 = nThisOther - nFillStart;
1087 SCROW nDiff2 = nThisRow - nFillPos;
1088 SCROW nMinDiff = std::min(nDiff1, nDiff2);
1090 pOtherRows[nFillPos+
i] = nFillStart+
i;
1095 nFillStart = nThisOther + 1;
1096 nFillPos = nThisRow + 1;
1110 std::unique_ptr<SCTAB[]> pOtherTabs(
new SCTAB[nThisCount]);
1115 OUString aOtherName;
1116 for (nThisTab=0; nThisTab<nThisCount; nThisTab++)
1121 GetName( nThisTab, aThisName );
1122 for (
SCTAB nTemp=0; nTemp<nOtherCount && nOtherTab>
MAXTAB; nTemp++)
1125 rOtherDoc.
GetName( nTemp, aOtherName );
1126 if ( aThisName == aOtherName )
1130 pOtherTabs[nThisTab] = nOtherTab;
1133 SCTAB nFillStart = 0;
1135 bool bInFill =
false;
1136 for (nThisTab = 0; nThisTab <= nThisCount; nThisTab++)
1138 SCTAB nThisOther = ( nThisTab < nThisCount ) ? pOtherTabs[nThisTab] : nOtherCount;
1143 if ( nThisOther > nFillStart )
1145 SCTAB nDiff1 = nThisOther - nFillStart;
1146 SCTAB nDiff2 = nThisTab - nFillPos;
1147 SCTAB nMinDiff = std::min(nDiff1, nDiff2);
1150 pOtherTabs[nFillPos+
i] = nFillStart+
i;
1155 nFillStart = nThisOther + 1;
1156 nFillPos = nThisTab + 1;
1164 for (nThisTab=0; nThisTab<nThisCount; nThisTab++)
1166 SCTAB nOtherTab = pOtherTabs[nThisTab];
1169 SCCOL nThisEndCol = 0;
1170 SCROW nThisEndRow = 0;
1171 SCCOL nOtherEndCol = 0;
1172 SCROW nOtherEndRow = 0;
1173 GetCellArea( nThisTab, nThisEndCol, nThisEndRow );
1174 rOtherDoc.
GetCellArea( nOtherTab, nOtherEndCol, nOtherEndRow );
1175 SCCOL nEndCol = std::max(nThisEndCol, nOtherEndCol);
1176 SCROW nEndRow = std::max(nThisEndRow, nOtherEndRow);
1184 GetName( nThisTab, aTabName );
1185 OUString aTemplate =
ScResId(STR_PROGRESS_COMPARING);
1193 std::unique_ptr<SCCOLROW[]> pTempRows(
new SCCOLROW[nThisEndRow+1]);
1194 std::unique_ptr<SCCOLROW[]> pOtherRows(
new SCCOLROW[nThisEndRow+1]);
1195 std::unique_ptr<SCCOLROW[]> pOtherCols(
new SCCOLROW[nThisEndCol+1]);
1206 FindOrder( pTempRows.get(), nThisEndRow, nOtherEndRow,
false,
1207 rOtherDoc, nThisTab, nOtherTab, nEndCol,
nullptr, &aProgress, 0 );
1209 FindOrder( pOtherCols.get(), nThisEndCol, nOtherEndCol,
true,
1210 rOtherDoc, nThisTab, nOtherTab, nEndRow,
nullptr,
nullptr, 0 );
1211 FindOrder( pOtherRows.get(), nThisEndRow, nOtherEndRow,
false,
1212 rOtherDoc, nThisTab, nOtherTab, nThisEndCol,
1213 pOtherCols.get(), &aProgress, nThisEndRow );
1216 for (nThisRow = 0; nThisRow<=nThisEndRow; nThisRow++)
1219 RowDifferences( nThisRow, nThisTab, rOtherDoc, pTempRows[nThisRow],
1220 nOtherTab, nEndCol,
nullptr );
1223 for (nThisRow = 0; nThisRow<=nThisEndRow; nThisRow++)
1224 if (
ValidRow(pOtherRows[nThisRow]))
1226 RowDifferences( nThisRow, nThisTab, rOtherDoc, pOtherRows[nThisRow],
1227 nOtherTab, nThisEndCol, pOtherCols.get() );
1229 if ( nMatch1 >= nMatch2 )
1232 for (nThisCol = 0; nThisCol<=nThisEndCol; nThisCol++)
1233 pOtherCols[nThisCol] = nThisCol;
1236 pTempRows.swap(pOtherRows);
1250 SCCOL nLastOtherCol =
static_cast<SCCOL>(nOtherEndCol + 1);
1252 for ( nThisCol = nThisEndCol+1; nThisCol > 0; )
1255 SCCOL nOtherCol =
static_cast<SCCOL>(pOtherCols[nThisCol]);
1256 if (
ValidCol(nOtherCol) && nOtherCol+1 < nLastOtherCol )
1259 ScRange aDelRange( nOtherCol+1, 0, nOtherTab,
1260 nLastOtherCol-1,
MaxRow(), nOtherTab );
1263 if ( nOtherCol >
MaxCol() )
1266 if ( nThisCol == nThisEndCol ||
ValidCol(
static_cast<SCCOL>(pOtherCols[nThisCol+1])) )
1268 SCCOL nFirstNew = nThisCol;
1269 while ( nFirstNew > 0 && pOtherCols[nFirstNew-1] >
MaxCol() )
1271 SCCOL nDiff = nThisCol - nFirstNew;
1272 ScRange aRange( nLastOtherCol, 0, nOtherTab,
1273 nLastOtherCol+nDiff,
MaxRow(), nOtherTab );
1278 nLastOtherCol = nOtherCol;
1280 if ( nLastOtherCol > 0 )
1282 ScRange aDelRange( 0, 0, nOtherTab,
1283 nLastOtherCol-1,
MaxRow(), nOtherTab );
1289 SCROW nLastOtherRow = nOtherEndRow + 1;
1291 for ( nThisRow = nThisEndRow+1; nThisRow > 0; )
1294 SCROW nOtherRow = pOtherRows[nThisRow];
1295 if (
ValidRow(nOtherRow) && nOtherRow+1 < nLastOtherRow )
1298 ScRange aDelRange( 0, nOtherRow+1, nOtherTab,
1299 MaxCol(), nLastOtherRow-1, nOtherTab );
1302 if ( nOtherRow >
MaxRow() )
1305 if ( nThisRow == nThisEndRow ||
ValidRow(pOtherRows[nThisRow+1]) )
1307 SCROW nFirstNew = nThisRow;
1308 while ( nFirstNew > 0 && pOtherRows[nFirstNew-1] >
MaxRow() )
1310 SCROW nDiff = nThisRow - nFirstNew;
1311 ScRange aRange( 0, nLastOtherRow, nOtherTab,
1312 MaxCol(), nLastOtherRow+nDiff, nOtherTab );
1317 nLastOtherRow = nOtherRow;
1319 if ( nLastOtherRow > 0 )
1321 ScRange aDelRange( 0, 0, nOtherTab,
1322 MaxCol(), nLastOtherRow-1, nOtherTab );
1328 for (nThisRow = 0; nThisRow <= nThisEndRow; nThisRow++)
1330 SCROW nOtherRow = pOtherRows[nThisRow];
1331 for (nThisCol = 0; nThisCol <= nThisEndCol; nThisCol++)
1333 SCCOL nOtherCol =
static_cast<SCCOL>(pOtherCols[nThisCol]);
1334 ScAddress aThisPos( nThisCol, nThisRow, nThisTab );
1336 aThisCell.
assign(*
this, aThisPos);
1340 ScAddress aOtherPos( nOtherCol, nOtherRow, nOtherTab );
1341 aOtherCell.
assign(rOtherDoc, aOtherPos);
1348 pAction->
SetOldValue(aOtherCell, &rOtherDoc,
this);
1362 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
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
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