20#include <com/sun/star/script/vba/XVBAEventProcessor.hpp>
21#include <com/sun/star/sheet/TableValidationVisibility.hpp>
30#include <osl/thread.hxx>
31#include <osl/diagnose.h>
33#include <document.hxx>
74#include <LibreOfficeKit/LibreOfficeKitEnums.h>
76#include <config_fuzzers.h>
83void sortAndRemoveDuplicates(std::vector<ScTypedStrData>& rStrings,
bool bCaseSens)
88 std::vector<ScTypedStrData>::iterator it =
90 rStrings.erase(it, rStrings.end());
95 std::vector<ScTypedStrData>::iterator it =
97 rStrings.erase(it, rStrings.end());
99 if (std::any_of(rStrings.begin(), rStrings.end(),
100 [](
ScTypedStrData& rString) { return rString.IsHiddenByFilter(); })) {
117 if (!
p ||
p->empty())
121 aNames.emplace(
i,
p);
128 for (
const auto& [rName, rRangeName] : rRangeMap)
133 if (!rRangeName.empty())
139 bool bFound =
GetTable(rName, nTab);
140 assert(bFound); (void)bFound;
141 if (rRangeName.empty())
161 OUString aTableName =
maTabs[
i]->GetName();
162 aRangeNameMap.insert(std::pair<OUString, ScRangeName*>(aTableName,
p));
174 return pTable->GetRangeName();
188 pTable->SetRangeName(std::move(pNew));
206 for (
const auto& rEntry : *pRangeNames)
208 if (rEntry.second->IsValidReference(aNameRange))
249 rName =
pData->GetName();
261 rName =
pData->GetName();
263 *pSheetLocal =
false;
283 for (
const auto& rxNamedDB : rNamedDBs)
285 const ScDBData& rOldData = *rxNamedDB;
293 if (pNewDBCollection)
325 return pDBCollection->GetDBAtCursor(nCol, nRow, nTab, ePortion);
333 return pDBCollection->GetDBAtCursor(nCol, nRow, nTab, ePortion);
341 return pDBCollection->GetDBAtArea(nTab, nCol1, nRow1, nCol2, nRow2);
349 return pDBCollection->GetDBAtArea(nTab, nCol1, nRow1, nCol2, nRow2);
386 return &(*pDPCollection)[
i];
401 return &(*pDPCollection)[
i];
413 std::unique_ptr<ScChartListenerCollection> pNewChartListenerCollection,
414 bool bSetChartRangeLists )
429 pTable->SetScenario(bFlag);
443 pTable->SetScenarioComment( rComment );
444 pTable->SetScenarioColor( rColor );
445 pTable->SetScenarioFlags( nFlags );
452 return pTable->GetTabBgColor();
459 pTable->SetTabBgColor(rColor);
465 return pTable->GetTabBgColor() ==
COL_AUTO;
474 pTable->GetScenarioComment( rComment );
475 rColor = pTable->GetScenarioColor();
476 rFlags = pTable->GetScenarioFlags();
483 rFlags = pTable->GetScenarioFlags();
489 return pTable && pTable->
IsLinked();
505 return pTable->GetLinkMode();
512 return pTable->GetLinkDoc();
519 return pTable->GetLinkFlt();
526 return pTable->GetLinkOpt();
533 return pTable->GetLinkTab();
540 return pTable->GetLinkRefreshDelay();
545 const OUString& rFilter,
const OUString& rOptions,
546 const OUString& rTabName,
sal_uLong nRefreshDelay )
549 pTable->SetLink(nMode, rDoc, rFilter, rOptions, rTabName, nRefreshDelay);
553 std::u16string_view rFilter, std::u16string_view rOptions )
const
567 const OUString& aFileName,
const OUString& aTabName )
571 OSL_FAIL(
"LinkExternalTab in Clipboard" );
581 OUString aFilterName;
591 if ( pSrcDoc->
GetTable( aTabName, nSrcTab ) )
595 OSL_FAIL(
"can't insert external document table");
600 TransferTab( *pSrcDoc, nSrcTab, rTab,
false,
true );
607 bool bWasThere =
HasLink( aFileName, aFilterName, aOptions );
612 pLink->SetInCreate(
true );
613 OUString aFilName = aFilterName;
616 pLink->SetInCreate(
false );
664 return pTable->GetSheetEvents();
671 pTable->SetSheetEvents( std::move(pNew) );
680 if ( pEvents && pEvents->
GetScript( nEvent ) )
685 uno::Sequence< uno::Any > aArgs{
uno::Any(nTab) };
690 catch( uno::Exception& )
700 for (
SCTAB nTab = 0; nTab < nSize; nTab++)
709 for (
SCTAB nTab = 0; nTab < nSize; nTab++)
710 if (
maTabs[nTab] &&
maTabs[nTab]->GetCalcNotification())
718 return pTable->GetCalcNotification();
726 pTable->SetCalcNotification(
true);
732 for (
SCTAB nTab = 0; nTab < nSize; nTab++)
733 if (
maTabs[nTab] &&
maTabs[nTab]->GetCalcNotification())
734 maTabs[nTab]->SetCalcNotification(
false);
743 pVal = pTable->GetOutlineTable();
744 if (!pVal && bCreate)
746 pTable->StartOutlineTable();
747 pVal = pTable->GetOutlineTable();
764 pTable->DoAutoOutline( nStartCol, nStartRow, nEndCol, nEndRow );
776 pTable->RemoveSubTotals( rParam );
788 for (
bool bHas = aIter.
first(); bHas; bHas = aIter.
next())
808 maTabs[nTab]->CopyUpdated( pPosDoc->
maTabs[nTab].get(), pDestDoc->
maTabs[nTab].get() );
821 for (
SCTAB nTab = nDestTab+1;
827 bool bTouched =
false;
828 for (
size_t nR=0, nRangeCount = aRanges.
size(); nR < nRangeCount && !bTouched; nR++ )
830 const ScRange& rRange = aRanges[ nR ];
836 maTabs[nTab]->SetActiveScenario(
false);
843 maTabs[nSrcTab]->SetActiveScenario(
true);
861 pTable->MarkScenarioIn(rDestMark, nNeededBits);
875 return pTable->GetScenarioRanges();
889 pTable->SetActiveScenario( bActive );
897 OSL_FAIL(
"wrong table at TestCopyScenario");
934 OSL_FAIL(
"RemoveUnoObject called from BroadcastUno" );
941 osl::Thread::yield();
948 OSL_FAIL(
"No Uno broadcaster");
966 rHint.
GetId() == SfxHintId::DataChanged &&
981 const lang::EventObject& rEvent )
983 OSL_ENSURE(
bInUnoBroadcast,
"AddUnoListenerCall is supposed to be called from BroadcastUno only" );
1018 std::unique_ptr<sc::ExpandRefsSwitch> pExpandRefsSwitch;
1022 size_t nFirstTab, nLastTab;
1040 xColNameRanges->UpdateReference( eUpdateRefMode,
this, aRange, nDx, nDy, nDz );
1041 xRowNameRanges->UpdateReference( eUpdateRefMode,
this, aRange, nDx, nDy, nDz );
1042 pDBCollection->UpdateReference( eUpdateRefMode, nCol1, nRow1, nTab1, nCol2, nRow2, nTab2, nDx, nDy, nDz );
1046 pDPCollection->UpdateReference( eUpdateRefMode, aRange, nDx, nDy, nDz );
1047 UpdateChartRef( eUpdateRefMode, nCol1, nRow1, nTab1, nCol2, nRow2, nTab2, nDx, nDy, nDz );
1055 pDetOpList->UpdateReference(
this, eUpdateRefMode, aRange, nDx, nDy, nDz );
1058 eUpdateRefMode, aRange, nDx, nDy, nDz ) );
1061 nLastTab =
maTabs.size()-1;
1064 for (
size_t i = nFirstTab,
n =
maTabs.size() ;
i <= nLastTab &&
i <
n; ++
i)
1069 maTabs[
i]->UpdateReference(rCxt, pUndoDoc, bIncludeDraw, bUpdateNoteCaptionPos);
1097 nDx,nDy,nDz, theCol1,theRow1,theTab1, theCol2,theRow2,theTab2 ) )
1115 OSL_ENSURE(pClipDoc->
bIsClip,
"UpdateTranspose: No Clip");
1127 while (!pClipDoc->
maTabs[nClipTab]) nClipTab = (nClipTab+1) % (
MAXTAB+1);
1130 aDest.
SetTab( nDestTab );
1134 pRangeName->UpdateTranspose( aSource, aDest );
1137 maTabs[
i]->UpdateTranspose( aSource, aDest, pUndoDoc );
1139 nClipTab = (nClipTab+1) % (
MAXTAB+1);
1150 pRangeName->UpdateGrow( rArea, nGrowX, nGrowY );
1158 double nStepValue,
double nMaxValue)
1164 for (
const auto& rTab : rMark)
1170 maTabs[rTab]->Fill(nCol1, nRow1, nCol2, nRow2,
1171 nFillCount, eFillDir, eFillCmd, eFillDateCmd,
1182 return maTabs[nTab]->GetAutoFillPreview( rSource, nEndX, nEndY );
1188 sal_uInt16 nFormatNo,
const ScMarkData& rMark )
1193 for (
const auto& rTab : rMark)
1198 maTabs[rTab]->AutoFormat( nStartCol, nStartRow, nEndCol, nEndRow, nFormatNo );
1209 pTable->GetAutoFormatData(nStartCol, nStartRow, nEndCol, nEndRow, rData);
1217 bool bReplace = ( nCommand == SvxSearchCmd::REPLACE ||
1218 nCommand == SvxSearchCmd::REPLACE_ALL );
1228 else if ( bReplace )
1246 else if ( bReplace )
1267 else if ( bReplace )
1285 else if ( bReplace )
1310 OUString& rUndoStr,
ScDocument* pUndoDoc,
bool& bMatchedRangesWereClamped)
1313 bool bFound =
false;
1315 OSL_FAIL(
"table out of range");
1322 if ( nCommand == SvxSearchCmd::FIND_ALL ||
1323 nCommand == SvxSearchCmd::REPLACE_ALL )
1326 for (
const auto& rMarkedTab : rMark)
1328 if (rMarkedTab >= nMax)
1334 bFound |=
maTabs[rMarkedTab]->SearchAndReplace(
1335 rSearchItem, nCol, nRow, rMark, rMatchedRanges, rUndoStr, pUndoDoc, bMatchedRangesWereClamped);
1347 for (nTab = rTab; (nTab >= 0) && !bFound; nTab--)
1352 bFound =
maTabs[nTab]->SearchAndReplace(
1353 rSearchItem, nCol, nRow, rMark, rMatchedRanges, rUndoStr, pUndoDoc, bMatchedRangesWereClamped);
1363 rSearchItem, nCol, nRow );
1368 OString aPayload = OString::number(nTab);
1370 pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_SET_PART, aPayload);
1378 for (nTab = rTab; (nTab <
GetTableCount()) && !bFound; nTab++)
1383 bFound =
maTabs[nTab]->SearchAndReplace(
1384 rSearchItem, nCol, nRow, rMark, rMatchedRanges, rUndoStr, pUndoDoc, bMatchedRangesWereClamped);
1394 rSearchItem, nCol, nRow );
1399 OString aPayload = OString::number(nTab);
1401 pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_SET_PART, aPayload);
1418 return pTable->UpdateOutlineCol(nStartCol, nEndCol, bShow);
1420 OSL_FAIL(
"missing tab");
1427 return pTable->UpdateOutlineRow(nStartRow, nEndRow, bShow);
1429 OSL_FAIL(
"missing tab");
1434 SCTAB nTab,
const ScSortParam& rSortParam,
bool bKeepQuery,
bool bUpdateRefs,
1441 pTable->Sort(rSortParam, bKeepQuery, bUpdateRefs, pProgress, pUndo);
1461 pTable->PrepareQuery(rQueryParam);
1464 OSL_FAIL(
"missing tab");
1471 return pTable->Query(rQueryParam, bKeepSub);
1473 OSL_FAIL(
"missing tab");
1480 return pTable->GetUpperCellString( nCol, nRow );
1490 OSL_FAIL(
"missing tab");
1497 bool bHasAutoFilter = (pDBData !=
nullptr);
1509 nRow = aParam.
nRow1;
1511 for ( nCol=aParam.
nCol1; nCol<=aParam.
nCol2 && bHasAutoFilter; nCol++ )
1516 bHasAutoFilter =
false;
1520 bHasAutoFilter =
false;
1523 return bHasAutoFilter;
1530 return pTable && pTable->
HasColHeader(nStartCol, nStartRow, nEndCol, nEndRow);
1537 return pTable && pTable->
HasRowHeader(nStartCol, nStartRow, nEndCol, nEndRow);
1572 pDBData->
GetArea( nAreaTab, nStartCol, nStartRow, nEndCol, nEndRow );
1581 bool bFilter =
true;
1595 maTabs[nTab]->GetFilteredFilterEntries( nCol, nStartRow, nEndRow, aParam, rFilterEntries, bFilter );
1599 maTabs[nTab]->GetFilterEntries( nCol, nStartRow, nEndRow, rFilterEntries );
1614 pTable->GetFilterEntries(nCol, nStartRow, nEndRow, rFilterEntries,
true);
1615 sortAndRemoveDuplicates(rFilterEntries.
maStrData, bCaseSens);
1624 std::vector<ScTypedStrData>& rStrings,
bool bValidation )
1637 if (
pData->GetListType() == css::sheet::TableValidationVisibility::SORTEDASCENDING)
1638 sortAndRemoveDuplicates(rStrings,
true);
1648 std::set<ScTypedStrData> aStrings;
1651 rStrings.insert(rStrings.end(), aStrings.begin(), aStrings.end());
1652 sortAndRemoveDuplicates(rStrings,
true);
1673 for (
const auto& rxDB : rDBs)
1686 for (
size_t i = 0, nPairs = pList->size();
i < nPairs; ++
i )
1691 for (
bool bHas = aIter.
first(); bHas; bHas = aIter.
next())
1715 OSL_FAIL(
"table out of range");
1718 OSL_FAIL(
"GetEmbeddedRect without a table");
1757 bool bAdded =
false;
1759 while (rTwips < nStopTwips && nRow <= nEndRow && !bStop)
1761 SCROW nHeightEndRow;
1762 sal_uInt16 nHeight = pTable->
GetRowHeight( nRow,
nullptr, &nHeightEndRow, bHiddenAsZero );
1763 if (nHeightEndRow > nEndRow)
1764 nHeightEndRow = nEndRow;
1766 nRow = nHeightEndRow + 1;
1769 SCROW nRows = nHeightEndRow - nRow + 1;
1770 sal_Int64 nAdd =
static_cast<sal_Int64
>(nHeight) * nRows;
1771 if (nAdd + rTwips >= nStopTwips)
1773 sal_Int64 nDiff = nAdd + rTwips - nStopTwips;
1774 nRows -=
static_cast<SCROW>(nDiff / nHeight);
1775 nAdd =
static_cast<sal_Int64
>(nHeight) * nRows;
1777 if (nAdd + rTwips >= nStopTwips)
1801 pTable =
maTabs[nTab].get();
1803 OSL_FAIL(
"table out of range");
1806 OSL_FAIL(
"GetRange without a table");
1820 nTwips = aPosRect.
Left();
1827 if (nSize+nAdd <= nTwips+1 && nX1<
MaxCol())
1841 nTwips = aPosRect.
Right();
1845 if (nSize+nAdd < nTwips && nX2<
MaxCol())
1856 nTwips = aPosRect.
Top();
1866 nTwips = aPosRect.
Bottom();
1872 return ScRange( nX1,nY1,nTab, nX2,nY2,nTab );
1908 return pTable->IsProtected();
1910 OSL_FAIL(
"Wrong table number");
1917 return pTable->GetProtection();
1925 pTable->SetProtection(pProtect);
1933 maTabs[nTabDest]->SetProtection(
maTabs[nTabSrc]->GetProtection() );
1990 OSL_FAIL(
"GetMMRect: wrong table");
1997 for (
i=0;
i<nStartCol;
i++)
2004 for (
i=nStartCol;
i<=nEndCol;
i++)
2029 OUStringBuffer aTotal;
2033 for (nRow=nStartRow; nRow<=nEndRow; nRow++)
2034 for (nCol=nStartCol; nCol<=nEndCol; nCol++)
2037 if (!aCellStr.isEmpty())
2039 if (!aTotal.isEmpty())
2041 aTotal.append(aCellStr);
2043 if (nCol != nStartCol || nRow != nStartRow)
2047 SetString(nStartCol,nStartRow,nTab,aTotal.makeStringAndClear());
2055 for (nRow=nStartRow; nRow<=nEndRow; nRow++)
2056 for (nCol=nStartCol; nCol<=nEndCol; nCol++)
2058 if (nCol != nStartCol || nRow != nStartRow)
2074 if( nStartCol < nEndCol )
2075 DeleteAreaTab( nStartCol + 1, nStartRow, nEndCol, nStartRow, nTab, nDelFlag );
2076 if( nStartRow < nEndRow )
2077 DeleteAreaTab( nStartCol, nStartRow + 1, nEndCol, nEndRow, nTab, nDelFlag );
2093 ApplyAttr( nCol, nRow, nTab, *pDefAttr );
2100 maTabs[nTab]->ExtendPrintArea(pDev, nStartCol, nStartRow, rEndCol, nEndRow);
2106 return pTable->GetPatternCount( nCol );
2114 return pTable->GetPatternCount(nCol, nRow1, nRow2);
2121 pTable->ReservePatternCount(nCol, nReserve);
2136 return maTabs[nTab]->ClampToAllocatedColumns(nCol);
2141 return maTabs[nTab]->GetAllocatedColumnsCount();
bool ValidTab(SCTAB nTab)
const SCTAB SC_TAB_APPEND
size_t SCSIZE
size_t typedef to be able to find places where code was changed from USHORT to size_t and is used to ...
void PutInOrder(T &nStart, T &nEnd)
Walk through all cells in an area.
ScFormulaCell * getFormulaCell()
OUString getString() const
All current charts in the calc will be locked in constructor and unlocked in destructor.
Stores global named database ranges.
bool HasAutoFilter() const
void GetFilterSelCount(SCSIZE &nSelected, SCSIZE &nTotal)
void GetArea(SCTAB &rTab, SCCOL &rCol1, SCROW &rRow1, SCCOL &rCol2, SCROW &rRow2) const
const OUString & GetUpperName() const
SC_DLLPUBLIC void GetQueryParam(ScQueryParam &rQueryParam) const
void ExtendDataArea(const ScDocument &rDoc)
ScDocument * GetDocument()
SC_DLLPUBLIC bool InsertTab(SCTAB nPos, const OUString &rName, bool bExternalDocument=false, bool bUndoDeleteTab=false)
SC_DLLPUBLIC bool IsScenario(SCTAB nTab) const
SC_DLLPUBLIC SCCOL GetAllocatedColumnsCount(SCTAB nTab) const
SC_DLLPUBLIC bool RemoveFlagsTab(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, SCTAB nTab, ScMF nFlags)
SC_DLLPUBLIC sal_uInt16 GetRowHeight(SCROW nRow, SCTAB nTab, bool bHiddenAsZero=true) const
void UpdateGrow(const ScRange &rArea, SCCOL nGrowX, SCROW nGrowY)
bool IsAddressInRangeName(RangeNameScope eScope, const ScAddress &rAddress)
SC_DLLPUBLIC void GetRangeNameMap(std::map< OUString, ScRangeName * > &rRangeName)
bool UpdateOutlineCol(SCCOL nStartCol, SCCOL nEndCol, SCTAB nTab, bool bShow)
Adapt Outline.
void GetAutoFormatData(SCTAB nTab, SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, ScAutoFormatData &rData)
SC_DLLPUBLIC ScRange GetRange(SCTAB nTab, const tools::Rectangle &rMMRect, bool bHiddenAsZero=true) const
bool RefreshAutoFilter(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, SCTAB nTab)
tools::Rectangle GetEmbeddedRect() const
SC_DLLPUBLIC bool LinkExternalTab(SCTAB &nTab, const OUString &aDocTab, const OUString &aFileName, const OUString &aTabName)
SC_DLLPUBLIC sal_uInt16 GetColWidth(SCCOL nCol, SCTAB nTab, bool bHiddenAsZero=true) const
void SC_DLLPUBLIC GetSortParam(ScSortParam &rParam, SCTAB nTab)
SC_DLLPUBLIC void SetAllRangeNames(const std::map< OUString, ScRangeName > &rRangeMap)
SC_DLLPUBLIC OUString GetLinkTab(SCTAB nTab) const
SC_DLLPUBLIC const ScTableProtection * GetTabProtection(SCTAB nTab) const
void UpdateRefAreaLinks(UpdateRefMode eUpdateRefMode, const ScRange &r, SCCOL nDx, SCROW nDy, SCTAB nDz)
SC_DLLPUBLIC void CopyUpdated(ScDocument *pPosDoc, ScDocument *pDestDoc)
From this document this method copies the cells of positions at which there are also cells in pPosDoc...
bool SetOutlineTable(SCTAB nTab, const ScOutlineTable *pNewOutline)
SC_DLLPUBLIC ScRangeName * GetRangeName() const
SC_DLLPUBLIC sal_uLong TransferTab(ScDocument &rSrcDoc, SCTAB nSrcPos, SCTAB nDestPos, bool bInsertNew=true, bool bResultsOnly=false)
SC_DLLPUBLIC ScTable * FetchTable(SCTAB nTab)
ScFormulaParserPool & GetFormulaParserPool() const
Returns the pool containing external formula parsers.
SC_DLLPUBLIC bool IsDocProtected() const
void SetRangeName(SCTAB nTab, std::unique_ptr< ScRangeName > pNew)
std::unique_ptr< ScUnoListenerCalls > pUnoListenerCalls
SC_DLLPUBLIC void Fill(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, ScProgress *pProgress, const ScMarkData &rMark, sal_uInt64 nFillCount, FillDir eFillDir=FILL_TO_BOTTOM, FillCmd eFillCmd=FILL_LINEAR, FillDateCmd eFillDateCmd=FILL_DAY, double nStepValue=1.0, double nMaxValue=1E307)
ScClipParam & GetClipParam()
std::unique_ptr< ScClipOptions > mpClipOptions
SC_DLLPUBLIC Color GetTabBgColor(SCTAB nTab) const
void PrepareQuery(SCTAB nTab, ScQueryParam &rQueryParam)
SC_DLLPUBLIC bool GetTable(const OUString &rName, SCTAB &rTab) const
std::unique_ptr< ScDocOptions > pDocOptions
SC_DLLPUBLIC bool IsTabProtected(SCTAB nTab) const
bool IsIdleEnabled() const
LanguageType eCtlLanguage
ScRangePairList * GetRowNameRanges()
void MarkScenario(SCTAB nSrcTab, SCTAB nDestTab, ScMarkData &rDestMark, bool bResetMark=true, ScScenarioFlags nNeededBits=ScScenarioFlags::NONE) const
void RemoveSubTotals(SCTAB nTab, ScSubTotalParam &rParam)
SC_DLLPUBLIC SCCOL MaxCol() const
ScDPObject * GetDPAtBlock(const ScRange &rBlock) const
std::unique_ptr< ScDPCollection > pDPCollection
SC_DLLPUBLIC void SetScenarioData(SCTAB nTab, const OUString &rComment, const Color &rColor, ScScenarioFlags nFlags)
SC_DLLPUBLIC const ScValidationData * GetValidationEntry(sal_uInt32 nIndex) const
const ScDBData * GetDBAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab, ScDBDataPortion ePortion) const
const ScSheetEvents * GetSheetEvents(SCTAB nTab) const
std::unique_ptr< ScFormulaParserPool > mxFormulaParserPool
SC_DLLPUBLIC SCROW GetMaxRowCount() const
SC_DLLPUBLIC void DoMergeContents(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, SCTAB nTab)
formula::FormulaGrammar::Grammar eGrammar
OUString GetLinkOpt(SCTAB nTab) const
rtl::Reference< ScPoolHelper > mxPoolHelper
bool InsertNewRangeName(const OUString &rName, const ScAddress &rPos, const OUString &rExpr)
Insert a new named expression to the global scope.
void GetSearchAndReplaceStart(const SvxSearchItem &rSearchItem, SCCOL &rCol, SCROW &rRow)
void SetCalcNotification(SCTAB nTab)
SC_DLLPUBLIC formula::FormulaGrammar::AddressConvention GetAddressConvention() 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 bool HasPivotTable() const
bool HasLink(std::u16string_view rDoc, std::u16string_view rFilter, std::u16string_view rOptions) const
void AddUnoRefChange(sal_Int64 nId, const ScRangeList &rOldRanges)
SC_DLLPUBLIC void DoMerge(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, SCTAB nTab, bool bDeleteCaptions=true)
void UpdateReference(sc::RefUpdateContext &rCxt, ScDocument *pUndoDoc=nullptr, bool bIncludeDraw=true, bool bUpdateNoteCaptionPos=true)
bool DoSubTotals(SCTAB nTab, ScSubTotalParam &rParam)
SC_DLLPUBLIC const ScDBData * GetDBAtArea(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2) const
SfxBindings * GetViewBindings()
std::unique_ptr< SfxBroadcaster > pUnoBroadcaster
SC_DLLPUBLIC void SetDocOptions(const ScDocOptions &rOpt)
bool HasScenarioRange(SCTAB nTab, const ScRange &rRange) const
SC_DLLPUBLIC bool IsNegativePage(SCTAB nTab) const
void RepaintRange(const ScRange &rRange)
std::unique_ptr< ScValidationDataList > pValidationList
void CopyScenario(SCTAB nSrcTab, SCTAB nDestTab, bool bNewScenario=false)
bool IsDocEditable() const
ScRangePairListRef xRowNameRanges
SC_DLLPUBLIC ScExternalRefManager * GetExternalRefManager() const
std::unique_ptr< ScUnoRefList > EndUnoRefUndo()
SC_DLLPUBLIC void GetScenarioData(SCTAB nTab, OUString &rComment, Color &rColor, ScScenarioFlags &rFlags) const
SC_DLLPUBLIC void GetAllTabRangeNames(ScRangeName::TabNameCopyMap &rRangeNames) const
Get all range names that are local to each table.
void RemoveMerge(SCCOL nCol, SCROW nRow, SCTAB nTab)
SC_DLLPUBLIC void GetFilterEntriesArea(SCCOL nCol, SCROW nStartRow, SCROW nEndRow, SCTAB nTab, bool bCaseSens, ScFilterEntries &rFilterEntries)
Entries for Filter dialog.
void CopyTabProtection(SCTAB nTabSrc, SCTAB nTabDest)
void ReservePatternCount(SCTAB nTab, SCCOL nCol, SCSIZE nReserve)
SC_DLLPUBLIC const ScViewOptions & GetViewOptions() const
SC_DLLPUBLIC void DoEmptyBlock(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, SCTAB nTab)
void AddUnoObject(SfxListener &rObject)
void ResetCalcNotifications()
void SetChartListenerCollection(std::unique_ptr< ScChartListenerCollection >, bool bSetChartRangeLists)
std::unique_ptr< ScDetOpList > pDetOpList
SC_DLLPUBLIC bool CreateQueryParam(const ScRange &rRange, ScQueryParam &rQueryParam)
OUString GetUpperCellString(SCCOL nCol, SCROW nRow, SCTAB nTab)
void SetLanguage(LanguageType eLatin, LanguageType eCjk, LanguageType eCtl)
std::unique_ptr< ScExtDocOptions > pExtDocOptions
SC_DLLPUBLIC bool SetString(SCCOL nCol, SCROW nRow, SCTAB nTab, const OUString &rString, const ScSetStringParam *pParam=nullptr)
ScRangePairList * GetColNameRanges()
void GetFilterEntries(SCCOL nCol, SCROW nRow, SCTAB nTab, ScFilterEntries &rFilterEntries)
Get a list of unique strings to use in filtering criteria.
SC_DLLPUBLIC void SetGrammar(formula::FormulaGrammar::Grammar eGram)
bool HasAnyCalcNotification() const
SC_DLLPUBLIC bool HasColHeader(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, SCTAB nTab)
std::unique_ptr< ScExternalRefManager > pExternalRefMgr
void SetAllFormulasDirty(const sc::SetFormulaDirtyContext &rCxt)
bool UpdateOutlineRow(SCROW nStartRow, SCROW nEndRow, SCTAB nTab, bool bShow)
SC_DLLPUBLIC void SetViewOptions(const ScViewOptions &rOpt)
void GetDataEntries(SCCOL nCol, SCROW nRow, SCTAB nTab, std::vector< ScTypedStrData > &rStrings, bool bValidation=false)
Entries for selection list listbox (no numbers/formulas)
SC_DLLPUBLIC const ScRangeList * GetScenarioRanges(SCTAB nTab) const
void DoAutoOutline(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, SCTAB nTab)
void SC_DLLPUBLIC SetSortParam(const ScSortParam &rParam, SCTAB nTab)
SC_DLLPUBLIC formula::FormulaGrammar::Grammar GetGrammar() const
void Reorder(const sc::ReorderParam &rParam)
void MarkUsedExternalReferences()
std::unique_ptr< ScUnoRefList > pUnoRefUndoList
SC_DLLPUBLIC const ScRangeData * GetRangeAtBlock(const ScRange &rBlock, OUString &rName, bool *pSheetLocal=nullptr) const
void GetEmbedded(ScRange &rRange) const
bool HasCalcNotification(SCTAB nTab) const
SCSIZE GetPatternCount(SCTAB nTab, SCCOL nCol) const
SC_DLLPUBLIC ScDPObject * GetDPAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab) const
void EnableIdle(bool bDo)
void StopTemporaryChartLock()
SC_DLLPUBLIC void ApplyAttr(SCCOL nCol, SCROW nRow, SCTAB nTab, const SfxPoolItem &rAttr)
SC_DLLPUBLIC ScDocProtection * GetDocProtection() const
SC_DLLPUBLIC void GetLanguage(LanguageType &rLatin, LanguageType &rCjk, LanguageType &rCtl) const
SC_DLLPUBLIC ScOutlineTable * GetOutlineTable(SCTAB nTab, bool bCreate=false)
SCSIZE Query(SCTAB nTab, const ScQueryParam &rQueryParam, bool bKeepSub)
bool TestRemoveSubTotals(SCTAB nTab, const ScSubTotalParam &rParam)
SC_DLLPUBLIC SCCOL ClampToAllocatedColumns(SCTAB nTab, SCCOL nCol) const
void SetSheetEvents(SCTAB nTab, std::unique_ptr< ScSheetEvents > pNew)
void SetClipOptions(std::unique_ptr< ScClipOptions > pClipOptions)
bool HasSheetEventScript(SCTAB nTab, ScSheetEventId nEvent, bool bWithVbaEvents=false) const
LanguageType eCjkLanguage
sal_uLong GetLinkRefreshDelay(SCTAB nTab) const
void SetLink(SCTAB nTab, ScLinkMode nMode, const OUString &rDoc, const OUString &rFilter, const OUString &rOptions, const OUString &rTabName, sal_uLong nRefreshDelay)
SC_DLLPUBLIC void SetExtDocOptions(std::unique_ptr< ScExtDocOptions > pNewOptions)
void AddUnoListenerCall(const css::uno::Reference< css::util::XModifyListener > &rListener, const css::lang::EventObject &rEvent)
bool HasAnySheetEventScript(ScSheetEventId nEvent, bool bWithVbaEvents=false) const
std::unique_ptr< ScDBCollection > pDBCollection
SC_DLLPUBLIC void SetActiveScenario(SCTAB nTab, bool bActive)
SC_DLLPUBLIC void SetDocProtection(const ScDocProtection *pProtect)
SC_DLLPUBLIC bool HasRowHeader(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, SCTAB nTab)
std::map< SCTAB, ScSortParam > mSheetSortParams
std::unique_ptr< ScTemporaryChartLock > apTemporaryChartLock
OUString GetAutoFillPreview(const ScRange &rSource, SCCOL nEndX, SCROW nEndY)
bool TestCopyScenario(SCTAB nSrcTab, SCTAB nDestTab) const
bool SearchAndReplace(const SvxSearchItem &rSearchItem, SCCOL &rCol, SCROW &rRow, SCTAB &rTab, const ScMarkData &rMark, ScRangeList &rMatchedRanges, OUString &rUndoStr, ScDocument *pUndoDoc, bool &bMatchedRangesWereClamped)
void AutoFormat(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, sal_uInt16 nFormatNo, const ScMarkData &rMark)
static bool IsEmptyCellSearch(const SvxSearchItem &rSearchItem)
SC_DLLPUBLIC void DeleteAreaTab(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, SCTAB nTab, InsertDeleteFlags nDelFlag)
SC_DLLPUBLIC OUString GetString(SCCOL nCol, SCROW nRow, SCTAB nTab, const ScInterpreterContext *pContext=nullptr) const
void RemoveUnoObject(SfxListener &rObject)
void UpdateChartRef(UpdateRefMode eUpdateRefMode, SCCOL nCol1, SCROW nRow1, SCTAB nTab1, SCCOL nCol2, SCROW nRow2, SCTAB nTab2, SCCOL nDx, SCROW nDy, SCTAB nDz)
SC_DLLPUBLIC OUString GetLinkDoc(SCTAB nTab) const
void UpdateDrawLanguages()
SC_DLLPUBLIC void SetTabProtection(SCTAB nTab, const ScTableProtection *pProtect)
bool IsLinked(SCTAB nTab) const
void RefreshDirtyTableColumnNames()
void SetDBCollection(std::unique_ptr< ScDBCollection > pNewDBCollection, bool bRemoveAutoFilter=false)
bool IsInExternalReferenceMarking() const
std::unique_ptr< ScDocProtection > pDocProtection
SC_DLLPUBLIC bool HasTable(SCTAB nTab) const
css::uno::Reference< css::script::vba::XVBAEventProcessor > mxVbaEvents
bool HasSubTotalCells(const ScRange &rRange)
SC_DLLPUBLIC sfx2::LinkManager * GetLinkManager()
void GetFilterSelCount(SCCOL nCol, SCROW nRow, SCTAB nTab, SCSIZE &nSelected, SCSIZE &nTotal)
std::unique_ptr< ScViewOptions > pViewOptions
SC_DLLPUBLIC void SetTabBgColor(SCTAB nTab, const Color &rColor)
OUString GetLinkFlt(SCTAB nTab) const
void ExtendPrintArea(OutputDevice *pDev, SCTAB nTab, SCCOL nStartCol, SCROW nStartRow, SCCOL &rEndCol, SCROW nEndRow) const
Find the maximum column position that contains printable data for the specified row range.
SC_DLLPUBLIC void SetScenario(SCTAB nTab, bool bFlag)
bool IsClipboardSource() const
bool ValidRange(const ScRange &rRange) const
bool mbChangeReadOnlyEnabled
SC_DLLPUBLIC const SfxPoolItem * GetAttr(SCCOL nCol, SCROW nRow, SCTAB nTab, sal_uInt16 nWhich) const
bool HasAutoFilter(SCCOL nCol, SCROW nRow, SCTAB nTab)
ScRangePairListRef xColNameRanges
void GetScenarioFlags(SCTAB nTab, ScScenarioFlags &rFlags) const
SC_DLLPUBLIC void UpdateTranspose(const ScAddress &rDestPos, ScDocument *pClipDoc, const ScMarkData &rMark, ScDocument *pUndoDoc)
SC_DLLPUBLIC SCCOL GetMaxColCount() const
SC_DLLPUBLIC ScLkUpdMode GetLinkMode() const
SC_DLLPUBLIC const ScDocOptions & GetDocOptions() const
SC_DLLPUBLIC ScDPCollection * GetDPCollection()
std::unique_ptr< ScRangeName > pRangeName
void Sort(SCTAB nTab, const ScSortParam &rSortParam, bool bKeepQuery, bool bUpdateRefs, ScProgress *pProgress, sc::ReorderParam *pUndo)
Sort a range of data.
SC_DLLPUBLIC bool IsActiveScenario(SCTAB nTab) const
SC_DLLPUBLIC bool IsDefaultTabBgColor(SCTAB nTab) const
SC_DLLPUBLIC tools::Rectangle GetMMRect(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, SCTAB nTab, bool bHiddenAsZero=true) const
void BroadcastUno(const SfxHint &rHint)
void GetFormulaEntries(ScTypedCaseStrSet &rStrings)
Entries for Formula auto input.
SC_DLLPUBLIC SCTAB GetTableCount() const
std::unique_ptr< ScChartListenerCollection > pChartListenerCollection
void SetEmbedded(const ScRange &rRange)
static void MirrorRectRTL(tools::Rectangle &rRect)
todo: It should be possible to have MarkArrays for each table, in order to enable "search all" across...
const ScRange & GetMarkArea() const
bool GetTableSelect(SCTAB nTab) const
void SetAreaTab(SCTAB nTab)
SCCOL GetColMerge() const
SCROW GetRowMerge() const
static ScDocument * GetClipDoc()
SC_DLLPUBLIC ScRangeData * findByIndex(sal_uInt16 i) const
::std::map< SCTAB, const ScRangeName * > TabNameCopyMap
Map that stores non-managed pointers to ScRangeName instances.
SC_DLLPUBLIC bool insert(ScRangeData *p, bool bReuseFreeIndex=true)
Insert object into set.
SC_DLLPUBLIC const ScRangeData * findByRange(const ScRange &rRange) const
const ScRange & GetRange(sal_uInt16 n) const
bool Contains(const ScAddress &) const
is Address& fully in Range?
static ScRefUpdateRes Update(const ScDocument *pDoc, UpdateRefMode eUpdateRefMode, SCCOL nCol1, SCROW nRow1, SCTAB nTab1, SCCOL nCol2, SCROW nRow2, SCTAB nTab2, SCCOL nDx, SCROW nDy, SCTAB nDz, SCCOL &theCol1, SCROW &theRow1, SCTAB &theTab1, SCCOL &theCol2, SCROW &theRow2, SCTAB &theTab2)
const OUString * GetScript(ScSheetEventId nEvent) const
static sal_Int32 GetVbaDocumentEventId(ScSheetEventId nEvent)
static sal_Int32 GetVbaSheetEventId(ScSheetEventId nEvent)
sheet protection state container
bool IsActiveScenario() const
bool HasRowHeader(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow) const
bool GetCalcNotification() const
bool HasScenarioRange(const ScRange &rRange) const
sal_uInt16 GetColWidth(SCCOL nCol, bool bHiddenAsZero=true) const
sal_uInt16 GetRowHeight(SCROW nRow, SCROW *pStartRow, SCROW *pEndRow, bool bHiddenAsZero=true) const
bool SetOutlineTable(const ScOutlineTable *pNewOutline)
void SetMergedCells(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2)
bool HasColHeader(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow) const
bool DoSubTotals(ScSubTotalParam &rParam)
void Reorder(const sc::ReorderParam &rParam)
bool TestRemoveSubTotals(const ScSubTotalParam &rParam)
ScUnoListenerCalls stores notifications to XModifyListener that can't be processed during BroadcastUn...
List of RefUpdate changes made to UNO objects during ScUpdateRefHint broadcast.
void Invalidate(sal_uInt16 nId)
void SetPoolDefaultItem(const SfxPoolItem &)
void StartListening(SfxBroadcaster &rBroadcaster, DuplicateHandling eDuplicateHanding=DuplicateHandling::Unexpected)
void EndListening(SfxBroadcaster &rBroadcaster, bool bRemoveAllDuplicates=false)
static SAL_WARN_UNUSED_RESULT SfxViewShell * Current()
SvxSearchCmd GetCommand() const
const i18nutil::SearchOptions2 & GetSearchOptions() const
bool GetRowDirection() const
SvxSearchCellType GetCellType() const
Temporarily switch on/off auto calculation mode.
void InsertFileLink(sfx2::SvBaseLink &, SvBaseLinkObjectType nFileType, std::u16string_view rFileNm, const OUString *pFilterNm=nullptr, const OUString *pRange=nullptr)
constexpr ::Color COL_AUTO(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
ScDBDataPortion
Enum used to indicate which portion of the DBArea is to be considered.
static bool lcl_AddTwipsWhile(tools::Long &rTwips, tools::Long nStopTwips, SCROW &rPosY, SCROW nEndRow, const ScTable *pTable, bool bHiddenAsZero)
Similar to ScViewData::AddPixelsWhile(), but add height twips and only while result is less than nSto...
@ NOTE
Strings (and string results if InsertDeleteFlags::FORMULA is not set).
@ NOCAPTIONS
Sparklines in a cell.
constexpr OUStringLiteral STR_GLOBAL_RANGE_NAME
std::unique_ptr< sal_Int32[]> pData
constexpr Point convert(const Point &rPoint, o3tl::Length eFrom, o3tl::Length eTo)
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
constexpr TypedWhichId< ScMergeFlagAttr > ATTR_MERGE_FLAG(145)
constexpr TypedWhichId< ScMergeAttr > ATTR_MERGE(144)
constexpr TypedWhichId< SvxLanguageItem > ATTR_CTL_FONT_LANGUAGE(120)
constexpr TypedWhichId< SvxLanguageItem > ATTR_FONT_LANGUAGE(110)
constexpr TypedWhichId< SfxUInt32Item > ATTR_VALIDDATA(153)
constexpr TypedWhichId< SvxLanguageItem > ATTR_CJK_FONT_LANGUAGE(115)
This struct stores general clipboard parameters associated with a ScDocument instance created in clip...
std::vector< ScTypedStrData > maStrData
A pretty assertion that checks that the relevant bits in the @nFlags are not set on the document at e...
Each instance of this struct represents a single filtering criteria.
SC_DLLPUBLIC const ScQueryEntry & GetEntry(SCSIZE n) const
SC_DLLPUBLIC SCSIZE GetEntryCount() 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.
ScRange maSortRange
This sort range already takes into account the presence or absence of header row / column i....
std::set< ScTypedStrData, ScTypedStrData::LessCaseSensitive > ScTypedCaseStrSet