LibreOffice Module sc (master)  1
undotab.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 <sfx2/bindings.hxx>
22 #include <sfx2/dispatch.hxx>
23 #include <svl/hint.hxx>
24 #include <osl/diagnose.h>
25 
26 #include <undotab.hxx>
27 #include <document.hxx>
28 #include <docsh.hxx>
29 #include <tabvwsh.hxx>
30 #include <globstr.hrc>
31 #include <global.hxx>
32 #include <sc.hrc>
33 #include <strings.hrc>
34 #include <undoolk.hxx>
35 #include <target.hxx>
36 #include <uiitems.hxx>
37 #include <prnsave.hxx>
38 #include <printfun.hxx>
39 #include <chgtrack.hxx>
40 #include <tabprotection.hxx>
41 #include <viewdata.hxx>
42 #include <progress.hxx>
43 #include <markdata.hxx>
44 #include <refundo.hxx>
45 
46 // for ScUndoRenameObject - might me moved to another file later
47 #include <svx/svditer.hxx>
48 #include <svx/svdoole2.hxx>
49 #include <drwlayer.hxx>
50 #include <scresid.hxx>
51 #include <sheetevents.hxx>
52 #include <LibreOfficeKit/LibreOfficeKitEnums.h>
53 #include <comphelper/lok.hxx>
54 #include <tools/json_writer.hxx>
55 
56 #include <memory>
57 #include <utility>
58 #include <vector>
59 
60 using namespace com::sun::star;
61 using ::std::unique_ptr;
62 using ::std::vector;
63 
64 
66  SCTAB nTabNum,
67  bool bApp,
68  const OUString& rNewName) :
69  ScSimpleUndo( pNewDocShell ),
70  sNewName( rNewName ),
71  nTab( nTabNum ),
72  bAppend( bApp )
73 {
76 }
77 
79 {
80  pDrawUndo.reset();
81 }
82 
84 {
85  if (bAppend)
86  return ScResId( STR_UNDO_APPEND_TAB );
87  else
88  return ScResId( STR_UNDO_INSERT_TAB );
89 }
90 
92 {
93  ScDocument& rDoc = pDocShell->GetDocument();
94  ScChangeTrack* pChangeTrack = rDoc.GetChangeTrack();
95  if ( pChangeTrack )
96  {
97  ScRange aRange( 0, 0, nTab, rDoc.MaxCol(), rDoc.MaxRow(), nTab );
98  pChangeTrack->AppendInsert( aRange );
99  nEndChangeAction = pChangeTrack->GetActionMax();
100  }
101  else
102  nEndChangeAction = 0;
103 }
104 
106 {
108  pViewShell->SetTabNo(nTab);
109 
110  pDocShell->SetInUndo( true );
111  bDrawIsInUndo = true;
112  pViewShell->DeleteTable( nTab, false );
113  bDrawIsInUndo = false;
114  pDocShell->SetInUndo( false );
115 
117 
118  ScChangeTrack* pChangeTrack = pDocShell->GetDocument().GetChangeTrack();
119  if ( pChangeTrack )
120  pChangeTrack->Undo( nEndChangeAction, nEndChangeAction );
121 
122  // SetTabNo(...,sal_True) for all views to sync with drawing layer pages
123  pDocShell->Broadcast( SfxHint( SfxHintId::ScForceSetTab ) );
124 }
125 
127 {
129 
130  RedoSdrUndoAction( pDrawUndo.get() ); // Draw Redo first
131 
132  pDocShell->SetInUndo( true );
133  bDrawIsInUndo = true;
134  if (bAppend)
135  pViewShell->AppendTable( sNewName, false );
136  else
137  {
138  pViewShell->SetTabNo(nTab);
139  pViewShell->InsertTable( sNewName, nTab, false );
140  }
141  bDrawIsInUndo = false;
142  pDocShell->SetInUndo( false );
143 
144  SetChangeTrack();
145 }
146 
148 {
149  if (auto pViewTarget = dynamic_cast<ScTabViewTarget*>( &rTarget))
150  pViewTarget->GetViewShell()->GetViewData().GetDispatcher().
151  Execute(FID_INS_TABLE, SfxCallMode::SLOT | SfxCallMode::RECORD);
152 }
153 
155 {
156  return dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr;
157 }
158 
160  SCTAB nTabNum,
161  std::vector<OUString>&& newNameList) :
162  ScSimpleUndo( pNewDocShell ),
163  aNameList( std::move(newNameList) ),
164  nTab( nTabNum )
165 {
167 
168  SetChangeTrack();
169 }
170 
172 {
173  pDrawUndo.reset();
174 }
175 
177 {
178  return ScResId( STR_UNDO_INSERT_TAB );
179 }
180 
182 {
183  ScDocument& rDoc = pDocShell->GetDocument();
184  ScChangeTrack* pChangeTrack = rDoc.GetChangeTrack();
185  if ( pChangeTrack )
186  {
187  nStartChangeAction = pChangeTrack->GetActionMax() + 1;
188  nEndChangeAction = 0;
189  ScRange aRange( 0, 0, nTab, rDoc.MaxCol(), rDoc.MaxRow(), nTab );
190  for( size_t i = 0; i < aNameList.size(); i++ )
191  {
192  aRange.aStart.SetTab( sal::static_int_cast<SCTAB>( nTab + i ) );
193  aRange.aEnd.SetTab( sal::static_int_cast<SCTAB>( nTab + i ) );
194  pChangeTrack->AppendInsert( aRange );
195  nEndChangeAction = pChangeTrack->GetActionMax();
196  }
197  }
198  else
200 }
201 
203 {
205  pViewShell->SetTabNo(nTab);
206 
207  pDocShell->SetInUndo( true );
208  bDrawIsInUndo = true;
209 
210  pViewShell->DeleteTables( nTab, static_cast<SCTAB>(aNameList.size()) );
211 
212  bDrawIsInUndo = false;
213  pDocShell->SetInUndo( false );
214 
216 
217  ScChangeTrack* pChangeTrack = pDocShell->GetDocument().GetChangeTrack();
218  if ( pChangeTrack )
219  pChangeTrack->Undo( nStartChangeAction, nEndChangeAction );
220 
221  // SetTabNo(...,sal_True) for all views to sync with drawing layer pages
222  pDocShell->Broadcast( SfxHint( SfxHintId::ScForceSetTab ) );
223 }
224 
226 {
228 
229  RedoSdrUndoAction( pDrawUndo.get() ); // Draw Redo first
230 
231  pDocShell->SetInUndo( true );
232  bDrawIsInUndo = true;
233  pViewShell->InsertTables( aNameList, nTab, static_cast<SCTAB>(aNameList.size()),false );
234 
235  bDrawIsInUndo = false;
236  pDocShell->SetInUndo( false );
237 
238  SetChangeTrack();
239 }
240 
242 {
243  if (auto pViewTarget = dynamic_cast<ScTabViewTarget*>( &rTarget))
244  pViewTarget->GetViewShell()->GetViewData().GetDispatcher().
245  Execute(FID_INS_TABLE, SfxCallMode::SLOT | SfxCallMode::RECORD);
246 }
247 
249 {
250  return dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr;
251 }
252 
253 ScUndoDeleteTab::ScUndoDeleteTab( ScDocShell* pNewDocShell, const vector<SCTAB> &aTab,
254  ScDocumentUniquePtr pUndoDocument, std::unique_ptr<ScRefUndoData> pRefData ) :
255  ScMoveUndo( pNewDocShell, std::move(pUndoDocument), std::move(pRefData) )
256 {
257  theTabs.insert(theTabs.end(), aTab.begin(), aTab.end() );
258  SetChangeTrack();
259 }
260 
262 {
263  theTabs.clear();
264 }
265 
267 {
268  return ScResId( STR_UNDO_DELETE_TAB );
269 }
270 
272 {
273  ScDocument& rDoc = pDocShell->GetDocument();
274  ScChangeTrack* pChangeTrack = rDoc.GetChangeTrack();
275  if ( pChangeTrack )
276  {
277  sal_uLong nTmpChangeAction;
278  nStartChangeAction = pChangeTrack->GetActionMax() + 1;
279  nEndChangeAction = 0;
280  ScRange aRange( 0, 0, 0, rDoc.MaxCol(), rDoc.MaxRow(), 0 );
281  for ( size_t i = 0; i < theTabs.size(); ++i )
282  {
283  aRange.aStart.SetTab( theTabs[i] );
284  aRange.aEnd.SetTab( theTabs[i] );
285  pChangeTrack->AppendDeleteRange( aRange, pRefUndoDoc.get(),
286  nTmpChangeAction, nEndChangeAction, static_cast<short>(i) );
287  }
288  }
289  else
291 }
292 
293 static SCTAB lcl_GetVisibleTabBefore( const ScDocument& rDoc, SCTAB nTab )
294 {
295  while ( nTab > 0 && !rDoc.IsVisible( nTab ) )
296  --nTab;
297 
298  return nTab;
299 }
300 
302 {
303  BeginUndo();
304  ScDocument& rDoc = pDocShell->GetDocument();
305 
306  bool bLink = false;
307  OUString aName;
308 
309  for(SCTAB nTab: theTabs)
310  {
311  pRefUndoDoc->GetName( nTab, aName );
312 
313  bDrawIsInUndo = true;
314  bool bOk = rDoc.InsertTab(nTab, aName, false, true);
315  bDrawIsInUndo = false;
316  if (bOk)
317  {
318  pRefUndoDoc->CopyToDocument(0,0,nTab, rDoc.MaxCol(),rDoc.MaxRow(),nTab, InsertDeleteFlags::ALL,false, rDoc);
319 
320  OUString aOldName;
321  pRefUndoDoc->GetName( nTab, aOldName );
322  rDoc.RenameTab( nTab, aOldName );
323  if (pRefUndoDoc->IsLinked(nTab))
324  {
325  rDoc.SetLink( nTab, pRefUndoDoc->GetLinkMode(nTab), pRefUndoDoc->GetLinkDoc(nTab),
326  pRefUndoDoc->GetLinkFlt(nTab), pRefUndoDoc->GetLinkOpt(nTab),
327  pRefUndoDoc->GetLinkTab(nTab), pRefUndoDoc->GetLinkRefreshDelay(nTab) );
328  bLink = true;
329  }
330 
331  if ( pRefUndoDoc->IsScenario(nTab) )
332  {
333  rDoc.SetScenario( nTab, true );
334  OUString aComment;
335  Color aColor;
336  ScScenarioFlags nScenFlags;
337  pRefUndoDoc->GetScenarioData( nTab, aComment, aColor, nScenFlags );
338  rDoc.SetScenarioData( nTab, aComment, aColor, nScenFlags );
339  bool bActive = pRefUndoDoc->IsActiveScenario( nTab );
340  rDoc.SetActiveScenario( nTab, bActive );
341  }
342  rDoc.SetVisible( nTab, pRefUndoDoc->IsVisible( nTab ) );
343  rDoc.SetTabBgColor( nTab, pRefUndoDoc->GetTabBgColor(nTab) );
344  auto pSheetEvents = pRefUndoDoc->GetSheetEvents( nTab );
345  rDoc.SetSheetEvents( nTab, std::unique_ptr<ScSheetEvents>(pSheetEvents ? new ScSheetEvents(*pSheetEvents) : nullptr) );
346  rDoc.SetLayoutRTL( nTab, pRefUndoDoc->IsLayoutRTL( nTab ) );
347 
348  if ( pRefUndoDoc->IsTabProtected( nTab ) )
349  rDoc.SetTabProtection(nTab, pRefUndoDoc->GetTabProtection(nTab));
350  }
351  }
352  if (bLink)
353  {
354  pDocShell->UpdateLinks(); // update Link Manager
355  }
356 
357  EndUndo(); // Draw-Undo has to be called before Broadcast!
358 
359  ScChangeTrack* pChangeTrack = pDocShell->GetDocument().GetChangeTrack();
360  if ( pChangeTrack )
361  pChangeTrack->Undo( nStartChangeAction, nEndChangeAction );
362 
363  for(SCTAB nTab: theTabs)
364  {
365  pDocShell->Broadcast( ScTablesHint( SC_TAB_INSERTED, nTab) );
366  }
367  SfxApplication* pSfxApp = SfxGetpApp(); // Navigator
368  pSfxApp->Broadcast( SfxHint( SfxHintId::ScTablesChanged ) );
369  pSfxApp->Broadcast( SfxHint( SfxHintId::ScDbAreasChanged ) );
370  pSfxApp->Broadcast( SfxHint( SfxHintId::ScAreaLinksChanged ) );
371 
372  pDocShell->PostPaint(0,0,0, rDoc.MaxCol(),rDoc.MaxRow(),MAXTAB, PaintPartFlags::All ); // incl. extras
373 
374  // not ShowTable due to SetTabNo(..., sal_True):
376  if (pViewShell)
377  pViewShell->SetTabNo( lcl_GetVisibleTabBefore( rDoc, theTabs[0] ), true );
378 }
379 
381 {
383  pViewShell->SetTabNo( lcl_GetVisibleTabBefore( pDocShell->GetDocument(), theTabs.front() ) );
384 
385  RedoSdrUndoAction( pDrawUndo.get() ); // Draw Redo first
386 
387  pDocShell->SetInUndo( true );
388  bDrawIsInUndo = true;
389  pViewShell->DeleteTables( theTabs, false );
390  bDrawIsInUndo = false;
391  pDocShell->SetInUndo( true );
392 
393  SetChangeTrack();
394 
395  // SetTabNo(...,sal_True) for all views to sync with drawing layer pages
396  pDocShell->Broadcast( SfxHint( SfxHintId::ScForceSetTab ) );
397 }
398 
400 {
401  if (auto pViewTarget = dynamic_cast<ScTabViewTarget*>( &rTarget))
402  {
403  ScTabViewShell* pViewShell = pViewTarget->GetViewShell();
404  pViewShell->DeleteTable( pViewShell->GetViewData().GetTabNo() );
405  }
406 }
407 
409 {
410  return dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr;
411 }
412 
414  SCTAB nT,
415  const OUString& rOldName,
416  const OUString& rNewName) :
417  ScSimpleUndo( pNewDocShell ),
418  nTab ( nT )
419 {
420  sOldName = rOldName;
421  sNewName = rNewName;
422 }
423 
425 {
426 }
427 
429 {
430  return ScResId( STR_UNDO_RENAME_TAB );
431 }
432 
433 void ScUndoRenameTab::DoChange( SCTAB nTabP, const OUString& rName ) const
434 {
435  ScDocument& rDoc = pDocShell->GetDocument();
436  rDoc.RenameTab( nTabP, rName );
437 
438  SfxGetpApp()->Broadcast( SfxHint( SfxHintId::ScTablesChanged ) ); // Navigator
439  SfxGetpApp()->Broadcast( SfxHint( SfxHintId::ScTablesRenamed ) ); // Name Box
440 
444 
445  // The sheet name might be used in a formula ...
447  if (pViewShell)
448  pViewShell->UpdateInputHandler();
449 }
450 
452 {
454 }
455 
457 {
459 }
460 
462 {
463  // makes no sense
464 }
465 
466 bool ScUndoRenameTab::CanRepeat(SfxRepeatTarget& /* rTarget */) const
467 {
468  return false;
469 }
470 
472  ScDocShell* pNewDocShell, std::unique_ptr<vector<SCTAB>> pOldTabs, std::unique_ptr<vector<SCTAB>> pNewTabs,
473  std::unique_ptr<vector<OUString>> pOldNames, std::unique_ptr<vector<OUString>> pNewNames) :
474  ScSimpleUndo( pNewDocShell ),
475  mpOldTabs(std::move(pOldTabs)), mpNewTabs(std::move(pNewTabs)),
476  mpOldNames(std::move(pOldNames)), mpNewNames(std::move(pNewNames))
477 {
478  // The sizes differ. Something is wrong.
479  assert(!mpOldNames || mpOldTabs->size() == mpOldNames->size());
480  // The sizes differ. Something is wrong.
481  assert(!mpNewNames || mpNewTabs->size() == mpNewNames->size());
482 }
483 
485 {
486 }
487 
489 {
490  return ScResId( STR_UNDO_MOVE_TAB );
491 }
492 
493 void ScUndoMoveTab::DoChange( bool bUndo ) const
494 {
495  ScDocument& rDoc = pDocShell->GetDocument();
497 
498  if (bUndo) // UnDo
499  {
500  size_t i = mpNewTabs->size();
501  ScProgress aProgress(pDocShell, ScResId(STR_UNDO_MOVE_TAB),
502  i * rDoc.GetCodeCount(), true);
503  for (; i > 0; --i)
504  {
505  SCTAB nDestTab = (*mpNewTabs)[i-1];
506  SCTAB nOldTab = (*mpOldTabs)[i-1];
507  if (nDestTab > MAXTAB) // appended ?
508  nDestTab = rDoc.GetTableCount() - 1;
509 
510  rDoc.MoveTab( nDestTab, nOldTab, &aProgress );
511  pViewShell->GetViewData().MoveTab( nDestTab, nOldTab );
512  pViewShell->SetTabNo( nOldTab, true );
513  if (mpOldNames)
514  {
515  const OUString& rOldName = (*mpOldNames)[i-1];
516  rDoc.RenameTab(nOldTab, rOldName);
517  }
518  }
519  }
520  else
521  {
522  size_t n = mpNewTabs->size();
523  ScProgress aProgress(pDocShell, ScResId(STR_UNDO_MOVE_TAB),
524  n * rDoc.GetCodeCount(), true);
525  for (size_t i = 0; i < n; ++i)
526  {
527  SCTAB nDestTab = (*mpNewTabs)[i];
528  SCTAB nNewTab = nDestTab;
529  SCTAB nOldTab = (*mpOldTabs)[i];
530  if (nDestTab > MAXTAB) // appended ?
531  nDestTab = rDoc.GetTableCount() - 1;
532 
533  rDoc.MoveTab( nOldTab, nNewTab, &aProgress );
534  pViewShell->GetViewData().MoveTab( nOldTab, nNewTab );
535  pViewShell->SetTabNo( nDestTab, true );
536  if (mpNewNames)
537  {
538  const OUString& rNewName = (*mpNewNames)[i];
539  rDoc.RenameTab(nNewTab, rNewName);
540  }
541  }
542  }
543 
544  SfxGetpApp()->Broadcast( SfxHint( SfxHintId::ScTablesChanged ) ); // Navigator
545 
549 }
550 
552 {
553  DoChange( true );
554 }
555 
557 {
558  DoChange( false );
559 }
560 
562 {
563  // No Repeat ! ? !
564 }
565 
566 bool ScUndoMoveTab::CanRepeat(SfxRepeatTarget& /* rTarget */) const
567 {
568  return false;
569 }
570 
572  ScDocShell* pNewDocShell,
573  std::unique_ptr<vector<SCTAB>> pOldTabs, std::unique_ptr<vector<SCTAB>> pNewTabs,
574  std::unique_ptr<vector<OUString>> pNewNames) :
575  ScSimpleUndo( pNewDocShell ),
576  mpOldTabs(std::move(pOldTabs)),
577  mpNewTabs(std::move(pNewTabs)),
578  mpNewNames(std::move(pNewNames))
579 {
581 
582  // The sizes differ. Something is wrong.
583  assert(!mpNewNames || mpNewTabs->size() == mpNewNames->size());
584 }
585 
587 {
588  pDrawUndo.reset();
589 }
590 
592 {
593  return ScResId( STR_UNDO_COPY_TAB );
594 }
595 
597 {
599 
600  if (pViewShell)
601  pViewShell->SetTabNo((*mpOldTabs)[0],true);
602 
603  SfxGetpApp()->Broadcast( SfxHint( SfxHintId::ScTablesChanged ) ); // Navigator
604 
608 }
609 
611 {
612  ScDocument& rDoc = pDocShell->GetDocument();
613 
614  DoSdrUndoAction( pDrawUndo.get(), &rDoc ); // before the sheets are deleted
615 
616  vector<SCTAB>::const_reverse_iterator itr, itrEnd = mpNewTabs->rend();
617  for (itr = mpNewTabs->rbegin(); itr != itrEnd; ++itr)
618  {
619  SCTAB nDestTab = *itr;
620  if (nDestTab > MAXTAB) // append?
621  nDestTab = rDoc.GetTableCount() - 1;
622 
623  bDrawIsInUndo = true;
624  rDoc.DeleteTab(nDestTab);
625  bDrawIsInUndo = false;
626  }
627 
628  // ScTablesHint broadcasts after all sheets have been deleted,
629  // so sheets and draw pages are in sync!
630 
631  for (itr = mpNewTabs->rbegin(); itr != itrEnd; ++itr)
632  {
633  SCTAB nDestTab = *itr;
634  if (nDestTab > MAXTAB) // append?
635  nDestTab = rDoc.GetTableCount() - 1;
636 
637  pDocShell->Broadcast( ScTablesHint( SC_TAB_DELETED, nDestTab ) );
638  }
639 
640  DoChange();
641 }
642 
644 {
645  ScDocument& rDoc = pDocShell->GetDocument();
647 
648  SCTAB nDestTab = 0;
649  for (size_t i = 0, n = mpNewTabs->size(); i < n; ++i)
650  {
651  nDestTab = (*mpNewTabs)[i];
652  SCTAB nNewTab = nDestTab;
653  SCTAB nOldTab = (*mpOldTabs)[i];
654  if (nDestTab > MAXTAB) // appended ?
655  nDestTab = rDoc.GetTableCount() - 1;
656 
657  bDrawIsInUndo = true;
658  rDoc.CopyTab( nOldTab, nNewTab );
659  bDrawIsInUndo = false;
660 
661  pViewShell->GetViewData().MoveTab( nOldTab, nNewTab );
662 
663  SCTAB nAdjSource = nOldTab;
664  if ( nNewTab <= nOldTab )
665  ++nAdjSource; // new position of source table after CopyTab
666 
667  if ( rDoc.IsScenario(nAdjSource) )
668  {
669  rDoc.SetScenario(nNewTab, true );
670  OUString aComment;
671  Color aColor;
672  ScScenarioFlags nScenFlags;
673  rDoc.GetScenarioData(nAdjSource, aComment, aColor, nScenFlags );
674  rDoc.SetScenarioData(nNewTab, aComment, aColor, nScenFlags );
675  bool bActive = rDoc.IsActiveScenario(nAdjSource);
676  rDoc.SetActiveScenario(nNewTab, bActive );
677  bool bVisible = rDoc.IsVisible(nAdjSource);
678  rDoc.SetVisible(nNewTab,bVisible );
679  }
680 
681  if ( rDoc.IsTabProtected( nAdjSource ) )
682  rDoc.CopyTabProtection(nAdjSource, nNewTab);
683 
684  if (mpNewNames)
685  {
686  const OUString& rName = (*mpNewNames)[i];
687  rDoc.RenameTab(nNewTab, rName);
688  }
689  }
690 
691  RedoSdrUndoAction( pDrawUndo.get() ); // after the sheets are inserted
692 
693  pViewShell->SetTabNo( nDestTab, true ); // after draw-undo
694 
695  DoChange();
696 
697 }
698 
700 {
701  // no Repeat ! ? !
702 }
703 
704 bool ScUndoCopyTab::CanRepeat(SfxRepeatTarget& /* rTarget */) const
705 {
706  return false;
707 }
708 
710  ScDocShell* pNewDocShell, SCTAB nT, const Color& aOTabBgColor, const Color& aNTabBgColor) :
711  ScSimpleUndo( pNewDocShell )
712 {
713  ScUndoTabColorInfo aInfo(nT);
714  aInfo.maOldTabBgColor = aOTabBgColor;
715  aInfo.maNewTabBgColor = aNTabBgColor;
716  aTabColorList.push_back(aInfo);
717 }
718 
720  ScDocShell* pNewDocShell,
721  ScUndoTabColorInfo::List&& rUndoTabColorList) :
722  ScSimpleUndo(pNewDocShell),
723  aTabColorList(std::move(rUndoTabColorList))
724 {
725 }
726 
728 {
729 }
730 
732 {
733  if (aTabColorList.size() > 1)
734  return ScResId(STR_UNDO_SET_MULTI_TAB_BG_COLOR);
735  return ScResId(STR_UNDO_SET_TAB_BG_COLOR);
736 }
737 
738 void ScUndoTabColor::DoChange(bool bUndoType) const
739 {
740  ScDocument& rDoc = pDocShell->GetDocument();
741 
742  size_t nTabColorCount = aTabColorList.size();
743  for (size_t i = 0; i < nTabColorCount; ++i)
744  {
745  const ScUndoTabColorInfo& rTabColor = aTabColorList[i];
746  rDoc.SetTabBgColor(rTabColor.mnTabId,
747  bUndoType ? rTabColor.maOldTabBgColor : rTabColor.maNewTabBgColor);
748  }
749 
751  ScDocShellModificator aModificator( *pDocShell );
752  aModificator.SetDocumentModified();
753 }
754 
756 {
757  DoChange(true);
758 }
759 
761 {
762  DoChange(false);
763 }
764 
766 {
767  // makes no sense
768 }
769 
770 bool ScUndoTabColor::CanRepeat(SfxRepeatTarget& /* rTarget */) const
771 {
772  return false;
773 }
774 
776  SCTAB nSrc, SCTAB nDest,
777  const OUString& rN, const OUString& rC,
778  const Color& rCol, ScScenarioFlags nF,
779  const ScMarkData& rMark ) :
780  ScSimpleUndo( pNewDocShell ),
781  mpMarkData(new ScMarkData(rMark)),
782  nSrcTab( nSrc ),
783  nDestTab( nDest ),
784  aName( rN ),
785  aComment( rC ),
786  aColor( rCol ),
787  nFlags( nF )
788 {
790 }
791 
793 {
794  pDrawUndo.reset();
795 }
796 
798 {
799  return ScResId( STR_UNDO_MAKESCENARIO );
800 }
801 
803 {
804  ScDocument& rDoc = pDocShell->GetDocument();
805 
806  pDocShell->SetInUndo( true );
807  bDrawIsInUndo = true;
808  rDoc.DeleteTab( nDestTab );
809  bDrawIsInUndo = false;
810  pDocShell->SetInUndo( false );
811 
812  DoSdrUndoAction( pDrawUndo.get(), &rDoc );
813 
816 
818  if (pViewShell)
819  pViewShell->SetTabNo( nSrcTab, true );
820 
821  SfxGetpApp()->Broadcast( SfxHint( SfxHintId::ScTablesChanged ) );
822 
823  // SetTabNo(...,sal_True) for all views to sync with drawing layer pages
824  pDocShell->Broadcast( SfxHint( SfxHintId::ScForceSetTab ) );
825 }
826 
828 {
830 
831  RedoSdrUndoAction( pDrawUndo.get() ); // Draw Redo first
832 
833  pDocShell->SetInUndo( true );
834  bDrawIsInUndo = true;
835 
837 
838  bDrawIsInUndo = false;
839  pDocShell->SetInUndo( false );
840 
842  if (pViewShell)
843  pViewShell->SetTabNo( nDestTab, true );
844 
845  SfxGetpApp()->Broadcast( SfxHint( SfxHintId::ScTablesChanged ) );
846 }
847 
849 {
850  if (auto pViewTarget = dynamic_cast<ScTabViewTarget*>( &rTarget))
851  {
852  pViewTarget->GetViewShell()->MakeScenario( aName, aComment, aColor, nFlags );
853  }
854 }
855 
857 {
858  return dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr;
859 }
860 
862  SCTAB nNewTab, SCTAB nNewCount)
863  : ScSimpleUndo(pShell)
864  , nTab(nNewTab)
865  , nCount(nNewCount)
866 {
868 }
869 
871 {
872  pDrawUndo.reset();
873 }
874 
876 {
877  return ScResId( STR_UNDO_INSERT_TAB );
878 }
879 
881 {
883  ScDocument& rDoc = pDocShell->GetDocument();
884  SCTAB nTabCount = rDoc.GetTableCount();
885  if (pViewShell)
886  {
887  if(nTab<nTabCount)
888  {
889  pViewShell->SetTabNo(nTab,true);
890  }
891  else
892  {
893  pViewShell->SetTabNo(nTab-1,true);
894  }
895  }
896 
897  SfxGetpApp()->Broadcast( SfxHint( SfxHintId::ScTablesChanged ) ); // Navigator
898  pDocShell->PostPaint( 0,0,0, rDoc.MaxCol(),rDoc.MaxRow(),MAXTAB,
900 }
901 
903 {
904  // Inserted range names, etc.
905 
906  SCTAB i;
907  ScDocument& rDoc = pDocShell->GetDocument();
908  bool bMakeRedo = !xRedoDoc;
909  if (bMakeRedo)
910  {
911  xRedoDoc.reset(new ScDocument(SCDOCMODE_UNDO));
912  xRedoDoc->InitUndo(rDoc, nTab,nTab+nCount-1, true, true);
913 
914  OUString aOldName;
915  for (i=0; i<nCount; i++)
916  {
917  SCTAB nTabPos=nTab+i;
918 
919  rDoc.CopyToDocument(0,0,nTabPos, rDoc.MaxCol(),rDoc.MaxRow(),nTabPos, InsertDeleteFlags::ALL,false, *xRedoDoc);
920  rDoc.GetName( nTabPos, aOldName );
921  xRedoDoc->RenameTab(nTabPos, aOldName);
922  xRedoDoc->SetTabBgColor(nTabPos, rDoc.GetTabBgColor(nTabPos));
923 
924  if ( rDoc.IsScenario(nTabPos) )
925  {
926  xRedoDoc->SetScenario(nTabPos, true);
927  OUString aComment;
928  Color aColor;
929  ScScenarioFlags nScenFlags;
930  rDoc.GetScenarioData(nTabPos, aComment, aColor, nScenFlags );
931  xRedoDoc->SetScenarioData(nTabPos, aComment, aColor, nScenFlags);
932  bool bActive = rDoc.IsActiveScenario(nTabPos);
933  xRedoDoc->SetActiveScenario(nTabPos, bActive);
934  bool bVisible = rDoc.IsVisible(nTabPos);
935  xRedoDoc->SetVisible(nTabPos, bVisible);
936  }
937 
938  if ( rDoc.IsTabProtected( nTabPos ) )
939  xRedoDoc->SetTabProtection(nTabPos, rDoc.GetTabProtection(nTabPos));
940  }
941 
942  }
943 
944  DoSdrUndoAction( pDrawUndo.get(), &rDoc ); // before the sheets are deleted
945 
946  bDrawIsInUndo = true;
947  for (i=0; i<nCount; i++)
948  rDoc.DeleteTab( nTab );
949  bDrawIsInUndo = false;
950 
951  DoChange();
952 }
953 
955 {
956  if (!xRedoDoc)
957  {
958  OSL_FAIL("Where is my Redo Document?");
959  return;
960  }
961 
962  ScDocument& rDoc = pDocShell->GetDocument();
963  OUString aName;
964  SCTAB i;
965  for (i=0; i<nCount; i++) // first insert all sheets (#63304#)
966  {
967  SCTAB nTabPos=nTab+i;
968  xRedoDoc->GetName(nTabPos, aName);
969  bDrawIsInUndo = true;
970  rDoc.InsertTab(nTabPos,aName);
971  bDrawIsInUndo = false;
972  }
973  for (i=0; i<nCount; i++) // then copy into inserted sheets
974  {
975  SCTAB nTabPos=nTab+i;
976  xRedoDoc->CopyToDocument(0,0,nTabPos, rDoc.MaxCol(),rDoc.MaxRow(),nTabPos, InsertDeleteFlags::ALL,false, rDoc);
977  rDoc.SetTabBgColor(nTabPos, xRedoDoc->GetTabBgColor(nTabPos));
978 
979  if (xRedoDoc->IsScenario(nTabPos))
980  {
981  rDoc.SetScenario(nTabPos, true );
982  OUString aComment;
983  Color aColor;
984  ScScenarioFlags nScenFlags;
985  xRedoDoc->GetScenarioData(nTabPos, aComment, aColor, nScenFlags );
986  rDoc.SetScenarioData(nTabPos, aComment, aColor, nScenFlags );
987  bool bActive = xRedoDoc->IsActiveScenario(nTabPos);
988  rDoc.SetActiveScenario(nTabPos, bActive );
989  bool bVisible = xRedoDoc->IsVisible(nTabPos);
990  rDoc.SetVisible(nTabPos,bVisible );
991  }
992 
993  if (xRedoDoc->IsTabProtected(nTabPos))
994  rDoc.SetTabProtection(nTabPos, xRedoDoc->GetTabProtection(nTabPos));
995  }
996 
997  RedoSdrUndoAction( pDrawUndo.get() ); // after the sheets are inserted
998 
999  DoChange();
1000 }
1001 
1003 {
1004  if (auto pViewTarget = dynamic_cast<ScTabViewTarget*>( &rTarget))
1005  pViewTarget->GetViewShell()->GetViewData().GetDispatcher().
1006  Execute(FID_INS_TABLE, SfxCallMode::SLOT | SfxCallMode::RECORD);
1007 }
1008 
1010 {
1011  return dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr;
1012 }
1013 
1014 ScUndoRemoveLink::ScUndoRemoveLink( ScDocShell* pShell, const OUString& rDocName ) :
1015  ScSimpleUndo( pShell ),
1016  aDocName( rDocName ),
1017  nRefreshDelay( 0 ),
1018  nCount( 0 )
1019 {
1020  ScDocument& rDoc = pDocShell->GetDocument();
1021  SCTAB nTabCount = rDoc.GetTableCount();
1022  pTabs.reset( new SCTAB[nTabCount] );
1023  pModes.reset( new ScLinkMode[nTabCount] );
1024  pTabNames.reset( new OUString[nTabCount] );
1025 
1026  for (SCTAB i=0; i<nTabCount; i++)
1027  {
1028  ScLinkMode nMode = rDoc.GetLinkMode(i);
1029  if (nMode != ScLinkMode::NONE)
1030  if (rDoc.GetLinkDoc(i) == aDocName)
1031  {
1032  if (!nCount)
1033  {
1034  aFltName = rDoc.GetLinkFlt(i);
1035  aOptions = rDoc.GetLinkOpt(i);
1037  }
1038  else
1039  {
1040  OSL_ENSURE(aFltName == rDoc.GetLinkFlt(i) &&
1041  aOptions == rDoc.GetLinkOpt(i),
1042  "different Filter for a Document?");
1043  }
1044  pTabs[nCount] = i;
1045  pModes[nCount] = nMode;
1046  pTabNames[nCount] = rDoc.GetLinkTab(i);
1047  ++nCount;
1048  }
1049  }
1050 }
1051 
1053 {
1054 }
1055 
1057 {
1058  return ScResId( STR_UNDO_REMOVELINK );
1059 }
1060 
1061 void ScUndoRemoveLink::DoChange( bool bLink ) const
1062 {
1063  ScDocument& rDoc = pDocShell->GetDocument();
1064  for (sal_uInt16 i=0; i<nCount; i++)
1065  if (bLink) // establish link
1067  else // remove link
1068  rDoc.SetLink( pTabs[i], ScLinkMode::NONE, "", "", "", "", 0 );
1070 }
1071 
1073 {
1074  DoChange( true );
1075 }
1076 
1078 {
1079  DoChange( false );
1080 }
1081 
1083 {
1084  // makes no sense
1085 }
1086 
1088 {
1089  return false;
1090 }
1091 
1092 ScUndoShowHideTab::ScUndoShowHideTab( ScDocShell* pShell, std::vector<SCTAB>&& newUndoTabs, bool bNewShow ) :
1093  ScSimpleUndo( pShell ),
1094  undoTabs( std::move(newUndoTabs) ),
1095  bShow( bNewShow )
1096 {
1097 }
1098 
1100 {
1101 }
1102 
1103 void ScUndoShowHideTab::DoChange( bool bShowP ) const
1104 {
1105  ScDocument& rDoc = pDocShell->GetDocument();
1107 
1108  for(const SCTAB& nTab : undoTabs)
1109  {
1110  rDoc.SetVisible( nTab, bShowP );
1111  if (pViewShell)
1112  pViewShell->SetTabNo(nTab,true);
1113  }
1114 
1115  SfxGetpApp()->Broadcast( SfxHint( SfxHintId::ScTablesChanged ) );
1117 }
1118 
1120 {
1121  DoChange(!bShow);
1122 }
1123 
1125 {
1126  DoChange(bShow);
1127 }
1128 
1130 {
1131  if (auto pViewTarget = dynamic_cast<ScTabViewTarget*>( &rTarget))
1132  pViewTarget->GetViewShell()->GetViewData().GetDispatcher().
1133  Execute( bShow ? FID_TABLE_SHOW : FID_TABLE_HIDE,
1134  SfxCallMode::SLOT | SfxCallMode::RECORD);
1135 }
1136 
1138 {
1139  return dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr;
1140 }
1141 
1143 {
1144  TranslateId pId;
1145  if (undoTabs.size() > 1)
1146  {
1147  pId = bShow ? STR_UNDO_SHOWTABS : STR_UNDO_HIDETABS;
1148  }
1149  else
1150  {
1151  pId = bShow ? STR_UNDO_SHOWTAB : STR_UNDO_HIDETAB;
1152  }
1153 
1154  return ScResId(pId);
1155 }
1156 
1157 ScUndoDocProtect::ScUndoDocProtect(ScDocShell* pShell, unique_ptr<ScDocProtection> && pProtectSettings) :
1158  ScSimpleUndo(pShell),
1159  mpProtectSettings(std::move(pProtectSettings))
1160 {
1161 }
1162 
1164 {
1165 }
1166 
1167 void ScUndoDocProtect::DoProtect(bool bProtect)
1168 {
1169  ScDocument& rDoc = pDocShell->GetDocument();
1170 
1171  if (bProtect)
1172  {
1173  // set protection.
1174  unique_ptr<ScDocProtection> pCopy(new ScDocProtection(*mpProtectSettings));
1175  pCopy->setProtected(true);
1176  rDoc.SetDocProtection(pCopy.get());
1177  }
1178  else
1179  {
1180  // remove protection.
1181  rDoc.SetDocProtection(nullptr);
1182  }
1183 
1185  if (pViewShell)
1186  {
1187  pViewShell->UpdateLayerLocks();
1188  pViewShell->UpdateInputHandler(true); // so that input can be immediately entered again
1189  }
1190 
1192 }
1193 
1195 {
1196  BeginUndo();
1197  DoProtect(!mpProtectSettings->isProtected());
1198  EndUndo();
1199 }
1200 
1202 {
1203  BeginRedo();
1204  DoProtect(mpProtectSettings->isProtected());
1205  EndRedo();
1206 }
1207 
1209 {
1210  // makes no sense
1211 }
1212 
1214 {
1215  return false; // makes no sense
1216 }
1217 
1219 {
1220  TranslateId pId = mpProtectSettings->isProtected() ? STR_UNDO_PROTECT_DOC : STR_UNDO_UNPROTECT_DOC;
1221  return ScResId(pId);
1222 }
1223 
1224 ScUndoTabProtect::ScUndoTabProtect(ScDocShell* pShell, SCTAB nTab, unique_ptr<ScTableProtection> && pProtectSettings) :
1225  ScSimpleUndo(pShell),
1226  mnTab(nTab),
1227  mpProtectSettings(std::move(pProtectSettings))
1228 {
1229 }
1230 
1232 {
1233 }
1234 
1235 void ScUndoTabProtect::DoProtect(bool bProtect)
1236 {
1237  ScDocument& rDoc = pDocShell->GetDocument();
1238 
1239  if (bProtect)
1240  {
1241  // set protection.
1242  unique_ptr<ScTableProtection> pCopy(new ScTableProtection(*mpProtectSettings));
1243  pCopy->setProtected(true);
1244  rDoc.SetTabProtection(mnTab, pCopy.get());
1245  }
1246  else
1247  {
1248  // remove protection.
1249  rDoc.SetTabProtection(mnTab, nullptr);
1250  }
1251 
1253  if (pViewShell)
1254  {
1255  if (ScTabView* pTabView = pViewShell->GetViewData().GetView())
1256  pTabView->SetTabProtectionSymbol( mnTab, bProtect);
1257  pViewShell->UpdateLayerLocks();
1258  pViewShell->UpdateInputHandler(true); // so that input can be immediately entered again
1259  }
1260 
1262 }
1263 
1265 {
1266  BeginUndo();
1267  DoProtect(!mpProtectSettings->isProtected());
1268  EndUndo();
1269 }
1270 
1272 {
1273  BeginRedo();
1274  DoProtect(mpProtectSettings->isProtected());
1275  EndRedo();
1276 }
1277 
1279 {
1280  // makes no sense
1281 }
1282 
1284 {
1285  return false; // makes no sense
1286 }
1287 
1289 {
1290  TranslateId pId = mpProtectSettings->isProtected() ? STR_UNDO_PROTECT_TAB : STR_UNDO_UNPROTECT_TAB;
1291  return ScResId(pId);
1292 }
1293 
1295  std::unique_ptr<ScPrintRangeSaver> pOld, std::unique_ptr<ScPrintRangeSaver> pNew ) :
1296  ScSimpleUndo( pShell ),
1297  nTab( nNewTab ),
1298  pOldRanges( std::move(pOld) ),
1299  pNewRanges( std::move(pNew) )
1300 {
1301 }
1302 
1304 {
1305  pOldRanges.reset();
1306  pNewRanges.reset();
1307 }
1308 
1310 {
1311  ScDocument& rDoc = pDocShell->GetDocument();
1312  if (bUndo)
1313  rDoc.RestorePrintRanges( *pOldRanges );
1314  else
1315  rDoc.RestorePrintRanges( *pNewRanges );
1316 
1318  if (pViewShell)
1319  pViewShell->SetTabNo( nTab );
1320 
1321  ScPrintFunc( pDocShell, pDocShell->GetPrinter(), nTab ).UpdatePages();
1322 
1323  if (pViewShell && comphelper::LibreOfficeKit::isActive())
1324  {
1325  tools::JsonWriter aJsonWriter;
1326  if (bUndo)
1327  pOldRanges->GetPrintRangesInfo(aJsonWriter);
1328  else
1329  pNewRanges->GetPrintRangesInfo(aJsonWriter);
1330 
1331  const std::string message = aJsonWriter.extractAsStdString();
1332  pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_PRINT_RANGES, message.c_str());
1333  }
1334 
1336 }
1337 
1339 {
1340  BeginUndo();
1341  DoChange( true );
1342  EndUndo();
1343 }
1344 
1346 {
1347  BeginRedo();
1348  DoChange( false );
1349  EndRedo();
1350 }
1351 
1353 {
1354  // makes no sense
1355 }
1356 
1358 {
1359  return false; // makes no sense
1360 }
1361 
1363 {
1364  return ScResId( STR_UNDO_PRINTRANGES );
1365 }
1366 
1368  const OUString& rON, const OUString& rNN, const OUString& rOC, const OUString& rNC,
1369  const Color& rOCol, const Color& rNCol, ScScenarioFlags nOF, ScScenarioFlags nNF) :
1370  ScSimpleUndo( pNewDocShell ),
1371  nTab ( nT ),
1372  aOldName ( rON ),
1373  aNewName ( rNN ),
1374  aOldComment ( rOC ),
1375  aNewComment ( rNC ),
1376  aOldColor ( rOCol ),
1377  aNewColor ( rNCol ),
1378  nOldFlags (nOF),
1379  nNewFlags (nNF)
1380 {
1381 }
1382 
1384 {
1385 }
1386 
1388 {
1389  return ScResId( STR_UNDO_EDITSCENARIO );
1390 }
1391 
1393 {
1394  ScDocument& rDoc = pDocShell->GetDocument();
1395 
1396  rDoc.RenameTab( nTab, aOldName );
1398 
1400  // The sheet name might be used in a formula ...
1402  if (pViewShell)
1403  pViewShell->UpdateInputHandler();
1404 
1405  if ( aOldName != aNewName )
1406  SfxGetpApp()->Broadcast( SfxHint( SfxHintId::ScTablesChanged ) );
1407 }
1408 
1410 {
1411  ScDocument& rDoc = pDocShell->GetDocument();
1412 
1413  rDoc.RenameTab( nTab, aNewName );
1415 
1417  // The sheet name might be used in a formula ...
1419  if (pViewShell)
1420  pViewShell->UpdateInputHandler();
1421 
1422  if ( aOldName != aNewName )
1423  SfxGetpApp()->Broadcast( SfxHint( SfxHintId::ScTablesChanged ) );
1424 }
1425 
1427 {
1428  // Repeat makes no sense
1429 }
1430 
1432 {
1433  return false;
1434 }
1435 
1436 // (move to different file?)
1437 ScUndoRenameObject::ScUndoRenameObject( ScDocShell* pNewDocShell, const OUString& rPN,
1438  const OUString& rON, const OUString& rNN ) :
1439  ScSimpleUndo( pNewDocShell ),
1440  aPersistName( rPN ),
1441  aOldName ( rON ),
1442  aNewName ( rNN )
1443 {
1444 }
1445 
1447 {
1448 }
1449 
1451 {
1452  // string resource shared with title for dialog
1453  return ScResId(SCSTR_RENAMEOBJECT);
1454 }
1455 
1457 {
1458  ScDocument& rDoc = pDocShell->GetDocument();
1459  ScDrawLayer* pDrawLayer = rDoc.GetDrawLayer();
1460  if ( pDrawLayer )
1461  {
1462  sal_uInt16 nCount = pDrawLayer->GetPageCount();
1463  for (sal_uInt16 nTab=0; nTab<nCount; nTab++)
1464  {
1465  SdrPage* pPage = pDrawLayer->GetPage(nTab);
1466  assert(pPage && "Page ?");
1467 
1468  SdrObjListIter aIter( pPage, SdrIterMode::DeepNoGroups );
1469  SdrObject* pObject = aIter.Next();
1470  while (pObject)
1471  {
1472  if ( pObject->GetObjIdentifier() == SdrObjKind::OLE2 &&
1473  static_cast<SdrOle2Obj*>(pObject)->GetPersistName() == aPersistName )
1474  {
1475  return pObject;
1476  }
1477 
1478  pObject = aIter.Next();
1479  }
1480  }
1481  }
1482  OSL_FAIL("Object not found");
1483  return nullptr;
1484 }
1485 
1487 {
1488  BeginUndo();
1489  SdrObject* pObj = GetObject();
1490  if ( pObj )
1491  pObj->SetName( aOldName );
1492  EndUndo();
1493 }
1494 
1496 {
1497  BeginRedo();
1498  SdrObject* pObj = GetObject();
1499  if ( pObj )
1500  pObj->SetName( aNewName );
1501  EndRedo();
1502 }
1503 
1505 {
1506 }
1507 
1509 {
1510  return false;
1511 }
1512 
1513 ScUndoLayoutRTL::ScUndoLayoutRTL( ScDocShell* pShell, SCTAB nNewTab, bool bNewRTL ) :
1514  ScSimpleUndo( pShell ),
1515  nTab( nNewTab ),
1516  bRTL( bNewRTL )
1517 {
1518 }
1519 
1521 {
1522 }
1523 
1524 void ScUndoLayoutRTL::DoChange( bool bNew )
1525 {
1526  pDocShell->SetInUndo( true );
1527 
1528  ScDocument& rDoc = pDocShell->GetDocument();
1530 
1532  if (pViewShell)
1533  pViewShell->SetTabNo(nTab,true);
1534 
1536 
1537  pDocShell->SetInUndo( false );
1538 }
1539 
1541 {
1542  DoChange(!bRTL);
1543 }
1544 
1546 {
1547  DoChange(bRTL);
1548 }
1549 
1551 {
1552  if (auto pViewTarget = dynamic_cast<ScTabViewTarget*>( &rTarget))
1553  pViewTarget->GetViewShell()->GetViewData().GetDispatcher().
1554  Execute( FID_TAB_RTL, SfxCallMode::SLOT | SfxCallMode::RECORD);
1555 }
1556 
1558 {
1559  return dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr;
1560 }
1561 
1563 {
1564  return ScResId( STR_UNDO_TAB_RTL );
1565 }
1566 
1567 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SC_DLLPUBLIC OUString GetLinkDoc(SCTAB nTab) const
Definition: documen3.cxx:511
OUString GetLinkOpt(SCTAB nTab) const
Definition: documen3.cxx:525
void UpdateLinks() override
Definition: docsh6.cxx:318
virtual void Undo() override
Definition: undotab.cxx:551
bool InsertTable(const OUString &rName, SCTAB nTabNr, bool bRecord=true)
Definition: viewfun2.cxx:2377
void DoChange(bool bNew)
Definition: undotab.cxx:1524
virtual bool CanRepeat(SfxRepeatTarget &rTarget) const override
Definition: undotab.cxx:1137
virtual void Redo() override
Definition: undotab.cxx:1271
virtual ~ScUndoMoveTab() override
Definition: undotab.cxx:484
virtual void Repeat(SfxRepeatTarget &rTarget) override
Definition: undotab.cxx:1426
ScAddress aStart
Definition: address.hxx:497
bool bVisible
SC_DLLPUBLIC void SetScenario(SCTAB nTab, bool bFlag)
Definition: documen3.cxx:426
SC_DLLPUBLIC bool IsTabProtected(SCTAB nTab) const
Definition: documen3.cxx:1913
todo: It should be possible to have MarkArrays for each table, in order to enable "search all" across...
Definition: markdata.hxx:42
SfxPrinter * GetPrinter(bool bCreateIfNotExist=true)
Definition: docsh3.cxx:451
ScUndoShowHideTab(ScDocShell *pShell, std::vector< SCTAB > &&newUndoTabs, bool bNewShow)
Definition: undotab.cxx:1092
SC_DLLPUBLIC ScLinkMode GetLinkMode(SCTAB nTab) const
Definition: documen3.cxx:504
virtual OUString GetComment() const override
Definition: undotab.cxx:488
OUString ScResId(TranslateId aId)
Definition: scdll.cxx:90
virtual void Redo() override
Definition: undotab.cxx:1201
void PostPaintGridAll()
Definition: docsh3.cxx:183
std::unique_ptr< SdrUndoAction > GetSdrUndoAction(ScDocument *pDoc)
Definition: undoolk.cxx:26
virtual void Undo() override
Definition: undotab.cxx:610
SC_DLLPUBLIC void SetTabProtection(SCTAB nTab, const ScTableProtection *pProtect)
Definition: documen3.cxx:1930
bool AppendTable(const OUString &rName, bool bRecord=true)
Definition: viewfun2.cxx:2432
virtual OUString GetComment() const override
Definition: undotab.cxx:875
void SetSheetEvents(SCTAB nTab, std::unique_ptr< ScSheetEvents > pNew)
Definition: documen3.cxx:670
virtual void Repeat(SfxRepeatTarget &rTarget) override
Definition: undotab.cxx:848
void SetName(const OUString &rStr, const bool bSetChanged=true)
virtual void Repeat(SfxRepeatTarget &rTarget) override
Definition: undotab.cxx:1504
virtual ~ScUndoTabProtect() override
Definition: undotab.cxx:1231
ScUndoMakeScenario(ScDocShell *pNewDocShell, SCTAB nSrc, SCTAB nDest, const OUString &rN, const OUString &rC, const Color &rCol, ScScenarioFlags nF, const ScMarkData &rMark)
Definition: undotab.cxx:775
virtual void Redo() override
Definition: undotab.cxx:1545
virtual OUString GetComment() const override
Definition: undotab.cxx:1562
SC_DLLPUBLIC bool IsActiveScenario(SCTAB nTab) const
Definition: documen3.cxx:880
sal_uLong nStartChangeAction
Definition: undotab.hxx:110
sal_uInt64 GetCodeCount() const
Definition: document.cxx:6263
sheet protection state container
SC_DLLPUBLIC void SetTabBgColor(SCTAB nTab, const Color &rColor)
Definition: documen3.cxx:455
virtual ~ScUndoShowHideTab() override
Definition: undotab.cxx:1099
ScScenarioFlags
Definition: global.hxx:224
ScScenarioFlags nOldFlags
Definition: undotab.hxx:423
virtual void Repeat(SfxRepeatTarget &rTarget) override
Definition: undotab.cxx:399
SC_DLLPUBLIC void SetLayoutRTL(SCTAB nTab, bool bRTL, ScObjectHandling eObjectHandling=ScObjectHandling::RecalcPosMode)
Definition: document.cxx:953
sal_uIntPtr sal_uLong
virtual void Undo() override
Definition: undotab.cxx:451
virtual OUString GetComment() const override
Definition: undotab.cxx:1450
sal_Int64 n
void DoProtect(bool bProtect)
Definition: undotab.cxx:1167
ScUndoLayoutRTL(ScDocShell *pShell, SCTAB nNewTab, bool bNewRTL)
Definition: undotab.cxx:1513
const ::avmedia::MediaItem * Execute(const SdrMarkView *pSdrView, SfxRequest const &rReq)
SdrObject * GetObject()
Definition: undotab.cxx:1456
void DeleteTable(SCTAB nTabNr, bool bRecord=true)
Definition: viewfun2.cxx:2463
void SetDocumentModified()
Definition: docsh.cxx:2959
void PostPaintExtras()
Definition: docsh3.cxx:198
std::unique_ptr< SdrUndoAction > pDrawUndo
Definition: undobase.hxx:142
SCTAB GetTabNo() const
Definition: viewdata.hxx:395
virtual ~ScUndoTabColor() override
Definition: undotab.cxx:727
ScUndoDeleteTab(ScDocShell *pNewDocShell, const std::vector< SCTAB > &theTabs, ScDocumentUniquePtr pUndoDocument, std::unique_ptr< ScRefUndoData > pRefData)
Definition: undotab.cxx:253
bool SetViewMarkData(const ScMarkData &rMarkData)
Definition: undobase.cxx:52
ScDocumentUniquePtr xRedoDoc
Definition: undotab.hxx:269
virtual void Undo() override
Definition: undotab.cxx:1486
void EndUndo()
Definition: undobase.cxx:122
#define SC_TAB_INSERTED
Definition: uiitems.hxx:75
virtual OUString GetComment() const override
Definition: undotab.cxx:797
void SetChangeTrack()
Definition: undotab.cxx:271
OUString sNewName
Definition: undotab.hxx:136
virtual SdrObjKind GetObjIdentifier() const
sal_uLong GetActionMax() const
Definition: chgtrack.hxx:955
EmbeddedObjectRef * pObject
ScUndoTabProtect(ScDocShell *pShell, SCTAB nTab, std::unique_ptr< ScTableProtection > &&pProtectSettings)
Definition: undotab.cxx:1224
std::vector< SCTAB > undoTabs
Definition: undotab.hxx:323
virtual bool CanRepeat(SfxRepeatTarget &rTarget) const override
Definition: undotab.cxx:1009
std::unique_ptr< ::std::vector< OUString > > mpNewNames
Definition: undotab.hxx:164
SC_DLLPUBLIC void SetVisible(SCTAB nTab, bool bVisible)
Definition: document.cxx:904
sal_uLong nStartChangeAction
Definition: undotab.hxx:84
virtual bool CanRepeat(SfxRepeatTarget &rTarget) const override
Definition: undotab.cxx:1283
virtual void Redo() override
Definition: undotab.cxx:760
void DoChange() const
Definition: undotab.cxx:880
virtual OUString GetComment() const override
Definition: undotab.cxx:266
ScScenarioFlags nNewFlags
Definition: undotab.hxx:424
virtual void Redo() override
Definition: undotab.cxx:380
virtual void Repeat(SfxRepeatTarget &rTarget) override
Definition: undotab.cxx:561
void DoProtect(bool bProtect)
Definition: undotab.cxx:1235
::std::unique_ptr< ScDocProtection > mpProtectSettings
Definition: undotab.hxx:345
SfxApplication * SfxGetpApp()
std::unique_ptr< ScPrintRangeSaver > pOldRanges
Definition: undotab.hxx:390
OUString sOldName
Definition: undotab.hxx:135
void InsertTables(std::vector< OUString > &aNames, SCTAB nTab, SCTAB nCount, bool bRecord=true)
Definition: viewfun2.cxx:2390
void EndUndo()
Definition: undobase.cxx:442
void DoChange(SCTAB nTab, const OUString &rName) const
Definition: undotab.cxx:433
std::unique_ptr< ::std::vector< OUString > > mpNewNames
Definition: undotab.hxx:190
virtual void Repeat(SfxRepeatTarget &rTarget) override
Definition: undotab.cxx:147
virtual bool CanRepeat(SfxRepeatTarget &rTarget) const override
Definition: undotab.cxx:1508
SC_DLLPUBLIC bool RenameTab(SCTAB nTab, const OUString &rName, bool bExternalDocument=false)
Definition: document.cxx:856
virtual bool CanRepeat(SfxRepeatTarget &rTarget) const override
Definition: undotab.cxx:248
virtual ~ScUndoInsertTables() override
Definition: undotab.cxx:171
ScUndoPrintRange(ScDocShell *pShell, SCTAB nNewTab, std::unique_ptr< ScPrintRangeSaver > pOld, std::unique_ptr< ScPrintRangeSaver > pNew)
Definition: undotab.cxx:1294
SC_DLLPUBLIC SCROW MaxRow() const
Definition: document.hxx:891
virtual ~ScUndoMakeScenario() override
Definition: undotab.cxx:792
SC_DLLPUBLIC SCTAB GetTableCount() const
Definition: document.cxx:315
virtual void Undo() override
Definition: undotab.cxx:1119
virtual ~ScUndoCopyTab() override
Definition: undotab.cxx:586
int nCount
virtual ~ScUndoDeleteTab() override
Definition: undotab.cxx:261
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:2063
virtual void libreOfficeKitViewCallback(int nType, const char *pPayload) const override
void RedoSdrUndoAction(SdrUndoAction *pUndoAction)
Definition: undoolk.cxx:61
std::unique_ptr< ::std::vector< SCTAB > > mpNewTabs
Definition: undotab.hxx:162
void UpdateInputHandler(bool bForce=false, bool bStopEditing=true)
Definition: tabvwsha.cxx:668
ScLinkMode
Definition: global.hxx:213
#define SC_TAB_DELETED
Definition: uiitems.hxx:76
void CopyTabProtection(SCTAB nTabSrc, SCTAB nTabDest)
Definition: documen3.cxx:1938
virtual ~ScUndoRenameObject() override
Definition: undotab.cxx:1446
virtual bool CanRepeat(SfxRepeatTarget &rTarget) const override
Definition: undotab.cxx:704
void SetChangeTrack()
Definition: undotab.cxx:181
virtual void Redo() override
Definition: undotab.cxx:456
virtual void Repeat(SfxRepeatTarget &rTarget) override
Definition: undotab.cxx:1129
ScViewData & GetViewData()
Definition: tabview.hxx:333
ScChangeTrack * GetChangeTrack() const
Definition: document.hxx:2485
SC_DLLPUBLIC void Undo(sal_uLong nStartAction, sal_uLong nEndAction, bool bMerge=false)
Definition: chgtrack.cxx:3034
virtual void Undo() override
Definition: undotab.cxx:1338
std::vector< SCTAB > theTabs
Definition: undotab.hxx:109
virtual OUString GetComment() const override
Definition: undotab.cxx:1362
ScUndoInsertTab(ScDocShell *pNewDocShell, SCTAB nTabNum, bool bApp, const OUString &rNewName)
Definition: undotab.cxx:65
void SetTab(SCTAB nTabP)
Definition: address.hxx:295
void BeginRedo()
Definition: undobase.cxx:142
bool bDrawIsInUndo
Definition: drwlayer.cxx:91
OUString aOldName
Definition: undotab.hxx:445
SC_DLLPUBLIC void SetScenarioData(SCTAB nTab, const OUString &rComment, const Color &rColor, ScScenarioFlags nFlags)
Definition: documen3.cxx:437
SC_DLLPUBLIC ScDrawLayer * GetDrawLayer()
Definition: document.hxx:1081
SC_DLLPUBLIC SCCOL MaxCol() const
Definition: document.hxx:890
virtual OUString GetComment() const override
Definition: undotab.cxx:176
SC_DLLPUBLIC bool CopyTab(SCTAB nOldPos, SCTAB nNewPos, const ScMarkData *pOnlyMarked=nullptr)
Definition: documen2.cxx:787
virtual OUString GetComment() const override
Definition: undotab.cxx:1142
std::unique_ptr< ScPrintRangeSaver > pNewRanges
Definition: undotab.hxx:391
std::string extractAsStdString()
virtual void Undo() override
Definition: undotab.cxx:105
virtual void Undo() override
Definition: undotab.cxx:802
virtual void Repeat(SfxRepeatTarget &rTarget) override
Definition: undotab.cxx:1352
int i
void DoChange(bool bShow) const
Definition: undotab.cxx:1103
SC_DLLPUBLIC void SetActiveScenario(SCTAB nTab, bool bActive)
Definition: documen3.cxx:885
OUString aNewComment
Definition: undotab.hxx:420
::std::unique_ptr< ScTableProtection > mpProtectSettings
Definition: undotab.hxx:368
void DoChange(bool bUndo)
Definition: undotab.cxx:1309
sal_uLong nEndChangeAction
Definition: undotab.hxx:57
virtual OUString GetComment() const override
Definition: undotab.cxx:1387
ScUndoTabColorInfo::List aTabColorList
Definition: undotab.hxx:217
std::unique_ptr< ScDocument, o3tl::default_delete< ScDocument > > ScDocumentUniquePtr
Definition: document.hxx:2715
virtual OUString GetComment() const override
Definition: undotab.cxx:428
virtual bool CanRepeat(SfxRepeatTarget &rTarget) const override
Definition: undotab.cxx:770
void RestorePrintRanges(const ScPrintRangeSaver &rSaver)
Definition: document.cxx:6445
ScDocShell * pDocShell
Definition: undobase.hxx:47
virtual void Repeat(SfxRepeatTarget &rTarget) override
Definition: undotab.cxx:765
ScUndoDocProtect(ScDocShell *pShell,::std::unique_ptr< ScDocProtection > &&pProtectSettings)
Definition: undotab.cxx:1157
std::unique_ptr< ScMarkData > mpMarkData
Definition: undotab.hxx:241
SC_DLLPUBLIC void SetTabNo(SCTAB nTab, bool bNew=false, bool bExtendSelection=false, bool bSameTabButMoved=false)
Definition: tabview3.cxx:1800
const SdrPage * GetPage(sal_uInt16 nPgNum) const
void SetChangeTrack()
Definition: undotab.cxx:91
virtual void Redo() override
Definition: undotab.cxx:1124
std::unique_ptr< SdrUndoAction > pDrawUndo
Definition: undotab.hxx:82
virtual void Redo() override
Definition: undotab.cxx:225
virtual void Redo() override
Definition: undotab.cxx:1345
virtual bool CanRepeat(SfxRepeatTarget &rTarget) const override
Definition: undotab.cxx:408
void DoChange() const
Definition: undotab.cxx:596
sal_uLong nEndChangeAction
Definition: undotab.hxx:111
void SetLink(SCTAB nTab, ScLinkMode nMode, const OUString &rDoc, const OUString &rFilter, const OUString &rOptions, const OUString &rTabName, sal_uLong nRefreshDelay)
Definition: documen3.cxx:546
void DoSdrUndoAction(SdrUndoAction *pUndoAction, ScDocument *pDoc)
Definition: undoolk.cxx:35
std::unique_ptr< ::std::vector< OUString > > mpOldNames
Definition: undotab.hxx:163
ScDocumentUniquePtr pRefUndoDoc
Definition: undobase.hxx:143
SC_DLLPUBLIC bool InsertTab(SCTAB nPos, const OUString &rName, bool bExternalDocument=false, bool bUndoDeleteTab=false)
Definition: document.cxx:505
ScUndoTabColor(ScDocShell *pNewDocShell, SCTAB nT, const Color &aOTabBgColor, const Color &aNTabBgColor)
Definition: undotab.cxx:709
std::unique_ptr< SdrUndoAction > pDrawUndo
Definition: undotab.hxx:191
OUString GetLinkFlt(SCTAB nTab) const
Definition: documen3.cxx:518
virtual void Redo() override
Definition: undotab.cxx:954
SC_DLLPUBLIC void AppendDeleteRange(const ScRange &, ScDocument *pRefDoc, SCTAB nDz, sal_uLong nRejectingInsert)
Definition: chgtrack.cxx:2389
void DoChange(bool bUndo) const
Definition: undotab.cxx:493
virtual void Repeat(SfxRepeatTarget &rTarget) override
Definition: undotab.cxx:1208
const SCTAB MAXTAB
Definition: address.hxx:70
virtual bool CanRepeat(SfxRepeatTarget &rTarget) const override
Definition: undotab.cxx:154
virtual void Redo() override
Definition: undotab.cxx:126
void PostPaint(SCCOL nStartCol, SCROW nStartRow, SCTAB nStartTab, SCCOL nEndCol, SCROW nEndRow, SCTAB nEndTab, PaintPartFlags nPart, sal_uInt16 nExtFlags=0)
Definition: docsh3.cxx:101
virtual bool CanRepeat(SfxRepeatTarget &rTarget) const override
Definition: undotab.cxx:566
virtual void Repeat(SfxRepeatTarget &rTarget) override
Definition: undotab.cxx:699
ScUndoRenameTab(ScDocShell *pNewDocShell, SCTAB nT, const OUString &rOldName, const OUString &rNewName)
Definition: undotab.cxx:413
void MoveTab(SCTAB nSrcTab, SCTAB nDestTab)
Definition: viewdata.cxx:968
void PostDataChanged()
Definition: docsh3.cxx:93
SfxViewShell * GetViewShell() const
ScUndoInsertTables(ScDocShell *pNewDocShell, SCTAB nTabNum, std::vector< OUString > &&newNameList)
Definition: undotab.cxx:159
virtual void Undo() override
Definition: undotab.cxx:755
ScDBFunc * GetView() const
Definition: viewdata.cxx:863
virtual OUString GetComment() const override
Definition: undotab.cxx:83
std::unique_ptr< ::std::vector< SCTAB > > mpOldTabs
Definition: undotab.hxx:188
void BeginUndo()
Definition: undobase.cxx:435
virtual bool CanRepeat(SfxRepeatTarget &rTarget) const override
Definition: undotab.cxx:1557
SC_DLLPUBLIC void GetScenarioData(SCTAB nTab, OUString &rComment, Color &rColor, ScScenarioFlags &rFlags) const
Definition: documen3.cxx:468
ScUndoRenameObject(ScDocShell *pNewDocShell, const OUString &rPN, const OUString &rON, const OUString &rNN)
Definition: undotab.cxx:1437
virtual void Undo() override
Definition: undotab.cxx:1392
virtual void Repeat(SfxRepeatTarget &rTarget) override
Definition: undotab.cxx:1278
virtual bool CanRepeat(SfxRepeatTarget &rTarget) const override
Definition: undotab.cxx:1357
std::unique_ptr< SdrUndoAction > pDrawUndo
Definition: undotab.hxx:270
virtual ~ScUndoInsertTab() override
Definition: undotab.cxx:78
SC_DLLPUBLIC Color GetTabBgColor(SCTAB nTab) const
Definition: documen3.cxx:448
SdrObject * Next()
void SetInUndo(bool bSet)
Definition: docsh.cxx:3054
virtual bool CanRepeat(SfxRepeatTarget &rTarget) const override
Definition: undotab.cxx:466
virtual ~ScUndoLayoutRTL() override
Definition: undotab.cxx:1520
virtual void Undo() override
Definition: undotab.cxx:1264
virtual ~ScUndoPrintRange() override
Definition: undotab.cxx:1303
std::unique_ptr< ::std::vector< SCTAB > > mpOldTabs
Definition: undotab.hxx:161
static ScTabViewShell * GetActiveViewShell()
Definition: tabvwsh4.cxx:1075
bool MoveTab(SCTAB nOldPos, SCTAB nNewPos, ScProgress *pProgress=nullptr)
Definition: documen2.cxx:716
virtual OUString GetComment() const override
Definition: undotab.cxx:731
SC_DLLPUBLIC bool IsScenario(SCTAB nTab) const
Definition: documen3.cxx:432
virtual void Repeat(SfxRepeatTarget &rTarget) override
Definition: undotab.cxx:461
virtual void Redo() override
Definition: undotab.cxx:556
virtual OUString GetComment() const override
Definition: undotab.cxx:591
virtual bool CanRepeat(SfxRepeatTarget &rTarget) const override
Definition: undotab.cxx:856
SCTAB MakeScenario(SCTAB nTab, const OUString &rName, const OUString &rComment, const Color &rColor, ScScenarioFlags nFlags, ScMarkData &rMark, bool bRecord=true)
Definition: docsh5.cxx:783
virtual void Undo() override
Definition: undotab.cxx:202
virtual ~ScUndoScenarioFlags() override
Definition: undotab.cxx:1383
OUString aName
sal_uLong GetLinkRefreshDelay(SCTAB nTab) const
Definition: documen3.cxx:539
ScUndoMoveTab(ScDocShell *pNewDocShell, std::unique_ptr< std::vector< SCTAB >> pOldTabs, std::unique_ptr< std::vector< SCTAB >> pNewTabs, std::unique_ptr< std::vector< OUString >> pOldNames=nullptr, std::unique_ptr< std::vector< OUString >> pNewNames=nullptr)
Definition: undotab.cxx:471
virtual void Redo() override
Definition: undotab.cxx:827
sal_uLong nEndChangeAction
Definition: undotab.hxx:85
virtual void Redo() override
Definition: undotab.cxx:643
SC_DLLPUBLIC OUString GetLinkTab(SCTAB nTab) const
Definition: documen3.cxx:532
virtual void Undo() override
Definition: undotab.cxx:1194
const ScDocument & GetDocument() const
Definition: docsh.hxx:220
std::unique_ptr< SdrUndoAction > pDrawUndo
Definition: undotab.hxx:56
virtual ~ScUndoRenameTab() override
Definition: undotab.cxx:424
void DoChange(bool bUndoType) const
Definition: undotab.cxx:738
virtual bool CanRepeat(SfxRepeatTarget &rTarget) const override
Definition: undotab.cxx:1213
static SCTAB lcl_GetVisibleTabBefore(const ScDocument &rDoc, SCTAB nTab)
Definition: undotab.cxx:293
SC_DLLPUBLIC bool DeleteTab(SCTAB nTab)
Definition: document.cxx:674
bool DeleteTables(const std::vector< SCTAB > &TheTabs, bool bRecord=true)
virtual void Repeat(SfxRepeatTarget &rTarget) override
Definition: undotab.cxx:1550
void SetDocumentModified()
Definition: docsh.cxx:3297
std::unique_ptr< ::std::vector< SCTAB > > mpNewTabs
Definition: undotab.hxx:189
OUString aNewName
Definition: undotab.hxx:446
ScUndoCopyTab(ScDocShell *pNewDocShell, std::unique_ptr< std::vector< SCTAB >> pOldTabs, std::unique_ptr< std::vector< SCTAB >> pNewTabs, std::unique_ptr< std::vector< OUString >> pNewNames=nullptr)
Definition: undotab.cxx:571
SC_DLLPUBLIC bool IsVisible(SCTAB nTab) const
Definition: document.cxx:911
SC_DLLPUBLIC void SetDocProtection(const ScDocProtection *pProtect)
Definition: documen3.cxx:1894
virtual void Repeat(SfxRepeatTarget &rTarget) override
Definition: undotab.cxx:241
std::vector< OUString > aNameList
Definition: undotab.hxx:83
ScUndoImportTab(ScDocShell *pShell, SCTAB nNewTab, SCTAB nNewCount)
Definition: undotab.cxx:861
OUString sNewName
Definition: undotab.hxx:55
SC_DLLPUBLIC void AppendInsert(const ScRange &rRange, bool bEndOfList=false)
Definition: chgtrack.cxx:2753
virtual void Redo() override
Definition: undotab.cxx:1409
virtual OUString GetComment() const override
Definition: undotab.cxx:1288
void UpdateLayerLocks()
Definition: tabview5.cxx:355
virtual OUString GetComment() const override
Definition: undotab.cxx:1218
ScUndoScenarioFlags(ScDocShell *pNewDocShell, SCTAB nT, const OUString &rON, const OUString &rNN, const OUString &rOC, const OUString &rNC, const Color &rOCol, const Color &rNCol, ScScenarioFlags nOF, ScScenarioFlags nNF)
Definition: undotab.cxx:1367
virtual void Redo() override
Definition: undotab.cxx:1495
virtual ~ScUndoImportTab() override
Definition: undotab.cxx:870
std::unique_ptr< SdrUndoAction > pDrawUndo
Definition: undotab.hxx:248
virtual ~ScUndoDocProtect() override
Definition: undotab.cxx:1163
virtual void Undo() override
Definition: undotab.cxx:1540
SC_DLLPUBLIC bool GetName(SCTAB nTab, OUString &rName) const
Definition: document.cxx:215
void EndRedo()
Definition: undobase.cxx:151
virtual bool CanRepeat(SfxRepeatTarget &rTarget) const override
Definition: undotab.cxx:1431
Create before modifications of the document and destroy thereafter.
Definition: docsh.hxx:456
::std::vector< ScUndoTabColorInfo > List
Definition: tabbgcolor.hxx:36
OUString aComment
Definition: undotab.hxx:245
OUString aPersistName
Definition: undotab.hxx:444
OUString aOldComment
Definition: undotab.hxx:419
sal_uInt16 GetPageCount() const
sal_Int16 SCTAB
Definition: types.hxx:22
virtual void Undo() override
Definition: undotab.cxx:301
void BeginUndo()
Definition: undobase.cxx:87
ScScenarioFlags nFlags
Definition: undotab.hxx:247
virtual void Undo() override
Definition: undotab.cxx:902
virtual void Repeat(SfxRepeatTarget &rTarget) override
Definition: undotab.cxx:1002
SC_DLLPUBLIC const ScTableProtection * GetTabProtection(SCTAB nTab) const
Definition: documen3.cxx:1922