LibreOffice Module sc (master) 1
undobase.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#include <utility>
21#include <vcl/virdev.hxx>
22#include <svx/svdundo.hxx>
23
24#include <undobase.hxx>
25#include <undocell.hxx>
26#include <refundo.hxx>
27#include <docsh.hxx>
28#include <tabvwsh.hxx>
29#include <undoolk.hxx>
30#include <undodraw.hxx>
31#include <dbdata.hxx>
32#include <attrib.hxx>
33#include <queryparam.hxx>
34#include <subtotalparam.hxx>
35#include <rowheightcontext.hxx>
36#include <column.hxx>
37#include <sortparam.hxx>
38#include <columnspanset.hxx>
39#include <undomanager.hxx>
40
41
43 pDocShell( pDocSh ),
44 mnViewShellId(-1)
45{
47 mnViewShellId = pViewShell->GetViewShellId();
48}
49
51{
52 return mnViewShellId;
53}
54
56{
57 if ( IsPaintLocked() )
58 return false;
59
61 if ( !pViewShell )
62 return false;
63
64 pViewShell->SetMarkData( rMarkData );
65 return true;
66}
67
69{
70 // A SdrUndoGroup for updating detective arrows can belong
71 // to each Undo-Action.
72 // DetectiveRefresh is always called next,
73 // the SdrUndoGroup is encapsulated in a ScUndoDraw action.
74 // AddUndoAction is only called with bTryMerg=sal_True
75 // for automatic update.
76
77 if ( !pDetectiveUndo && dynamic_cast<const ScUndoDraw*>( pNextAction) != nullptr )
78 {
79 // Take SdrUndoAction from ScUndoDraw Action,
80 // ScUndoDraw is later deleted by the UndoManager
81
82 ScUndoDraw* pCalcUndo = static_cast<ScUndoDraw*>(pNextAction);
83 pDetectiveUndo = pCalcUndo->ReleaseDrawUndo();
84 return true;
85 }
86
87 return false;
88}
89
91{
92 pDocShell->SetInUndo( true );
93
95 if (pViewShell)
96 pViewShell->HideAllCursors(); // for example due to merged cells
97
98 // detective updates happened last, must be undone first
100 pDetectiveUndo->Undo();
101}
102
103namespace
104{
105 class DisableUndoGuard
106 {
107 private:
109 bool m_bUndoEnabled;
110 public:
111 explicit DisableUndoGuard(ScDocShell *pDocShell)
112 : m_rDoc(pDocShell->GetDocument())
113 , m_bUndoEnabled(m_rDoc.IsUndoEnabled())
114 {
115 m_rDoc.EnableUndo(false);
116 }
117
118 ~DisableUndoGuard()
119 {
120 m_rDoc.EnableUndo(m_bUndoEnabled);
121 }
122 };
123}
124
126{
127 {
128 // rhbz#1352881 Temporarily turn off undo generation during
129 // SetDocumentModified
130 DisableUndoGuard aGuard(pDocShell);
132 }
133
135 if (pViewShell)
136 {
137 pViewShell->UpdateAutoFillMark();
138 pViewShell->UpdateInputHandler();
139 pViewShell->ShowAllCursors();
140 }
141
142 pDocShell->SetInUndo( false );
143}
144
146{
147 pDocShell->SetInUndo( true );
148
150 if (pViewShell)
151 pViewShell->HideAllCursors(); // for example due to merged cells
152}
153
155{
156 if (pDetectiveUndo)
157 pDetectiveUndo->Redo();
158
159 {
160 // rhbz#1352881 Temporarily turn off undo generation during
161 // SetDocumentModified
162 DisableUndoGuard aGuard(pDocShell);
164 }
165
167 if (pViewShell)
168 {
169 pViewShell->UpdateAutoFillMark();
170 pViewShell->UpdateInputHandler();
171 pViewShell->ShowAllCursors();
172 }
173
174 pDocShell->SetInUndo( false );
175}
176
178{
180 rDoc.BroadcastCells(rRange, SfxHintId::ScDataChanged);
181}
182
183namespace {
184
185class SpanBroadcaster : public sc::ColumnSpanSet::ColumnAction
186{
187 ScDocument& mrDoc;
188 SCTAB mnCurTab;
189 SCCOL mnCurCol;
190
191public:
192 explicit SpanBroadcaster( ScDocument& rDoc ) : mrDoc(rDoc), mnCurTab(-1), mnCurCol(-1) {}
193
194 virtual void startColumn( ScColumn* pCol ) override
195 {
196 mnCurTab = pCol->GetTab();
197 mnCurCol = pCol->GetCol();
198 }
199
200 virtual void execute( SCROW nRow1, SCROW nRow2, bool bVal ) override
201 {
202 if (!bVal)
203 return;
204
205 ScRange aRange(mnCurCol, nRow1, mnCurTab, mnCurCol, nRow2, mnCurTab);
206 mrDoc.BroadcastCells(aRange, SfxHintId::ScDataChanged);
207 };
208};
209
210}
211
213{
215 SpanBroadcaster aBroadcaster(rDoc);
216
217 for (const auto& rEntry : rSpans)
218 {
219 const sc::ColumnSpanSet& rSet = *rEntry.second;
220 rSet.executeColumnAction(rDoc, aBroadcaster);
221 }
222}
223
225{
227 if (pViewShell)
228 pViewShell->SetTabNo( nTab );
229}
230
231void ScSimpleUndo::ShowTable( const ScRange& rRange )
232{
234 if (pViewShell)
235 {
236 SCTAB nStart = rRange.aStart.Tab();
237 SCTAB nEnd = rRange.aEnd.Tab();
238 SCTAB nTab = pViewShell->GetViewData().GetTabNo();
239 if ( nTab < nStart || nTab > nEnd ) // if not in range:
240 pViewShell->SetTabNo( nStart ); // at beginning of the range
241 }
242}
243
245 ScBlockUndoMode eBlockMode ) :
246 ScSimpleUndo( pDocSh ),
247 aBlockRange( rRange ),
248 eMode( eBlockMode )
249{
251}
252
254{
255 pDrawUndo.reset();
256}
257
259{
262}
263
265{
267 AdjustHeight();
268
271
272 ShowBlock();
274}
275
277{
279 AdjustHeight();
280
281 ShowBlock();
283}
284
286{
288
290 Fraction aZoomX( 1, 1 );
291 Fraction aZoomY = aZoomX;
292 double nPPTX, nPPTY;
294 if (pViewShell)
295 {
296 ScViewData& rData = pViewShell->GetViewData();
297 nPPTX = rData.GetPPTX();
298 nPPTY = rData.GetPPTY();
299 aZoomX = rData.GetZoomX();
300 aZoomY = rData.GetZoomY();
301 }
302 else
303 {
304 // Leave zoom at 100
307 }
308
309 sc::RowHeightContext aCxt(rDoc.MaxRow(), nPPTX, nPPTY, aZoomX, aZoomY, pVirtDev);
310 bool bRet = rDoc.SetOptimalHeight(
312
313 if (bRet)
314 {
315 // tdf#76183: recalculate objects' positions
317
319 rDoc.MaxCol(), rDoc.MaxRow(), aBlockRange.aEnd.Tab(),
321 }
322 return bRet;
323}
324
326{
327 if ( IsPaintLocked() )
328 return;
329
331 if (!pViewShell)
332 return;
333
334 ShowTable( aBlockRange ); // with multiple sheets in range each of them is good
336 SC_FOLLOW_JUMP, false, false );
337 SCTAB nTab = pViewShell->GetViewData().GetTabNo();
338 ScRange aRange = aBlockRange;
339 aRange.aStart.SetTab( nTab );
340 aRange.aEnd.SetTab( nTab );
341 pViewShell->MarkRange( aRange );
342
343 // not through SetMarkArea to MarkData, due to possibly lacking paint
344}
345
347 ScDocShell* pDocSh, ScRangeList aRanges) :
348 ScSimpleUndo(pDocSh),
349 maBlockRanges(std::move(aRanges))
350{
352}
353
355{
356 mpDrawUndo.reset();
357}
358
360{
363}
364
366{
369
370 ShowBlock();
372}
373
375{
376 ShowBlock();
378}
379
381{
382 if ( IsPaintLocked() )
383 return;
384
386 if (!pViewShell)
387 return;
388
389 if (maBlockRanges.empty())
390 return;
391
392 // Move to the sheet of the first range.
393 ScRange aRange = maBlockRanges.front();
394 ShowTable(aRange);
395 pViewShell->MoveCursorAbs(
396 aRange.aStart.Col(), aRange.aStart.Row(), SC_FOLLOW_JUMP, false, false);
397 SCTAB nTab = pViewShell->GetViewData().GetTabNo();
398 aRange.aStart.SetTab(nTab);
399 aRange.aEnd.SetTab(nTab);
400 pViewShell->MarkRange(aRange, false);
401
402 for (size_t i = 1, n = maBlockRanges.size(); i < n; ++i)
403 {
404 aRange = maBlockRanges[i];
405 aRange.aStart.SetTab(nTab);
406 aRange.aEnd.SetTab(nTab);
407 pViewShell->MarkRange(aRange, false, true);
408 }
409}
410
411ScMoveUndo::ScMoveUndo( ScDocShell* pDocSh, ScDocumentUniquePtr pRefDoc, std::unique_ptr<ScRefUndoData> pRefData ) :
412 ScSimpleUndo( pDocSh ),
413 pRefUndoDoc( std::move(pRefDoc) ),
414 pRefUndoData( std::move(pRefData) )
415{
417 if (pRefUndoData)
418 pRefUndoData->DeleteUnchanged(&rDoc);
419 pDrawUndo = GetSdrUndoAction( &rDoc );
420}
421
423{
424 pRefUndoData.reset();
425 pRefUndoDoc.reset();
426 pDrawUndo.reset();
427}
428
430{
432 ScRange aRange(0,0,0, rDoc.MaxCol(),rDoc.MaxRow(),pRefUndoDoc->GetTableCount()-1);
433 pRefUndoDoc->CopyToDocument(aRange, InsertDeleteFlags::FORMULA, false, rDoc, nullptr, false);
434 if (pRefUndoData)
435 pRefUndoData->DoUndo( &rDoc, false );
436}
437
439{
441
443}
444
446{
447 DoSdrUndoAction( pDrawUndo.get(), &pDocShell->GetDocument() ); // must also be called when pointer is null
448
449 if (pRefUndoDoc)
450 UndoRef();
451
453
455}
456
457ScDBFuncUndo::ScDBFuncUndo( ScDocShell* pDocSh, const ScRange& rOriginal ) :
458 ScSimpleUndo( pDocSh ),
459 aOriginalRange( rOriginal )
460{
462}
463
465{
466 pAutoDBRange.reset();
467}
468
470{
472 DoSdrUndoAction( nullptr, &pDocShell->GetDocument() );
473}
474
476{
478
479 if ( !pAutoDBRange )
480 return;
481
483 SCTAB nTab = rDoc.GetVisibleTab();
484 ScDBData* pNoNameData = rDoc.GetAnonymousDBData(nTab);
485 if (!pNoNameData )
486 return;
487
488 SCCOL nRangeX1;
489 SCROW nRangeY1;
490 SCCOL nRangeX2;
491 SCROW nRangeY2;
492 SCTAB nRangeTab;
493 pNoNameData->GetArea( nRangeTab, nRangeX1, nRangeY1, nRangeX2, nRangeY2 );
494 pDocShell->DBAreaDeleted( nRangeTab, nRangeX1, nRangeY1, nRangeX2 );
495
496 *pNoNameData = *pAutoDBRange;
497
498 if ( pAutoDBRange->HasAutoFilter() )
499 {
500 // restore AutoFilter buttons
501 pAutoDBRange->GetArea( nRangeTab, nRangeX1, nRangeY1, nRangeX2, nRangeY2 );
502 rDoc.ApplyFlagsTab( nRangeX1, nRangeY1, nRangeX2, nRangeY1, nRangeTab, ScMF::Auto );
503 pDocShell->PostPaint( nRangeX1, nRangeY1, nRangeTab, nRangeX2, nRangeY1, nRangeTab, PaintPartFlags::Grid );
504 }
505}
506
508{
509 RedoSdrUndoAction( nullptr );
510 if ( pAutoDBRange )
511 {
512 // move the database range to this function's position again (see ScDocShell::GetDBData)
513
515 ScDBData* pNoNameData = rDoc.GetAnonymousDBData(aOriginalRange.aStart.Tab());
516 if ( pNoNameData )
517 {
518
519 SCCOL nRangeX1;
520 SCROW nRangeY1;
521 SCCOL nRangeX2;
522 SCROW nRangeY2;
523 SCTAB nRangeTab;
524 pNoNameData->GetArea( nRangeTab, nRangeX1, nRangeY1, nRangeX2, nRangeY2 );
525 pDocShell->DBAreaDeleted( nRangeTab, nRangeX1, nRangeY1, nRangeX2 );
526
527 pNoNameData->SetSortParam( ScSortParam() );
528 pNoNameData->SetQueryParam( ScQueryParam() );
529 pNoNameData->SetSubTotalParam( ScSubTotalParam() );
530
531 pNoNameData->SetArea( aOriginalRange.aStart.Tab(),
534
535 pNoNameData->SetByRow( true );
536 pNoNameData->SetAutoFilter( false );
537 // header is always set with the operation in redo
538 }
539 }
540
542}
543
545{
547}
548
549ScUndoWrapper::ScUndoWrapper( std::unique_ptr<SfxUndoAction> pUndo ) :
550 pWrappedUndo( std::move(pUndo) ),
551 mnViewShellId( -1 )
552{
553 if (pWrappedUndo)
554 mnViewShellId = pWrappedUndo->GetViewShellId();
555}
556
558{
559}
560
562{
563 pWrappedUndo = nullptr; // don't delete in dtor - pointer must be stored outside
564}
565
567{
568 if (pWrappedUndo)
569 return pWrappedUndo->GetComment();
570 return OUString();
571}
572
574{
575 return mnViewShellId;
576}
577
578OUString ScUndoWrapper::GetRepeatComment(SfxRepeatTarget& rTarget) const
579{
580 if (pWrappedUndo)
581 return pWrappedUndo->GetRepeatComment(rTarget);
582 return OUString();
583}
584
586{
587 if (pWrappedUndo)
588 return pWrappedUndo->Merge(pNextAction);
589 else
590 return false;
591}
592
594{
595 if (pWrappedUndo)
596 pWrappedUndo->Undo();
597}
598
600{
601 if (pWrappedUndo)
602 pWrappedUndo->Redo();
603}
604
605void ScUndoWrapper::Repeat(SfxRepeatTarget& rTarget)
606{
607 if (pWrappedUndo)
608 pWrappedUndo->Repeat(rTarget);
609}
610
611bool ScUndoWrapper::CanRepeat(SfxRepeatTarget& rTarget) const
612{
613 if (pWrappedUndo)
614 return pWrappedUndo->CanRepeat(rTarget);
615 else
616 return false;
617}
618
620
625bool ScUndoManager::IsViewUndoActionIndependent(const SfxViewShell* pView, sal_uInt16& rOffset) const
626{
627 if (GetUndoActionCount() <= 1)
628 {
629 // Single or less undo, owned by another view.
630 return false;
631 }
632
633 if (!pView)
634 {
635 return false;
636 }
637
638 // Last undo action that doesn't belong to the view.
639 const SfxUndoAction* pTopAction = GetUndoAction();
640
641 ViewShellId nViewId = pView->GetViewShellId();
642
643 // Earlier undo action that belongs to the view, but is not the top one.
644 const SfxUndoAction* pViewAction = nullptr;
645 size_t nOffset = 0;
646 for (size_t i = 0; i < GetUndoActionCount(); ++i)
647 {
648 const SfxUndoAction* pAction = GetUndoAction(i);
649 if (pAction->GetViewShellId() == nViewId)
650 {
651 pViewAction = pAction;
652 nOffset = i;
653 break;
654 }
655 }
656
657 if (!pViewAction)
658 {
659 // Found no earlier undo action that belongs to the view.
660 return false;
661 }
662
663 std::optional<ScRange> topRange = getAffectedRangeFromUndo(pTopAction);
664 if (!topRange)
665 return false;
666
667 std::optional<ScRange> viewRange = getAffectedRangeFromUndo(pViewAction);
668 if (!viewRange)
669 return false;
670
671 if (topRange->Intersects(*viewRange))
672 return false;
673
674 for (size_t i = 0; i < GetRedoActionCount(); ++i)
675 {
676 auto pRedoAction = getScSimpleUndo(GetRedoAction(i));
677 if (!pRedoAction)
678 {
679 return false;
680 }
681 std::optional<ScRange> redoRange = getAffectedRangeFromUndo(pRedoAction);
682 if (!redoRange || (redoRange->Intersects(*viewRange) && pRedoAction->GetViewShellId() != nViewId))
683 {
684 // Dependent redo action and owned by another view.
685 return false;
686 }
687 }
688
689 rOffset = nOffset;
690 return true;
691}
692
693std::optional<ScRange> ScUndoManager::getAffectedRangeFromUndo(const SfxUndoAction* pAction)
694{
695 auto pSimpleUndo = getScSimpleUndo(pAction);
696 if (!pSimpleUndo)
697 return std::nullopt;
698 return pSimpleUndo->getAffectedRange();
699}
700
702{
703 const ScSimpleUndo* pSimpleUndo = dynamic_cast<const ScSimpleUndo*>(pAction);
704 if (pSimpleUndo)
705 return pSimpleUndo;
706 auto pListAction = dynamic_cast<const SfxListUndoAction*>(pAction);
707 if (!pListAction)
708 return nullptr;
709 if (pListAction->maUndoActions.size() > 1)
710 return nullptr;
711 return dynamic_cast<ScSimpleUndo*>(pListAction->maUndoActions[0].pAction.get());
712}
713
714/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SCTAB Tab() const
Definition: address.hxx:283
SCROW Row() const
Definition: address.hxx:274
void SetTab(SCTAB nTabP)
Definition: address.hxx:295
SCCOL Col() const
Definition: address.hxx:279
ScRange aBlockRange
Definition: undobase.hxx:90
bool AdjustHeight()
Definition: undobase.cxx:285
void ShowBlock()
Definition: undobase.cxx:325
void EndRedo()
Definition: undobase.cxx:276
virtual ~ScBlockUndo() override
Definition: undobase.cxx:253
std::unique_ptr< SdrUndoAction > pDrawUndo
Definition: undobase.hxx:91
void BeginUndo()
Definition: undobase.cxx:258
ScBlockUndoMode eMode
Definition: undobase.hxx:92
void EndUndo()
Definition: undobase.cxx:264
ScBlockUndo(ScDocShell *pDocSh, const ScRange &rRange, ScBlockUndoMode eBlockMode)
Definition: undobase.cxx:244
SCTAB GetTab() const
Definition: column.hxx:254
SCCOL GetCol() const
Definition: column.hxx:255
void SetByRow(bool bByR)
Definition: dbdata.hxx:135
void GetArea(SCTAB &rTab, SCCOL &rCol1, SCROW &rRow1, SCCOL &rCol2, SCROW &rRow2) const
Definition: dbdata.cxx:300
void SetAutoFilter(bool bSet)
Definition: dbdata.hxx:213
void SetSubTotalParam(const ScSubTotalParam &rSubTotalParam)
Definition: dbdata.cxx:475
SC_DLLPUBLIC void SetSortParam(const ScSortParam &rSortParam)
Definition: dbdata.cxx:413
SC_DLLPUBLIC void SetQueryParam(const ScQueryParam &rQueryParam)
Definition: dbdata.cxx:437
void SetArea(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2)
Definition: dbdata.cxx:322
std::unique_ptr< ScDBData > pAutoDBRange
Definition: undobase.hxx:126
ScDBFuncUndo(ScDocShell *pDocSh, const ScRange &rOriginal)
Definition: undobase.cxx:457
void EndUndo()
Definition: undobase.cxx:475
virtual ~ScDBFuncUndo() override
Definition: undobase.cxx:464
void EndRedo()
Definition: undobase.cxx:544
void BeginUndo()
Definition: undobase.cxx:469
ScRange aOriginalRange
Definition: undobase.hxx:127
void BeginRedo()
Definition: undobase.cxx:507
void SetDocumentModified()
Definition: docsh.cxx:2959
const ScDocument & GetDocument() const
Definition: docsh.hxx:220
std::unique_ptr< ScDBData > GetOldAutoDBRange()
Definition: docsh5.cxx:363
void SetInUndo(bool bSet)
Definition: docsh.cxx:3054
void PostPaint(SCCOL nStartCol, SCROW nStartRow, SCTAB nStartTab, SCCOL nEndCol, SCROW nEndRow, SCTAB nEndTab, PaintPartFlags nPart, sal_uInt16 nExtFlags=0)
Definition: docsh3.cxx:101
void DBAreaDeleted(SCTAB nTab, SCCOL nX1, SCROW nY1, SCCOL nX2)
Definition: docsh5.cxx:103
SCTAB GetVisibleTab() const
Definition: document.hxx:878
SC_DLLPUBLIC SCCOL MaxCol() const
Definition: document.hxx:891
SC_DLLPUBLIC bool SetOptimalHeight(sc::RowHeightContext &rCxt, SCROW nStartRow, SCROW nEndRow, SCTAB nTab, bool bApi)
Definition: document.cxx:4330
SC_DLLPUBLIC SCROW MaxRow() const
Definition: document.hxx:892
void BroadcastCells(const ScRange &rRange, SfxHintId nHint, bool bBroadcastSingleBroadcasters=true)
Definition: documen7.cxx:158
SC_DLLPUBLIC bool ApplyFlagsTab(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, SCTAB nTab, ScMF nFlags)
Definition: document.cxx:5083
SC_DLLPUBLIC void SetDrawPageSize(SCTAB nTab)
Definition: documen9.cxx:195
SC_DLLPUBLIC ScDBData * GetAnonymousDBData(SCTAB nTab)
Definition: document.cxx:310
static SC_DLLPUBLIC double nScreenPPTX
Horizontal pixel per twips factor.
Definition: global.hxx:588
static SC_DLLPUBLIC double nScreenPPTY
Vertical pixel per twips factor.
Definition: global.hxx:590
todo: It should be possible to have MarkArrays for each table, in order to enable "search all" across...
Definition: markdata.hxx:43
std::unique_ptr< SdrUndoAction > pDrawUndo
Definition: undobase.hxx:147
void BeginUndo()
Definition: undobase.cxx:438
virtual ~ScMoveUndo() override
Definition: undobase.cxx:422
ScDocumentUniquePtr pRefUndoDoc
Definition: undobase.hxx:148
void EndUndo()
Definition: undobase.cxx:445
void UndoRef()
Definition: undobase.cxx:429
std::unique_ptr< ScRefUndoData > pRefUndoData
Definition: undobase.hxx:149
ScMoveUndo(ScDocShell *pDocSh, ScDocumentUniquePtr pRefDoc, std::unique_ptr< ScRefUndoData > pRefData)
Definition: undobase.cxx:411
virtual ~ScMultiBlockUndo() override
Definition: undobase.cxx:354
ScRangeList maBlockRanges
Definition: undobase.hxx:110
std::unique_ptr< SdrUndoAction > mpDrawUndo
Definition: undobase.hxx:111
ScMultiBlockUndo(ScDocShell *pDocSh, ScRangeList aRanges)
Definition: undobase.cxx:346
ScRange & front()
Definition: rangelst.hxx:92
bool empty() const
Definition: rangelst.hxx:88
size_t size() const
Definition: rangelst.hxx:89
ScAddress aEnd
Definition: address.hxx:498
ScAddress aStart
Definition: address.hxx:497
virtual bool Merge(SfxUndoAction *pNextAction) override
Definition: undobase.cxx:68
ScSimpleUndo(const ScSimpleUndo &)=delete
void BroadcastChanges(const ScRange &rRange)
Definition: undobase.cxx:177
std::map< SCTAB, std::unique_ptr< sc::ColumnSpanSet > > DataSpansType
Definition: undobase.hxx:39
std::unique_ptr< SfxUndoAction > pDetectiveUndo
Definition: undobase.hxx:52
void BeginRedo()
Definition: undobase.cxx:145
ViewShellId mnViewShellId
Definition: undobase.hxx:53
static void ShowTable(SCTAB nTab)
Definition: undobase.cxx:224
bool IsPaintLocked() const
Definition: undobase.hxx:55
void EndRedo()
Definition: undobase.cxx:154
bool SetViewMarkData(const ScMarkData &rMarkData)
Definition: undobase.cxx:55
void EndUndo()
Definition: undobase.cxx:125
ScDocShell * pDocShell
Definition: undobase.hxx:50
ViewShellId GetViewShellId() const override
See SfxUndoAction::GetViewShellId().
Definition: undobase.cxx:50
void BeginUndo()
Definition: undobase.cxx:90
void UpdateInputHandler(bool bForce=false, bool bStopEditing=true)
Definition: tabvwsha.cxx:666
static ScTabViewShell * GetActiveViewShell()
Definition: tabvwsh4.cxx:1076
void UpdateAutoFillMark(bool bFromPaste=false)
Definition: tabview3.cxx:187
void MarkRange(const ScRange &rRange, bool bSetCursor=true, bool bContinue=false)
Definition: tabview3.cxx:1711
SC_DLLPUBLIC void MoveCursorAbs(SCCOL nCurX, SCROW nCurY, ScFollowMode eMode, bool bShift, bool bControl, bool bKeepOld=false, bool bKeepSel=false)
Definition: tabview3.cxx:1194
ScViewData & GetViewData()
Definition: tabview.hxx:335
void ShowAllCursors()
Definition: tabview3.cxx:234
void SetMarkData(const ScMarkData &rNew)
Definition: tabview3.cxx:1761
SC_DLLPUBLIC void SetTabNo(SCTAB nTab, bool bNew=false, bool bExtendSelection=false, bool bSameTabButMoved=false)
Definition: tabview3.cxx:1822
void HideAllCursors()
Definition: tabview3.cxx:220
std::unique_ptr< SfxUndoAction > ReleaseDrawUndo()
Definition: undodraw.hxx:39
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.
Definition: undobase.cxx:625
static std::optional< ScRange > getAffectedRangeFromUndo(const SfxUndoAction *)
Definition: undobase.cxx:693
static const ScSimpleUndo * getScSimpleUndo(const SfxUndoAction *)
Definition: undobase.cxx:701
ViewShellId mnViewShellId
Definition: undobase.hxx:163
virtual bool CanRepeat(SfxRepeatTarget &rTarget) const override
Definition: undobase.cxx:611
virtual OUString GetRepeatComment(SfxRepeatTarget &) const override
Definition: undobase.cxx:578
std::unique_ptr< SfxUndoAction > pWrappedUndo
Definition: undobase.hxx:162
virtual OUString GetComment() const override
Definition: undobase.cxx:566
void ForgetWrappedUndo()
Definition: undobase.cxx:561
virtual void Redo() override
Definition: undobase.cxx:599
ViewShellId GetViewShellId() const override
See SfxUndoAction::GetViewShellId().
Definition: undobase.cxx:573
virtual void Repeat(SfxRepeatTarget &rTarget) override
Definition: undobase.cxx:605
virtual bool Merge(SfxUndoAction *pNextAction) override
Definition: undobase.cxx:585
virtual void Undo() override
Definition: undobase.cxx:593
ScUndoWrapper(std::unique_ptr< SfxUndoAction > pUndo)
Definition: undobase.cxx:549
virtual ~ScUndoWrapper() override
Definition: undobase.cxx:557
const Fraction & GetZoomY() const
Definition: viewdata.hxx:460
SCTAB GetTabNo() const
Definition: viewdata.hxx:395
double GetPPTY() const
Definition: viewdata.hxx:469
const Fraction & GetZoomX() const
Definition: viewdata.hxx:459
double GetPPTX() const
Definition: viewdata.hxx:468
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...
constexpr double nPPTX
constexpr double nPPTY
SwDoc & m_rDoc
std::unique_ptr< ScDocument, o3tl::default_delete< ScDocument > > ScDocumentUniquePtr
Definition: document.hxx:2717
FilterGroup & rTarget
@ FORMULA
Cell notes.
Mode eMode
sal_Int64 n
int i
static SfxItemSet & rSet
sal_Int16 SCTAB
Definition: types.hxx:22
sal_Int16 SCCOL
Definition: types.hxx:21
sal_Int32 SCROW
Definition: types.hxx:17
ScBlockUndoMode
Definition: undobase.hxx:78
@ SC_UNDO_AUTOHEIGHT
Definition: undobase.hxx:78
std::unique_ptr< SdrUndoAction > GetSdrUndoAction(ScDocument *pDoc)
Definition: undoolk.cxx:26
void DoSdrUndoAction(SdrUndoAction *pUndoAction, ScDocument *pDoc)
Definition: undoolk.cxx:35
void RedoSdrUndoAction(SdrUndoAction *pUndoAction)
Definition: undoolk.cxx:61
void EnableDrawAdjust(ScDocument *pDoc, bool bEnable)
Definition: undoolk.cxx:68
@ SC_FOLLOW_JUMP
Definition: viewdata.hxx:52