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