LibreOffice Module sc (master) 1
undodat.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 <sfx2/app.hxx>
21#include <svx/svdundo.hxx>
23#include <osl/diagnose.h>
24
25#include <undodat.hxx>
26#include <undoutil.hxx>
27#include <undoolk.hxx>
28#include <document.hxx>
29#include <docsh.hxx>
30#include <tabvwsh.hxx>
31#include <olinetab.hxx>
32#include <dbdata.hxx>
33#include <rangenam.hxx>
34#include <globstr.hrc>
35#include <scresid.hxx>
36#include <global.hxx>
37#include <globalnames.hxx>
38#include <target.hxx>
39#include <dbdocfun.hxx>
40#include <olinefun.hxx>
41#include <dpobject.hxx>
42#include <attrib.hxx>
43#include <hints.hxx>
44#include <chgtrack.hxx>
45#include <refundo.hxx>
46#include <markdata.hxx>
47#include <utility>
48
49// Show or hide outline groups
50
52 SCCOLROW nNewStart, SCCOLROW nNewEnd, SCTAB nNewTab,
53 ScDocumentUniquePtr pNewUndoDoc, bool bNewColumns,
54 sal_uInt16 nNewLevel, sal_uInt16 nNewEntry, bool bNewShow ) :
55 ScSimpleUndo( pNewDocShell ),
56 nStart( nNewStart ),
57 nEnd( nNewEnd ),
58 nTab( nNewTab ),
59 pUndoDoc( std::move(pNewUndoDoc) ),
60 bColumns( bNewColumns ),
61 nLevel( nNewLevel ),
62 nEntry( nNewEntry ),
63 bShow( bNewShow )
64{
65}
66
68{
69}
70
72{ // Show outline" "Hide outline"
73 return bShow ?
74 ScResId( STR_UNDO_DOOUTLINE ) :
75 ScResId( STR_UNDO_REDOOUTLINE );
76}
77
79{
80 BeginUndo();
81
84
85 // sheet has to be switched over (#46952#)!
86
87 SCTAB nVisTab = pViewShell->GetViewData().GetTabNo();
88 if ( nVisTab != nTab )
89 pViewShell->SetTabNo( nTab );
90
91 // perform the inverse function
92
93 if (bShow)
94 pViewShell->HideOutline( bColumns, nLevel, nEntry, false, false );
95 else
96 pViewShell->ShowOutline( bColumns, nLevel, nEntry, false, false );
97
98 // Original column/row status
99 if (bColumns)
100 pUndoDoc->CopyToDocument(static_cast<SCCOL>(nStart), 0, nTab,
101 static_cast<SCCOL>(nEnd), rDoc.MaxRow(), nTab, InsertDeleteFlags::NONE, false, rDoc);
102 else
103 pUndoDoc->CopyToDocument(0, nStart, nTab, rDoc.MaxCol(), nEnd, nTab, InsertDeleteFlags::NONE, false, rDoc);
104
106 false /* bSizes*/, true /* bHidden */, true /* bFiltered */,
107 true /* bGroups */, nTab);
108 pViewShell->UpdateScrollBars();
109
111
112 EndUndo();
113}
114
116{
117 BeginRedo();
118
120
121 // sheet has to be switched over (#46952#)!
122
123 SCTAB nVisTab = pViewShell->GetViewData().GetTabNo();
124 if ( nVisTab != nTab )
125 pViewShell->SetTabNo( nTab );
126
127 if (bShow)
128 pViewShell->ShowOutline( bColumns, nLevel, nEntry, false );
129 else
130 pViewShell->HideOutline( bColumns, nLevel, nEntry, false );
131
132 EndRedo();
133}
134
135void ScUndoDoOutline::Repeat(SfxRepeatTarget& /* rTarget */)
136{
137}
138
139bool ScUndoDoOutline::CanRepeat(SfxRepeatTarget& /* rTarget */) const
140{
141 return false; // is not possible
142}
143
146 SCCOL nStartX, SCROW nStartY, SCTAB nStartZ,
147 SCCOL nEndX, SCROW nEndY, SCTAB nEndZ,
148 std::unique_ptr<ScOutlineTable> pNewUndoTab, bool bNewColumns, bool bNewMake ) :
149 ScSimpleUndo( pNewDocShell ),
150 aBlockStart( nStartX, nStartY, nStartZ ),
151 aBlockEnd( nEndX, nEndY, nEndZ ),
152 pUndoTable( std::move(pNewUndoTab) ),
153 bColumns( bNewColumns ),
154 bMake( bNewMake )
155{
156}
157
159{
160}
161
163{ // "Grouping" "Undo grouping"
164 return bMake ?
165 ScResId( STR_UNDO_MAKEOUTLINE ) :
166 ScResId( STR_UNDO_REMAKEOUTLINE );
167}
168
170{
171 BeginUndo();
172
175 SCTAB nTab = aBlockStart.Tab();
176
178
179 rDoc.SetOutlineTable( nTab, pUndoTable.get() );
180
181 SCTAB nVisTab = pViewShell->GetViewData().GetTabNo();
182 if ( nVisTab != nTab )
183 pViewShell->SetTabNo( nTab );
184
186
189 pViewShell,
190 bColumns /* bColumns */, !bColumns /* bRows */,
191 false /* bSizes*/, true /* bHidden */, true /* bFiltered */,
192 true /* bGroups */, nTab);
193
194 EndUndo();
195}
196
198{
199 BeginRedo();
200
203
205
206 if (bMake)
207 pViewShell->MakeOutline( bColumns, false );
208 else
209 pViewShell->RemoveOutline( bColumns, false );
210
212
213 EndRedo();
214}
215
216void ScUndoMakeOutline::Repeat(SfxRepeatTarget& rTarget)
217{
218 if (auto pViewTarget = dynamic_cast<ScTabViewTarget*>( &rTarget))
219 {
220 ScTabViewShell& rViewShell = *pViewTarget->GetViewShell();
221
222 if (bMake)
223 rViewShell.MakeOutline( bColumns );
224 else
225 rViewShell.RemoveOutline( bColumns );
226 }
227}
228
229bool ScUndoMakeOutline::CanRepeat(SfxRepeatTarget& rTarget) const
230{
231 return dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr;
232}
233
235 SCCOLROW nNewStart, SCCOLROW nNewEnd, SCTAB nNewTab,
236 ScDocumentUniquePtr pNewUndoDoc, std::unique_ptr<ScOutlineTable> pNewUndoTab,
237 bool bNewColumns, sal_uInt16 nNewLevel )
238 : ScSimpleUndo(pNewDocShell)
239 , nStart(nNewStart)
240 , nEnd(nNewEnd)
241 , nTab(nNewTab)
242 , xUndoDoc(std::move(pNewUndoDoc))
243 , xUndoTable(std::move(pNewUndoTab))
244 , bColumns(bNewColumns)
245 , nLevel(nNewLevel)
246{
247}
248
250{ // "Select outline level"
251 return ScResId( STR_UNDO_OUTLINELEVEL );
252}
253
255{
256 BeginUndo();
257
260
261 // Original Outline table
262
263 rDoc.SetOutlineTable(nTab, xUndoTable.get());
264
265 // Original column/row status
266
267 if (bColumns)
268 xUndoDoc->CopyToDocument(static_cast<SCCOL>(nStart), 0, nTab,
269 static_cast<SCCOL>(nEnd), rDoc.MaxRow(), nTab, InsertDeleteFlags::NONE, false, rDoc);
270 else
271 xUndoDoc->CopyToDocument(0, nStart, nTab, rDoc.MaxCol(), nEnd, nTab, InsertDeleteFlags::NONE, false, rDoc);
272
273 rDoc.UpdatePageBreaks( nTab );
274
276 false /* bSizes*/, true /* bHidden */, true /* bFiltered */,
277 true /* bGroups */, nTab);
278 pViewShell->UpdateScrollBars();
279
280 SCTAB nVisTab = pViewShell->GetViewData().GetTabNo();
281 if ( nVisTab != nTab )
282 pViewShell->SetTabNo( nTab );
283
285
286 EndUndo();
287}
288
290{
291 BeginRedo();
292
294
295 // sheet has to be switched on or off before this (#46952#) !!!
296
297 SCTAB nVisTab = pViewShell->GetViewData().GetTabNo();
298 if ( nVisTab != nTab )
299 pViewShell->SetTabNo( nTab );
300
301 pViewShell->SelectLevel( bColumns, nLevel, false );
302
303 EndRedo();
304}
305
306void ScUndoOutlineLevel::Repeat(SfxRepeatTarget& rTarget)
307{
308 if (auto pViewTarget = dynamic_cast<ScTabViewTarget*>( &rTarget))
309 pViewTarget->GetViewShell()->SelectLevel( bColumns, nLevel );
310}
311
312bool ScUndoOutlineLevel::CanRepeat(SfxRepeatTarget& rTarget) const
313{
314 return dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr;
315}
316
319 SCCOL nStartX, SCROW nStartY, SCTAB nStartZ,
320 SCCOL nEndX, SCROW nEndY, SCTAB nEndZ,
321 ScDocumentUniquePtr pNewUndoDoc, std::unique_ptr<ScOutlineTable> pNewUndoTab, bool bNewShow ) :
322 ScSimpleUndo( pNewDocShell ),
323 aBlockStart( nStartX, nStartY, nStartZ ),
324 aBlockEnd( nEndX, nEndY, nEndZ ),
325 xUndoDoc(std::move(pNewUndoDoc)),
326 xUndoTable(std::move(pNewUndoTab)),
327 bShow( bNewShow )
328{
329}
330
332{ // "Show outline" "Hide outline"
333 return bShow ?
334 ScResId( STR_UNDO_DOOUTLINEBLK ) :
335 ScResId( STR_UNDO_REDOOUTLINEBLK );
336}
337
339{
340 BeginUndo();
341
344 SCTAB nTab = aBlockStart.Tab();
345
346 // Original Outline table
347 rDoc.SetOutlineTable(nTab, xUndoTable.get());
348
349 // Original column/row status
350 SCCOLROW nStartCol = aBlockStart.Col();
351 SCCOLROW nEndCol = aBlockEnd.Col();
352 SCCOLROW nStartRow = aBlockStart.Row();
353 SCCOLROW nEndRow = aBlockEnd.Row();
354
355 if (!bShow)
356 { // Size of the hidden blocks
357 size_t nLevel;
358 xUndoTable->GetColArray().FindTouchedLevel(nStartCol, nEndCol, nLevel);
359 xUndoTable->GetColArray().ExtendBlock(nLevel, nStartCol, nEndCol);
360 xUndoTable->GetRowArray().FindTouchedLevel(nStartRow, nEndRow, nLevel);
361 xUndoTable->GetRowArray().ExtendBlock(nLevel, nStartRow, nEndRow);
362 }
363
364 xUndoDoc->CopyToDocument(static_cast<SCCOL>(nStartCol), 0, nTab,
365 static_cast<SCCOL>(nEndCol), rDoc.MaxRow(), nTab, InsertDeleteFlags::NONE, false, rDoc);
366 xUndoDoc->CopyToDocument(0, nStartRow, nTab, rDoc.MaxCol(), nEndRow, nTab, InsertDeleteFlags::NONE, false, rDoc);
367
368 rDoc.UpdatePageBreaks( nTab );
369
370 ScTabViewShell::notifyAllViewsSheetGeomInvalidation(pViewShell, true /* bColumns */, true /* bRows */,
371 false /* bSizes*/, true /* bHidden */, true /* bFiltered */,
372 true /* bGroups */, nTab);
373 pViewShell->UpdateScrollBars();
374
375 SCTAB nVisTab = pViewShell->GetViewData().GetTabNo();
376 if ( nVisTab != nTab )
377 pViewShell->SetTabNo( nTab );
378
380
381
382 pViewShell->OnLOKShowHideColRow(/*columns: */ true, nStartCol - 1);
383 pViewShell->OnLOKShowHideColRow(/*columns: */ false, nStartRow - 1);
384
385 EndUndo();
386}
387
389{
390 BeginRedo();
391
393
395 if (bShow)
396 pViewShell->ShowMarkedOutlines( false );
397 else
398 pViewShell->HideMarkedOutlines( false );
399
400 EndRedo();
401}
402
403void ScUndoOutlineBlock::Repeat(SfxRepeatTarget& rTarget)
404{
405 if (auto pViewTarget = dynamic_cast<ScTabViewTarget*>( &rTarget))
406 {
407 ScTabViewShell& rViewShell = *pViewTarget->GetViewShell();
408
409 if (bShow)
410 rViewShell.ShowMarkedOutlines();
411 else
412 rViewShell.HideMarkedOutlines();
413 }
414}
415
416bool ScUndoOutlineBlock::CanRepeat(SfxRepeatTarget& rTarget) const
417{
418 return dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr;
419}
420
422 SCCOL nStartX, SCROW nStartY, SCTAB nStartZ,
423 SCCOL nEndX, SCROW nEndY, SCTAB nEndZ,
424 ScDocumentUniquePtr pNewUndoDoc, std::unique_ptr<ScOutlineTable> pNewUndoTab)
425 : ScSimpleUndo(pNewDocShell)
426 , aBlockStart(nStartX, nStartY, nStartZ)
427 , aBlockEnd(nEndX, nEndY, nEndZ)
428 , xUndoDoc(std::move(pNewUndoDoc))
429 , xUndoTable(std::move(pNewUndoTab))
430{
431}
432
434{ // "Remove outlines"
435 return ScResId( STR_UNDO_REMOVEALLOTLNS );
436}
437
439{
440 BeginUndo();
441
444 SCTAB nTab = aBlockStart.Tab();
445
446 // Original Outline table
447 rDoc.SetOutlineTable(nTab, xUndoTable.get());
448
449 // Original column/row status
450 SCCOL nStartCol = aBlockStart.Col();
451 SCCOL nEndCol = aBlockEnd.Col();
452 SCROW nStartRow = aBlockStart.Row();
453 SCROW nEndRow = aBlockEnd.Row();
454
455 xUndoDoc->CopyToDocument(nStartCol, 0, nTab, nEndCol, rDoc.MaxRow(), nTab, InsertDeleteFlags::NONE, false, rDoc);
456 xUndoDoc->CopyToDocument(0, nStartRow, nTab, rDoc.MaxCol(), nEndRow, nTab, InsertDeleteFlags::NONE, false, rDoc);
457
458 rDoc.UpdatePageBreaks( nTab );
459
460 pViewShell->UpdateScrollBars();
461
462 SCTAB nVisTab = pViewShell->GetViewData().GetTabNo();
463 if ( nVisTab != nTab )
464 pViewShell->SetTabNo( nTab );
465
467
470 pViewShell,
471 true /* bColumns */, true /* bRows */,
472 false /* bSizes*/, true /* bHidden */, true /* bFiltered */,
473 true /* bGroups */, nTab);
474
475 EndUndo();
476}
477
479{
480 BeginRedo();
481
483
484 // sheet has to be switched over (#46952#)!
485
486 SCTAB nTab = aBlockStart.Tab();
487 SCTAB nVisTab = pViewShell->GetViewData().GetTabNo();
488 if ( nVisTab != nTab )
489 pViewShell->SetTabNo( nTab );
490
491 pViewShell->RemoveAllOutlines( false );
492
493 EndRedo();
494}
495
496void ScUndoRemoveAllOutlines::Repeat(SfxRepeatTarget& rTarget)
497{
498 if (auto pViewTarget = dynamic_cast<ScTabViewTarget*>( &rTarget))
499 pViewTarget->GetViewShell()->RemoveAllOutlines();
500}
501
502bool ScUndoRemoveAllOutlines::CanRepeat(SfxRepeatTarget& rTarget) const
503{
504 return dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr;
505}
506
508 SCCOL nStartX, SCROW nStartY, SCTAB nStartZ,
509 SCCOL nEndX, SCROW nEndY, SCTAB nEndZ,
510 ScDocumentUniquePtr pNewUndoDoc, std::unique_ptr<ScOutlineTable> pNewUndoTab)
511 : ScSimpleUndo(pNewDocShell)
512 , aBlockStart(nStartX, nStartY, nStartZ)
513 , aBlockEnd(nEndX, nEndY, nEndZ)
514 , xUndoDoc(std::move(pNewUndoDoc))
515 , xUndoTable(std::move(pNewUndoTab))
516{
517}
518
520{
521 return ScResId( STR_UNDO_AUTOOUTLINE );
522}
523
525{
526 BeginUndo();
527
530 SCTAB nTab = aBlockStart.Tab();
531
532 // Original outline table
533 rDoc.SetOutlineTable(nTab, xUndoTable.get());
534
535 // Original column/row status
536 if (xUndoDoc && xUndoTable)
537 {
538 SCCOLROW nStartCol;
539 SCCOLROW nStartRow;
540 SCCOLROW nEndCol;
541 SCCOLROW nEndRow;
542 xUndoTable->GetColArray().GetRange(nStartCol, nEndCol);
543 xUndoTable->GetRowArray().GetRange(nStartRow, nEndRow);
544
545 xUndoDoc->CopyToDocument(static_cast<SCCOL>(nStartCol), 0, nTab,
546 static_cast<SCCOL>(nEndCol), rDoc.MaxRow(), nTab, InsertDeleteFlags::NONE, false,
547 rDoc);
548 xUndoDoc->CopyToDocument(0, nStartRow, nTab, rDoc.MaxCol(), nEndRow, nTab, InsertDeleteFlags::NONE, false, rDoc);
549
550 pViewShell->UpdateScrollBars();
551 }
552
553 SCTAB nVisTab = pViewShell->GetViewData().GetTabNo();
554 if ( nVisTab != nTab )
555 pViewShell->SetTabNo( nTab );
556
558
559 EndUndo();
560}
561
563{
564 BeginRedo();
565
567
568 SCTAB nTab = aBlockStart.Tab();
569 if (pViewShell)
570 {
571 // sheet has to be switched on or off before this (#46952#) !!!
572
573 SCTAB nVisTab = pViewShell->GetViewData().GetTabNo();
574 if ( nVisTab != nTab )
575 pViewShell->SetTabNo( nTab );
576 }
577
578 ScRange aRange( aBlockStart.Col(), aBlockStart.Row(), nTab,
579 aBlockEnd.Col(), aBlockEnd.Row(), nTab );
580 ScOutlineDocFunc aFunc( *pDocShell );
581 aFunc.AutoOutline( aRange, false );
582
583 // Select in View
584 // If it was called with a multi selection,
585 // then this is now the enclosing range...
586
587 if (pViewShell)
588 pViewShell->MarkRange( aRange );
589
590 EndRedo();
591}
592
593void ScUndoAutoOutline::Repeat(SfxRepeatTarget& rTarget)
594{
595 if (auto pViewTarget = dynamic_cast<ScTabViewTarget*>( &rTarget))
596 pViewTarget->GetViewShell()->AutoOutline();
597}
598
599bool ScUndoAutoOutline::CanRepeat(SfxRepeatTarget& rTarget) const
600{
601 return dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr;
602}
603
605 const ScSubTotalParam& rNewParam, SCROW nNewEndY,
606 ScDocumentUniquePtr pNewUndoDoc, std::unique_ptr<ScOutlineTable> pNewUndoTab,
607 std::unique_ptr<ScRangeName> pNewUndoRange, std::unique_ptr<ScDBCollection> pNewUndoDB)
608 : ScDBFuncUndo(pNewDocShell, ScRange(rNewParam.nCol1, rNewParam.nRow1, nNewTab,
609 rNewParam.nCol2, rNewParam.nRow2, nNewTab))
610 , nTab(nNewTab)
611 , aParam(rNewParam)
612 , nNewEndRow(nNewEndY)
613 , xUndoDoc(std::move(pNewUndoDoc))
614 , xUndoTable(std::move(pNewUndoTab))
615 , xUndoRange(std::move(pNewUndoRange))
616 , xUndoDB(std::move(pNewUndoDB))
617{
618}
619
621{ // "Subtotals"
622 return ScResId( STR_UNDO_SUBTOTALS );
623}
624
626{
627 BeginUndo();
628
631
632 if (nNewEndRow > aParam.nRow2)
633 {
634 rDoc.DeleteRow( 0,nTab, rDoc.MaxCol(),nTab, aParam.nRow2+1, static_cast<SCSIZE>(nNewEndRow-aParam.nRow2) );
635 }
636 else if (nNewEndRow < aParam.nRow2)
637 {
638 rDoc.InsertRow( 0,nTab, rDoc.MaxCol(),nTab, nNewEndRow+1, static_cast<SCSIZE>(aParam.nRow2-nNewEndRow) );
639 }
640
641 // Original Outline table
642 rDoc.SetOutlineTable(nTab, xUndoTable.get());
643
644 // Original column/row status
645 if (xUndoTable)
646 {
647 SCCOLROW nStartCol;
648 SCCOLROW nStartRow;
649 SCCOLROW nEndCol;
650 SCCOLROW nEndRow;
651 xUndoTable->GetColArray().GetRange(nStartCol, nEndCol);
652 xUndoTable->GetRowArray().GetRange(nStartRow, nEndRow);
653
654 xUndoDoc->CopyToDocument(static_cast<SCCOL>(nStartCol), 0, nTab,
655 static_cast<SCCOL>(nEndCol), rDoc.MaxRow(), nTab, InsertDeleteFlags::NONE, false,
656 rDoc);
657 xUndoDoc->CopyToDocument(0, nStartRow, nTab, rDoc.MaxCol(), nEndRow, nTab, InsertDeleteFlags::NONE, false, rDoc);
658
659 pViewShell->UpdateScrollBars();
660 }
661
662 // Original data and references
663
665 rDoc.MaxCol(), aParam.nRow2, nTab );
666
668
669 xUndoDoc->CopyToDocument(0, aParam.nRow1+1, nTab, rDoc.MaxCol(), aParam.nRow2, nTab,
670 InsertDeleteFlags::NONE, false, rDoc); // Flags
671 xUndoDoc->UndoToDocument(0, aParam.nRow1+1, nTab, rDoc.MaxCol(), aParam.nRow2, nTab,
672 InsertDeleteFlags::ALL, false, rDoc);
673
676
677 if (xUndoRange)
678 rDoc.SetRangeName(std::unique_ptr<ScRangeName>(new ScRangeName(*xUndoRange)));
679 if (xUndoDB)
680 rDoc.SetDBCollection(std::unique_ptr<ScDBCollection>(new ScDBCollection(*xUndoDB)), true);
681
682 SCTAB nVisTab = pViewShell->GetViewData().GetTabNo();
683 if ( nVisTab != nTab )
684 pViewShell->SetTabNo( nTab );
685
688
689 EndUndo();
690}
691
693{
694 BeginRedo();
695
697
698 SCTAB nVisTab = pViewShell->GetViewData().GetTabNo();
699 if ( nVisTab != nTab )
700 pViewShell->SetTabNo( nTab );
701
704 pViewShell->DoSubTotals( aParam, false );
705
706 EndRedo();
707}
708
709void ScUndoSubTotals::Repeat(SfxRepeatTarget& /* rTarget */)
710{
711}
712
713bool ScUndoSubTotals::CanRepeat(SfxRepeatTarget& /* rTarget */) const
714{
715 return false; // is not possible due to column numbers
716}
717
718ScUndoQuery::ScUndoQuery( ScDocShell* pNewDocShell, SCTAB nNewTab, const ScQueryParam& rParam,
719 ScDocumentUniquePtr pNewUndoDoc, std::unique_ptr<ScDBCollection> pNewUndoDB,
720 const ScRange* pOld, bool bSize, const ScRange* pAdvSrc ) :
721 ScDBFuncUndo( pNewDocShell, ScRange( rParam.nCol1, rParam.nRow1, nNewTab,
722 rParam.nCol2, rParam.nRow2, nNewTab ) ),
723 nTab( nNewTab ),
724 aQueryParam( rParam ),
725 xUndoDoc( std::move(pNewUndoDoc) ),
726 xUndoDB( std::move(pNewUndoDB) ),
727 bIsAdvanced( false ),
728 bDestArea( false ),
729 bDoSize( bSize )
730{
731 if ( pOld )
732 {
733 bDestArea = true;
734 aOldDest = *pOld;
735 }
736 if ( pAdvSrc )
737 {
738 bIsAdvanced = true;
739 aAdvSource = *pAdvSrc;
740 }
741
743}
744
746{
747 pDrawUndo.reset();
748}
749
751{ // "Filter";
752 return ScResId( STR_UNDO_QUERY );
753}
754
756{
758 if (ScTabViewShell::isAnyEditViewInRange(pViewShell, /*bColumns*/ false, aQueryParam.nRow1, aQueryParam.nRow2))
759 return;
760
761 BeginUndo();
762
764
765 bool bCopy = !aQueryParam.bInplace;
766 SCCOL nDestEndCol = 0;
767 SCROW nDestEndRow = 0;
768 if (bCopy)
769 {
772
775 if (pData)
776 {
777 ScRange aNewDest;
778 pData->GetArea( aNewDest );
779 nDestEndCol = aNewDest.aEnd.Col();
780 nDestEndRow = aNewDest.aEnd.Row();
781 }
782
783 if ( bDoSize && bDestArea )
784 {
785 // aDestRange is the old range
786 rDoc.FitBlock( ScRange(
788 nDestEndCol, nDestEndRow, aQueryParam.nDestTab ),
789 aOldDest );
790 }
791
794 nDestEndCol, nDestEndRow, aQueryParam.nDestTab );
796 nDestEndCol, nDestEndRow, aQueryParam.nDestTab, InsertDeleteFlags::ALL );
797
798 pViewShell->DoneBlockMode();
799
801 nDestEndCol, nDestEndRow, aQueryParam.nDestTab,
802 InsertDeleteFlags::ALL, false, rDoc);
803 // Attributes are always copied (#49287#)
804
805 // rest of the old range
806 if ( bDestArea && !bDoSize )
807 {
809 xUndoDoc->CopyToDocument(aOldDest, InsertDeleteFlags::ALL, false, rDoc);
810 }
811 }
812 else
813 xUndoDoc->CopyToDocument(0, aQueryParam.nRow1, nTab, rDoc.MaxCol(), aQueryParam.nRow2, nTab,
814 InsertDeleteFlags::NONE, false, rDoc);
815
816 if (xUndoDB)
817 rDoc.SetDBCollection(std::unique_ptr<ScDBCollection>(new ScDBCollection(*xUndoDB )), true);
818
819 if (!bCopy)
820 {
822 rDoc.UpdatePageBreaks( nTab );
823 }
824
825 ScRange aDirtyRange( 0 , aQueryParam.nRow1, nTab,
826 rDoc.MaxCol(), aQueryParam.nRow2, nTab );
827 rDoc.SetDirty( aDirtyRange, true );
828
829 DoSdrUndoAction( pDrawUndo.get(), &rDoc );
830
831 SCTAB nVisTab = pViewShell->GetViewData().GetTabNo();
832 if ( nVisTab != nTab )
833 pViewShell->SetTabNo( nTab );
834
835
836 // invalidate cache positions and update cursor and selection
837 pViewShell->OnLOKShowHideColRow(/*bColumns*/ false, aQueryParam.nRow1 - 1);
840 pViewShell,
841 false /* bColumns */, true /* bRows */,
842 false /* bSizes*/, true /* bHidden */, true /* bFiltered */,
843 false /* bGroups */, nTab);
844
845 // Paint
846
847 if (bCopy)
848 {
849 SCCOL nEndX = nDestEndCol;
850 SCROW nEndY = nDestEndRow;
851 if (bDestArea)
852 {
853 if ( aOldDest.aEnd.Col() > nEndX )
854 nEndX = aOldDest.aEnd.Col();
855 if ( aOldDest.aEnd.Row() > nEndY )
856 nEndY = aOldDest.aEnd.Row();
857 }
858 if (bDoSize)
859 nEndY = rDoc.MaxRow();
862 }
863 else
864 pDocShell->PostPaint( 0, aQueryParam.nRow1, nTab, rDoc.MaxCol(), rDoc.MaxRow(), nTab,
867
868 EndUndo();
869}
870
872{
873 BeginRedo();
874
876
877 SCTAB nVisTab = pViewShell->GetViewData().GetTabNo();
878 if ( nVisTab != nTab )
879 pViewShell->SetTabNo( nTab );
880
881 if ( bIsAdvanced )
882 pViewShell->Query( aQueryParam, &aAdvSource, false );
883 else
884 pViewShell->Query( aQueryParam, nullptr, false );
885
886 EndRedo();
887}
888
889void ScUndoQuery::Repeat(SfxRepeatTarget& /* rTarget */)
890{
891}
892
893bool ScUndoQuery::CanRepeat(SfxRepeatTarget& /* rTarget */) const
894{
895 return false; // does not work due to column numbers
896}
897
898// Show or hide AutoFilter buttons (doesn't include filter settings)
899
901 OUString aName, bool bSet ) :
902 ScDBFuncUndo( pNewDocShell, rRange ),
903 aDBName(std::move( aName )),
904 bFilterSet( bSet )
905{
906}
907
909{
910}
911
913{
914 return ScResId( STR_UNDO_QUERY ); // same as ScUndoQuery
915}
916
918{
919 bool bNewFilter = bUndo ? !bFilterSet : bFilterSet;
920
922 ScDBData* pDBData=nullptr;
924 {
926 pDBData = rDoc.GetAnonymousDBData(nTab);
927 }
928 else
929 {
930 ScDBCollection* pColl = rDoc.GetDBCollection();
931 pDBData = pColl->getNamedDBs().findByUpperName(ScGlobal::getCharClass().uppercase(aDBName));
932 }
933
934 if ( !pDBData )
935 return;
936
937 pDBData->SetAutoFilter( bNewFilter );
938
939 SCCOL nRangeX1;
940 SCROW nRangeY1;
941 SCCOL nRangeX2;
942 SCROW nRangeY2;
943 SCTAB nRangeTab;
944 pDBData->GetArea( nRangeTab, nRangeX1, nRangeY1, nRangeX2, nRangeY2 );
945
946 if ( bNewFilter )
947 rDoc.ApplyFlagsTab( nRangeX1, nRangeY1, nRangeX2, nRangeY1, nRangeTab, ScMF::Auto );
948 else
949 rDoc.RemoveFlagsTab( nRangeX1, nRangeY1, nRangeX2, nRangeY1, nRangeTab, ScMF::Auto );
950
951 pDocShell->PostPaint( nRangeX1, nRangeY1, nRangeTab, nRangeX2, nRangeY1, nRangeTab, PaintPartFlags::Grid );
952}
953
955{
956 BeginUndo();
957 DoChange( true );
958 EndUndo();
959}
960
962{
963 BeginRedo();
964 DoChange( false );
965 EndRedo();
966}
967
968void ScUndoAutoFilter::Repeat(SfxRepeatTarget& /* rTarget */)
969{
970}
971
972bool ScUndoAutoFilter::CanRepeat(SfxRepeatTarget& /* rTarget */) const
973{
974 return false;
975}
976
977// change database sections (dialog)
979 std::unique_ptr<ScDBCollection> pNewUndoColl,
980 std::unique_ptr<ScDBCollection> pNewRedoColl ) :
981 ScSimpleUndo( pNewDocShell ),
982 pUndoColl( std::move(pNewUndoColl) ),
983 pRedoColl( std::move(pNewRedoColl) )
984{
985}
986
988{
989}
990
992{ // "Change database range";
993 return ScResId( STR_UNDO_DBDATA );
994}
995
997{
998 BeginUndo();
999
1000 ScDocument& rDoc = pDocShell->GetDocument();
1001
1002 bool bOldAutoCalc = rDoc.GetAutoCalc();
1003 rDoc.SetAutoCalc( false ); // Avoid unnecessary calculations
1005 rDoc.SetDBCollection( std::unique_ptr<ScDBCollection>(new ScDBCollection(*pUndoColl)), true );
1006 rDoc.CompileHybridFormula();
1007 rDoc.SetAutoCalc( bOldAutoCalc );
1008
1009 SfxGetpApp()->Broadcast( SfxHint( SfxHintId::ScDbAreasChanged ) );
1010
1011 EndUndo();
1012}
1013
1015{
1016 BeginRedo();
1017
1018 ScDocument& rDoc = pDocShell->GetDocument();
1019
1020 bool bOldAutoCalc = rDoc.GetAutoCalc();
1021 rDoc.SetAutoCalc( false ); // Avoid unnecessary calculations
1023 rDoc.SetDBCollection( std::unique_ptr<ScDBCollection>(new ScDBCollection(*pRedoColl)), true );
1024 rDoc.CompileHybridFormula();
1025 rDoc.SetAutoCalc( bOldAutoCalc );
1026
1027 SfxGetpApp()->Broadcast( SfxHint( SfxHintId::ScDbAreasChanged ) );
1028
1029 EndRedo();
1030}
1031
1032void ScUndoDBData::Repeat(SfxRepeatTarget& /* rTarget */)
1033{
1034}
1035
1036bool ScUndoDBData::CanRepeat(SfxRepeatTarget& /* rTarget */) const
1037{
1038 return false; // is not possible
1039}
1040
1042 const ScImportParam& rParam, SCCOL nNewEndX, SCROW nNewEndY,
1043 SCCOL nNewFormula,
1044 ScDocumentUniquePtr pNewUndoDoc, ScDocumentUniquePtr pNewRedoDoc,
1045 std::unique_ptr<ScDBData> pNewUndoData, std::unique_ptr<ScDBData> pNewRedoData ) :
1046 ScSimpleUndo( pNewDocShell ),
1047 nTab( nNewTab ),
1048 aImportParam( rParam ),
1049 nEndCol( nNewEndX ),
1050 nEndRow( nNewEndY ),
1051 xUndoDoc(std::move(pNewUndoDoc)),
1052 xRedoDoc(std::move(pNewRedoDoc)),
1053 xUndoDBData(std::move(pNewUndoData)),
1054 xRedoDBData(std::move(pNewRedoData)),
1055 nFormulaCols( nNewFormula ),
1056 bRedoFilled( false )
1057{
1058 // redo doc doesn't contain imported data (but everything else)
1059}
1060
1062{
1063 return ScResId( STR_UNDO_IMPORTDATA );
1064}
1065
1067{
1068 BeginUndo();
1069
1070 ScDocument& rDoc = pDocShell->GetDocument();
1072
1075
1076 SCTAB nTable;
1077 SCCOL nCol1, nCol2;
1078 SCROW nRow1, nRow2;
1079 ScDBData* pCurrentData = nullptr;
1080 if (xUndoDBData && xRedoDBData)
1081 {
1082 xRedoDBData->GetArea( nTable, nCol1, nRow1, nCol2, nRow2 );
1083 pCurrentData = ScUndoUtil::GetOldDBData(xRedoDBData.get(), &rDoc, nTab,
1084 nCol1, nRow1, nCol2, nRow2);
1085
1086 if ( !bRedoFilled )
1087 {
1088 // read redo data from document at first undo
1089 // imported data is deleted later anyway,
1090 // so now delete each column after copying to save memory (#41216#)
1091
1092 bool bOldAutoCalc = rDoc.GetAutoCalc();
1093 rDoc.SetAutoCalc( false ); // outside of the loop
1094 for (SCCOL nCopyCol = nCol1; nCopyCol <= nCol2; nCopyCol++)
1095 {
1096 rDoc.CopyToDocument(nCopyCol,nRow1,nTab, nCopyCol,nRow2,nTab,
1098 rDoc.DeleteAreaTab(nCopyCol, nRow1, nCopyCol, nRow2, nTab, InsertDeleteFlags::CONTENTS & ~InsertDeleteFlags::NOTE);
1099 }
1100 rDoc.SetAutoCalc( bOldAutoCalc );
1101 bRedoFilled = true;
1102 }
1103 }
1104 bool bMoveCells = xUndoDBData && xRedoDBData &&
1105 xRedoDBData->IsDoSize(); // the same in old and new
1106 if (bMoveCells)
1107 {
1108 // Undo: first delete the new data, then FitBlock backwards
1109
1110 ScRange aOld, aNew;
1111 xUndoDBData->GetArea(aOld);
1112 xRedoDBData->GetArea(aNew);
1113
1114 rDoc.DeleteAreaTab( aNew.aStart.Col(), aNew.aStart.Row(),
1116
1117 aOld.aEnd.SetCol( aOld.aEnd.Col() + nFormulaCols ); // FitBlock also for formulas
1118 aNew.aEnd.SetCol( aNew.aEnd.Col() + nFormulaCols );
1119 rDoc.FitBlock( aNew, aOld, false ); // backwards
1120 }
1121 else
1124
1128
1129 if (pCurrentData)
1130 {
1131 *pCurrentData = *xUndoDBData;
1132
1133 xUndoDBData->GetArea(nTable, nCol1, nRow1, nCol2, nRow2);
1134 ScUndoUtil::MarkSimpleBlock( pDocShell, nCol1, nRow1, nTable, nCol2, nRow2, nTable );
1135 }
1136
1137 SCTAB nVisTab = pViewShell->GetViewData().GetTabNo();
1138 if ( nVisTab != nTab )
1139 pViewShell->SetTabNo( nTab );
1140
1141 if (bMoveCells)
1143 else
1147
1148 EndUndo();
1149}
1150
1152{
1153 BeginRedo();
1154
1155 ScDocument& rDoc = pDocShell->GetDocument();
1157
1160
1161 SCTAB nTable;
1162 SCCOL nCol1, nCol2;
1163 SCROW nRow1, nRow2;
1164 ScDBData* pCurrentData = nullptr;
1165 if (xUndoDBData && xRedoDBData)
1166 {
1167 xUndoDBData->GetArea( nTable, nCol1, nRow1, nCol2, nRow2 );
1168 pCurrentData = ScUndoUtil::GetOldDBData(xUndoDBData.get(), &rDoc, nTab,
1169 nCol1, nRow1, nCol2, nRow2);
1170 }
1171 bool bMoveCells = xUndoDBData && xRedoDBData &&
1172 xRedoDBData->IsDoSize(); // the same in old and new
1173 if (bMoveCells)
1174 {
1175 // Redo: FitBlock, then delete data (needed for CopyToDocument)
1176
1177 ScRange aOld, aNew;
1178 xUndoDBData->GetArea(aOld);
1179 xRedoDBData->GetArea(aNew);
1180
1181 aOld.aEnd.SetCol( aOld.aEnd.Col() + nFormulaCols ); // FitBlock also for formulas
1182 aNew.aEnd.SetCol( aNew.aEnd.Col() + nFormulaCols );
1183 rDoc.FitBlock( aOld, aNew );
1184
1185 rDoc.DeleteAreaTab( aNew.aStart.Col(), aNew.aStart.Row(),
1187
1188 xRedoDoc->CopyToDocument(aNew, InsertDeleteFlags::ALL & ~InsertDeleteFlags::NOTE, false, rDoc); // including formulas
1189 }
1190 else
1191 {
1196 }
1197
1198 if (pCurrentData)
1199 {
1200 *pCurrentData = *xRedoDBData;
1201
1202 xRedoDBData->GetArea(nTable, nCol1, nRow1, nCol2, nRow2);
1203 ScUndoUtil::MarkSimpleBlock( pDocShell, nCol1, nRow1, nTable, nCol2, nRow2, nTable );
1204 }
1205
1206 SCTAB nVisTab = pViewShell->GetViewData().GetTabNo();
1207 if ( nVisTab != nTab )
1208 pViewShell->SetTabNo( nTab );
1209
1210 if (bMoveCells)
1212 else
1216
1217 EndRedo();
1218}
1219
1220void ScUndoImportData::Repeat(SfxRepeatTarget& rTarget)
1221{
1222 if (auto pViewTarget = dynamic_cast<ScTabViewTarget*>( &rTarget))
1223 {
1224 ScTabViewShell& rViewShell = *pViewTarget->GetViewShell();
1225
1226 SCTAB nDummy;
1227 ScImportParam aNewParam(aImportParam);
1228 ScDBData* pDBData = rViewShell.GetDBData();
1229 pDBData->GetArea( nDummy, aNewParam.nCol1,aNewParam.nRow1, aNewParam.nCol2,aNewParam.nRow2 );
1230
1231 rViewShell.ImportData( aNewParam );
1232 }
1233}
1234
1235bool ScUndoImportData::CanRepeat(SfxRepeatTarget& rTarget) const
1236{
1237 // Repeat only for import using a database range, then xUndoDBData is set
1238
1239 if (xUndoDBData)
1240 return dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr;
1241 else
1242 return false; // Address book
1243}
1244
1246 SCCOL nStartX, SCROW nStartY, SCCOL nEndX, SCROW nEndY,
1247 SCROW nResultEndRow, SCCOL nCurX, SCROW nCurY,
1248 ScDocumentUniquePtr pNewUndoDoc, std::unique_ptr<ScOutlineTable> pNewUndoTab,
1249 std::unique_ptr<ScRangeName> pNewUndoRange, std::unique_ptr<ScDBCollection> pNewUndoDB,
1250 const ScRange* pOldQ, const ScRange* pNewQ ) :
1251 ScSimpleUndo( pNewDocShell ),
1252 aBlockStart( nStartX,nStartY,nNewTab ),
1253 aBlockEnd( nEndX,nEndY,nNewTab ),
1254 nNewEndRow( nResultEndRow ),
1255 aCursorPos( nCurX,nCurY,nNewTab ),
1256 xUndoDoc(std::move(pNewUndoDoc)),
1257 xUndoTable(std::move(pNewUndoTab)),
1258 xUndoRange(std::move(pNewUndoRange)),
1259 xUndoDB(std::move(pNewUndoDB)),
1260 bQuerySize( false )
1261{
1262 if ( pOldQ && pNewQ )
1263 {
1264 aOldQuery = *pOldQ;
1265 aNewQuery = *pNewQ;
1266 bQuerySize = true;
1267 }
1268}
1269
1271{
1272 return ScResId( STR_UNDO_REPEATDB );
1273}
1274
1276{
1277 BeginUndo();
1278
1279 ScDocument& rDoc = pDocShell->GetDocument();
1281 SCTAB nTab = aBlockStart.Tab();
1282
1283 if (bQuerySize)
1284 {
1285 rDoc.FitBlock( aNewQuery, aOldQuery, false );
1286
1287 if ( aNewQuery.aEnd.Col() == aOldQuery.aEnd.Col() )
1288 {
1289 SCCOL nFormulaCols = 0;
1290 SCCOL nCol = aOldQuery.aEnd.Col() + 1;
1291 SCROW nRow = aOldQuery.aStart.Row() + 1; // test the header
1292 while ( nCol <= rDoc.MaxCol() &&
1293 rDoc.GetCellType(ScAddress( nCol, nRow, nTab )) == CELLTYPE_FORMULA )
1294 {
1295 ++nCol;
1296 ++nFormulaCols;
1297 }
1298
1299 if ( nFormulaCols > 0 )
1300 {
1301 ScRange aOldForm = aOldQuery;
1302 aOldForm.aStart.SetCol( aOldQuery.aEnd.Col() + 1 );
1303 aOldForm.aEnd.SetCol( aOldQuery.aEnd.Col() + nFormulaCols );
1304 ScRange aNewForm = aOldForm;
1305 aNewForm.aEnd.SetRow( aNewQuery.aEnd.Row() );
1306 rDoc.FitBlock( aNewForm, aOldForm, false );
1307 }
1308 }
1309 }
1310
1311 // TODO Data from Filter in other range are still missing!
1312
1313 if (nNewEndRow > aBlockEnd.Row())
1314 {
1315 rDoc.DeleteRow( 0,nTab, rDoc.MaxCol(),nTab, aBlockEnd.Row()+1, static_cast<SCSIZE>(nNewEndRow-aBlockEnd.Row()) );
1316 }
1317 else if (nNewEndRow < aBlockEnd.Row())
1318 {
1319 rDoc.InsertRow( 0,nTab, rDoc.MaxCol(),nTab, nNewEndRow+1, static_cast<SCSIZE>(nNewEndRow-aBlockEnd.Row()) );
1320 }
1321
1322 // Original Outline table
1323 rDoc.SetOutlineTable(nTab, xUndoTable.get());
1324
1325 // Original column/row status
1326 if (xUndoTable)
1327 {
1328 SCCOLROW nStartCol;
1329 SCCOLROW nStartRow;
1330 SCCOLROW nEndCol;
1331 SCCOLROW nEndRow;
1332 xUndoTable->GetColArray().GetRange(nStartCol, nEndCol);
1333 xUndoTable->GetRowArray().GetRange(nStartRow, nEndRow);
1334
1335 xUndoDoc->CopyToDocument(static_cast<SCCOL>(nStartCol), 0, nTab,
1336 static_cast<SCCOL>(nEndCol), rDoc.MaxRow(), nTab, InsertDeleteFlags::NONE, false,
1337 rDoc);
1338 xUndoDoc->CopyToDocument(0, nStartRow, nTab, rDoc.MaxCol(), nEndRow, nTab, InsertDeleteFlags::NONE, false, rDoc);
1339
1340 pViewShell->UpdateScrollBars();
1341 }
1342
1343 // Original data and references
1345 rDoc.MaxCol(), aBlockEnd.Row(), nTab );
1346 rDoc.DeleteAreaTab( 0, aBlockStart.Row(),
1347 rDoc.MaxCol(), aBlockEnd.Row(), nTab, InsertDeleteFlags::ALL );
1348
1349 xUndoDoc->CopyToDocument(0, aBlockStart.Row(), nTab, rDoc.MaxCol(), aBlockEnd.Row(), nTab,
1350 InsertDeleteFlags::NONE, false, rDoc); // Flags
1351 xUndoDoc->UndoToDocument(0, aBlockStart.Row(), nTab, rDoc.MaxCol(), aBlockEnd.Row(), nTab,
1352 InsertDeleteFlags::ALL, false, rDoc);
1353
1355 aBlockEnd.Col(),aBlockEnd.Row(),nTab );
1356
1357 if (xUndoRange)
1358 rDoc.SetRangeName(std::unique_ptr<ScRangeName>(new ScRangeName(*xUndoRange)));
1359 if (xUndoDB)
1360 rDoc.SetDBCollection(std::unique_ptr<ScDBCollection>(new ScDBCollection(*xUndoDB)), true);
1361
1362 ScTabViewShell::notifyAllViewsSheetGeomInvalidation(pViewShell, false /* bColumns */, true /* bRows */,
1363 false /* bSizes*/, true /* bHidden */, true /* bFiltered */,
1364 false /* bGroups */, nTab);
1365
1366 SCTAB nVisTab = pViewShell->GetViewData().GetTabNo();
1367 if ( nVisTab != nTab )
1368 pViewShell->SetTabNo( nTab );
1369
1372
1373 EndUndo();
1374}
1375
1377{
1378 BeginRedo();
1379
1381 SCTAB nTab = aBlockStart.Tab();
1382
1383 SCTAB nVisTab = pViewShell->GetViewData().GetTabNo();
1384 if ( nVisTab != nTab )
1385 pViewShell->SetTabNo( nTab );
1386
1388 aBlockEnd.Col(),aBlockEnd.Row(),nTab );
1389 pViewShell->SetCursor( aCursorPos.Col(), aCursorPos.Row() );
1390
1391 pViewShell->RepeatDB( false );
1392
1393 EndRedo();
1394}
1395
1396void ScUndoRepeatDB::Repeat(SfxRepeatTarget& rTarget)
1397{
1398 if (auto pViewTarget = dynamic_cast<ScTabViewTarget*>( &rTarget))
1399 pViewTarget->GetViewShell()->RepeatDB();
1400}
1401
1402bool ScUndoRepeatDB::CanRepeat(SfxRepeatTarget& rTarget) const
1403{
1404 return dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr;
1405}
1406
1409 const ScDPObject* pOldObj, const ScDPObject* pNewObj, bool bMove )
1410 : ScSimpleUndo(pNewDocShell)
1411 , xOldUndoDoc(std::move(pOldDoc))
1412 , xNewUndoDoc(std::move(pNewDoc))
1413 , bAllowMove( bMove)
1414{
1415 if (pOldObj)
1416 xOldDPObject.reset(new ScDPObject(*pOldObj));
1417 if (pNewObj)
1418 xNewDPObject.reset(new ScDPObject(*pNewObj));
1419}
1420
1422{
1423 TranslateId pResId;
1424 if (xOldUndoDoc && xNewUndoDoc)
1425 pResId = STR_UNDO_PIVOT_MODIFY;
1426 else if (xNewUndoDoc)
1427 pResId = STR_UNDO_PIVOT_NEW;
1428 else
1429 pResId = STR_UNDO_PIVOT_DELETE;
1430
1431 return ScResId(pResId);
1432}
1433
1435{
1436 BeginUndo();
1437
1438 ScDocument& rDoc = pDocShell->GetDocument();
1439
1440 ScRange aOldRange;
1441 ScRange aNewRange;
1442
1444 {
1445 aNewRange = xNewDPObject->GetOutRange();
1446 rDoc.DeleteAreaTab( aNewRange, InsertDeleteFlags::ALL );
1447 xNewUndoDoc->CopyToDocument(aNewRange, InsertDeleteFlags::ALL, false, rDoc);
1448 }
1450 {
1451 aOldRange = xOldDPObject->GetOutRange();
1452 rDoc.DeleteAreaTab(aOldRange, InsertDeleteFlags::ALL);
1453 xOldUndoDoc->CopyToDocument(aOldRange, InsertDeleteFlags::ALL, false, rDoc);
1454 }
1455
1456 // update objects in collection
1457 if (xNewDPObject)
1458 {
1459 // find updated object
1461
1462 ScDPObject* pDocObj = rDoc.GetDPAtCursor(
1463 aNewRange.aStart.Col(), aNewRange.aStart.Row(), aNewRange.aStart.Tab() );
1464 OSL_ENSURE(pDocObj, "DPObject not found");
1465 if (pDocObj)
1466 {
1467 if (xOldDPObject)
1468 {
1469 // restore old settings
1470 xOldDPObject->WriteSourceDataTo( *pDocObj );
1471 ScDPSaveData* pData = xOldDPObject->GetSaveData();
1472 if (pData)
1473 pDocObj->SetSaveData(*pData);
1474 pDocObj->SetOutRange(xOldDPObject->GetOutRange());
1475 xOldDPObject->WriteTempDataTo( *pDocObj );
1476 }
1477 else
1478 {
1479 // delete inserted object
1480 rDoc.GetDPCollection()->FreeTable(pDocObj);
1481 }
1482 }
1483 }
1484 else if (xOldDPObject)
1485 {
1486 // re-insert deleted object
1487 rDoc.GetDPCollection()->InsertNewTable(std::make_unique<ScDPObject>(*xOldDPObject));
1488 }
1489
1490 if (xNewUndoDoc)
1492 if (xOldUndoDoc)
1495
1497 if (pViewShell)
1498 {
1500 }
1501
1502 if (xNewDPObject)
1503 {
1504 // notify API objects
1506 }
1507
1508 EndUndo();
1509}
1510
1512{
1513 BeginRedo();
1514
1517
1518 ScDocument& rDoc = pDocShell->GetDocument();
1519
1520 ScDPObject* pSourceObj = nullptr;
1521 if (xOldDPObject)
1522 {
1523 // find object to modify
1525
1526 ScRange aOldRange = xOldDPObject->GetOutRange();
1527 pSourceObj = rDoc.GetDPAtCursor(
1528 aOldRange.aStart.Col(), aOldRange.aStart.Row(), aOldRange.aStart.Tab() );
1529 OSL_ENSURE(pSourceObj, "DPObject not found");
1530 }
1531
1532 ScDBDocFunc aFunc( *pDocShell );
1533 aFunc.DataPilotUpdate(pSourceObj, xNewDPObject.get(), false, false, bAllowMove); // no new undo action
1534
1535 EndRedo();
1536}
1537
1538void ScUndoDataPilot::Repeat(SfxRepeatTarget& /* rTarget */)
1539{
1541}
1542
1543bool ScUndoDataPilot::CanRepeat(SfxRepeatTarget& /* rTarget */) const
1544{
1546 return false;
1547}
1548
1550 const ScConsolidateParam& rPar, ScDocumentUniquePtr pNewUndoDoc,
1551 bool bReference, SCROW nInsCount, std::unique_ptr<ScOutlineTable> pTab,
1552 std::unique_ptr<ScDBData> pData )
1553 : ScSimpleUndo(pNewDocShell)
1554 , aDestArea(rArea)
1555 , xUndoDoc(std::move(pNewUndoDoc))
1556 , aParam(rPar)
1557 , bInsRef(bReference)
1558 , nInsertCount(nInsCount)
1559 , xUndoTab(std::move(pTab))
1560 , xUndoData(std::move(pData))
1561{
1562}
1563
1565{
1566 return ScResId( STR_UNDO_CONSOLIDATE );
1567}
1568
1570{
1571 BeginUndo();
1572
1573 ScDocument& rDoc = pDocShell->GetDocument();
1574 SCTAB nTab = aDestArea.nTab;
1575
1576 ScRange aOldRange;
1577 if (xUndoData)
1578 xUndoData->GetArea(aOldRange);
1579
1580 if (bInsRef)
1581 {
1582 rDoc.DeleteRow( 0,nTab, rDoc.MaxCol(),nTab, aDestArea.nRowStart, nInsertCount );
1583 rDoc.SetOutlineTable(nTab, xUndoTab.get());
1584
1585 // Row status
1586 xUndoDoc->CopyToDocument(0, 0, nTab, rDoc.MaxCol(), rDoc.MaxRow(), nTab, InsertDeleteFlags::NONE, false, rDoc);
1587
1588 // Data and references
1590 xUndoDoc->UndoToDocument(0, aDestArea.nRowStart, nTab,
1591 rDoc.MaxCol(), aDestArea.nRowEnd, nTab,
1592 InsertDeleteFlags::ALL, false, rDoc);
1593
1594 // Original range
1595 if (xUndoData)
1596 {
1597 rDoc.DeleteAreaTab(aOldRange, InsertDeleteFlags::ALL);
1598 xUndoDoc->CopyToDocument(aOldRange, InsertDeleteFlags::ALL, false, rDoc);
1599 }
1600
1601 pDocShell->PostPaint( 0,aDestArea.nRowStart,nTab, rDoc.MaxCol(),rDoc.MaxRow(),nTab,
1603 }
1604 else
1605 {
1608 xUndoDoc->CopyToDocument(aDestArea.nColStart, aDestArea.nRowStart, nTab,
1610 InsertDeleteFlags::ALL, false, rDoc);
1611
1612 // Original range
1613 if (xUndoData)
1614 {
1615 rDoc.DeleteAreaTab(aOldRange, InsertDeleteFlags::ALL);
1616 xUndoDoc->CopyToDocument(aOldRange, InsertDeleteFlags::ALL, false, rDoc);
1617 }
1618
1619 SCCOL nEndX = aDestArea.nColEnd;
1620 SCROW nEndY = aDestArea.nRowEnd;
1621 if (xUndoData)
1622 {
1623 if ( aOldRange.aEnd.Col() > nEndX )
1624 nEndX = aOldRange.aEnd.Col();
1625 if ( aOldRange.aEnd.Row() > nEndY )
1626 nEndY = aOldRange.aEnd.Row();
1627 }
1629 nEndX, nEndY, nTab, PaintPartFlags::Grid );
1630 }
1631
1632 // Adjust Database range again
1633 if (xUndoData)
1634 {
1635 ScDBCollection* pColl = rDoc.GetDBCollection();
1636 if (pColl)
1637 {
1638 ScDBData* pDocData = pColl->getNamedDBs().findByUpperName(xUndoData->GetUpperName());
1639 if (pDocData)
1640 *pDocData = *xUndoData;
1641 }
1642 }
1643
1645 if (pViewShell)
1646 {
1647 SCTAB nViewTab = pViewShell->GetViewData().GetTabNo();
1648 if ( nViewTab != nTab )
1649 pViewShell->SetTabNo( nTab );
1650 }
1651
1652 EndUndo();
1653}
1654
1656{
1657 BeginRedo();
1658
1659 pDocShell->DoConsolidate( aParam, false );
1660
1662 if (pViewShell)
1663 {
1664 SCTAB nViewTab = pViewShell->GetViewData().GetTabNo();
1665 if ( nViewTab != aParam.nTab )
1666 pViewShell->SetTabNo( aParam.nTab );
1667 }
1668
1669 EndRedo();
1670}
1671
1672void ScUndoConsolidate::Repeat(SfxRepeatTarget& /* rTarget */)
1673{
1674}
1675
1676bool ScUndoConsolidate::CanRepeat(SfxRepeatTarget& /* rTarget */) const
1677{
1678 return false;
1679}
1680
1681// Change source data of Chart
1683{
1684 ScDocument& rDoc = pDocShell->GetDocument();
1687}
1688
1689ScUndoChartData::ScUndoChartData( ScDocShell* pNewDocShell, OUString aName,
1690 const ScRange& rNew, bool bColHdr, bool bRowHdr,
1691 bool bAdd ) :
1692 ScSimpleUndo( pNewDocShell ),
1693 aChartName(std::move( aName )),
1694 bOldColHeaders(false),
1695 bOldRowHeaders(false),
1696 bNewColHeaders( bColHdr ),
1697 bNewRowHeaders( bRowHdr ),
1698 bAddRange( bAdd )
1699{
1701 aNewRangeListRef->push_back( rNew );
1702
1703 Init();
1704}
1705
1706ScUndoChartData::ScUndoChartData( ScDocShell* pNewDocShell, OUString aName,
1707 ScRangeListRef xNew, bool bColHdr, bool bRowHdr,
1708 bool bAdd ) :
1709 ScSimpleUndo( pNewDocShell ),
1710 aChartName(std::move( aName )),
1711 bOldColHeaders(false),
1712 bOldRowHeaders(false),
1713 aNewRangeListRef(std::move( xNew )),
1714 bNewColHeaders( bColHdr ),
1715 bNewRowHeaders( bRowHdr ),
1716 bAddRange( bAdd )
1717{
1718 Init();
1719}
1720
1722{
1723}
1724
1726{
1727 return ScResId( STR_UNDO_CHARTDATA );
1728}
1729
1731{
1732 BeginUndo();
1733
1736
1737 EndUndo();
1738}
1739
1741{
1742 BeginRedo();
1743
1746
1747 EndRedo();
1748}
1749
1750void ScUndoChartData::Repeat(SfxRepeatTarget& /* rTarget */)
1751{
1752}
1753
1754bool ScUndoChartData::CanRepeat(SfxRepeatTarget& /* rTarget */) const
1755{
1756 return false;
1757}
1758
1760 SCCOL nStartX, SCROW nStartY, SCTAB nStartZ,
1761 SCCOL nEndX, SCROW nEndY, SCTAB nEndZ,
1762 const ScMarkData& rMark,
1763 ScDocumentUniquePtr pNewUndoDoc, ScDocumentUniquePtr pNewRedoDoc,
1764 std::unique_ptr<ScRefUndoData> pRefData )
1765 : ScBlockUndo(pNewDocShell, ScRange( nStartX, nStartY, nStartZ, nEndX, nEndY, nEndZ ), SC_UNDO_SIMPLE)
1766 , mxMarkData(new ScMarkData(rMark))
1767 , xUndoDoc(std::move(pNewUndoDoc))
1768 , xRedoDoc(std::move(pNewRedoDoc))
1769 , xRefUndoData(std::move(pRefData))
1770 , bRedoFilled(false)
1771{
1772 // pFill1,pFill2,pFill3 are there so the ctor calls for simple paste (without cutting)
1773 // don't have to be changed and branched for 641.
1774 // They can be removed later.
1775
1776 if (!mxMarkData->IsMarked()) // no cell marked:
1777 mxMarkData->SetMarkArea(aBlockRange); // mark paste block
1778
1779 if (xRefUndoData)
1780 xRefUndoData->DeleteUnchanged(&pDocShell->GetDocument());
1781}
1782
1784{
1785 return ScResId( STR_UNDO_PASTE );
1786}
1787
1789{
1790 BeginUndo();
1791 DoChange( true );
1793 EndUndo();
1794 SfxGetpApp()->Broadcast( SfxHint( SfxHintId::ScAreaLinksChanged ) );
1795}
1796
1798{
1799 BeginRedo();
1800 ScDocument& rDoc = pDocShell->GetDocument();
1801 EnableDrawAdjust( &rDoc, false );
1802 DoChange( false );
1803 EnableDrawAdjust( &rDoc, true );
1804 EndRedo();
1805 SfxGetpApp()->Broadcast( SfxHint( SfxHintId::ScAreaLinksChanged ) );
1806}
1807
1808void ScUndoDataForm::Repeat(SfxRepeatTarget& /*rTarget*/)
1809{
1810}
1811
1812bool ScUndoDataForm::CanRepeat(SfxRepeatTarget& rTarget) const
1813{
1814 return (dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr);
1815}
1816
1817void ScUndoDataForm::DoChange( const bool bUndo )
1818{
1819 ScDocument& rDoc = pDocShell->GetDocument();
1820
1821 // RefUndoData for redo is created before first undo
1822 // (with DeleteUnchanged after the DoUndo call)
1823 bool bCreateRedoData = (bUndo && xRefUndoData && !xRefRedoData);
1824 if (bCreateRedoData)
1825 xRefRedoData.reset(new ScRefUndoData(&rDoc));
1826
1827 ScRefUndoData* pWorkRefData = bUndo ? xRefUndoData.get() : xRefRedoData.get();
1828
1829 bool bPaintAll = false;
1830
1832
1833 SCTAB nTabCount = rDoc.GetTableCount();
1834 if ( bUndo && !bRedoFilled )
1835 {
1836 if (!xRedoDoc)
1837 {
1838 bool bColInfo = ( aBlockRange.aStart.Row()==0 && aBlockRange.aEnd.Row()==rDoc.MaxRow() );
1839 bool bRowInfo = ( aBlockRange.aStart.Col()==0 && aBlockRange.aEnd.Col()==rDoc.MaxCol() );
1840
1842 xRedoDoc->InitUndoSelected(rDoc, *mxMarkData, bColInfo, bRowInfo);
1843 }
1844 // read "redo" data from the document in the first undo
1845 // all sheets - CopyToDocument skips those that don't exist in pRedoDoc
1846 ScRange aCopyRange = aBlockRange;
1847 aCopyRange.aStart.SetTab(0);
1848 aCopyRange.aEnd.SetTab(nTabCount-1);
1849 rDoc.CopyToDocument(aCopyRange, InsertDeleteFlags::VALUE, false, *xRedoDoc);
1850 bRedoFilled = true;
1851 }
1852
1853 sal_uInt16 nExtFlags = 0;
1854 pDocShell->UpdatePaintExt( nExtFlags, aBlockRange );
1855
1856 for ( sal_uInt16 i=0; i <= ( aBlockRange.aEnd.Col() - aBlockRange.aStart.Col() ); i++ )
1857 {
1858 OUString aOldString = xUndoDoc->GetString(
1860 rDoc.SetString( aBlockRange.aStart.Col()+i , aBlockRange.aStart.Row() , aBlockRange.aStart.Tab() , aOldString );
1861 }
1862
1863 if (pWorkRefData)
1864 {
1865 pWorkRefData->DoUndo( &rDoc, true ); // TRUE = bSetChartRangeLists for SetChartListenerCollection
1866 if ( rDoc.RefreshAutoFilter( 0,0, rDoc.MaxCol(),rDoc.MaxRow(), aBlockRange.aStart.Tab() ) )
1867 bPaintAll = true;
1868 }
1869
1870 if (bCreateRedoData && xRefRedoData)
1871 xRefRedoData->DeleteUnchanged(&rDoc);
1872
1873 if ( bUndo )
1874 {
1875 ScChangeTrack* pChangeTrack = rDoc.GetChangeTrack();
1876 if ( pChangeTrack )
1877 pChangeTrack->Undo( 0, 0 );
1878 }
1879
1880 ScRange aDrawRange( aBlockRange );
1881 rDoc.ExtendMerge( aDrawRange, true ); // only needed for single sheet (text/rtf etc.)
1883 if (bPaintAll)
1884 {
1885 aDrawRange.aStart.SetCol(0);
1886 aDrawRange.aStart.SetRow(0);
1887 aDrawRange.aEnd.SetCol(rDoc.MaxCol());
1888 aDrawRange.aEnd.SetRow(rDoc.MaxRow());
1890/*A*/ if (pViewShell)
1891 pViewShell->AdjustBlockHeight(false);
1892 }
1893 else
1894 {
1895 if ( aBlockRange.aStart.Row() == 0 && aBlockRange.aEnd.Row() == rDoc.MaxRow() ) // whole column
1896 {
1897 nPaint |= PaintPartFlags::Top;
1898 aDrawRange.aEnd.SetCol(rDoc.MaxCol());
1899 }
1900 if ( aBlockRange.aStart.Col() == 0 && aBlockRange.aEnd.Col() == rDoc.MaxCol() ) // whole row
1901 {
1902 nPaint |= PaintPartFlags::Left;
1903 aDrawRange.aEnd.SetRow(rDoc.MaxRow());
1904 }
1905/*A*/ if (pViewShell && pViewShell->AdjustBlockHeight(false))
1906 {
1907 aDrawRange.aStart.SetCol(0);
1908 aDrawRange.aStart.SetRow(0);
1909 aDrawRange.aEnd.SetCol(rDoc.MaxCol());
1910 aDrawRange.aEnd.SetRow(rDoc.MaxRow());
1911 nPaint |= PaintPartFlags::Left;
1912 }
1913 pDocShell->UpdatePaintExt( nExtFlags, aDrawRange );
1914 }
1915
1916 if ( !bUndo ) // draw redo after updating row heights
1917 RedoSdrUndoAction( pDrawUndo.get() );
1918
1919 pDocShell->PostPaint( aDrawRange, nPaint, nExtFlags );
1920
1922 if (pViewShell)
1923 pViewShell->CellContentChanged();
1924}
1925
1926/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
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 ...
Definition: address.hxx:44
SfxApplication * SfxGetpApp()
SCTAB Tab() const
Definition: address.hxx:283
void SetCol(SCCOL nColP)
Definition: address.hxx:291
SCROW Row() const
Definition: address.hxx:274
void SetRow(SCROW nRowP)
Definition: address.hxx:287
void SetTab(SCTAB nTabP)
Definition: address.hxx:295
SCCOL Col() const
Definition: address.hxx:279
SCCOL nColEnd
Definition: rangeutl.hxx:250
SCTAB nTab
Definition: rangeutl.hxx:247
SCCOL nColStart
Definition: rangeutl.hxx:248
SCROW nRowEnd
Definition: rangeutl.hxx:251
SCROW nRowStart
Definition: rangeutl.hxx:249
ScRange aBlockRange
Definition: undobase.hxx:90
void EndRedo()
Definition: undobase.cxx:276
std::unique_ptr< SdrUndoAction > pDrawUndo
Definition: undobase.hxx:91
void BeginUndo()
Definition: undobase.cxx:258
void EndUndo()
Definition: undobase.cxx:264
SC_DLLPUBLIC void Undo(sal_uLong nStartAction, sal_uLong nEndAction, bool bMerge=false)
Definition: chgtrack.cxx:3034
ScDBData * findByUpperName(const OUString &rName)
Definition: dbdata.cxx:1221
NamedDBs & getNamedDBs()
Definition: dbdata.hxx:324
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
bool DataPilotUpdate(ScDPObject *pOldObj, const ScDPObject *pNewObj, bool bRecord, bool bApi, bool bAllowMove=false)
Definition: dbdocfun.cxx:1297
void EndUndo()
Definition: undobase.cxx:475
void EndRedo()
Definition: undobase.cxx:544
void BeginUndo()
Definition: undobase.cxx:469
ScRange aOriginalRange
Definition: undobase.hxx:127
void BeginRedo()
Definition: undobase.cxx:507
ScDBData * GetDBData(bool bMarkArea=true, ScGetDBMode eMode=SC_DB_MAKE, ScGetDBSelection eSel=ScGetDBSelection::Keep)
Definition: dbfunc.cxx:81
void RemoveOutline(bool bColumns, bool bRecord=true)
Definition: dbfunc3.cxx:110
void HideOutline(bool bColumns, sal_uInt16 nLevel, sal_uInt16 nEntry, bool bRecord=true, bool bPaint=true)
Definition: dbfunc3.cxx:287
SC_DLLPUBLIC void Query(const ScQueryParam &rQueryParam, const ScRange *pAdvSource, bool bRecord)
Definition: dbfunc.cxx:234
void DoSubTotals(const ScSubTotalParam &rParam, bool bRecord=true, const ScSortParam *pForceNewSort=nullptr)
Definition: dbfunc3.cxx:431
void OnLOKShowHideColRow(bool bColumns, SCCOLROW nStartRow)
Definition: dbfunc3.cxx:2280
void RepeatDB(bool bRecord=true)
Definition: dbfunc3.cxx:2115
void MakeOutline(bool bColumns, bool bRecord=true)
Definition: dbfunc3.cxx:89
void ShowMarkedOutlines(bool bRecord=true)
Definition: dbfunc3.cxx:385
void RemoveAllOutlines(bool bRecord=true)
Definition: dbfunc3.cxx:194
void ShowOutline(bool bColumns, sal_uInt16 nLevel, sal_uInt16 nEntry, bool bRecord=true, bool bPaint=true)
Definition: dbfunc3.cxx:267
bool ImportData(const ScImportParam &rParam)
Definition: dbfunc.cxx:451
void SelectLevel(bool bColumns, sal_uInt16 nLevel, bool bRecord=true)
Definition: dbfunc3.cxx:233
void HideMarkedOutlines(bool bRecord=true)
Definition: dbfunc3.cxx:408
SC_DLLPUBLIC ScDPObject * InsertNewTable(std::unique_ptr< ScDPObject > pDPObj)
Definition: dpobject.cxx:3743
void FreeTable(const ScDPObject *pDPObj)
Definition: dpobject.cxx:3728
void SetSaveData(const ScDPSaveData &rData)
Definition: dpobject.cxx:387
void SetOutRange(const ScRange &rRange)
Definition: dpobject.cxx:402
const ScDocument & GetDocument() const
Definition: docsh.hxx:220
void UpdatePaintExt(sal_uInt16 &rExtFlags, SCCOL nStartCol, SCROW nStartRow, SCTAB nStartTab, SCCOL nEndCol, SCROW nEndRow, SCTAB nEndTab)
Definition: docsh3.cxx:228
void PostDataChanged()
Definition: docsh3.cxx:93
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 DoConsolidate(const ScConsolidateParam &rParam, bool bRecord=true)
Definition: docsh5.cxx:501
SC_DLLPUBLIC bool RemoveFlagsTab(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, SCTAB nTab, ScMF nFlags)
Definition: document.cxx:5094
bool RefreshAutoFilter(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, SCTAB nTab)
Definition: document.cxx:5780
void UpdatePageBreaks(SCTAB nTab, const ScRange *pUserArea=nullptr)
Definition: document.cxx:6337
bool SetOutlineTable(SCTAB nTab, const ScOutlineTable *pNewOutline)
Definition: documen3.cxx:763
void SetRangeName(SCTAB nTab, std::unique_ptr< ScRangeName > pNew)
Definition: documen3.cxx:189
SC_DLLPUBLIC bool ExtendMerge(SCCOL nStartCol, SCROW nStartRow, SCCOL &rEndCol, SCROW &rEndRow, SCTAB nTab, bool bRefresh=false)
Definition: document.cxx:5676
SC_DLLPUBLIC void CompileHybridFormula()
Call this immediately after updating named ranges.
Definition: document10.cxx:317
void InvalidatePageBreaks(SCTAB nTab)
Definition: document.cxx:6331
SC_DLLPUBLIC SCCOL MaxCol() const
Definition: document.hxx:891
const ScDBData * GetDBAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab, ScDBDataPortion ePortion) const
Definition: documen3.cxx:328
SC_DLLPUBLIC SCROW MaxRow() const
Definition: document.hxx:892
SC_DLLPUBLIC void PreprocessDBDataUpdate()
Definition: document10.cxx:305
SC_DLLPUBLIC bool ApplyFlagsTab(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, SCTAB nTab, ScMF nFlags)
Definition: document.cxx:5083
SC_DLLPUBLIC bool GetAutoCalc() const
Definition: document.hxx:1411
SC_DLLPUBLIC bool SetString(SCCOL nCol, SCROW nRow, SCTAB nTab, const OUString &rString, const ScSetStringParam *pParam=nullptr)
Definition: document.cxx:3422
void DeleteRow(SCCOL nStartCol, SCTAB nStartTab, SCCOL nEndCol, SCTAB nEndTab, SCROW nStartRow, SCSIZE nSize, ScDocument *pRefUndoDoc=nullptr, bool *pUndoOutline=nullptr, const ScMarkData *pTabMark=nullptr)
Definition: document.cxx:1374
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)
Definition: document.cxx:2072
SC_DLLPUBLIC ScDBCollection * GetDBCollection() const
Definition: document.hxx:826
SC_DLLPUBLIC ScDPObject * GetDPAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab) const
Definition: documen3.cxx:383
void FitBlock(const ScRange &rOld, const ScRange &rNew, bool bClear=true)
Definition: document.cxx:1858
SC_DLLPUBLIC void SetAutoCalc(bool bNewAutoCalc)
Definition: documen7.cxx:608
void UpdateChartArea(const OUString &rChartName, const ScRange &rNewArea, bool bColHeaders, bool bRowHeaders, bool bAdd)
Definition: documen5.cxx:130
SC_DLLPUBLIC void DeleteAreaTab(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, SCTAB nTab, InsertDeleteFlags nDelFlag)
Definition: document.cxx:1951
void SetDBCollection(std::unique_ptr< ScDBCollection > pNewDBCollection, bool bRemoveAutoFilter=false)
Definition: documen3.cxx:281
ScChangeTrack * GetChangeTrack() const
Definition: document.hxx:2487
SC_DLLPUBLIC CellType GetCellType(SCCOL nCol, SCROW nRow, SCTAB nTab) const
Definition: document.cxx:3790
void GetOldChartParameters(std::u16string_view rName, ScRangeList &rRanges, bool &rColHeaders, bool &rRowHeaders)
Definition: documen5.cxx:204
SC_DLLPUBLIC ScDBData * GetAnonymousDBData(SCTAB nTab)
Definition: document.cxx:310
void SetDirty(const ScRange &, bool bIncludeEmptyCells)
Definition: document.cxx:3899
bool InsertRow(SCCOL nStartCol, SCTAB nStartTab, SCCOL nEndCol, SCTAB nEndTab, SCROW nStartRow, SCSIZE nSize, ScDocument *pRefUndoDoc=nullptr, const ScMarkData *pTabMark=nullptr)
Definition: document.cxx:1252
SC_DLLPUBLIC ScDPCollection * GetDPCollection()
Definition: documen3.cxx:371
void BroadcastUno(const SfxHint &rHint)
Definition: documen3.cxx:958
SC_DLLPUBLIC SCTAB GetTableCount() const
Definition: document.cxx:317
static SC_DLLPUBLIC const CharClass & getCharClass()
Definition: global.cxx:1062
todo: It should be possible to have MarkArrays for each table, in order to enable "search all" across...
Definition: markdata.hxx:43
void AutoOutline(const ScRange &rRange, bool bRecord)
Definition: olinefun.cxx:253
ScAddress aEnd
Definition: address.hxx:498
ScAddress aStart
Definition: address.hxx:497
void DoUndo(ScDocument *pDoc, bool bUndoRefFirst)
Definition: refundo.cxx:135
void BeginRedo()
Definition: undobase.cxx:145
static void ShowTable(SCTAB nTab)
Definition: undobase.cxx:224
void EndRedo()
Definition: undobase.cxx:154
void EndUndo()
Definition: undobase.cxx:125
ScDocShell * pDocShell
Definition: undobase.hxx:50
void BeginUndo()
Definition: undobase.cxx:90
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...
Definition: tabvwshc.cxx:568
static bool isAnyEditViewInRange(const SfxViewShell *pForViewShell, bool bColumns, SCCOLROW nStart, SCCOLROW nEnd)
Definition: tabvwshc.cxx:543
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.
Definition: tabvwshc.cxx:510
static ScTabViewShell * GetActiveViewShell()
Definition: tabvwsh4.cxx:1076
void DoneBlockMode(bool bContinue=false)
Definition: tabview2.cxx:409
void MarkRange(const ScRange &rRange, bool bSetCursor=true, bool bContinue=false)
Definition: tabview3.cxx:1711
ScViewData & GetViewData()
Definition: tabview.hxx:335
SC_DLLPUBLIC void SetCursor(SCCOL nPosX, SCROW nPosY, bool bNew=false)
Definition: tabview3.cxx:363
SC_DLLPUBLIC void CellContentChanged()
Definition: tabview3.cxx:513
void UpdateScrollBars(HeaderType eHeaderType=BOTH_HEADERS)
Definition: tabview4.cxx:389
SC_DLLPUBLIC void SetTabNo(SCTAB nTab, bool bNew=false, bool bExtendSelection=false, bool bSameTabButMoved=false)
Definition: tabview3.cxx:1822
virtual OUString GetComment() const override
Definition: undodat.cxx:912
virtual void Repeat(SfxRepeatTarget &rTarget) override
Definition: undodat.cxx:968
ScUndoAutoFilter(ScDocShell *pNewDocShell, const ScRange &rRange, OUString aName, bool bSet)
Definition: undodat.cxx:900
virtual void Redo() override
Definition: undodat.cxx:961
virtual ~ScUndoAutoFilter() override
Definition: undodat.cxx:908
OUString aDBName
Definition: undodat.hxx:240
void DoChange(bool bUndo)
Definition: undodat.cxx:917
virtual void Undo() override
Definition: undodat.cxx:954
virtual bool CanRepeat(SfxRepeatTarget &rTarget) const override
Definition: undodat.cxx:972
ScAddress aBlockEnd
Definition: undodat.hxx:178
virtual void Redo() override
Definition: undodat.cxx:562
ScAddress aBlockStart
Definition: undodat.hxx:177
std::unique_ptr< ScOutlineTable > xUndoTable
Definition: undodat.hxx:180
virtual OUString GetComment() const override
Definition: undodat.cxx:519
ScUndoAutoOutline(ScDocShell *pNewDocShell, SCCOL nStartX, SCROW nStartY, SCTAB nStartZ, SCCOL nEndX, SCROW nEndY, SCTAB nEndZ, ScDocumentUniquePtr pNewUndoDoc, std::unique_ptr< ScOutlineTable > pNewUndoTab)
Definition: undodat.cxx:507
virtual bool CanRepeat(SfxRepeatTarget &rTarget) const override
Definition: undodat.cxx:599
virtual void Repeat(SfxRepeatTarget &rTarget) override
Definition: undodat.cxx:593
virtual void Undo() override
Definition: undodat.cxx:524
ScDocumentUniquePtr xUndoDoc
Definition: undodat.hxx:179
ScRangeListRef aOldRangeListRef
Definition: undodat.hxx:407
bool bNewColHeaders
Definition: undodat.hxx:412
virtual OUString GetComment() const override
Definition: undodat.cxx:1725
virtual void Redo() override
Definition: undodat.cxx:1740
virtual void Undo() override
Definition: undodat.cxx:1730
bool bOldRowHeaders
Definition: undodat.hxx:409
virtual bool CanRepeat(SfxRepeatTarget &rTarget) const override
Definition: undodat.cxx:1754
bool bNewRowHeaders
Definition: undodat.hxx:413
ScRangeListRef aNewRangeListRef
Definition: undodat.hxx:411
ScUndoChartData(ScDocShell *pNewDocShell, OUString aName, const ScRange &rNew, bool bColHdr, bool bRowHdr, bool bAdd)
Definition: undodat.cxx:1689
virtual void Repeat(SfxRepeatTarget &rTarget) override
Definition: undodat.cxx:1750
virtual ~ScUndoChartData() override
Definition: undodat.cxx:1721
OUString aChartName
Definition: undodat.hxx:406
bool bOldColHeaders
Definition: undodat.hxx:408
ScUndoConsolidate(ScDocShell *pNewDocShell, const ScArea &rArea, const ScConsolidateParam &rPar, ScDocumentUniquePtr pNewUndoDoc, bool bReference, SCROW nInsCount, std::unique_ptr< ScOutlineTable > pTab, std::unique_ptr< ScDBData > pData)
Definition: undodat.cxx:1549
virtual bool CanRepeat(SfxRepeatTarget &rTarget) const override
Definition: undodat.cxx:1676
std::unique_ptr< ScOutlineTable > xUndoTab
Definition: undodat.hxx:383
virtual OUString GetComment() const override
Definition: undodat.cxx:1564
SCSIZE nInsertCount
Definition: undodat.hxx:382
std::unique_ptr< ScDBData > xUndoData
Definition: undodat.hxx:384
virtual void Undo() override
Definition: undodat.cxx:1569
virtual void Redo() override
Definition: undodat.cxx:1655
ScDocumentUniquePtr xUndoDoc
Definition: undodat.hxx:379
virtual void Repeat(SfxRepeatTarget &rTarget) override
Definition: undodat.cxx:1672
ScConsolidateParam aParam
Definition: undodat.hxx:380
std::unique_ptr< ScDBCollection > pRedoColl
Definition: undodat.hxx:275
virtual void Undo() override
Definition: undodat.cxx:996
virtual void Redo() override
Definition: undodat.cxx:1014
virtual void Repeat(SfxRepeatTarget &rTarget) override
Definition: undodat.cxx:1032
virtual bool CanRepeat(SfxRepeatTarget &rTarget) const override
Definition: undodat.cxx:1036
virtual ~ScUndoDBData() override
Definition: undodat.cxx:987
ScUndoDBData(ScDocShell *pNewDocShell, std::unique_ptr< ScDBCollection > pNewUndoColl, std::unique_ptr< ScDBCollection > pNewRedoColl)
Definition: undodat.cxx:978
virtual OUString GetComment() const override
Definition: undodat.cxx:991
std::unique_ptr< ScDBCollection > pUndoColl
Definition: undodat.hxx:274
ScDocumentUniquePtr xUndoDoc
Definition: undodat.hxx:437
void DoChange(const bool bUndo)
Definition: undodat.cxx:1817
virtual void Redo() override
Definition: undodat.cxx:1797
std::unique_ptr< ScRefUndoData > xRefRedoData
Definition: undodat.hxx:440
virtual bool CanRepeat(SfxRepeatTarget &rTarget) const override
Definition: undodat.cxx:1812
virtual void Repeat(SfxRepeatTarget &rTarget) override
Definition: undodat.cxx:1808
bool bRedoFilled
Definition: undodat.hxx:441
virtual void Undo() override
Definition: undodat.cxx:1788
std::unique_ptr< ScRefUndoData > xRefUndoData
Definition: undodat.hxx:439
virtual OUString GetComment() const override
Definition: undodat.cxx:1783
std::unique_ptr< ScMarkData > mxMarkData
Definition: undodat.hxx:436
ScDocumentUniquePtr xRedoDoc
Definition: undodat.hxx:438
ScUndoDataForm(ScDocShell *pNewDocShell, SCCOL nStartX, SCROW nStartY, SCTAB nStartZ, SCCOL nEndX, SCROW nEndY, SCTAB nEndZ, const ScMarkData &rMark, ScDocumentUniquePtr pNewUndoDoc, ScDocumentUniquePtr pNewRedoDoc, std::unique_ptr< ScRefUndoData > pRefData)
Definition: undodat.cxx:1759
virtual void Undo() override
Definition: undodat.cxx:1434
std::unique_ptr< ScDPObject > xOldDPObject
Definition: undodat.hxx:356
ScUndoDataPilot(ScDocShell *pNewDocShell, ScDocumentUniquePtr pOldDoc, ScDocumentUniquePtr pNewDoc, const ScDPObject *pOldObj, const ScDPObject *pNewObj, bool bMove)
Definition: undodat.cxx:1407
ScDocumentUniquePtr xOldUndoDoc
Definition: undodat.hxx:354
ScDocumentUniquePtr xNewUndoDoc
Definition: undodat.hxx:355
virtual bool CanRepeat(SfxRepeatTarget &rTarget) const override
Definition: undodat.cxx:1543
virtual void Repeat(SfxRepeatTarget &rTarget) override
Definition: undodat.cxx:1538
std::unique_ptr< ScDPObject > xNewDPObject
Definition: undodat.hxx:357
virtual void Redo() override
Definition: undodat.cxx:1511
virtual OUString GetComment() const override
Definition: undodat.cxx:1421
sal_uInt16 nLevel
Definition: undodat.hxx:59
virtual ~ScUndoDoOutline() override
Definition: undodat.cxx:67
SCCOLROW nStart
Definition: undodat.hxx:53
virtual void Repeat(SfxRepeatTarget &rTarget) override
Definition: undodat.cxx:135
ScDocumentUniquePtr pUndoDoc
Definition: undodat.hxx:57
virtual void Undo() override
Definition: undodat.cxx:78
virtual OUString GetComment() const override
Definition: undodat.cxx:71
virtual bool CanRepeat(SfxRepeatTarget &rTarget) const override
Definition: undodat.cxx:139
sal_uInt16 nEntry
Definition: undodat.hxx:60
ScUndoDoOutline(ScDocShell *pNewDocShell, SCCOLROW nNewStart, SCCOLROW nNewEnd, SCTAB nNewTab, ScDocumentUniquePtr pNewUndoDoc, bool bNewColumns, sal_uInt16 nNewLevel, sal_uInt16 nNewEntry, bool bNewShow)
Definition: undodat.cxx:51
virtual void Redo() override
Definition: undodat.cxx:115
SCCOLROW nEnd
Definition: undodat.hxx:54
ScDocumentUniquePtr xRedoDoc
Definition: undodat.hxx:300
std::unique_ptr< ScDBData > xRedoDBData
Definition: undodat.hxx:302
ScDocumentUniquePtr xUndoDoc
Definition: undodat.hxx:299
virtual void Redo() override
Definition: undodat.cxx:1151
virtual OUString GetComment() const override
Definition: undodat.cxx:1061
virtual bool CanRepeat(SfxRepeatTarget &rTarget) const override
Definition: undodat.cxx:1235
virtual void Undo() override
Definition: undodat.cxx:1066
std::unique_ptr< ScDBData > xUndoDBData
Definition: undodat.hxx:301
ScUndoImportData(ScDocShell *pNewDocShell, SCTAB nNewTab, const ScImportParam &rParam, SCCOL nNewEndX, SCROW nNewEndY, SCCOL nNewFormula, ScDocumentUniquePtr pNewUndoDoc, ScDocumentUniquePtr pNewRedoDoc, std::unique_ptr< ScDBData > pNewUndoData, std::unique_ptr< ScDBData > pNewRedoData)
Definition: undodat.cxx:1041
virtual void Repeat(SfxRepeatTarget &rTarget) override
Definition: undodat.cxx:1220
SCCOL nFormulaCols
Definition: undodat.hxx:303
ScImportParam aImportParam
Definition: undodat.hxx:296
ScUndoMakeOutline(ScDocShell *pNewDocShell, SCCOL nStartX, SCROW nStartY, SCTAB nStartZ, SCCOL nEndX, SCROW nEndY, SCTAB nEndZ, std::unique_ptr< ScOutlineTable > pNewUndoTab, bool bNewColumns, bool bNewMake)
Make or delete outline groups.
Definition: undodat.cxx:145
virtual bool CanRepeat(SfxRepeatTarget &rTarget) const override
Definition: undodat.cxx:229
virtual void Redo() override
Definition: undodat.cxx:197
ScAddress aBlockStart
Definition: undodat.hxx:82
virtual ~ScUndoMakeOutline() override
Definition: undodat.cxx:158
virtual OUString GetComment() const override
Definition: undodat.cxx:162
virtual void Undo() override
Definition: undodat.cxx:169
ScAddress aBlockEnd
Definition: undodat.hxx:83
virtual void Repeat(SfxRepeatTarget &rTarget) override
Definition: undodat.cxx:216
std::unique_ptr< ScOutlineTable > pUndoTable
Definition: undodat.hxx:85
virtual OUString GetComment() const override
Definition: undodat.cxx:331
ScAddress aBlockEnd
Definition: undodat.hxx:133
virtual bool CanRepeat(SfxRepeatTarget &rTarget) const override
Definition: undodat.cxx:416
ScDocumentUniquePtr xUndoDoc
Definition: undodat.hxx:134
virtual void Redo() override
Definition: undodat.cxx:388
std::unique_ptr< ScOutlineTable > xUndoTable
Definition: undodat.hxx:135
ScUndoOutlineBlock(ScDocShell *pNewDocShell, SCCOL nStartX, SCROW nStartY, SCTAB nStartZ, SCCOL nEndX, SCROW nEndY, SCTAB nEndZ, ScDocumentUniquePtr pNewUndoDoc, std::unique_ptr< ScOutlineTable > pNewUndoTab, bool bNewShow)
show/hide outline over block marks
Definition: undodat.cxx:318
virtual void Repeat(SfxRepeatTarget &rTarget) override
Definition: undodat.cxx:403
ScAddress aBlockStart
Definition: undodat.hxx:132
virtual void Undo() override
Definition: undodat.cxx:338
sal_uInt16 nLevel
Definition: undodat.hxx:112
virtual void Repeat(SfxRepeatTarget &rTarget) override
Definition: undodat.cxx:306
virtual OUString GetComment() const override
Definition: undodat.cxx:249
virtual bool CanRepeat(SfxRepeatTarget &rTarget) const override
Definition: undodat.cxx:312
virtual void Undo() override
Definition: undodat.cxx:254
std::unique_ptr< ScOutlineTable > xUndoTable
Definition: undodat.hxx:110
ScUndoOutlineLevel(ScDocShell *pNewDocShell, SCCOLROW nNewStart, SCCOLROW nNewEnd, SCTAB nNewTab, ScDocumentUniquePtr pNewUndoDoc, std::unique_ptr< ScOutlineTable > pNewUndoTab, bool bNewColumns, sal_uInt16 nNewLevel)
Definition: undodat.cxx:234
ScDocumentUniquePtr xUndoDoc
Definition: undodat.hxx:109
virtual void Redo() override
Definition: undodat.cxx:289
virtual void Redo() override
Definition: undodat.cxx:871
std::unique_ptr< ScDBCollection > xUndoDB
Definition: undodat.hxx:229
virtual ~ScUndoQuery() override
Definition: undodat.cxx:745
bool bIsAdvanced
Definition: undodat.hxx:232
bool bDestArea
Definition: undodat.hxx:233
virtual bool CanRepeat(SfxRepeatTarget &rTarget) const override
Definition: undodat.cxx:893
std::unique_ptr< SdrUndoAction > pDrawUndo
Definition: undodat.hxx:225
ScQueryParam aQueryParam
Definition: undodat.hxx:227
ScRange aAdvSource
Definition: undodat.hxx:231
SCTAB nTab
Definition: undodat.hxx:226
ScRange aOldDest
Definition: undodat.hxx:230
ScDocumentUniquePtr xUndoDoc
Definition: undodat.hxx:228
bool bDoSize
Definition: undodat.hxx:234
virtual void Undo() override
Definition: undodat.cxx:755
virtual OUString GetComment() const override
Definition: undodat.cxx:750
ScUndoQuery(ScDocShell *pNewDocShell, SCTAB nNewTab, const ScQueryParam &rParam, ScDocumentUniquePtr pNewUndoDoc, std::unique_ptr< ScDBCollection > pNewUndoDB, const ScRange *pOld, bool bSize, const ScRange *pAdvSrc)
Definition: undodat.cxx:718
virtual void Repeat(SfxRepeatTarget &rTarget) override
Definition: undodat.cxx:889
ScDocumentUniquePtr xUndoDoc
Definition: undodat.hxx:157
virtual void Undo() override
Definition: undodat.cxx:438
virtual OUString GetComment() const override
Definition: undodat.cxx:433
virtual void Repeat(SfxRepeatTarget &rTarget) override
Definition: undodat.cxx:496
ScUndoRemoveAllOutlines(ScDocShell *pNewDocShell, SCCOL nStartX, SCROW nStartY, SCTAB nStartZ, SCCOL nEndX, SCROW nEndY, SCTAB nEndZ, ScDocumentUniquePtr pNewUndoDoc, std::unique_ptr< ScOutlineTable > pNewUndoTab)
Definition: undodat.cxx:421
virtual bool CanRepeat(SfxRepeatTarget &rTarget) const override
Definition: undodat.cxx:502
virtual void Redo() override
Definition: undodat.cxx:478
std::unique_ptr< ScOutlineTable > xUndoTable
Definition: undodat.hxx:158
ScAddress aBlockStart
Definition: undodat.hxx:325
virtual void Repeat(SfxRepeatTarget &rTarget) override
Definition: undodat.cxx:1396
ScDocumentUniquePtr xUndoDoc
Definition: undodat.hxx:329
virtual bool CanRepeat(SfxRepeatTarget &rTarget) const override
Definition: undodat.cxx:1402
std::unique_ptr< ScRangeName > xUndoRange
Definition: undodat.hxx:331
SCROW nNewEndRow
Definition: undodat.hxx:327
ScUndoRepeatDB(ScDocShell *pNewDocShell, SCTAB nNewTab, SCCOL nStartX, SCROW nStartY, SCCOL nEndX, SCROW nEndY, SCROW nResultEndRow, SCCOL nCurX, SCROW nCurY, ScDocumentUniquePtr pNewUndoDoc, std::unique_ptr< ScOutlineTable > pNewUndoTab, std::unique_ptr< ScRangeName > pNewUndoRange, std::unique_ptr< ScDBCollection > pNewUndoDB, const ScRange *pOldQ, const ScRange *pNewQ)
Definition: undodat.cxx:1245
virtual void Undo() override
Definition: undodat.cxx:1275
ScAddress aCursorPos
Definition: undodat.hxx:328
std::unique_ptr< ScDBCollection > xUndoDB
Definition: undodat.hxx:332
virtual OUString GetComment() const override
Definition: undodat.cxx:1270
ScRange aNewQuery
Definition: undodat.hxx:334
ScRange aOldQuery
Definition: undodat.hxx:333
virtual void Redo() override
Definition: undodat.cxx:1376
std::unique_ptr< ScOutlineTable > xUndoTable
Definition: undodat.hxx:330
ScAddress aBlockEnd
Definition: undodat.hxx:326
virtual bool CanRepeat(SfxRepeatTarget &rTarget) const override
Definition: undodat.cxx:713
virtual OUString GetComment() const override
Definition: undodat.cxx:620
ScDocumentUniquePtr xUndoDoc
Definition: undodat.hxx:202
std::unique_ptr< ScDBCollection > xUndoDB
Definition: undodat.hxx:205
virtual void Redo() override
Definition: undodat.cxx:692
virtual void Undo() override
Definition: undodat.cxx:625
virtual void Repeat(SfxRepeatTarget &rTarget) override
Definition: undodat.cxx:709
ScUndoSubTotals(ScDocShell *pNewDocShell, SCTAB nNewTab, const ScSubTotalParam &rNewParam, SCROW nNewEndY, ScDocumentUniquePtr pNewUndoDoc, std::unique_ptr< ScOutlineTable > pNewUndoTab, std::unique_ptr< ScRangeName > pNewUndoRange, std::unique_ptr< ScDBCollection > pNewUndoDB)
Definition: undodat.cxx:604
std::unique_ptr< ScRangeName > xUndoRange
Definition: undodat.hxx:204
SCROW nNewEndRow
Definition: undodat.hxx:201
std::unique_ptr< ScOutlineTable > xUndoTable
Definition: undodat.hxx:203
ScSubTotalParam aParam
Definition: undodat.hxx:200
static ScDBData * GetOldDBData(const ScDBData *pUndoData, ScDocument *pDoc, SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2)
Search for Data base range in Document ("untitled" or by region) create new if not found.
Definition: undoutil.cxx:69
static void MarkSimpleBlock(const ScDocShell *pDocShell, SCCOL nStartX, SCROW nStartY, SCTAB nStartZ, SCCOL nEndX, SCROW nEndY, SCTAB nEndZ)
Mark Block (invisible - has to be repainted)
Definition: undoutil.cxx:31
SCTAB GetTabNo() const
Definition: viewdata.hxx:395
bool AdjustBlockHeight(bool bPaint=true, ScMarkData *pMarkData=nullptr)
Definition: viewfun2.cxx:115
SfxViewShell * GetViewShell() const
@ TOP_LEFT
top left cell of area
#define SC_PF_LINES
Definition: docsh.hxx:77
std::unique_ptr< ScDocument, o3tl::default_delete< ScDocument > > ScDocumentUniquePtr
Definition: document.hxx:2717
@ SCDOCMODE_UNDO
Definition: document.hxx:257
FilterGroup & rTarget
@ CELLTYPE_FORMULA
Definition: global.hxx:275
@ NOTE
Strings (and string results if InsertDeleteFlags::FORMULA is not set).
PaintPartFlags
Definition: global.hxx:109
constexpr OUStringLiteral STR_DB_LOCAL_NONAME
Definition: globalnames.hxx:14
OUString aName
std::unique_ptr< sal_Int32[]> pData
int i
OUString ScResId(TranslateId aId)
Definition: scdll.cxx:90
SCROW nRow1
Definition: global.hxx:441
SCCOL nCol1
Definition: global.hxx:440
SCCOL nCol2
Definition: global.hxx:442
SCROW nRow2
Definition: global.hxx:443
SCCOL nCol1
selected area
@ COLUMN_HEADER
Definition: tabview.hxx:59
@ ROW_HEADER
Definition: tabview.hxx:60
@ BOTH_HEADERS
Definition: tabview.hxx:61
sal_Int32 SCCOLROW
a type capable of holding either SCCOL or SCROW
Definition: types.hxx:23
sal_Int16 SCTAB
Definition: types.hxx:22
sal_Int16 SCCOL
Definition: types.hxx:21
sal_Int32 SCROW
Definition: types.hxx:17
@ SC_UNDO_SIMPLE
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