39#include <undomanager.hxx>
105 class DisableUndoGuard
111 explicit DisableUndoGuard(
ScDocShell *pDocShell)
112 :
m_rDoc(pDocShell->GetDocument())
113 , m_bUndoEnabled(
m_rDoc.IsUndoEnabled())
120 m_rDoc.EnableUndo(m_bUndoEnabled);
192 explicit SpanBroadcaster(
ScDocument& rDoc ) : mrDoc(rDoc), mnCurTab(-1), mnCurCol(-1) {}
196 mnCurTab = pCol->
GetTab();
197 mnCurCol = pCol->
GetCol();
205 ScRange aRange(mnCurCol, nRow1, mnCurTab, mnCurCol, nRow2, mnCurTab);
215 SpanBroadcaster aBroadcaster(rDoc);
217 for (
const auto& rEntry : rSpans)
220 rSet.executeColumnAction(rDoc, aBroadcaster);
239 if ( nTab < nStart || nTab > nEnd )
247 aBlockRange( rRange ),
349 maBlockRanges(
std::move(aRanges))
407 pViewShell->
MarkRange(aRange,
false,
true);
413 pRefUndoDoc(
std::move(pRefDoc) ),
414 pRefUndoData(
std::move(pRefData) )
459 aOriginalRange( rOriginal )
493 pNoNameData->
GetArea( nRangeTab, nRangeX1, nRangeY1, nRangeX2, nRangeY2 );
501 pAutoDBRange->GetArea( nRangeTab, nRangeX1, nRangeY1, nRangeX2, nRangeY2 );
524 pNoNameData->
GetArea( nRangeTab, nRangeX1, nRangeY1, nRangeX2, nRangeY2 );
550 pWrappedUndo(
std::move(pUndo) ),
627 if (GetUndoActionCount() <= 1)
646 for (
size_t i = 0;
i < GetUndoActionCount(); ++
i)
651 pViewAction = pAction;
671 if (topRange->Intersects(*viewRange))
674 for (
size_t i = 0;
i < GetRedoActionCount(); ++
i)
682 if (!redoRange || (redoRange->Intersects(*viewRange) && pRedoAction->GetViewShellId() != nViewId))
698 return pSimpleUndo->getAffectedRange();
709 if (pListAction->maUndoActions.size() > 1)
711 return dynamic_cast<ScSimpleUndo*
>(pListAction->maUndoActions[0].pAction.get());
virtual ~ScBlockUndo() override
std::unique_ptr< SdrUndoAction > pDrawUndo
ScBlockUndo(ScDocShell *pDocSh, const ScRange &rRange, ScBlockUndoMode eBlockMode)
void GetArea(SCTAB &rTab, SCCOL &rCol1, SCROW &rRow1, SCCOL &rCol2, SCROW &rRow2) const
void SetAutoFilter(bool bSet)
void SetSubTotalParam(const ScSubTotalParam &rSubTotalParam)
SC_DLLPUBLIC void SetSortParam(const ScSortParam &rSortParam)
SC_DLLPUBLIC void SetQueryParam(const ScQueryParam &rQueryParam)
void SetArea(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2)
std::unique_ptr< ScDBData > pAutoDBRange
ScDBFuncUndo(ScDocShell *pDocSh, const ScRange &rOriginal)
virtual ~ScDBFuncUndo() override
void SetDocumentModified()
const ScDocument & GetDocument() const
std::unique_ptr< ScDBData > GetOldAutoDBRange()
void SetInUndo(bool bSet)
void PostPaint(SCCOL nStartCol, SCROW nStartRow, SCTAB nStartTab, SCCOL nEndCol, SCROW nEndRow, SCTAB nEndTab, PaintPartFlags nPart, sal_uInt16 nExtFlags=0)
void DBAreaDeleted(SCTAB nTab, SCCOL nX1, SCROW nY1, SCCOL nX2)
SCTAB GetVisibleTab() const
SC_DLLPUBLIC SCCOL MaxCol() const
SC_DLLPUBLIC bool SetOptimalHeight(sc::RowHeightContext &rCxt, SCROW nStartRow, SCROW nEndRow, SCTAB nTab, bool bApi)
SC_DLLPUBLIC SCROW MaxRow() const
void BroadcastCells(const ScRange &rRange, SfxHintId nHint, bool bBroadcastSingleBroadcasters=true)
SC_DLLPUBLIC bool ApplyFlagsTab(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, SCTAB nTab, ScMF nFlags)
SC_DLLPUBLIC void SetDrawPageSize(SCTAB nTab)
SC_DLLPUBLIC ScDBData * GetAnonymousDBData(SCTAB nTab)
static SC_DLLPUBLIC double nScreenPPTX
Horizontal pixel per twips factor.
static SC_DLLPUBLIC double nScreenPPTY
Vertical pixel per twips factor.
todo: It should be possible to have MarkArrays for each table, in order to enable "search all" across...
std::unique_ptr< SdrUndoAction > pDrawUndo
virtual ~ScMoveUndo() override
ScDocumentUniquePtr pRefUndoDoc
std::unique_ptr< ScRefUndoData > pRefUndoData
ScMoveUndo(ScDocShell *pDocSh, ScDocumentUniquePtr pRefDoc, std::unique_ptr< ScRefUndoData > pRefData)
virtual ~ScMultiBlockUndo() override
ScRangeList maBlockRanges
std::unique_ptr< SdrUndoAction > mpDrawUndo
ScMultiBlockUndo(ScDocShell *pDocSh, ScRangeList aRanges)
virtual bool Merge(SfxUndoAction *pNextAction) override
ScSimpleUndo(const ScSimpleUndo &)=delete
void BroadcastChanges(const ScRange &rRange)
std::map< SCTAB, std::unique_ptr< sc::ColumnSpanSet > > DataSpansType
std::unique_ptr< SfxUndoAction > pDetectiveUndo
ViewShellId mnViewShellId
static void ShowTable(SCTAB nTab)
bool IsPaintLocked() const
bool SetViewMarkData(const ScMarkData &rMarkData)
ViewShellId GetViewShellId() const override
See SfxUndoAction::GetViewShellId().
void UpdateInputHandler(bool bForce=false, bool bStopEditing=true)
static ScTabViewShell * GetActiveViewShell()
void UpdateAutoFillMark(bool bFromPaste=false)
void MarkRange(const ScRange &rRange, bool bSetCursor=true, bool bContinue=false)
SC_DLLPUBLIC void MoveCursorAbs(SCCOL nCurX, SCROW nCurY, ScFollowMode eMode, bool bShift, bool bControl, bool bKeepOld=false, bool bKeepSel=false)
ScViewData & GetViewData()
void SetMarkData(const ScMarkData &rNew)
SC_DLLPUBLIC void SetTabNo(SCTAB nTab, bool bNew=false, bool bExtendSelection=false, bool bSameTabButMoved=false)
std::unique_ptr< SfxUndoAction > ReleaseDrawUndo()
bool IsViewUndoActionIndependent(const SfxViewShell *pView, sal_uInt16 &rOffset) const
Checks if the topmost undo action owned by pView is independent from the topmost action undo action.
static std::optional< ScRange > getAffectedRangeFromUndo(const SfxUndoAction *)
static const ScSimpleUndo * getScSimpleUndo(const SfxUndoAction *)
ViewShellId mnViewShellId
virtual bool CanRepeat(SfxRepeatTarget &rTarget) const override
virtual OUString GetRepeatComment(SfxRepeatTarget &) const override
std::unique_ptr< SfxUndoAction > pWrappedUndo
virtual OUString GetComment() const override
virtual void Redo() override
ViewShellId GetViewShellId() const override
See SfxUndoAction::GetViewShellId().
virtual void Repeat(SfxRepeatTarget &rTarget) override
virtual bool Merge(SfxUndoAction *pNextAction) override
virtual void Undo() override
ScUndoWrapper(std::unique_ptr< SfxUndoAction > pUndo)
virtual ~ScUndoWrapper() override
const Fraction & GetZoomY() const
const Fraction & GetZoomX() const
virtual ViewShellId GetViewShellId() const
ViewShellId GetViewShellId() const override
virtual void execute(SCROW nRow1, SCROW nRow2, bool bVal)=0
virtual void startColumn(ScColumn *pCol)=0
Structure that stores segments of boolean flags per column, and perform custom action on those segmen...
std::unique_ptr< ScDocument, o3tl::default_delete< ScDocument > > ScDocumentUniquePtr
std::unique_ptr< SdrUndoAction > GetSdrUndoAction(ScDocument *pDoc)
void DoSdrUndoAction(SdrUndoAction *pUndoAction, ScDocument *pDoc)
void RedoSdrUndoAction(SdrUndoAction *pUndoAction)
void EnableDrawAdjust(ScDocument *pDoc, bool bEnable)