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