37#include <osl/diagnose.h>
39#include <com/sun/star/container/XNameContainer.hpp>
40#include <com/sun/star/script/ModuleType.hpp>
41#include <com/sun/star/script/XLibraryContainer.hpp>
42#include <com/sun/star/script/vba/XVBAModuleInfo.hpp>
68#include <stlsheet.hxx>
80#include <compiler.hxx>
86#include <progress.hxx>
90#include <tokenarray.hxx>
109#include <config_features.h>
133 for (
SCTAB nTab=0; nTab<nTabCount; nTab++)
173 bool bChanged = rDoc.
SetOptimalHeight(aCxt, nStartRow, nEndRow, nTab, bApi);
183 if (pTabViewShell && pTabViewShell->
GetDocId() == pSomeViewForThisDoc->
GetDocId())
186 pPosHelper->invalidateByIndex(nStartRow);
194 if ( bPaint && bChanged )
202 pSomeViewForThisDoc,
false ,
true ,
true ,
203 false ,
false ,
false , nTab);
224 std::unique_ptr<SdrUndoGroup> pUndo;
234 std::make_unique<ScUndoDetective>( &
rDocShell, std::move(pUndo), &aOperation ) );
239 pBindings->
Invalidate( SID_DETECTIVE_REFRESH );
263 std::unique_ptr<SdrUndoGroup> pUndo;
273 std::make_unique<ScUndoDetective>( &
rDocShell, std::move(pUndo), &aOperation ) );
278 pBindings->
Invalidate( SID_DETECTIVE_REFRESH );
300 std::unique_ptr<SdrUndoGroup> pUndo;
310 std::make_unique<ScUndoDetective>( &
rDocShell, std::move(pUndo), &aOperation ) );
315 pBindings->
Invalidate( SID_DETECTIVE_REFRESH );
339 std::unique_ptr<SdrUndoGroup> pUndo;
349 std::make_unique<ScUndoDetective>( &
rDocShell, std::move(pUndo), &aOperation ) );
354 pBindings->
Invalidate( SID_DETECTIVE_REFRESH );
376 std::unique_ptr<SdrUndoGroup> pUndo;
386 std::make_unique<ScUndoDetective>( &
rDocShell, std::move(pUndo), &aOperation ) );
391 pBindings->
Invalidate( SID_DETECTIVE_REFRESH );
412 std::unique_ptr<SdrUndoGroup> pUndo;
420 pUndo->SetComment(
ScResId( STR_UNDO_DETINVALID ) );
427 VclMessageType::Info, VclButtonsType::Ok,
428 ScResId(STR_DETINVALID_OVERFLOW)));
450 std::unique_ptr<SdrUndoGroup> pUndo;
456 std::unique_ptr<ScDetOpList> pUndoList;
457 if (bUndo && pOldList)
465 std::make_unique<ScUndoDetective>( &
rDocShell, std::move(pUndo),
nullptr, std::move(pUndoList) ) );
470 pBindings->
Invalidate( SID_DETECTIVE_REFRESH );
482 if ( pList && pList->
Count() )
493 for (
SCTAB nTab=0; nTab<nTabCount; nTab++)
524 OSL_FAIL(
"wrong operation in DetectiveRefresh");
530 std::unique_ptr<SdrUndoGroup> pUndo = pModel->
GetCalcUndo();
533 pUndo->SetComment(
ScResId( STR_UNDO_DETREFRESH ) );
536 std::make_unique<ScUndoDraw>( std::move(pUndo), &
rDocShell ),
551 vector<ScTokenRef> aRefTokens;
552 if (rSrcRanges.
empty())
556 for (
size_t i = 0,
n = rSrcRanges.
size();
i <
n; ++
i)
570 rRefTokens.swap(aRefTokens);
590 OSL_FAIL(
"ScDocFunc::DeleteContents without markings");
614 ScRange aExtendedRange(aMarkRange);
621 sal_uInt16 nExtFlags = 0;
632 if (bRecord && bDrawUndo)
646 std::shared_ptr<ScSimpleUndo::DataSpansType> pDataSpans;
661 std::move(pUndoDoc), nFlags, pDataSpans, bMulti, bDrawUndo);
694 sal_uInt16 nExtFlags = 0;
706 if (bDrawUndo && bRecord)
713 std::shared_ptr<ScSimpleUndo::DataSpansType> pDataSpans;
728 nFlags, pDataSpans,
false, bDrawUndo);
770 pUndoDoc->InitUndo( rDoc, nStartTab, nStartTab );
771 for (
const auto& rTab : rMark)
773 if (rTab >= nTabCount)
776 if (rTab != nStartTab)
777 pUndoDoc->AddUndoTab( rTab, rTab );
780 ScRange aCopyRange = aMarkRange;
786 std::make_unique<ScUndoTransliterate>( &
rDocShell, aMultiMark, std::move(pUndoDoc),
nType ) );
828 aOldValue.
mnFormat = pItem->GetValue();
833 aOldValues.push_back(aOldValue);
842 std::make_unique<ScUndoEnterData>(&
rDocShell, rPos, aOldValues, rText,
nullptr));
860 if (
pData->IsDataValid(aCell, rPos))
877 aOldVal.
assign(rDoc, rPos);
885 aNewVal.
assign(rDoc, rPos);
907 SCROW nLastRow = rPos.
Row() + aVals.size() - 1;
908 if (nLastRow > rDoc.
MaxRow())
921 pUndoObj->SetNewValues(aVals);
946 aOldVal.
assign(rDoc, rPos);
956 aNewVal.
assign(rDoc, rPos);
983 aOldVal.
assign(rDoc, rPos);
991 aNewVal.
assign(rDoc, rPos);
1017 return SetEditCell(rPos, *pEditText, bInteraction);
1025 std::unique_ptr<ScFormulaCell> xCell(pCell);
1035 aOldVal.
assign(rDoc, rPos);
1055 aNewVal.
assign(rDoc, rPos);
1076 const size_t nLength = rCells.size();
1087 std::unique_ptr<sc::UndoSetCells> pUndoObj;
1102 for (
auto* pCell : rCells)
1106 pCell->SetDirtyVar();
1113 pUndoObj->SetNewValues(rCells);
1149 struct ScMyRememberItem
1154 ScMyRememberItem(
SfxItemSet _aItemSet, sal_Int32 nTempIndex) :
1155 nIndex(nTempIndex), aItemSet(
std::move(_aItemSet)) {}
1177 std::vector<std::unique_ptr<ScMyRememberItem>> aRememberItems;
1189 if ( !bLoseContent )
1191 aRememberItems.push_back(std::make_unique<ScMyRememberItem>(rEngine.
GetParaAttribs(
i),
i));
1202 for (
const auto& rxItem : aRememberItems)
1208 if ( bUpdateMode && !bLoseContent )
1213 OUString aText = rEngine.
GetText();
1214 if (aText.isEmpty())
1216 bool bNumFmtSet =
false;
1241 const ScAddress& rPos,
const OUString& rText,
bool bInterpret,
bool bEnglish,
bool bApi,
1251 ::std::optional<ScExternalRefManager::ApiGuard> pExtRefGuard;
1253 pExtRefGuard.emplace(rDoc);
1275 else if (!rText.isEmpty())
1282 bool bNumFmtSet =
false;
1307 if (
ScDrawView* pDrawView = pViewData->GetScDrawView())
1308 pDrawView->SyncForGrid( pNote->
GetCaption());
1332 pNote->SetText( rPos, aNewText );
1353 std::unique_ptr<ScPostIt> pOldNote = rDoc.
ReleaseNote( rPos );
1354 sal_uInt32 nNoteId = 0;
1357 nNoteId = pOldNote->GetId();
1359 pOldNote->GetOrCreateCaption( rPos );
1361 aOldData = pOldNote->GetNoteData();
1369 bool hadOldNote(pOldNote);
1377 if( pAuthor ) pNewNote->
SetAuthor( *pAuthor );
1378 if( pDate ) pNewNote->
SetDate( *pDate );
1399 &rDoc, rPos, pNewNote);
1413 std::unique_ptr<ScPostIt> pOldNote = rDoc.
ReleaseNote( rPos );
1414 SAL_WARN_IF(pOldNote,
"sc.ui",
"imported data has >1 notes on same cell? at pos " << rPos);
1430 bool bRecord =
true;
1437 bool bOnlyNotBecauseOfMatrix;
1439 && !bOnlyNotBecauseOfMatrix )
1460 pUndoDoc->InitUndo( rDoc, aMultiRange.
aStart.
Tab(), aMultiRange.
aEnd.
Tab() );
1464 std::make_unique<ScUndoSelectionAttr>(
1468 std::move(pUndoDoc), bMulti, &rPattern ) );
1472 sal_uInt16 nExtFlags = 0;
1473 if ( !bImportingXML )
1476 bool bChanged =
false;
1481 if ( !bImportingXML )
1499 bool bRecord =
true;
1506 bool bOnlyNotBecauseOfMatrix;
1508 && !bOnlyNotBecauseOfMatrix )
1516 rStyleName, SfxStyleFamily::Para ));
1534 pUndoDoc->InitUndo( rDoc, nStartTab, nStartTab );
1535 for (
const auto& rTab : rMark)
1537 if (rTab >= nTabCount)
1540 if (rTab != nStartTab)
1541 pUndoDoc->AddUndoTab( rTab, rTab );
1544 ScRange aCopyRange = aMultiRange;
1550 std::make_unique<ScUndoSelectionStyle>(
1551 &
rDocShell, rMark, aMultiRange, rStyleName, std::move(pUndoDoc) ) );
1587 aRange.aStart.SetCol(0);
1588 aRange.aEnd.SetCol(rDoc.
MaxCol());
1593 auto bIntersects = std::any_of(rMarkData.
begin(), rMarkData.
end(), [&pDPs, &aRange](
const SCTAB& rTab) {
1594 return pDPs->IntersectsTableByColumns(aRange.aStart.Col(), aRange.aEnd.Col(), aRange.aStart.Row(), rTab); });
1600 if (aRange.aStart.Row() < 0)
1604 if (aRange.aStart.Row() == 0)
1609 aTest.aStart.IncRow(-1);
1610 aTest.aEnd.SetRow(aTest.aStart.Row());
1611 for (
const auto& rTab : rMarkData)
1613 aTest.aStart.SetTab(rTab);
1614 aTest.aEnd.SetTab(rTab);
1622 aRange.aStart.SetRow(0);
1623 aRange.aEnd.SetRow(rDoc.
MaxRow());
1628 auto bIntersects = std::any_of(rMarkData.begin(), rMarkData.end(), [&pDPs, &aRange](
const SCTAB& rTab) {
1629 return pDPs->IntersectsTableByRows(aRange.aStart.Col(), aRange.aStart.Row(), aRange.aEnd.Row(), rTab); });
1635 if (aRange.aStart.Col() < 0)
1639 if (aRange.aStart.Col() == 0)
1644 aTest.aStart.IncCol(-1);
1645 aTest.aEnd.SetCol(aTest.aStart.Col());
1646 for (
const auto& rTab : rMarkData)
1648 aTest.aStart.SetTab(rTab);
1649 aTest.aEnd.SetTab(rTab);
1682 aRange.aStart.SetCol(0);
1683 aRange.aEnd.SetCol(rDoc.
MaxCol());
1688 auto bIntersects = std::any_of(rMarkData.
begin(), rMarkData.
end(), [&pDPs, &aRange](
const SCTAB& rTab) {
1689 return pDPs->IntersectsTableByColumns(aRange.aStart.Col(), aRange.aEnd.Col(), aRange.aStart.Row(), rTab); });
1695 for (
const auto& rTab : rMarkData)
1697 aTest.aStart.SetTab(rTab);
1698 aTest.aEnd.SetTab(rTab);
1706 aRange.aStart.SetRow(0);
1707 aRange.aEnd.SetRow(rDoc.
MaxRow());
1712 auto bIntersects = std::any_of(rMarkData.begin(), rMarkData.end(), [&pDPs, &aRange](
const SCTAB& rTab) {
1713 return pDPs->IntersectsTableByRows(aRange.aStart.Col(), aRange.aStart.Row(), aRange.aEnd.Row(), rTab); });
1719 for (
const auto& rTab : rMarkData)
1721 aTest.aStart.SetTab(rTab);
1722 aTest.aEnd.SetTab(rTab);
1737 bool bRecord,
bool bApi,
bool bPartOfPaste )
1748 SAL_WARN(
"sc.ui",
"ScDocFunc::InsertCells - no change-tracking of partial cell shift");
1752 ScRange aTargetRange( rRange );
1782 OSL_FAIL(
"invalid row in InsertCells");
1787 SCCOL nPaintStartCol = nStartCol;
1788 SCROW nPaintStartRow = nStartRow;
1789 SCCOL nPaintEndCol = nEndCol;
1790 SCROW nPaintEndRow = nEndRow;
1795 SCCOL nCursorCol = 0;
1796 SCROW nCursorRow = 0;
1817 if(
nCount == nEndTab+1 )
1827 for (
const auto& rTab : aMark)
1829 if (rTab >= nTabCount)
1840 SCCOL nMergeTestStartCol = nStartCol;
1841 SCROW nMergeTestStartRow = nStartRow;
1842 SCCOL nMergeTestEndCol = nEndCol;
1843 SCROW nMergeTestEndRow = nEndRow;
1845 ScRange aExtendMergeRange( aTargetRange );
1851 nMergeTestEndCol = aExtendMergeRange.
aEnd.
Col();
1852 nMergeTestEndRow = aExtendMergeRange.
aEnd.
Row();
1853 nPaintEndCol = nMergeTestEndCol;
1854 nPaintEndRow = nMergeTestEndRow;
1859 nMergeTestStartCol = 0;
1860 nMergeTestEndCol = rDoc.
MaxCol();
1864 nMergeTestStartRow = 0;
1865 nMergeTestEndRow = rDoc.
MaxRow();
1868 nMergeTestEndRow = rDoc.
MaxRow();
1870 nMergeTestEndCol = rDoc.
MaxCol();
1872 bool bNeedRefresh =
false;
1899 rDoc, nMergeTestStartCol, nMergeTestStartRow, nEditTestEndCol, nEditTestEndRow, aMark);
1910 if (!canInsertCellsByPivot(aTargetRange, aMark, eCmd, rDoc))
1920 std::unique_ptr<ScRefUndoData> pUndoData;
1924 pRefUndoDoc->InitUndo( rDoc, 0, nTabCount-1 );
1935 bool bInsertMerge =
false;
1936 std::vector<ScRange> qIncreaseRange;
1937 OUString aUndo =
ScResId( STR_UNDO_INSERTCELLS );
1945 std::unique_ptr<ScUndoRemoveMerge> pUndoRemoveMerge;
1947 for (
const SCTAB i : aMark)
1955 bNeedRefresh =
true;
1957 SCCOL nMergeStartCol = nMergeTestStartCol;
1958 SCROW nMergeStartRow = nMergeTestStartRow;
1959 SCCOL nMergeEndCol = nMergeTestEndCol;
1960 SCROW nMergeEndRow = nMergeTestEndRow;
1962 rDoc.
ExtendMerge( nMergeStartCol, nMergeStartRow, nMergeEndCol, nMergeEndRow,
i );
1963 rDoc.
ExtendOverlapped( nMergeStartCol, nMergeStartRow, nMergeEndCol, nMergeEndRow,
i );
1965 if(( eCmd ==
INS_CELLSDOWN && ( nMergeStartCol != nMergeTestStartCol || nMergeEndCol != nMergeTestEndCol )) ||
1966 (eCmd ==
INS_CELLSRIGHT && ( nMergeStartRow != nMergeTestStartRow || nMergeEndRow != nMergeTestEndRow )) )
1974 SCCOL nTestCol = -1;
1975 SCROW nTestRow1 = -1;
1976 SCROW nTestRow2 = -1;
1978 ScDocAttrIterator aTestIter( rDoc,
i, nMergeTestStartCol, nMergeTestStartRow, nMergeTestEndCol, nMergeTestEndRow );
1979 ScRange aExtendRange( nMergeTestStartCol, nMergeTestStartRow,
i, nMergeTestEndCol, nMergeTestEndRow,
i );
1981 while ( ( pPattern = aTestIter.
GetNext( nTestCol, nTestRow1, nTestRow2 ) ) !=
nullptr )
1988 ScRange aRange( nTestCol, nTestRow1,
i );
1992 if( nTestRow1 < nTestRow2 && nNewFlags ==
ScMF::Hor )
1994 for(
SCROW nTestRow = nTestRow1; nTestRow <= nTestRow2; nTestRow++ )
1996 ScRange aTestRange( nTestCol, nTestRow,
i );
2000 if( !aExtendRange.
Contains( aMergeRange ) )
2002 qIncreaseRange.push_back( aTestRange );
2003 bInsertMerge =
true;
2010 if( !aExtendRange.
Contains( aMergeRange ) )
2012 qIncreaseRange.push_back( aRange );
2014 bInsertMerge =
true;
2023 nStartRow = aExtendMergeRange.
aStart.
Row();
2024 nEndRow = aExtendMergeRange.
aEnd.
Row();
2027 nEndCol = nMergeTestEndCol;
2037 nStartCol = aExtendMergeRange.
aStart.
Col();
2038 nEndCol = aExtendMergeRange.
aEnd.
Col();
2041 nEndRow = nMergeTestEndRow;
2050 if( !qIncreaseRange.empty() )
2052 if (bRecord && !pUndoRemoveMerge)
2055 pUndoDoc->InitUndo( rDoc, *aMark.
begin(), *aMark.
rbegin());
2059 for(
const ScRange& aRange : qIncreaseRange )
2063 UnmergeCells( aRange, bRecord, pUndoRemoveMerge.get() );
2078 if (bRecord && pUndoRemoveMerge)
2086 bSuccess = rDoc.
InsertRow( nStartCol, 0, nEndCol,
MAXTAB, nStartRow,
static_cast<SCSIZE>(nEndRow-nStartRow+1), pRefUndoDoc.get(), &aFullMark );
2087 nPaintEndRow = rDoc.
MaxRow();
2091 bSuccess = rDoc.
InsertRow( 0, 0, rDoc.
MaxCol(),
MAXTAB, nStartRow,
static_cast<SCSIZE>(nEndRow-nStartRow+1), pRefUndoDoc.get(), &aFullMark );
2093 nPaintEndCol = rDoc.
MaxCol();
2094 nPaintEndRow = rDoc.
MaxRow();
2098 bSuccess = rDoc.
InsertCol( nStartRow, 0, nEndRow,
MAXTAB, nStartCol,
static_cast<SCSIZE>(nEndCol-nStartCol+1), pRefUndoDoc.get(), &aFullMark );
2099 nPaintEndCol = rDoc.
MaxCol();
2103 bSuccess = rDoc.
InsertCol( 0, 0, rDoc.
MaxRow(),
MAXTAB, nStartCol,
static_cast<SCSIZE>(nEndCol-nStartCol+1), pRefUndoDoc.get(), &aFullMark );
2105 nPaintEndRow = rDoc.
MaxRow();
2106 nPaintEndCol = rDoc.
MaxCol();
2110 OSL_FAIL(
"Wrong code at inserting");
2121 std::unique_ptr<SCTAB[]> pTabs(
new SCTAB[nSelCount]);
2122 std::unique_ptr<SCTAB[]> pScenarios(
new SCTAB[nSelCount]);
2124 for (
const auto& rTab : aMark)
2126 if (rTab >= nTabCount)
2133 pScenarios[nUndoPos] =
nCount;
2134 pTabs[nUndoPos] = rTab;
2144 &
rDocShell,
ScRange( nStartCol, nStartRow, nStartTab, nEndCol, nEndRow, nEndTab ),
2145 nUndoPos, std::move(pTabs), std::move(pScenarios), eCmd, std::move(pRefUndoDoc), std::move(pUndoData), bPartOfPaste ) );
2150 while( !qIncreaseRange.empty() )
2152 ScRange aRange = qIncreaseRange.back();
2176 qIncreaseRange.pop_back();
2182 for (
const SCTAB i : aMark)
2190 rDoc.
ExtendMerge( nMergeTestStartCol, nMergeTestStartRow, nMergeTestEndCol, nMergeTestEndRow,
i,
true );
2192 rDoc.
RefreshAutoFilter( nMergeTestStartCol, nMergeTestStartRow, nMergeTestEndCol, nMergeTestEndRow,
i );
2197 sal_uInt16 nExtFlags = 0;
2200 SCTAB nScenarioCount = 0;
2215 rDocShell.
PostPaint( nPaintStartCol, nPaintStartRow,
i, nPaintEndCol, nPaintEndRow,
i+nScenarioCount, nPaintFlags, nExtFlags );
2222 while( !qIncreaseRange.empty() )
2224 ScRange aRange = qIncreaseRange.back();
2229 qIncreaseRange.pop_back();
2234 pViewSh->
MarkRange( aTargetRange,
false );
2235 pViewSh->
SetCursor( nCursorCol, nCursorRow );
2242 pRefUndoDoc.reset();
2283 SAL_WARN(
"sc.ui",
"ScDocFunc::DeleteCells - no change-tracking of partial cell shift");
2296 OSL_FAIL(
"invalid row in DeleteCells");
2301 SCCOL nPaintStartCol = nStartCol;
2302 SCROW nPaintStartRow = nStartRow;
2303 SCCOL nPaintEndCol = nEndCol;
2304 SCROW nPaintEndRow = nEndRow;
2307 bool bRecord =
true;
2322 if(
nCount == nEndTab+1 )
2332 for (
const auto& rTab : aMark)
2334 if (rTab >= nTabCount)
2343 SCCOL nUndoStartCol = nStartCol;
2344 SCROW nUndoStartRow = nStartRow;
2345 SCCOL nUndoEndCol = nEndCol;
2346 SCROW nUndoEndRow = nEndRow;
2348 ScRange aExtendMergeRange( rRange );
2354 nUndoEndCol = aExtendMergeRange.
aEnd.
Col();
2355 nUndoEndRow = aExtendMergeRange.
aEnd.
Row();
2356 nPaintEndCol = nUndoEndCol;
2357 nPaintEndRow = nUndoEndRow;
2363 nUndoEndCol = rDoc.
MaxCol();
2368 nUndoEndRow = rDoc.
MaxRow();
2372 SCCOL nEditTestEndX = nUndoEndCol;
2374 nEditTestEndX = rDoc.
MaxCol();
2375 SCROW nEditTestEndY = nUndoEndRow;
2377 nEditTestEndY = rDoc.
MaxRow();
2393 rDoc, nUndoStartCol, nUndoStartRow, nEditTestEndX, nEditTestEndY, aMark);
2403 if (!canDeleteCellsByPivot(rRange, aMark, eCmd, rDoc))
2413 SCCOL nExtendStartCol = nUndoStartCol;
2414 SCROW nExtendStartRow = nUndoStartRow;
2415 bool bNeedRefresh =
false;
2419 ::std::vector<ScRange> qDecreaseRange;
2420 bool bDeletingMerge =
false;
2421 OUString aUndo =
ScResId( STR_UNDO_DELETECELLS );
2426 nViewShellId = pViewSh->GetViewShellId();
2429 std::unique_ptr<ScUndoRemoveMerge> pUndoRemoveMerge;
2431 for (
const SCTAB i : aMark)
2438 SCCOL nMergeStartCol = nUndoStartCol;
2439 SCROW nMergeStartRow = nUndoStartRow;
2440 SCCOL nMergeEndCol = nMergeTestEndCol;
2441 SCROW nMergeEndRow = nMergeTestEndRow;
2443 rDoc.
ExtendMerge( nMergeStartCol, nMergeStartRow, nMergeEndCol, nMergeEndRow,
i );
2444 rDoc.
ExtendOverlapped( nMergeStartCol, nMergeStartRow, nMergeEndCol, nMergeEndRow,
i );
2445 if( ( eCmd ==
DelCellCmd::CellsUp && ( nMergeStartCol != nUndoStartCol || nMergeEndCol != nMergeTestEndCol))||
2446 ( eCmd ==
DelCellCmd::CellsLeft && ( nMergeStartRow != nUndoStartRow || nMergeEndRow != nMergeTestEndRow)))
2454 nExtendStartCol = nMergeStartCol;
2455 nExtendStartRow = nMergeStartRow;
2456 SCCOL nTestCol = -1;
2457 SCROW nTestRow1 = -1;
2458 SCROW nTestRow2 = -1;
2460 ScDocAttrIterator aTestIter( rDoc,
i, nUndoStartCol, nUndoStartRow, nMergeTestEndCol, nMergeTestEndRow );
2461 ScRange aExtendRange( nUndoStartCol, nUndoStartRow,
i, nMergeTestEndCol, nMergeTestEndRow,
i );
2463 while ( ( pPattern = aTestIter.
GetNext( nTestCol, nTestRow1, nTestRow2 ) ) !=
nullptr )
2470 ScRange aRange( nTestCol, nTestRow1,
i );
2474 if( nTestRow1 < nTestRow2 && nNewFlags ==
ScMF::Hor )
2476 for(
SCROW nTestRow = nTestRow1; nTestRow <= nTestRow2; nTestRow++ )
2478 ScRange aTestRange( nTestCol, nTestRow,
i );
2482 if( !aExtendRange.
Contains( aMergeRange ) )
2484 qDecreaseRange.push_back( aTestRange );
2485 bDeletingMerge =
true;
2492 if( !aExtendRange.
Contains( aMergeRange ) )
2494 qDecreaseRange.push_back( aRange );
2496 bDeletingMerge =
true;
2501 if( bDeletingMerge )
2506 nStartRow = aExtendMergeRange.
aStart.
Row();
2507 nEndRow = aExtendMergeRange.
aEnd.
Row();
2508 bNeedRefresh =
true;
2512 nEndCol = aExtendMergeRange.
aEnd.
Col();
2523 nStartCol = aExtendMergeRange.
aStart.
Col();
2524 nEndCol = aExtendMergeRange.
aEnd.
Col();
2527 nEndRow = aExtendMergeRange.
aEnd.
Row();
2528 bNeedRefresh =
true;
2537 if( !qDecreaseRange.empty() )
2539 if (bRecord && !pUndoRemoveMerge)
2542 pUndoDoc->InitUndo( rDoc, *aMark.
begin(), *aMark.
rbegin());
2546 for(
const ScRange& aRange : qDecreaseRange )
2550 UnmergeCells( aRange, bRecord, pUndoRemoveMerge.get() );
2565 if (bRecord && pUndoRemoveMerge)
2575 std::unique_ptr<ScDocument> pRefUndoDoc;
2576 std::unique_ptr<ScRefUndoData> pUndoData;
2584 for (
const auto& rTab : aMark)
2586 if (rTab >= nTabCount)
2589 SCTAB nScenarioCount = 0;
2594 rDoc.
CopyToDocument( nUndoStartCol, nUndoStartRow, rTab, nUndoEndCol, nUndoEndRow, rTab+nScenarioCount,
2599 pRefUndoDoc->InitUndo( rDoc, 0, nTabCount-1 );
2606 sal_uInt16 nExtFlags = 0;
2607 for (
const auto& rTab : aMark)
2609 if (rTab >= nTabCount)
2632 bool bUndoOutline =
false;
2636 rDoc.
DeleteRow( nStartCol, 0, nEndCol,
MAXTAB, nStartRow,
static_cast<SCSIZE>(nEndRow-nStartRow+1), pRefUndoDoc.get(),
nullptr, &aFullMark );
2637 nPaintEndRow = rDoc.
MaxRow();
2640 rDoc.
DeleteRow( 0, 0, rDoc.
MaxCol(),
MAXTAB, nStartRow,
static_cast<SCSIZE>(nEndRow-nStartRow+1), pRefUndoDoc.get(), &bUndoOutline, &aFullMark );
2642 nPaintEndCol = rDoc.
MaxCol();
2643 nPaintEndRow = rDoc.
MaxRow();
2647 rDoc.
DeleteCol( nStartRow, 0, nEndRow,
MAXTAB, nStartCol,
static_cast<SCSIZE>(nEndCol-nStartCol+1), pRefUndoDoc.get(),
nullptr, &aFullMark );
2648 nPaintEndCol = rDoc.
MaxCol();
2651 rDoc.
DeleteCol( 0, 0, rDoc.
MaxRow(),
MAXTAB, nStartCol,
static_cast<SCSIZE>(nEndCol-nStartCol+1), pRefUndoDoc.get(), &bUndoOutline, &aFullMark );
2653 nPaintEndRow = rDoc.
MaxRow();
2654 nPaintEndCol = rDoc.
MaxCol();
2658 OSL_FAIL(
"Wrong code at deleting");
2666 for (
const auto& rTab : aFullMark)
2668 if (rTab >= nTabCount)
2671 pRefUndoDoc->DeleteAreaTab(nUndoStartCol,nUndoStartRow,nUndoEndCol,nUndoEndRow, rTab,
InsertDeleteFlags::ALL);
2675 pUndoDoc->AddUndoTab( 0, nTabCount-1 );
2678 pRefUndoDoc->CopyToDocument(0,0,0,rDoc.
MaxCol(),rDoc.
MaxRow(),
MAXTAB,
InsertDeleteFlags::FORMULA,
false,*pUndoDoc,
nullptr,
false);
2679 pRefUndoDoc.reset();
2681 std::unique_ptr<SCTAB[]> pTabs(
new SCTAB[nSelCount]);
2682 std::unique_ptr<SCTAB[]> pScenarios(
new SCTAB[nSelCount]);
2685 for (
const auto& rTab : aMark)
2687 if (rTab >= nTabCount)
2694 pScenarios[nUndoPos] =
nCount;
2695 pTabs[nUndoPos] = rTab;
2699 if( !bDeletingMerge )
2705 &
rDocShell,
ScRange( nStartCol, nStartRow, nStartTab, nEndCol, nEndRow, nEndTab ),
2706 nUndoPos, std::move(pTabs), std::move(pScenarios),
2707 eCmd, std::move(pUndoDoc), std::move(pUndoData) ) );
2713 while( !qDecreaseRange.empty() )
2715 ScRange aRange = qDecreaseRange.back();
2717 sal_Int32 nDecreaseRowCount = 0;
2718 sal_Int32 nDecreaseColCount = 0;
2722 nDecreaseRowCount = nEndRow-nStartRow+1;
2724 nDecreaseRowCount = aRange.
aEnd.
Row()-nStartRow+1;
2726 nDecreaseRowCount = aRange.
aEnd.
Row()-nEndRow+1;
2731 nDecreaseColCount = nEndCol-nStartCol+1;
2733 nDecreaseColCount = aRange.
aEnd.
Col()-nStartCol+1;
2735 nDecreaseColCount = aRange.
aEnd.
Col()-nEndCol+1;
2755 MergeCells( aMergeOption,
false,
true,
true );
2757 qDecreaseRange.pop_back();
2760 if( bDeletingMerge )
2764 nMergeTestEndCol = rDoc.
MaxCol();
2766 nMergeTestEndRow = rDoc.
MaxRow();
2775 rDoc.
ApplyPatternArea( nExtendStartCol, nExtendStartRow, nMergeTestEndCol, nMergeTestEndRow, aMark, aPattern );
2777 for (
const auto& rTab : aMark)
2779 if (rTab >= nTabCount)
2782 SCTAB nScenarioCount = 0;
2787 ScRange aMergedRange( nExtendStartCol, nExtendStartRow, rTab, nMergeTestEndCol, nMergeTestEndRow, rTab+nScenarioCount );
2792 for (
const auto& rTab : aMark)
2794 if (rTab >= nTabCount)
2797 rDoc.
RefreshAutoFilter( nExtendStartCol, nExtendStartRow, nMergeTestEndCol, nMergeTestEndRow, rTab );
2800 for (
const auto& rTab : aMark)
2802 if (rTab >= nTabCount)
2810 rDocShell.
UpdatePaintExt( nExtFlags, nPaintStartCol, nPaintStartRow, rTab, nPaintEndCol, nPaintEndRow, rTab );
2812 SCTAB nScenarioCount = 0;
2819 rDocShell.
PostPaint( nPaintStartCol, nPaintStartRow, rTab, nPaintEndCol, nPaintEndRow, rTab+nScenarioCount, nPaintFlags, nExtFlags );
2853 bool bCut,
bool bRecord,
bool bPaint,
bool bApi )
2870 OSL_FAIL(
"invalid row in MoveBlock");
2875 bool bScenariosAdded =
false;
2880 if ( nDestTab == nStartTab && !rDoc.
IsScenario(nEndTab) )
2881 while ( nEndTab+1 < nTabCount && rDoc.
IsScenario(nEndTab+1) )
2884 bScenariosAdded =
true;
2887 SCTAB nSrcTabCount = nEndTab-nStartTab+1;
2888 SCTAB nDestEndTab = nDestTab+nSrcTabCount-1;
2894 for (nTab=nStartTab; nTab<=nEndTab; nTab++)
2902 aDragShellRef->DoInitNew();
2906 ScClipParam aClipParam(
ScRange(nStartCol, nStartRow, nStartTab, nEndCol, nEndRow, nStartTab), bCut);
2907 rDoc.
CopyToClip(aClipParam, pClipDoc.get(), &aSourceMark, bScenariosAdded,
true);
2911 SCCOL nOldEndCol = nEndCol;
2912 SCROW nOldEndRow = nEndRow;
2913 bool bClipOver =
false;
2914 for (nTab=nStartTab; nTab<=nEndTab; nTab++)
2916 SCCOL nTmpEndCol = nOldEndCol;
2917 SCROW nTmpEndRow = nOldEndRow;
2918 if (rDoc.
ExtendMerge( nStartCol, nStartRow, nTmpEndCol, nTmpEndRow, nTab ))
2920 if ( nTmpEndCol > nEndCol ) nEndCol = nTmpEndCol;
2921 if ( nTmpEndRow > nEndRow ) nEndRow = nTmpEndRow;
2924 SCCOL nDestEndCol = nDestCol + ( nOldEndCol-nStartCol );
2925 SCROW nDestEndRow = nDestRow + ( nOldEndRow-nStartRow );
2927 SCCOL nUndoEndCol = nDestCol + ( nEndCol-nStartCol );
2928 SCROW nUndoEndRow = nDestRow + ( nEndRow-nStartRow );
2930 bool bIncludeFiltered = bCut;
2931 if ( !bIncludeFiltered )
2937 pClipDoc->GetClipArea( nClipX, nClipY,
false );
2938 SCROW nUndoAdd = nUndoEndRow - nDestEndRow;
2939 nDestEndRow = nDestRow + nClipY;
2940 nUndoEndRow = nDestEndRow + nUndoAdd;
2953 for (nTab=nDestTab; nTab<=nDestEndTab; nTab++)
2954 aTester.
TestBlock( rDoc, nTab, nDestCol,nDestRow, nUndoEndCol,nUndoEndRow );
2956 for (nTab=nStartTab; nTab<=nEndTab; nTab++)
2957 aTester.
TestBlock( rDoc, nTab, nStartCol,nStartRow, nEndCol,nEndRow );
2968 if (bClipOver && !bCut)
2969 if (rDoc.
HasAttrib( nDestCol,nDestRow,nDestTab, nUndoEndCol,nUndoEndRow,nDestEndTab,
2979 sal_uInt16 nSourceExt = 0;
2981 sal_uInt16 nDestExt = 0;
2990 bool bWholeCols = ( nStartRow == 0 && nEndRow == rDoc.
MaxRow() );
2991 bool bWholeRows = ( nStartCol == 0 && nEndCol == rDoc.
MaxCol() );
2995 pUndoDoc->InitUndo( rDoc, nStartTab, nEndTab, bWholeCols, bWholeRows );
2999 rDoc.
CopyToDocument( nStartCol, nStartRow, nStartTab, nEndCol, nEndRow, nEndTab,
3000 nUndoFlags,
false, *pUndoDoc );
3003 if ( nDestTab != nStartTab )
3004 pUndoDoc->AddUndoTab( nDestTab, nDestEndTab, bWholeCols, bWholeRows );
3006 nDestEndCol, nDestEndRow, nDestEndTab,
3007 nUndoFlags,
false, *pUndoDoc );
3011 bool bSourceHeight =
false;
3015 for (nTab=nStartTab; nTab<=nEndTab; nTab++)
3025 if (rDoc.
HasAttrib( nDestCol,nDestRow,nDestTab,
3026 nUndoEndCol,nUndoEndRow,nDestEndTab,
3030 for (nTab=nStartTab; nTab<=nEndTab; nTab++)
3032 SCCOL nTmpEndCol = nEndCol;
3033 SCROW nTmpEndRow = nEndRow;
3034 rDoc.
ExtendMerge( nStartCol, nStartRow, nTmpEndCol, nTmpEndRow, nTab,
true );
3047 ScRange aPasteDest( nDestCol, nDestRow, nDestTab, nDestEndCol, nDestEndRow, nDestEndTab );
3050 for (nTab=nDestTab; nTab<=nDestEndTab; nTab++)
3061 pUndoDoc.get(), pClipDoc.get(),
true,
false, bIncludeFiltered);
3064 if ( !bIncludeFiltered && pClipDoc->HasClipFilteredRows() )
3068 ScRange( 0,nDestRow,nDestTab, rDoc.
MaxCol(),nDestEndRow,nDestEndTab ),
3074 if ( pClipDoc->GetDrawLayer() )
3076 nullptr, pClipDoc.get(),
true,
false, bIncludeFiltered );
3080 ScRange aUndoRange(nStartCol, nStartRow, nStartTab, nOldEndCol, nOldEndRow, nEndTab);
3081 ScAddress aDestPos(nDestCol, nDestRow, nDestTab);
3084 std::make_unique<ScUndoDragDrop>(
3085 &
rDocShell, aUndoRange, aDestPos, bCut, std::move(pUndoDoc), bScenariosAdded));
3088 SCCOL nDestPaintEndCol = nDestEndCol;
3089 SCROW nDestPaintEndRow = nDestEndRow;
3090 for (nTab=nDestTab; nTab<=nDestEndTab; nTab++)
3092 SCCOL nTmpEndCol = nDestEndCol;
3093 SCROW nTmpEndRow = nDestEndRow;
3094 rDoc.
ExtendMerge( nDestCol, nDestRow, nTmpEndCol, nTmpEndRow, nTab,
true );
3095 if (nTmpEndCol > nDestPaintEndCol) nDestPaintEndCol = nTmpEndCol;
3096 if (nTmpEndRow > nDestPaintEndRow) nDestPaintEndRow = nTmpEndRow;
3100 for (nTab=nStartTab; nTab<=nEndTab; nTab++)
3107 SCCOL nPaintStartX = nDestCol;
3108 SCROW nPaintStartY = nDestRow;
3109 SCCOL nPaintEndX = nDestPaintEndCol;
3110 SCROW nPaintEndY = nDestPaintEndRow;
3113 if ( nStartRow==0 && nEndRow==rDoc.
MaxRow() )
3115 nPaintEndX = rDoc.
MaxCol();
3117 nPaintEndY = rDoc.
MaxRow();
3120 if ( bDestHeight || ( nStartCol == 0 && nEndCol == rDoc.
MaxCol() ) )
3122 nPaintEndY = rDoc.
MaxRow();
3124 nPaintEndX = rDoc.
MaxCol();
3127 if ( bScenariosAdded )
3131 nPaintEndX = rDoc.
MaxCol();
3132 nPaintEndY = rDoc.
MaxRow();
3136 nPaintEndX,nPaintEndY,nDestEndTab, nFlags, nSourceExt | nDestExt );
3142 nPaintStartX = nStartCol;
3143 nPaintStartY = nStartRow;
3144 nPaintEndX = nEndCol;
3145 nPaintEndY = nEndRow;
3148 if ( bSourceHeight )
3150 nPaintEndY = rDoc.
MaxRow();
3152 nPaintEndX = rDoc.
MaxCol();
3155 if ( bScenariosAdded )
3159 nPaintEndX = rDoc.
MaxCol();
3160 nPaintEndY = rDoc.
MaxRow();
3164 nPaintEndX,nPaintEndY,nEndTab, nFlags, nSourceExt );
3177 uno::Reference< lang::XMultiServiceFactory> xSF(rDocSh.
GetModel(), uno::UNO_QUERY);
3178 uno::Reference< container::XNameAccess > xVBACodeNamedObjectAccess;
3179 uno::Reference< uno::XInterface > xDocModuleApiObject;
3182 xVBACodeNamedObjectAccess.set( xSF->createInstance(
"ooo.vba.VBAObjectModuleObjectProvider"), uno::UNO_QUERY );
3183 xDocModuleApiObject.set( xVBACodeNamedObjectAccess->getByName( sCodeName ), uno::UNO_QUERY );
3185 return xDocModuleApiObject;
3191 script::ModuleInfo sModuleInfo;
3192 sModuleInfo.ModuleType = script::ModuleType::DOCUMENT;
3200 uno::Reference< script::XLibraryContainer > xLibContainer = rDocSh.
GetBasicContainer();
3201 OSL_ENSURE( xLibContainer.is(),
"No BasicContainer!" );
3203 uno::Reference< container::XNameContainer > xLib;
3204 if( xLibContainer.is() )
3206 OUString aLibName(
"Standard" );
3207#if HAVE_FEATURE_SCRIPTING
3213 uno::Any aLibAny = xLibContainer->getByName( aLibName );
3221 OUString genModuleName =
"Sheet1";
3222 while( xLib->hasByName( genModuleName ) )
3223 genModuleName =
"Sheet" + OUString::number( ++nNum );
3226 OUString sTmpSource = sSource;
3227 if ( sTmpSource.isEmpty() )
3228 sTmpSource =
"Rem Attribute VBA_ModuleType=VBADocumentModule\nOption VBASupport 1\n";
3229 aSourceAny <<= sTmpSource;
3230 uno::Reference< script::vba::XVBAModuleInfo > xVBAModuleInfo( xLib, uno::UNO_QUERY );
3231 if ( xVBAModuleInfo.is() )
3235 xVBAModuleInfo->insertModuleInfo( genModuleName, sModuleInfo );
3236 xLib->insertByName( genModuleName, aSourceAny );
3242 uno::Reference< script::XLibraryContainer > xLibContainer = rDocSh.
GetBasicContainer();
3243 OSL_ENSURE( xLibContainer.is(),
"No BasicContainer!" );
3245 uno::Reference< container::XNameContainer > xLib;
3246 if( xLibContainer.is() )
3248 OUString aLibName(
"Standard" );
3249#if HAVE_FEATURE_SCRIPTING
3255 uno::Any aLibAny = xLibContainer->getByName( aLibName );
3260 uno::Reference< script::vba::XVBAModuleInfo > xVBAModuleInfo( xLib, uno::UNO_QUERY );
3261 if( xLib->hasByName( sModuleName ) )
3262 xLib->removeByName( sModuleName );
3263 if ( xVBAModuleInfo.is() && xVBAModuleInfo->hasModuleInfo(sModuleName) )
3264 xVBAModuleInfo->removeModuleInfo( sModuleName );
3271 bool bSuccess =
false;
3280 bool bInsertDocModule =
false;
3286 if ( bInsertDocModule || ( bRecord && !rDoc.
IsUndoEnabled() ) )
3293 bool bAppend = ( nTab >= nTabCount );
3301 std::make_unique<ScUndoInsertTab>( &
rDocShell, nTab, bAppend, rName));
3304 if( bInsertDocModule )
3327 bool bSuccess =
false;
3334 bool bWasLinked = rDoc.
IsLinked(nTab);
3336 std::unique_ptr<ScRefUndoData> pUndoData;
3342 pUndoDoc->InitUndo( rDoc, nTab, nTab,
true,
true );
3343 pUndoDoc->AddUndoTab( 0,
nCount-1 );
3347 rDoc.
GetName( nTab, aOldName );
3348 pUndoDoc->RenameTab( nTab, aOldName );
3357 pUndoDoc->SetScenario( nTab,
true );
3362 pUndoDoc->SetScenarioData( nTab, aComment, aColor, nScenFlags );
3364 pUndoDoc->SetActiveScenario( nTab, bActive );
3366 pUndoDoc->SetVisible( nTab, rDoc.
IsVisible( nTab ) );
3369 pUndoDoc->SetSheetEvents( nTab, std::unique_ptr<ScSheetEvents>(pSheetEvents ?
new ScSheetEvents(*pSheetEvents) :
nullptr) );
3381 vector<SCTAB> theTabs;
3382 theTabs.push_back(nTab);
3384 std::make_unique<ScUndoDeleteTab>( &
rDocShell, theTabs, std::move(pUndoDoc), std::move(pUndoData) ));
3409 pSfxApp->Broadcast(
SfxHint( SfxHintId::ScTablesChanged ) );
3410 pSfxApp->Broadcast(
SfxHint( SfxHintId::ScAreasChanged ) );
3411 pSfxApp->Broadcast(
SfxHint( SfxHintId::ScDbAreasChanged ) );
3412 pSfxApp->Broadcast(
SfxHint( SfxHintId::ScAreaLinksChanged ) );
3439 sal_uInt16 nVisCount = 0;
3456 std::vector<SCTAB> undoTabs { nTab };
3514 bool bSuccess =
false;
3522 std::make_unique<ScUndoRenameTab>( &
rDocShell, nTab, sOldName, rName));
3549 bool bSuccess =
false;
3558 std::make_unique<ScUndoTabColor>( &
rDocShell, nTab, aOldTabBgColor, rColor));
3574 bool bRecord =
true;
3586 Color aNewTabBgColor;
3587 bool bSuccess =
true;
3588 size_t nTabProtectCount = 0;
3589 size_t nTabListCount = rUndoTabColorList.size();
3590 for (
size_t i = 0;
i < nTabListCount; ++
i )
3611 if ( nTabProtectCount == nTabListCount )
3623 std::make_unique<ScUndoTabColor>( &
rDocShell, std::vector(rUndoTabColorList)));
3653 bool bWidth,
const std::vector<sc::ColRowSpan>& rRanges,
SCTAB nTab,
3654 ScSizeMode eMode, sal_uInt16 nSizeTwips,
bool bRecord,
bool bApi )
3658 if (rRanges.empty())
3673 SCCOLROW nStart = rRanges[0].mnStart;
3682 std::unique_ptr<ScOutlineTable> pUndoTab;
3683 std::vector<sc::ColRowSpan> aUndoRanges;
3692 pUndoDoc->InitUndo( rDoc, nTab, nTab,
true );
3697 pUndoDoc->InitUndo( rDoc, nTab, nTab,
false,
true );
3701 aUndoRanges = rRanges;
3709 bool bOutline =
false;
3713 SCCOLROW nStartNo = rRange.mnStart;
3725 for (
SCROW nRow=nStartNo; nRow<=nEndNo; nRow++)
3728 SCROW nLastRow = -1;
3729 bool bHidden = rDoc.
RowHidden(nRow, nTab,
nullptr, &nLastRow);
3742 rDoc.
ShowRows( nStartNo, nEndNo, nTab,
true );
3755 rDoc.
ShowRows( nStartNo, nEndNo, nTab, nSizeTwips != 0 );
3759 rDoc.
ShowRows( nStartNo, nEndNo, nTab,
true );
3764 for (
SCCOL nCol=
static_cast<SCCOL>(nStartNo); nCol<=static_cast<SCCOL>(nEndNo); nCol++)
3768 sal_uInt16 nThisSize = nSizeTwips;
3771 nThisSize = nSizeTwips +
3777 rDoc.
ShowCol( nCol, nTab, bShow );
3788 static_cast<SCCOL>(nStartNo),
3789 static_cast<SCCOL>(nEndNo), nTab, bShow );
3792 static_cast<SCROW>(nStartNo),
3793 static_cast<SCROW>(nEndNo), nTab, bShow );
3806 std::make_unique<ScUndoWidthOrHeight>(
3807 &
rDocShell, aMark, nStart, nTab, nEnd, nTab, std::move(pUndoDoc),
3808 std::move(aUndoRanges), std::move(pUndoTab),
eMode, nSizeTwips, bWidth));
3824 bool bRecord,
bool bSetModified )
3847 std::make_unique<ScUndoPageBreak>( &
rDocShell, rPos.
Col(), rPos.
Row(), nTab, bColumn,
true ) );
3878 pBindings->
Invalidate( FID_DEL_MANUALBREAKS );
3887 bool bRecord,
bool bSetModified )
3911 std::make_unique<ScUndoPageBreak>( &
rDocShell, rPos.
Col(), rPos.
Row(), nTab, bColumn,
false ) );
3941 pBindings->
Invalidate( FID_DEL_MANUALBREAKS );
3953 std::unique_ptr<ScTableProtection>
p;
3957 p = std::make_unique<ScTableProtection>(rProtect);
3966 p = std::make_unique<ScTableProtection>(*pProtect);
3969 std::make_unique<ScUndoTabProtect>(&
rDocShell, nTab, std::move(
p)));
3975 pTabViewShell->SetTabProtectionSymbol(nTab, rProtect.
isProtected());
3985 std::unique_ptr<ScDocProtection>
p;
3989 p = std::make_unique<ScDocProtection>(rProtect);
3998 p = std::make_unique<ScDocProtection>(*pProtect);
4001 std::make_unique<ScUndoDocProtect>(&
rDocShell, std::move(
p)));
4027 pNewProtection->setProtected(
true);
4028 pNewProtection->setPassword(rPassword);
4052 VclMessageType::Info, VclButtonsType::Ok,
4053 ScResId(SCSTR_WRONGPASSWORD)));
4077 VclMessageType::Info, VclButtonsType::Ok,
4078 ScResId(SCSTR_WRONGPASSWORD)));
4121 pUndoDoc->InitUndo( rDoc, nStartTab, nEndTab );
4125 std::make_unique<ScUndoClearItems>( &
rDocShell, aMultiMark, std::move(pUndoDoc), pWhich ) );
4158 pUndoDoc->InitUndo( rDoc, nStartTab, nStartTab );
4159 for (
const auto& rTab : rMark)
4161 if (rTab >= nTabCount)
4164 if (rTab != nStartTab)
4165 pUndoDoc->AddUndoTab( rTab, rTab );
4168 ScRange aCopyRange = aMarkRange;
4174 std::make_unique<ScUndoIndent>( &
rDocShell, rMark, std::move(pUndoDoc), bIncrement ) );
4190 pBindings->
Invalidate( SID_ATTR_PARA_ADJUST_LEFT );
4191 pBindings->
Invalidate( SID_ATTR_PARA_ADJUST_RIGHT );
4192 pBindings->
Invalidate( SID_ATTR_PARA_ADJUST_BLOCK );
4193 pBindings->
Invalidate( SID_ATTR_PARA_ADJUST_CENTER);
4195 pBindings->
Invalidate( SID_ALIGN_ANY_HDEFAULT );
4197 pBindings->
Invalidate( SID_ALIGN_ANY_HCENTER );
4198 pBindings->
Invalidate( SID_ALIGN_ANY_RIGHT );
4199 pBindings->
Invalidate( SID_ALIGN_ANY_JUSTIFIED );
4206 sal_uInt16 nFormatNo,
bool bApi )
4218 bool bRecord =
true;
4226 for (
SCTAB nTab=nStartTab; nTab<=nEndTab; nTab++)
4231 ScEditableTester aTester( rDoc, nStartCol,nStartRow, nEndCol,nEndRow, aMark );
4243 pUndoDoc->InitUndo( rDoc, nStartTab, nStartTab, bSize, bSize );
4244 for (
const auto& rTab : aMark)
4246 if (rTab >= nTabCount)
4249 if (rTab != nStartTab)
4250 pUndoDoc->AddUndoTab( rTab, rTab, bSize, bSize );
4267 rDoc.
AutoFormat( nStartCol, nStartRow, nEndCol, nEndRow, nFormatNo, aMark );
4271 std::vector<sc::ColRowSpan> aCols(1,
sc::ColRowSpan(nStartCol,nEndCol));
4272 std::vector<sc::ColRowSpan> aRows(1,
sc::ColRowSpan(nStartRow,nEndRow));
4274 for (
const auto& rTab : aMark)
4276 if (rTab >= nTabCount)
4287 for (
const auto& rTab : aMark)
4289 if (rTab >= nTabCount)
4293 nEndCol, nEndRow, rTab),
false, bApi );
4306 std::make_unique<ScUndoAutoFormat>( &
rDocShell, rRange, std::move(pUndoDoc), aMark, bSize, nFormatNo ) );
4318 const ScTokenArray* pTokenArray,
const OUString& rString,
bool bApi,
bool bEnglish,
4326 bool bSuccess =
false;
4340 for (
SCTAB nTab=nStartTab; nTab<=nEndTab; nTab++)
4344 ScEditableTester aTester( rDoc, nStartCol,nStartRow, nEndCol,nEndRow, aMark );
4356 pUndoDoc->InitUndo( rDoc, nStartTab, nEndTab );
4364 aMark, OUString(), pTokenArray, eGrammar);
4372 aMark, OUString(), &aCode, eGrammar);
4378 std::unique_ptr<ScTokenArray> pCode = aComp.
CompileString( rString );
4380 aMark, OUString(), pCode.get(), eGrammar);
4384 aMark, rString,
nullptr, eGrammar);
4390 std::make_unique<ScUndoEnterMatrix>( &
rDocShell, rRange, std::move(pUndoDoc), rString ) );
4410 bool bSuccess =
false;
4427 for (
SCTAB nTab=nStartTab; nTab<=nEndTab; nTab++)
4431 ScEditableTester aTester( rDoc, nStartCol,nStartRow, nEndCol,nEndRow, aMark );
4440 pUndoDoc->InitUndo( rDoc, nStartTab, nEndTab );
4444 std::make_unique<ScUndoTabOp>( &
rDocShell,
4445 nStartCol, nStartRow, nStartTab,
4446 nEndCol, nEndRow, nEndTab, std::move(pUndoDoc),
4453 rDoc.
InsertTableOp(rParam, nStartCol, nStartRow, nEndCol, nEndRow, aMark);
4551 bool bSuccess =
false;
4553 adjustFillRangeForAdjacentCopy(rDoc, aRange, eDir);
4562 bool bRecord =
true;
4571 for (
SCTAB nTab=nStartTab; nTab<=nEndTab; nTab++)
4575 ScEditableTester aTester( rDoc, nStartCol,nStartRow, nEndCol,nEndRow, aMark );
4611 pUndoDoc->InitUndo( rDoc, nDestStartTab, nDestStartTab );
4612 for (
const auto& rTab : aMark)
4614 if (rTab >= nTabCount)
4617 if (rTab != nDestStartTab)
4618 pUndoDoc->AddUndoTab( rTab, rTab );
4621 ScRange aCopyRange = aDestArea;
4634 ScResId(STR_FILL_SERIES_PROGRESS), nProgCount,
true );
4644 std::make_unique<ScUndoAutoFill>( &
rDocShell, aDestArea, aSourceArea, std::move(pUndoDoc), aMark,
4661 double fStart,
double fStep,
double fMax,
4666 bool bSuccess =
false;
4675 bool bRecord =
true;
4684 for (
SCTAB nTab=nStartTab; nTab<=nEndTab; nTab++)
4688 ScEditableTester aTester( rDoc, nStartCol,nStartRow, nEndCol,nEndRow, aMark );
4705 if (
nCount >= nTotLines )
4731 pUndoDoc->InitUndo( rDoc, nDestStartTab, nDestStartTab );
4732 for (
const auto& rTab : aMark)
4734 if (rTab >= nTabCount)
4737 if (rTab != nDestStartTab)
4738 pUndoDoc->AddUndoTab( rTab, rTab );
4755 rDoc.
SetValue( nValX, nValY, nTab, fStart );
4765 ScResId(STR_FILL_SERIES_PROGRESS), nProgCount,
true );
4769 aMark,
nCount, eDir, eCmd, eDateCmd, fStep, fMax );
4779 std::make_unique<ScUndoAutoFill>( &
rDocShell, aDestArea, aSourceArea, std::move(pUndoDoc), aMark,
4780 eDir, eCmd, eDateCmd, fStart, fStep, fMax) );
4817 for (
SCTAB nTab=nStartTab; nTab<=nEndTab; nTab++)
4830 if (
nCount > sal::static_int_cast<sal_uLong>( aSourceArea.
aStart.
Row() ))
4832 OSL_FAIL(
"FillAuto: Row < 0");
4841 if (
nCount > sal::static_int_cast<sal_uLong>( aSourceArea.
aStart.
Col() ))
4843 OSL_FAIL(
"FillAuto: Col < 0");
4849 OSL_FAIL(
"Wrong direction with FillAuto");
4866 nEndCol, nEndRow, aMark ) )
4887 pUndoDoc->InitUndo( rDoc, nDestStartTab, nDestStartTab );
4888 for (
const auto& rTab : aMark)
4890 if (rTab >= nTabCount)
4893 if (rTab != nDestStartTab)
4894 pUndoDoc->AddUndoTab( rTab, rTab );
4911 ScResId(STR_FILL_SERIES_PROGRESS), nProgCount,
true );
4915 aMark,
nCount, eDir, eCmd, eDateCmd, fStep, fMax );
4922 std::make_unique<ScUndoAutoFill>( &
rDocShell, aDestArea, aSourceArea, std::move(pUndoDoc), aMark,
4923 eDir, eCmd, eDateCmd,
MAXDOUBLE, fStep, fMax) );
4943 if ((nStartCol == nEndCol && nStartRow == nEndRow) || rOption.
maTabs.empty())
4955 for (
const auto& rTab : rOption.
maTabs)
4957 ScEditableTester aTester( rDoc, rTab, nStartCol, nStartRow, nEndCol, nEndRow );
4965 if ( rDoc.
HasAttrib( nStartCol, nStartRow, rTab, nEndCol, nEndRow, rTab,
4976 bool bNeedContentsUndo =
false;
4979 bool bIsBlockEmpty = ( nStartRow == nEndRow )
4980 ? rDoc.
IsEmptyData( nStartCol+1,nStartRow, nEndCol,nEndRow, nTab )
4981 : rDoc.
IsEmptyData( nStartCol,nStartRow+1, nStartCol,nEndRow, nTab ) &&
4982 rDoc.
IsEmptyData( nStartCol+1,nStartRow, nEndCol,nEndRow, nTab );
4983 bool bNeedContents = bContents && !bIsBlockEmpty;
4984 bool bNeedEmpty = bEmptyMergedCells && !bIsBlockEmpty && !bNeedContents;
4989 bool bHasNotes = rDoc.
HasNote(nTab, nStartCol, nStartRow, nEndCol, nEndRow);
4993 pUndoDoc->InitUndo(rDoc, nTab1, nTab2);
4996 rDoc.
CopyToDocument( nStartCol, nStartRow, nTab, nEndCol, nEndRow, nTab,
5004 else if ( bNeedEmpty )
5005 rDoc.
DoEmptyBlock( nStartCol,nStartRow, nEndCol,nEndRow, nTab );
5006 rDoc.
DoMerge( nStartCol,nStartRow, nEndCol,nEndRow, nTab );
5017 if (bNeedContents || rOption.
mbCenter)
5019 ScRange aRange(nStartCol, nStartRow, nTab, nEndCol, nEndRow, nTab);
5027 bNeedContentsUndo |= bNeedContents;
5034 std::make_unique<ScUndoMerge>(&
rDocShell, rOption, bNeedContentsUndo, std::move(pUndoDoc), std::move(pDrawUndo)) );
5054 for (
SCTAB i = nTab1;
i <= nTab2; ++
i)
5057 return UnmergeCells(aOption, bRecord, pUndoRemoveMerge);
5064 if (rOption.
maTabs.empty())
5075 assert( pUndoDoc || !pUndoRemoveMerge );
5120 if (pUndoRemoveMerge)
5146 OSL_ENSURE( pNewRanges,
"pNewRanges is 0" );
5161 std::unique_ptr<ScRangeName> pUndoRanges(
new ScRangeName(*pOld));
5162 std::unique_ptr<ScRangeName> pRedoRanges(
new ScRangeName(*pNewRanges));
5164 std::make_unique<ScUndoRangeNames>( &
rDocShell, std::move(pUndoRanges), std::move(pRedoRanges), nTab ) );
5195 std::map<OUString, ScRangeName*> aOldRangeMap;
5198 std::make_unique<ScUndoAllRangeNames>(&
rDocShell, aOldRangeMap, rRangeMap));
5212 bool& rCancel,
bool bApi )
5223 if (
aName.isEmpty())
5226 OUString aContent(
ScRange( nX1, nY1, nTab, nX2, nY2, nTab ).
Format(
5229 bool bInsert =
false;
5234 if (aOldStr != aContent)
5240 OUString aTemplate =
ScResId( STR_CREATENAME_REPLACE );
5244 VclMessageType::Question, VclButtonsType::YesNo,
5247 xQueryBox->set_default_response(
RET_YES);
5249 short nResult = xQueryBox->run();
5287 OSL_ENSURE(rRange.
aEnd.
Tab() == nTab,
"CreateNames: multiple tables not possible");
5291 if ( nStartRow == nEndRow )
5294 if ( nStartCol == nEndCol )
5315 SCCOL nContX1 = nStartCol;
5316 SCROW nContY1 = nStartRow;
5317 SCCOL nContX2 = nEndCol;
5318 SCROW nContY2 = nEndRow;
5329 bool bCancel =
false;
5334 for (
i=nContX1;
i<=nContX2;
i++)
5335 CreateOneName( aNewRanges,
i,nStartRow,nTab,
i,nContY1,
i,nContY2, bCancel, bApi );
5337 for (j=nContY1; j<=nContY2; j++)
5338 CreateOneName( aNewRanges, nStartCol,j,nTab, nContX1,j,nContX2,j, bCancel, bApi );
5340 for (
i=nContX1;
i<=nContX2;
i++)
5341 CreateOneName( aNewRanges,
i,nEndRow,nTab,
i,nContY1,
i,nContY2, bCancel, bApi );
5343 for (j=nContY1; j<=nContY2; j++)
5344 CreateOneName( aNewRanges, nEndCol,j,nTab, nContX1,j,nContX2,j, bCancel, bApi );
5346 if ( bTop && bLeft )
5347 CreateOneName( aNewRanges, nStartCol,nStartRow,nTab, nContX1,nContY1,nContX2,nContY2, bCancel, bApi );
5348 if ( bTop && bRight )
5349 CreateOneName( aNewRanges, nEndCol,nStartRow,nTab, nContX1,nContY1,nContX2,nContY2, bCancel, bApi );
5350 if ( bBottom && bLeft )
5351 CreateOneName( aNewRanges, nStartCol,nEndRow,nTab, nContX1,nContY1,nContX2,nContY2, bCancel, bApi );
5352 if ( bBottom && bRight )
5353 CreateOneName( aNewRanges, nEndCol,nEndRow,nTab, nContX1,nContY1,nContX2,nContY2, bCancel, bApi );
5374 sal_uInt16 nValidCount = 0;
5375 for (
const auto& rEntry : *pLocalList)
5382 for (
const auto& rEntry : *pList)
5393 SCCOL nEndCol = nStartCol + 1;
5394 SCROW nEndRow = nStartRow +
static_cast<SCROW>(nValidCount) - 1;
5396 ScEditableTester aTester( rDoc, nTab, nStartCol,nStartRow, nEndCol,nEndRow );
5397 if (aTester.IsEditable())
5404 pUndoDoc->InitUndo( rDoc, nTab, nTab );
5405 rDoc.
CopyToDocument(nStartCol,nStartRow,nTab, nEndCol,nEndRow,nTab,
5411 std::unique_ptr<ScRangeData*[]> ppSortArray(
new ScRangeData* [ nValidCount ]);
5413 for (
const auto& rEntry : *pLocalList)
5417 ppSortArray[j++] = &r;
5419 for (
const auto& [rName, rxData] : *pList)
5423 ppSortArray[j++] = &r;
5425 qsort(
static_cast<void*
>(ppSortArray.get()), nValidCount,
sizeof(
ScRangeData*),
5428 OUStringBuffer aContent;
5430 SCROW nOutRow = nStartRow;
5431 for (j=0; j<nValidCount; j++)
5436 pData->UpdateSymbol(aContent,
ScAddress( nStartCol, nOutRow, nTab ));
5437 aFormula =
"=" + aContent;
5445 ppSortArray.reset();
5450 pRedoDoc->InitUndo( rDoc, nTab, nTab );
5451 rDoc.
CopyToDocument(nStartCol,nStartRow,nTab, nEndCol,nEndRow,nTab,
5455 std::make_unique<ScUndoListNames>( &
rDocShell,
5456 ScRange( nStartCol,nStartRow,nTab, nEndCol,nEndRow,nTab ),
5457 std::move(pUndoDoc), std::move(pRedoDoc) ) );
5479 OUString aFormula = rDoc.
GetFormula( nStartCol, nStartRow, nTab );
5480 if ( !(aFormula.startsWith(
"{") && aFormula.endsWith(
"}")) )
5483 OUString aUndo =
ScResId( STR_UNDO_RESIZEMATRIX );
5489 nViewShellId = pViewSh->GetViewShellId();
5493 aFormula = aFormula.copy(1, aFormula.getLength()-2);
5515 const OUString& rOptions,
const OUString& rSource,
5516 const ScRange& rDestRange, sal_Int32 nRefreshDelaySeconds,
5517 bool bFitBlock,
bool bApi )
5528 sal_uInt16 nLinkCount = pLinkManager->
GetLinks().size();
5529 sal_uInt16 nRemoved = 0;
5530 sal_uInt16 nLinkPos = 0;
5531 while (nLinkPos<nLinkCount)
5542 OUString aUndo =
ScResId( STR_UNDO_INSERTAREALINK );
5545 nViewShellId = pViewSh->GetViewShellId();
5551 std::make_unique<ScUndoRemoveAreaLink>( &
rDocShell,
5555 pLinkManager->
Remove( pBase );
5556 nLinkCount = pLinkManager->
GetLinks().size();
5563 OUString aFilterName = rFilter;
5564 OUString aNewOptions = rOptions;
5565 if (aFilterName.isEmpty())
5573 aNewOptions, rSource, rDestRange, nRefreshDelaySeconds );
5574 OUString aTmp = aFilterName;
5582 rFile, aFilterName, aNewOptions,
5583 rSource, rDestRange, nRefreshDelaySeconds ) );
5591 pLink->SetDoInsert(bFitBlock);
5594 pLink->SetDoInsert(
true);
5617 pUndoDoc->InitUndo( rDoc, nTab, nTab );
5621 aCompleteRange = aCombinedRange;
5635 std::unique_ptr<ScRange> pRepaintRange;
5651 pRepaintRange->ExtendTo(aCombinedRange);
5653 pRepaintRange.reset(
new ScRange(aCombinedRange));
5664 pRedoDoc->InitUndo( rDoc, nTab, nTab );
5669 std::make_unique<ScUndoConditionalFormat>(&
rDocShell, std::move(pUndoDoc), std::move(pRedoDoc), aCompleteRange));
5691 pUndoDoc->InitUndo( rDoc, nTab, nTab );
5698 pUndoDoc->SetCondFormList(
nullptr, nTab);
5715 pRedoDoc->InitUndo( rDoc, nTab, nTab );
5719 std::make_unique<ScUndoConditionalFormatList>(&
rDocShell, std::move(pUndoDoc), std::move(pRedoDoc), nTab));
5731 bool bRecord =
true;
5748 if (bRecord && pUndoVals)
5751 std::make_unique<sc::UndoFormulaToValue>(&
rDocShell, *pUndoVals));
5762 OUString aUndo(
ScResId(pNameResId));
5765 nViewShellId = pViewSh->GetViewShellId();
5775 std::shared_ptr<sc::SparklineGroup> pSparklineGroup)
5777 std::vector<sc::SparklineData> aSparklineDataVector;
5781 sal_Int32 nOutputRowSize = rSparklineRange.
aEnd.
Row() - rSparklineRange.
aStart.
Row();
5793 ScRange aInputRangeSlice = rDataRange;
5805 aSparklineDataVector.emplace_back(aAddress, aInputRangeSlice);
5812 sal_Int32 nOutputColSize = rSparklineRange.
aEnd.
Col() - rSparklineRange.
aStart.
Col();
5824 ScRange aInputRangeSlice = rDataRange;
5836 aSparklineDataVector.emplace_back(aAddress, aInputRangeSlice);
5842 if (aSparklineDataVector.empty())
5845 auto pUndoInsertSparkline = std::make_unique<sc::UndoInsertSparkline>(
rDocShell, aSparklineDataVector, pSparklineGroup);
5847 pUndoInsertSparkline->Redo();
5857 if (!rDocument.HasSparkline(rAddress))
5860 auto pUndoDeleteSparkline = std::make_unique<sc::UndoDeleteSparkline>(
rDocShell, rAddress);
5862 pUndoDeleteSparkline->Redo();
5870 if (!pSparklineGroup)
5875 if (!rDocument.HasTable(nTab))
5878 auto pUndo = std::make_unique<sc::UndoDeleteSparklineGroup>(
rDocShell, pSparklineGroup, nTab);
5888 auto pUndo = std::make_unique<sc::UndoEditSparklneGroup>(
rDocShell, pExistingSparklineGroup, rNewAttributes);
5897 auto pUndo = std::make_unique<sc::UndoGroupSparklines>(
rDocShell, rRange, rpGroup);
5906 auto pUndo = std::make_unique<sc::UndoUngroupSparklines>(
rDocShell, rRange);
5915 auto pUndo = std::make_unique<sc::UndoEditSparkline>(
rDocShell, rpSparkline, nTab, rDataRange);
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 ...
SfxApplication * SfxGetpApp()
static weld::MessageDialog * CreateMessageDialog(weld::Widget *pParent, VclMessageType eMessageType, VclButtonsType eButtonType, const OUString &rPrimaryMessage, const ILibreOfficeKitNotifier *pNotifier=nullptr)
const OUString & GetName() const
sal_uInt32 GetValue() const
OUString GetText(LineEnd eEnd=LINEEND_LF) const
std::unique_ptr< EditTextObject > CreateTextObject()
bool SetUpdateLayout(bool bUpdate, bool bRestoring=false)
sal_Int32 GetParagraphCount() const
virtual void SetParaAttribs(sal_Int32 nPara, const SfxItemSet &rSet)
const SfxItemSet & GetParaAttribs(sal_Int32 nPara) const
virtual std::unique_ptr< EditTextObject > Clone() const=0
void IncCol(SCCOL nDelta=1)
void IncRow(SCROW nDelta=1)
const OUString & GetSource() const
const OUString & GetOptions() const
const ScRange & GetDestArea() const
const OUString & GetFile() const
const OUString & GetFilter() const
std::unique_ptr< ScTokenArray > CompileString(const OUString &rFormula)
Tokenize formula expression string into an array of tokens.
SC_DLLPUBLIC bool HasTable(const ScDPObject *pDPObj) const
ScDetOpType GetOperation() const
const ScAddress & GetPos() const
const ScDetOpData & GetObject(size_t nPos) const
bool DeleteSucc(SCCOL nCol, SCROW nRow)
bool ShowError(SCCOL nCol, SCROW nRow)
bool ShowPred(SCCOL nCol, SCROW nRow)
bool DeletePred(SCCOL nCol, SCROW nRow)
bool DeleteAll(ScDetectiveDelete eWhat)
void GetAllSuccs(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, ::std::vector< ScTokenRef > &rRefTokens)
bool MarkInvalid(bool &rOverflow)
bool ShowSucc(SCCOL nCol, SCROW nRow)
void GetAllPreds(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, ::std::vector< ScTokenRef > &rRefTokens)
bool DeleteCirclesAt(SCCOL nCol, SCROW nRow)
const ScPatternAttr * GetNext(SCCOL &rCol, SCROW &rRow1, SCROW &rRow2)
void ModifyRangeNames(const ScRangeName &rNewRanges, SCTAB nTab=-1)
SC_DLLPUBLIC bool DeleteSparkline(ScAddress const &rAddress)
bool DetectiveAddError(const ScAddress &rPos)
bool MoveBlock(const ScRange &rSource, const ScAddress &rDestPos, bool bCut, bool bRecord, bool bPaint, bool bApi)
bool AutoFormat(const ScRange &rRange, const ScMarkData *pTabMark, sal_uInt16 nFormatNo, bool bApi)
bool SetStringOrEditCell(const ScAddress &rPos, const OUString &rStr, bool bInteraction)
SC_DLLPUBLIC bool ChangeSparkline(std::shared_ptr< sc::Sparkline > const &rpSparkline, SCTAB nTab, ScRangeList const &rDataRange)
bool AdjustRowHeight(const ScRange &rRange, bool bPaint, bool bApi)
bool Protect(SCTAB nTab, const OUString &rPassword)
bool SetNormalString(bool &o_rbNumFmtSet, const ScAddress &rPos, const OUString &rText, bool bApi)
bool UnmergeCells(const ScRange &rRange, bool bRecord, ScUndoRemoveMerge *pUndoRemoveMerge)
bool SetTabBgColor(SCTAB nTab, const Color &rColor, bool bRecord, bool bApi)
void ResizeMatrix(const ScRange &rOldRange, const ScAddress &rNewEnd)
bool DetectiveAddPred(const ScAddress &rPos)
void ProtectDocument(const ScDocProtection &rProtect)
void SetConditionalFormatList(ScConditionalFormatList *pList, SCTAB nTab)
Sets or replaces the conditional format list of a table.
bool SetFormulaCell(const ScAddress &rPos, ScFormulaCell *pCell, bool bInteraction)
Below two methods take ownership of the formula cell instance(s).
void ModifyAllRangeNames(const std::map< OUString, ScRangeName > &rRangeMap)
Modify all range names, global scope names as well as sheet local ones, in one go.
bool ChangeIndent(const ScMarkData &rMark, bool bIncrement, bool bApi)
bool SetValueCell(const ScAddress &rPos, double fVal, bool bInteraction)
bool CreateNames(const ScRange &rRange, CreateNameFlags nFlags, bool bApi, SCTAB nTab=-1)
bool RenameTable(SCTAB nTab, const OUString &rName, bool bRecord, bool bApi)
SC_DLLPUBLIC bool FillAuto(ScRange &rRange, const ScMarkData *pTabMark, FillDir eDir, FillCmd eCmd, FillDateCmd eDateCmd, sal_uLong nCount, double fStep, double fMax, bool bRecord, bool bApi)
bool InsertCells(const ScRange &rRange, const ScMarkData *pTabMark, InsCellCmd eCmd, bool bRecord, bool bApi, bool bPartOfPaste=false)
bool RemovePageBreak(bool bColumn, const ScAddress &rPos, bool bRecord, bool bSetModified)
bool SetCellText(const ScAddress &rPos, const OUString &rText, bool bInterpret, bool bEnglish, bool bApi, const formula::FormulaGrammar::Grammar eGrammar)
void ProtectSheet(SCTAB nTab, const ScTableProtection &rProtect)
bool SetStringCell(const ScAddress &rPos, const OUString &rStr, bool bInteraction)
SC_DLLPUBLIC bool ShowNote(const ScAddress &rPos, bool bShow)
bool TabOp(const ScRange &rRange, const ScMarkData *pTabMark, const ScTabOpParam &rParam, bool bRecord, bool bApi)
SC_DLLPUBLIC bool MergeCells(const ScCellMergeOption &rOption, bool bContents, bool bRecord, bool bApi, bool bEmptyMergedCells=false)
void SetNewRangeNames(std::unique_ptr< ScRangeName > pNewRanges, bool bModifyDoc, SCTAB nTab)
bool DeleteCells(const ScRange &rRange, const ScMarkData *pTabMark, DelCellCmd eCmd, bool bApi)
bool SetFormulaCells(const ScAddress &rPos, std::vector< ScFormulaCell * > &rCells, bool bInteraction)
bool DetectiveMarkInvalid(SCTAB nTab)
bool InsertPageBreak(bool bColumn, const ScAddress &rPos, bool bRecord, bool bSetModified)
bool FillSeries(const ScRange &rRange, const ScMarkData *pTabMark, FillDir eDir, FillCmd eCmd, FillDateCmd eDateCmd, double fStart, double fStep, double fMax, bool bApi)
SC_DLLPUBLIC bool InsertTable(SCTAB nTab, const OUString &rName, bool bRecord, bool bApi)
void ReplaceConditionalFormat(sal_uLong nOldIndex, std::unique_ptr< ScConditionalFormat > pFormat, SCTAB nTab, const ScRangeList &rRanges)
void NotifyDrawUndo(std::unique_ptr< SdrUndoAction >)
void EnterListAction(TranslateId pNameResId)
SC_DLLPUBLIC bool DeleteContents(const ScMarkData &rMark, InsertDeleteFlags nFlags, bool bRecord, bool bApi)
void InsertAreaLink(const OUString &rFile, const OUString &rFilter, const OUString &rOptions, const OUString &rSource, const ScRange &rDestRange, sal_Int32 nRefreshDelaySeconds, bool bFitBlock, bool bApi)
void SetTableVisible(SCTAB nTab, bool bVisible, bool bApi)
bool ApplyStyle(const ScMarkData &rMark, const OUString &rStyleName, bool bApi)
SC_DLLPUBLIC bool UngroupSparklines(ScRange const &rRange)
SC_DLLPUBLIC bool InsertSparklines(ScRange const &rDataRange, ScRange const &rSparklineRange, std::shared_ptr< sc::SparklineGroup > pSparklineGroup)
void SetNoteText(const ScAddress &rPos, const OUString &rNoteText, bool bApi)
void SetValueCells(const ScAddress &rPos, const std::vector< double > &aVals, bool bInteraction)
SC_DLLPUBLIC bool SetWidthOrHeight(bool bWidth, const std::vector< sc::ColRowSpan > &rRanges, SCTAB nTab, ScSizeMode eMode, sal_uInt16 nSizeTwips, bool bRecord, bool bApi)
bool DetectiveDelPred(const ScAddress &rPos)
void CreateOneName(ScRangeName &rList, SCCOL nPosX, SCROW nPosY, SCTAB nTab, SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, bool &rCancel, bool bApi)
bool DetectiveDelSucc(const ScAddress &rPos)
SC_DLLPUBLIC bool ChangeSparklineGroupAttributes(std::shared_ptr< sc::SparklineGroup > const &pExistingSparklineGroup, sc::SparklineAttributes const &rNewAttributes)
bool ApplyAttributes(const ScMarkData &rMark, const ScPatternAttr &rPattern, bool bApi)
void ConvertFormulaToValue(const ScRange &rRange, bool bInteraction)
bool SetEditCell(const ScAddress &rPos, const EditTextObject &rStr, bool bInteraction)
bool DeleteTable(SCTAB nTab, bool bRecord)
bool DetectiveDelAll(SCTAB nTab)
void NotifyInputHandler(const ScAddress &rPos)
SC_DLLPUBLIC bool DeleteSparklineGroup(std::shared_ptr< sc::SparklineGroup > const &pSparklineGroup, SCTAB nTab)
bool FillSimple(const ScRange &rRange, const ScMarkData *pTabMark, FillDir eDir, bool bApi)
bool InsertNameList(const ScAddress &rStartPos, bool bApi)
void PutData(const ScAddress &rPos, ScEditEngineDefaulter &rEngine, bool bApi)
bool DeleteCell(const ScAddress &rPos, const ScMarkData &rMark, InsertDeleteFlags nFlags, bool bRecord, bool bApi)
bool DetectiveRefresh(bool bAutomatic=false)
SC_DLLPUBLIC bool EnterMatrix(const ScRange &rRange, const ScMarkData *pTabMark, const ScTokenArray *pTokenArray, const OUString &rString, bool bApi, bool bEnglish, const OUString &rFormulaNmsp, const formula::FormulaGrammar::Grammar)
void ClearItems(const ScMarkData &rMark, const sal_uInt16 *pWhich, bool bApi)
void DetectiveCollectAllPreds(const ScRangeList &rSrcRanges, ::std::vector< ScTokenRef > &rRefTokens)
SC_DLLPUBLIC bool GroupSparklines(ScRange const &rRange, std::shared_ptr< sc::SparklineGroup > const &rpGroup)
bool TransliterateText(const ScMarkData &rMark, TransliterationFlags nType, bool bApi)
bool SetLayoutRTL(SCTAB nTab, bool bRTL)
SC_DLLPUBLIC ScPostIt * ImportNote(const ScAddress &rPos, const OUString &rNoteText)
bool DetectiveAddSucc(const ScAddress &rPos)
bool Unprotect(SCTAB nTab, const OUString &rPassword, bool bApi)
void DetectiveCollectAllSuccs(const ScRangeList &rSrcRanges, ::std::vector< ScTokenRef > &rRefTokens)
void ReplaceNote(const ScAddress &rPos, const OUString &rNoteText, const OUString *pAuthor, const OUString *pDate, bool bApi)
virtual bool verifyPassword(const OUString &aPassText) const override
virtual void setPassword(const OUString &aPassText) override
virtual bool isProtected() const override
virtual void setProtected(bool bProtected) override
Create before modifications of the document and destroy thereafter.
void SetDocumentModified()
void PostPaintCell(SCCOL nCol, SCROW nRow, SCTAB nTab)
static weld::Window * GetActiveDialogParent()
void SetDocumentModified()
SfxBindings * GetViewBindings()
void ErrorMessage(TranslateId pGlobStrId)
const ScDocument & GetDocument() const
void UpdatePaintExt(sal_uInt16 &rExtFlags, SCCOL nStartCol, SCROW nStartRow, SCTAB nStartTab, SCCOL nEndCol, SCROW nEndRow, SCTAB nEndTab)
ScDrawLayer * MakeDrawLayer()
ScTabViewShell * GetBestViewShell(bool bOnlyVisible=true)
void PostPaint(SCCOL nStartCol, SCROW nStartRow, SCTAB nStartTab, SCCOL nEndCol, SCROW nEndRow, SCTAB nEndTab, PaintPartFlags nPart, sal_uInt16 nExtFlags=0)
void SetDrawModified()
SetDrawModified - without Formula update.
static ScViewData * GetViewData()
virtual SfxUndoManager * GetUndoManager() override
void UpdateLinks() override
static void LOKCommentNotify(LOKCommentNotificationType nType, const ScDocument *pDocument, const ScAddress &rPos, const ScPostIt *pNote)
static void RemoveAppPrefix(OUString &rFilterName)
static bool GetFilterName(const OUString &rFileName, OUString &rFilter, OUString &rOptions, bool bWithContent, bool bWithInteraction)
Returns the filter name and options from a file name.
SC_DLLPUBLIC bool InsertTab(SCTAB nPos, const OUString &rName, bool bExternalDocument=false, bool bUndoDeleteTab=false)
SC_DLLPUBLIC bool IsScenario(SCTAB nTab) const
SC_DLLPUBLIC bool SetEditText(const ScAddress &rPos, std::unique_ptr< EditTextObject > pEditText)
This method manages the lifecycle of the passed edit text object.
SC_DLLPUBLIC bool RemoveFlagsTab(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, SCTAB nTab, ScMF nFlags)
ScSheetLimits & GetSheetLimits() const
SC_DLLPUBLIC void CopyFromClip(const ScRange &rDestRange, const ScMarkData &rMark, InsertDeleteFlags nInsFlag, ScDocument *pRefUndoDoc, ScDocument *pClipDoc, bool bResetCut=true, bool bAsLink=false, bool bIncludeFiltered=true, bool bSkipEmptyCells=false, const ScRangeList *pDestRanges=nullptr)
Paste data from a clipboard document into this document.
SC_DLLPUBLIC void GetRangeNameMap(std::map< OUString, ScRangeName * > &rRangeName)
bool UpdateOutlineCol(SCCOL nStartCol, SCCOL nEndCol, SCTAB nTab, bool bShow)
Adapt Outline.
bool RefreshAutoFilter(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, SCTAB nTab)
SC_DLLPUBLIC ScFormulaCell * SetFormulaCell(const ScAddress &rPos, ScFormulaCell *pCell)
Set formula cell, and transfer its ownership to the document.
void SetValues(const ScAddress &rPos, const std::vector< double > &rVals)
SC_DLLPUBLIC void SetAllRangeNames(const std::map< OUString, ScRangeName > &rRangeMap)
SC_DLLPUBLIC OUString GetLinkTab(SCTAB nTab) const
bool ValidRow(SCROW nRow) const
SC_DLLPUBLIC const ScTableProtection * GetTabProtection(SCTAB nTab) const
SC_DLLPUBLIC void SetLayoutRTL(SCTAB nTab, bool bRTL, ScObjectHandling eObjectHandling=ScObjectHandling::RecalcPosMode)
void UpdatePageBreaks(SCTAB nTab, const ScRange *pUserArea=nullptr)
void SetRangeName(SCTAB nTab, std::unique_ptr< ScRangeName > pNew)
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)
SC_DLLPUBLIC bool ExtendMerge(SCCOL nStartCol, SCROW nStartRow, SCCOL &rEndCol, SCROW &rEndRow, SCTAB nTab, bool bRefresh=false)
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)
void TransliterateText(const ScMarkData &rMultiMark, TransliterationFlags nType)
SC_DLLPUBLIC Color GetTabBgColor(SCTAB nTab) const
SC_DLLPUBLIC void InsertTableOp(const ScTabOpParam &rParam, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, const ScMarkData &rMark)
SC_DLLPUBLIC void CompileHybridFormula()
Call this immediately after updating named ranges.
SC_DLLPUBLIC bool IsTabProtected(SCTAB nTab) const
void InvalidatePageBreaks(SCTAB nTab)
bool SetFormulaCells(const ScAddress &rPos, std::vector< ScFormulaCell * > &rCells)
bool IsSelectionEditable(const ScMarkData &rMark, bool *pOnlyNotBecauseOfMatrix=nullptr) const
SC_DLLPUBLIC SCCOL MaxCol() const
SC_DLLPUBLIC const ScValidationData * GetValidationEntry(sal_uInt32 nIndex) const
SC_DLLPUBLIC bool RenameTab(SCTAB nTab, const OUString &rName, bool bExternalDocument=false)
const ScSheetEvents * GetSheetEvents(SCTAB nTab) const
SC_DLLPUBLIC void DoMergeContents(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, SCTAB nTab)
OUString GetLinkOpt(SCTAB nTab) const
SC_DLLPUBLIC bool SetOptimalHeight(sc::RowHeightContext &rCxt, SCROW nStartRow, SCROW nEndRow, SCTAB nTab, bool bApi)
SC_DLLPUBLIC ScDocumentPool * GetPool()
SC_DLLPUBLIC void ApplyPatternAreaTab(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, SCTAB nTab, const ScPatternAttr &rAttr)
SC_DLLPUBLIC formula::FormulaGrammar::AddressConvention GetAddressConvention() const
SC_DLLPUBLIC SCROW MaxRow() const
bool IsAdjustHeightLocked() const
SC_DLLPUBLIC bool HasPivotTable() const
SC_DLLPUBLIC ScFieldEditEngine & GetEditEngine()
ScDetOpList * GetDetOpList() const
SC_DLLPUBLIC void DoMerge(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, SCTAB nTab, bool bDeleteCaptions=true)
void BroadcastCells(const ScRange &rRange, SfxHintId nHint, bool bBroadcastSingleBroadcasters=true)
SC_DLLPUBLIC ScPostIt * GetNote(const ScAddress &rPos)
void AddDetectiveOperation(const ScDetOpData &rData)
void DeleteConditionalFormat(sal_uLong nIndex, SCTAB nTab)
SC_DLLPUBLIC sal_Int16 GetNamedRangesLockCount() const
SC_DLLPUBLIC void DeleteSelection(InsertDeleteFlags nDelFlag, const ScMarkData &rMark, bool bBroadcast=true)
SC_DLLPUBLIC void SetColBreak(SCCOL nCol, SCTAB nTab, bool bPage, bool bManual)
SC_DLLPUBLIC void ApplySelectionStyle(const ScStyleSheet &rStyle, const ScMarkData &rMark)
SC_DLLPUBLIC void PreprocessRangeNameUpdate()
bool IsDocEditable() const
SC_DLLPUBLIC ScBreakType HasRowBreak(SCROW nRow, SCTAB nTab) const
SC_DLLPUBLIC void GetScenarioData(SCTAB nTab, OUString &rComment, Color &rColor, ScScenarioFlags &rFlags) const
bool HasOLEObjectsInArea(const ScRange &rRange, const ScMarkData *pTabMark=nullptr)
void SetStreamValid(SCTAB nTab, bool bSet, bool bIgnoreLock=false)
SC_DLLPUBLIC void CopyToClip(const ScClipParam &rClipParam, ScDocument *pClipDoc, const ScMarkData *pMarks, bool bKeepScenarioFlags, bool bIncludeObjects)
SC_DLLPUBLIC void DoEmptyBlock(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, SCTAB nTab)
SC_DLLPUBLIC void SetRowHeightRange(SCROW nStartRow, SCROW nEndRow, SCTAB nTab, sal_uInt16 nNewHeight)
void SetCondFormList(ScConditionalFormatList *pList, SCTAB nTab)
SC_DLLPUBLIC void ShowCol(SCCOL nCol, SCTAB nTab, bool bShow)
SC_DLLPUBLIC bool GetAutoCalc() const
void SetCodeName(const OUString &r)
SC_DLLPUBLIC std::unique_ptr< ScPostIt > ReleaseNote(const ScAddress &rPos)
SC_DLLPUBLIC bool SetString(SCCOL nCol, SCROW nRow, SCTAB nTab, const OUString &rString, const ScSetStringParam *pParam=nullptr)
SC_DLLPUBLIC void InitUndo(const ScDocument &rSrcDoc, SCTAB nTab1, SCTAB nTab2, bool bColInfo=false, bool bRowInfo=false)
SC_DLLPUBLIC void DeleteArea(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, const ScMarkData &rMark, InsertDeleteFlags nDelFlag, bool bBroadcast=true, sc::ColumnSpanSet *pBroadcastSpans=nullptr)
bool UpdateOutlineRow(SCROW nStartRow, SCROW nEndRow, SCTAB nTab, bool bShow)
void DeleteRow(SCCOL nStartCol, SCTAB nStartTab, SCCOL nEndCol, SCTAB nEndTab, SCROW nStartRow, SCSIZE nSize, ScDocument *pRefUndoDoc=nullptr, bool *pUndoOutline=nullptr, const ScMarkData *pTabMark=nullptr)
SC_DLLPUBLIC ScBreakType HasColBreak(SCCOL nCol, SCTAB nTab) const
SC_DLLPUBLIC void SetDrawPageSize(SCTAB nTab)
void DeleteObjectsInSelection(const ScMarkData &rMark)
SC_DLLPUBLIC ScDrawLayer * GetDrawLayer()
SC_DLLPUBLIC void ApplySelectionPattern(const ScPatternAttr &rAttr, const ScMarkData &rMark, ScEditDataArray *pDataArray=nullptr, bool *pIsChanged=nullptr)
SC_DLLPUBLIC void ShowRows(SCROW nRow1, SCROW nRow2, SCTAB nTab, bool bShow)
sal_uInt16 GetOptimalColWidth(SCCOL nCol, SCTAB nTab, OutputDevice *pDev, double nPPTX, double nPPTY, const Fraction &rZoomX, const Fraction &rZoomY, bool bFormula, const ScMarkData *pMarkData=nullptr, const ScColWidthParam *pParam=nullptr)
SC_DLLPUBLIC bool RowHidden(SCROW nRow, SCTAB nTab, SCROW *pFirstRow=nullptr, SCROW *pLastRow=nullptr) const
SC_DLLPUBLIC CRFlags GetRowFlags(SCROW nRow, SCTAB nTab) const
SC_DLLPUBLIC bool HasNote(const ScAddress &rPos) const
SC_DLLPUBLIC void SetRowBreak(SCROW nRow, SCTAB nTab, bool bPage, bool bManual)
bool IsExecuteLinkEnabled() const
SC_DLLPUBLIC ScLinkMode GetLinkMode(SCTAB nTab) const
SC_DLLPUBLIC bool HasAttrib(SCCOL nCol1, SCROW nRow1, SCTAB nTab1, SCCOL nCol2, SCROW nRow2, SCTAB nTab2, HasAttrFlags nMask) const
void DeleteObjectsInArea(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, const ScMarkData &rMark, bool bAnchored=false)
void CopyToDocument(SCCOL nCol1, SCROW nRow1, SCTAB nTab1, SCCOL nCol2, SCROW nRow2, SCTAB nTab2, InsertDeleteFlags nFlags, bool bMarked, ScDocument &rDestDoc, const ScMarkData *pMarks=nullptr, bool bColRowFlags=true)
SC_DLLPUBLIC void SetValue(SCCOL nCol, SCROW nRow, SCTAB nTab, const double &rVal)
bool IsChangeReadOnlyEnabled() const
const OUString & GetCodeName() const
SC_DLLPUBLIC void ApplyPatternArea(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, const ScMarkData &rMark, const ScPatternAttr &rAttr, ScEditDataArray *pDataArray=nullptr, bool *const pIsChanged=nullptr)
void ClearSelectionItems(const sal_uInt16 *pWhich, const ScMarkData &rMark)
void ConvertFormulaToValue(const ScRange &rRange, sc::TableValues *pUndo)
SC_DLLPUBLIC void ApplyAttr(SCCOL nCol, SCROW nRow, SCTAB nTab, const SfxPoolItem &rAttr)
SC_DLLPUBLIC ScDocProtection * GetDocProtection() const
SfxObjectShell * GetDocumentShell() const
void ChangeSelectionIndent(bool bIncrement, const ScMarkData &rMark)
SC_DLLPUBLIC ScStyleSheetPool * GetStyleSheetPool() const
SC_DLLPUBLIC ScOutlineTable * GetOutlineTable(SCTAB nTab, bool bCreate=false)
bool ValidCol(SCCOL nCol) const
SC_DLLPUBLIC void AddCondFormatData(const ScRangeList &rRange, SCTAB nTab, sal_uInt32 nIndex)
SC_DLLPUBLIC bool HasValueData(SCCOL nCol, SCROW nRow, SCTAB nTab) const
SC_DLLPUBLIC void ExtendOverlapped(SCCOL &rStartCol, SCROW &rStartRow, SCCOL nEndCol, SCROW nEndRow, SCTAB nTab) const
void DeleteCol(SCROW nStartRow, SCTAB nStartTab, SCROW nEndRow, SCTAB nEndTab, SCCOL nStartCol, SCSIZE nSize, ScDocument *pRefUndoDoc=nullptr, bool *pUndoOutline=nullptr, const ScMarkData *pTabMark=nullptr)
SC_DLLPUBLIC OUString GetFormula(SCCOL nCol, SCROW nRow, SCTAB nTab) const
SC_DLLPUBLIC void PreprocessAllRangeNamesUpdate(const std::map< OUString, ScRangeName > &rRangeMap)
Call this immediately before updating all named ranges.
sal_uLong GetLinkRefreshDelay(SCTAB nTab) const
SC_DLLPUBLIC void SetRowFlags(SCROW nRow, SCTAB nTab, CRFlags nNewFlags)
SC_DLLPUBLIC ScConditionalFormatList * GetCondFormList(SCTAB nTab) const
SC_DLLPUBLIC SvNumberFormatter * GetFormatTable() const
SC_DLLPUBLIC ScRangeName * GetRangeName(SCTAB nTab) const
SC_DLLPUBLIC ScPostIt * GetOrCreateNote(const ScAddress &rPos)
SC_DLLPUBLIC bool ColHidden(SCCOL nCol, SCTAB nTab, SCCOL *pFirstCol=nullptr, SCCOL *pLastCol=nullptr) const
SC_DLLPUBLIC void SetDocProtection(const ScDocProtection *pProtect)
void AutoFormat(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, sal_uInt16 nFormatNo, const ScMarkData &rMark)
SC_DLLPUBLIC bool IsEmptyData(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, SCTAB nTab) const
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
SC_DLLPUBLIC bool IsVisible(SCTAB nTab) const
void ClearDetectiveOperations()
SC_DLLPUBLIC OUString GetLinkDoc(SCTAB nTab) const
void RemoveCondFormatData(const ScRangeList &rRange, SCTAB nTab, sal_uInt32 nIndex)
SC_DLLPUBLIC void SetManualHeight(SCROW nStartRow, SCROW nEndRow, SCTAB nTab, bool bManual)
SC_DLLPUBLIC void SetTabProtection(SCTAB nTab, const ScTableProtection *pProtect)
bool IsLinked(SCTAB nTab) const
SC_DLLPUBLIC void SetColWidth(SCCOL nCol, SCTAB nTab, sal_uInt16 nNewWidth)
ScChangeTrack * GetChangeTrack() const
SC_DLLPUBLIC CellType GetCellType(SCCOL nCol, SCROW nRow, SCTAB nTab) const
SC_DLLPUBLIC bool IsLayoutRTL(SCTAB nTab) const
SC_DLLPUBLIC bool DeleteTab(SCTAB nTab)
SC_DLLPUBLIC sfx2::LinkManager * GetLinkManager()
bool IsUndoEnabled() const
void SetDirty(const ScRange &, bool bIncludeEmptyCells)
SC_DLLPUBLIC bool GetName(SCTAB nTab, OUString &rName) const
SC_DLLPUBLIC void SetTabBgColor(SCTAB nTab, const Color &rColor)
bool HasSelectedBlockMatrixFragment(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, const ScMarkData &rMark) const
OUString GetLinkFlt(SCTAB nTab) const
SC_DLLPUBLIC sal_uLong AddCondFormat(std::unique_ptr< ScConditionalFormat > pNew, SCTAB nTab)
void PutInFormulaTree(ScFormulaCell *pCell)
void TransferCellValuesTo(const ScAddress &rTopPos, size_t nLen, sc::CellValues &rDest)
Transfer a series of contiguous cell values from specified position to the passed container.
SC_DLLPUBLIC const SfxPoolItem * GetAttr(SCCOL nCol, SCROW nRow, SCTAB nTab, sal_uInt16 nWhich) const
SC_DLLPUBLIC SCSIZE GetEmptyLinesInBlock(SCCOL nStartCol, SCROW nStartRow, SCTAB nStartTab, SCCOL nEndCol, SCROW nEndRow, SCTAB nEndTab, ScDirection eDir)
SC_DLLPUBLIC const ScPatternAttr * GetPattern(SCCOL nCol, SCROW nRow, SCTAB nTab) const
bool InsertCol(SCROW nStartRow, SCTAB nStartTab, SCROW nEndRow, SCTAB nEndTab, SCCOL nStartCol, SCSIZE nSize, ScDocument *pRefUndoDoc=nullptr, const ScMarkData *pTabMark=nullptr)
bool InsertRow(SCCOL nStartCol, SCTAB nStartTab, SCCOL nEndCol, SCTAB nEndTab, SCROW nStartRow, SCSIZE nSize, ScDocument *pRefUndoDoc=nullptr, const ScMarkData *pTabMark=nullptr)
SC_DLLPUBLIC ScDPCollection * GetDPCollection()
SC_DLLPUBLIC void SetVisible(SCTAB nTab, bool bVisible)
SC_DLLPUBLIC bool IsActiveScenario(SCTAB nTab) const
void RemoveRowBreak(SCROW nRow, SCTAB nTab, bool bPage, bool bManual)
void IncXMLImportedFormulaCount(sal_uInt64 nVal)
bool IsImportingXML() const
SC_DLLPUBLIC SCTAB GetTableCount() const
void RemoveColBreak(SCCOL nCol, SCTAB nTab, bool bPage, bool bManual)
void BeginCalcUndo(bool bDisableTextEditUsesCommonUndoManager)
std::unique_ptr< SdrUndoGroup > GetCalcUndo()
void AddCalcUndo(std::unique_ptr< SdrUndoAction > pUndo)
static void SetGlobalDrawPersist(SfxObjectShell *pPersist)
const SfxItemSet & GetAttribs() const
bool NeedsCellAttr() const
void SetTextCurrentDefaults(const EditTextObject &rTextObject)
SetText and apply defaults already set.
TranslateId GetMessageId() const
void TestBlock(const ScDocument &rDoc, SCTAB nTab, SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, bool bNoMatrixAtAll=false)
static SC_DLLPUBLIC ScAutoFormat * GetOrCreateAutoFormat()
static SC_DLLPUBLIC const CharClass & getCharClass()
todo: It should be possible to have MarkArrays for each table, in order to enable "search all" across...
const_iterator end() const
const ScRange & GetMultiMarkArea() const
void SelectTable(SCTAB nTab, bool bNew)
const ScRange & GetMarkArea() const
void SelectOneTable(SCTAB nTab)
bool IsMultiMarked() const
void SetMarking(bool bFlag)
SCTAB GetSelectCount() const
void SetMarkArea(const ScRange &rRange)
const_iterator begin() const
const_reverse_iterator rbegin() const
static ScPostIt * CreateNoteFromString(ScDocument &rDoc, const ScAddress &rPos, const OUString &rNoteText, bool bShown, bool bAlwaysCreateCaption, sal_uInt32 nPostItId=0)
Creates a cell note based on the passed string and inserts it into the document.
void DeleteUnchanged(const ScPatternAttr *pOldAttrs)
SfxItemSet & GetItemSet()
const SfxPoolItem & GetItem(sal_uInt16 nWhichP) const
static void GetFromEditItemSet(SfxItemSet &rDestSet, const SfxItemSet &rEditSet)
Converts all edit engine items contained in rEditSet to Calc items and puts them into rDestSet.
Additional class containing cell annotation data.
const ScNoteData & GetNoteData() const
Returns the data struct containing all note settings.
void SetAuthor(const OUString &rAuthor)
Sets a new author date for this note.
void ShowCaption(const ScAddress &rPos, bool bShow)
Shows or hides the note caption object.
void SetDate(const OUString &rDate)
Sets a new creation date for this note.
bool IsCaptionShown() const
Returns true, if the caption object is visible.
SdrCaptionObj * GetCaption() const
Returns an existing note caption object.
bool HasType(Type nType) const
static void MakeValidName(const ScDocument &rDoc, OUString &rName)
SC_DLLPUBLIC OUString GetSymbol(const formula::FormulaGrammar::Grammar eGrammar=formula::FormulaGrammar::GRAM_DEFAULT) const
const OUString & GetUpperName() const
SC_DLLPUBLIC ScRangeData * findByUpperName(const OUString &rName)
void erase(const ScRangeData &r)
SC_DLLPUBLIC bool insert(ScRangeData *p, bool bReuseFreeIndex=true)
Insert object into set.
bool Move(SCCOL aDeltaX, SCROW aDeltaY, SCTAB aDeltaZ, ScRange &rErrorRange, const ScDocument &rDoc)
void ExtendTo(const ScRange &rRange)
bool Contains(const ScAddress &) const
is Address& fully in Range?
sal_Int32 GetRefreshDelaySeconds() const
OutputDevice * GetDevice() const
static ScInputStringType parseInputString(SvNumberFormatter &rFormatter, const OUString &rStr, LanguageType eLang)
static bool SC_DLLPUBLIC isMultiline(std::u16string_view rStr)
static void notifyAllViewsSheetGeomInvalidation(const SfxViewShell *pForViewShell, bool bColumns, bool bRows, bool bSizes, bool bHidden, bool bFiltered, bool bGroups, SCTAB nCurrentTabIndex)
Emits a LOK_CALLBACK_INVALIDATE_SHEET_GEOMETRY for all views whose current tab is equal to nCurrentTa...
static void notifyAllViewsHeaderInvalidation(const SfxViewShell *pForViewShell, HeaderType eHeaderType, SCTAB nCurrentTabIndex)
Emits a LOK_CALLBACK_INVALIDATE_HEADER for all views whose current tab is equal to nCurrentTabIndex.
void UpdateInputHandler(bool bForce=false, bool bStopEditing=true)
static ScTabViewShell * GetActiveViewShell()
static void OnLOKNoteStateChanged(const ScPostIt *pNote)
void MarkRange(const ScRange &rRange, bool bSetCursor=true, bool bContinue=false)
ScViewData & GetViewData()
SC_DLLPUBLIC void SetCursor(SCCOL nPosX, SCROW nPosY, bool bNew=false)
sheet protection state container
virtual bool verifyPassword(const OUString &aPassText) const override
virtual bool isProtected() const override
virtual void setProtected(bool bProtected) override
void AssignXMLString(const OUString &rText, const OUString &rFormulaNmsp)
Assign XML string placeholder to the array.
std::vector< Value > ValuesType
void AddCellMergeOption(const ScCellMergeOption &rOption)
ScDocument * GetUndoDoc()
ScPositionHelper & GetLOKHeightHelper()
ScDocShell * GetDocShell() const
static bool SelectionFillDOOM(const ScRange &rRange)
Determine DOOM condition, i.e. from selected range.
void OnLOKInsertDeleteColumn(SCCOL nStartCol, tools::Long nOffset)
void OnLOKInsertDeleteRow(SCROW nStartRow, tools::Long nOffset)
void OnLOKSetWidthOrHeight(SCCOLROW nStart, bool bWidth)
void Invalidate(sal_uInt16 nId)
const SfxPoolItem & GetDefaultItem(sal_uInt16 nWhich) const
const WhichRangesContainer & GetRanges() const
SfxItemPool * GetPool() const
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) const
sal_uInt16 ClearItem(sal_uInt16 nWhich=0)
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
css::uno::Reference< css::script::XLibraryContainer > GetBasicContainer()
BasicManager * GetBasicManager() const
css::uno::Reference< css::frame::XModel3 > GetModel() const
virtual SfxStyleSheetBase * Find(const OUString &, SfxStyleFamily eFam, SfxStyleSearchBits n=SfxStyleSearchBits::All)
virtual void EnterListAction(const OUString &rComment, const OUString &rRepeatComment, sal_uInt16 nId, ViewShellId nViewShellId)
void RemoveLastUndoAction()
virtual void AddUndoAction(std::unique_ptr< SfxUndoAction > pAction, bool bTryMerg=false)
static SAL_WARN_UNUSED_RESULT SfxViewFrame * GetNext(const SfxViewFrame &rPrev, const SfxObjectShell *pDoc=nullptr, bool bOnlyVisible=true)
static SAL_WARN_UNUSED_RESULT SfxViewFrame * GetFirst(const SfxObjectShell *pDoc=nullptr, bool bOnlyVisible=true)
ViewShellDocId GetDocId() const override
ViewShellId GetViewShellId() const override
static SAL_WARN_UNUSED_RESULT SfxViewShell * GetNext(const SfxViewShell &rPrev, bool bOnlyVisible=true, const std::function< bool(const SfxViewShell *)> &isViewShell=nullptr)
static SAL_WARN_UNUSED_RESULT SfxViewShell * GetFirst(bool bOnlyVisible=true, const std::function< bool(const SfxViewShell *)> &isViewShell=nullptr)
static void addDeleteContentsUndo(SfxUndoManager *pUndoMgr, ScDocShell *pDocSh, const ScMarkData &rMark, const ScRange &rRange, ScDocumentUniquePtr &&pUndoDoc, InsertDeleteFlags nFlags, const std::shared_ptr< ScSimpleUndo::DataSpansType > &pSpans, bool bMulti, bool bDrawUndo)
static ScDocumentUniquePtr createDeleteContentsUndoDoc(ScDocument &rDoc, const ScMarkData &rMark, const ScRange &rRange, InsertDeleteFlags nFlags, bool bOnlyMarked)
static std::shared_ptr< ScSimpleUndo::DataSpansType > getNonEmptyCellSpans(const ScDocument &rDoc, const ScMarkData &rMark, const ScRange &rRange)
static bool hasProtectedTab(const ScDocument &rDoc, const ScMarkData &rMark)
void setForceAutoSize(bool b)
Common properties for a group of sparklines.
Stores cell values for multiple tables.
void InsertFileLink(sfx2::SvBaseLink &, SvBaseLinkObjectType nFileType, std::u16string_view rFileNm, const OUString *pFilterNm=nullptr, const OUString *pRange=nullptr)
void Remove(SvBaseLink const *pLink)
const SvBaseLinks & GetLinks() const
void VBA_InsertModule(ScDocument &rDoc, SCTAB nTab, const OUString &sSource)
static void lcl_PaintAbove(ScDocShell &rDocShell, const ScRange &rRange)
static ScDirection DirFromFillDir(FillDir eDir)
static void lcl_collectAllPredOrSuccRanges(const ScRangeList &rSrcRanges, vector< ScTokenRef > &rRefTokens, ScDocShell &rDocShell, bool bPred)
static sal_uInt16 lcl_GetOptimalColWidth(ScDocShell &rDocShell, SCCOL nCol, SCTAB nTab)
SetWidthOrHeight - duplicated in ViewFunc !!!!!! Problems:
static uno::Reference< uno::XInterface > GetDocModuleObject(const SfxObjectShell &rDocSh, const OUString &sCodeName)
void VBA_DeleteModule(ScDocShell &rDocSh, const OUString &sModuleName)
static script::ModuleInfo lcl_InitModuleInfo(const SfxObjectShell &rDocSh, const OUString &sModule)
std::unique_ptr< ScDocument, o3tl::default_delete< ScDocument > > ScDocumentUniquePtr
@ NOTE
Strings (and string results if InsertDeleteFlags::FORMULA is not set).
@ NOCAPTIONS
Sparklines in a cell.
@ AUTOFILL
Copy flags for auto/series fill functions: do not touch notes and drawing objects.
@ ATTRIB
Internal use only (d&d undo): do not delete caption objects of cell notes.
constexpr sal_Int32 STD_EXTRA_WIDTH
#define LANGUAGE_ENGLISH_US
LineEnd GetSystemLineEnd()
TOOLS_DLLPUBLIC OString convertLineEnd(const OString &rIn, LineEnd eLineEnd)
#define SAL_WARN_IF(condition, area, stream)
#define SAL_WARN(area, stream)
std::unique_ptr< sal_Int32[]> pData
bool isTiledAnnotations()
constexpr std::enable_if_t< std::is_signed_v< T >, std::make_unsigned_t< T > > make_unsigned(T value)
std::basic_string_view< charT, traits > getToken(std::basic_string_view< charT, traits > sv, charT delimiter, std::size_t &position)
RangeOrientation calculateOrientation(sal_Int32 nOutputSize, ScRange const &rInputRange)
Determine the sparkline group orientation for the input data the output size.
int ScRangeData_QsortNameCompare(const void *p1, const void *p2)
OUString ScResId(TranslateId aId)
constexpr TypedWhichId< ScMergeFlagAttr > ATTR_MERGE_FLAG(145)
constexpr TypedWhichId< ScMergeAttr > ATTR_MERGE(144)
constexpr TypedWhichId< SvxHorJustifyItem > ATTR_HOR_JUSTIFY(129)
constexpr TypedWhichId< SfxUInt32Item > ATTR_VALUE_FORMAT(146)
constexpr TypedWhichId< SvxVerJustifyItem > ATTR_VER_JUSTIFY(132)
constexpr TypedWhichId< SfxUInt32Item > ATTR_VALIDDATA(153)
OUString VCL_DLLPUBLIC GetStandardText(StandardButtonType eButton)
ScRange getSingleRange(SCTAB nTab) const
::std::set< SCTAB > maTabs
Store arbitrary cell value of any kind.
void assign(const ScDocument &rDoc, const ScAddress &rPos)
Take cell value from specified position in specified document.
This struct stores general clipboard parameters associated with a ScDocument instance created in clip...
Internal data for a cell annotation.
rtl::Reference< SdrCaptionObj > mxCaption
Initial data for invisible notes without SdrObject.
This is very similar to ScCellValue, except that it references the original value instead of copying ...
Store parameters used in the ScDocument::SetString() method.
void setTextInput()
Call this whenever you need to unconditionally set input as text, no matter what the input is.
Parameter for data table aka multiple operations.
ScRefAddress aRefFormulaEnd
ScRefAddress aRefFormulaCell
::std::vector< ScUndoTabColorInfo > List
sal_Int32 SCCOLROW
a type capable of holding either SCCOL or SCROW