LibreOffice Module svx (master)  1
svdundo.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 <com/sun/star/drawing/FillStyle.hpp>
21 
22 #include <svx/svdundo.hxx>
23 #include <svx/svdotext.hxx>
24 #include <svx/svdobj.hxx>
25 #include <svx/svdpage.hxx>
26 #include <svx/svdlayer.hxx>
27 #include <svx/svdmodel.hxx>
28 #include <svx/svdview.hxx>
29 #include <svx/xbtmpit.hxx>
30 #include <svx/xfillit0.hxx>
31 #include <svx/strings.hrc>
32 #include <svx/dialmgr.hxx>
33 #include <svx/scene3d.hxx>
34 #include <editeng/outlobj.hxx>
35 #include <svx/svdogrp.hxx>
38 #include <svx/svdocapt.hxx>
39 #include <svl/whiter.hxx>
40 #include <svx/e3dsceneupdater.hxx>
41 #include <svx/svdviter.hxx>
42 #include <svx/svdotable.hxx> // #i124389#
43 #include <vcl/svapp.hxx>
44 #include <sfx2/viewsh.hxx>
45 #include <svx/svdoashp.hxx>
46 #include <sal/log.hxx>
47 #include <osl/diagnose.h>
49 
50 
51 // iterates over all views and unmarks this SdrObject if it is marked
52 static void ImplUnmarkObject( SdrObject* pObj )
53 {
54  SdrViewIter aIter( pObj );
55  for ( SdrView* pView = aIter.FirstView(); pView; pView = aIter.NextView() )
56  {
57  pView->MarkObj( pObj, pView->GetSdrPageView(), true );
58  }
59 }
60 
62  : rMod(rNewMod), m_nViewShellId(-1)
63 {
64  if (SfxViewShell* pViewShell = SfxViewShell::Current())
65  m_nViewShellId = pViewShell->GetViewShellId();
66 }
67 
69 
71 {
72  SdrView* pV=dynamic_cast<SdrView*>( &rView );
73  if (pV!=nullptr) return CanSdrRepeat(*pV);
74  return false;
75 }
76 
78 {
79  SdrView* pV=dynamic_cast<SdrView*>( &rView );
80  if (pV!=nullptr) SdrRepeat(*pV);
81  DBG_ASSERT(pV!=nullptr,"Repeat: SfxRepeatTarget that was handed over is not a SdrView");
82 }
83 
85 {
86  SdrView* pV=dynamic_cast<SdrView*>( &rView );
87  if (pV!=nullptr) return GetSdrRepeatComment();
88  return OUString();
89 }
90 
91 bool SdrUndoAction::CanSdrRepeat(SdrView& /*rView*/) const
92 {
93  return false;
94 }
95 
97 {
98 }
99 
101 {
102  return OUString();
103 }
104 
106 {
107  return m_nViewShellId;
108 }
109 
111 : SdrUndoAction(rNewMod),
112  eFunction(SdrRepeatFunc::NONE)
113 {}
114 
116 {
117 }
118 
119 void SdrUndoGroup::AddAction(std::unique_ptr<SdrUndoAction> pAct)
120 {
121  maActions.push_back(std::move(pAct));
122 }
123 
125 {
126  for (auto it = maActions.rbegin(); it != maActions.rend(); ++it)
127  (*it)->Undo();
128 }
129 
131 {
132  for (std::unique_ptr<SdrUndoAction> & pAction : maActions)
133  pAction->Redo();
134 }
135 
136 OUString SdrUndoGroup::GetComment() const
137 {
138  return aComment.replaceAll("%1", aObjDescription);
139 }
140 
142 {
143  switch (eFunction)
144  {
145  case SdrRepeatFunc::NONE : return false;
146  case SdrRepeatFunc::Delete : return rView.AreObjectsMarked();
148  case SdrRepeatFunc::CombineOnePoly : return rView.IsCombinePossible(true);
150  case SdrRepeatFunc::DismantleLines : return rView.IsDismantlePossible(true);
153  case SdrRepeatFunc::Group : return rView.IsGroupPossible();
154  case SdrRepeatFunc::Ungroup : return rView.IsUnGroupPossible();
155  case SdrRepeatFunc::PutToTop : return rView.IsToTopPossible();
156  case SdrRepeatFunc::PutToBottom : return rView.IsToBtmPossible();
157  case SdrRepeatFunc::MoveToTop : return rView.IsToTopPossible();
158  case SdrRepeatFunc::MoveToBottom : return rView.IsToBtmPossible();
160  case SdrRepeatFunc::ImportMtf : return rView.IsImportMtfPossible();
161  default: break;
162  } // switch
163  return false;
164 }
165 
167 {
168  switch (eFunction)
169  {
170  case SdrRepeatFunc::NONE : break;
171  case SdrRepeatFunc::Delete : rView.DeleteMarked(); break;
172  case SdrRepeatFunc::CombinePolyPoly : rView.CombineMarkedObjects(false); break;
175  case SdrRepeatFunc::DismantleLines : rView.DismantleMarkedObjects(true); break;
177  case SdrRepeatFunc::ConvertToPath : rView.ConvertMarkedToPathObj(false); break;
178  case SdrRepeatFunc::Group : rView.GroupMarked(); break;
179  case SdrRepeatFunc::Ungroup : rView.UnGroupMarked(); break;
180  case SdrRepeatFunc::PutToTop : rView.PutMarkedToTop(); break;
181  case SdrRepeatFunc::PutToBottom : rView.PutMarkedToBtm(); break;
182  case SdrRepeatFunc::MoveToTop : rView.MovMarkedToTop(); break;
183  case SdrRepeatFunc::MoveToBottom : rView.MovMarkedToBtm(); break;
185  case SdrRepeatFunc::ImportMtf : rView.DoImportMarkedMtf(); break;
186  default: break;
187  } // switch
188 }
189 
191 {
192  return aComment.replaceAll("%1", SvxResId(STR_ObjNameSingulPlural));
193 }
194 
196 : SdrUndoAction(rNewObj.getSdrModelFromSdrObject())
197  ,pObj(&rNewObj)
198 {
199 }
200 
201 OUString SdrUndoObj::GetDescriptionStringForObject( const SdrObject& _rForObject, TranslateId pStrCacheID, bool bRepeat )
202 {
203  const OUString rStr {SvxResId(pStrCacheID)};
204 
205  const sal_Int32 nPos = rStr.indexOf("%1");
206  if (nPos < 0)
207  return rStr;
208 
209  if (bRepeat)
210  return rStr.replaceAt(nPos, 2, SvxResId(STR_ObjNameSingulPlural));
211 
212  return rStr.replaceAt(nPos, 2, _rForObject.TakeObjNameSingul());
213 }
214 
215 OUString SdrUndoObj::ImpGetDescriptionStr(TranslateId pStrCacheID, bool bRepeat) const
216 {
217  if ( pObj )
218  return GetDescriptionStringForObject( *pObj, pStrCacheID, bRepeat );
219  return OUString();
220 }
221 
222 // common call method for possible change of the page when UNDO/REDO is triggered
224 {
226  {
229  }
230 }
231 
233 {
234  SfxStyleSheetBase* pThere = rStyleSheetPool.Find(rSheet.GetName(), rSheet.GetFamily());
235 
236  if(!pThere)
237  {
238  // re-insert remembered style which was removed in the meantime. To do this
239  // without assertion, do it without parent and set parent after insertion
240  const OUString aParent(rSheet.GetParent());
241 
242  rSheet.SetParent(OUString());
243  rStyleSheetPool.Insert(&rSheet);
244  rSheet.SetParent(aParent);
245  }
246 }
247 
248 SdrUndoAttrObj::SdrUndoAttrObj(SdrObject& rNewObj, bool bStyleSheet1, bool bSaveText)
249  : SdrUndoObj(rNewObj)
250  , bHaveToTakeRedoSet(true)
251 {
252  bStyleSheet = bStyleSheet1;
253 
254  SdrObjList* pOL = rNewObj.GetSubList();
255  bool bIsGroup(pOL!=nullptr && pOL->GetObjCount());
256  bool bIs3DScene(bIsGroup && dynamic_cast< E3dScene* >(pObj) != nullptr);
257 
258  if(bIsGroup)
259  {
260  // it's a group object!
262  const size_t nObjCount(pOL->GetObjCount());
263 
264  for(size_t nObjNum = 0; nObjNum < nObjCount; ++nObjNum)
265  {
266  pUndoGroup->AddAction(
267  std::make_unique<SdrUndoAttrObj>(*pOL->GetObj(nObjNum), bStyleSheet1));
268  }
269  }
270 
271  if(bIsGroup && !bIs3DScene)
272  return;
273 
274  moUndoSet.emplace( pObj->GetMergedItemSet() );
275 
276  if(bStyleSheet)
278 
279  if(bSaveText)
280  {
281  auto p = pObj->GetOutlinerParaObject();
282  if(p)
283  pTextUndo = *p;
284  }
285 }
286 
288 {
289  moUndoSet.reset();
290  moRedoSet.reset();
291  pUndoGroup.reset();
292  pTextUndo.reset();
293  pTextRedo.reset();
294 }
295 
297 {
299  bool bIs3DScene(dynamic_cast< E3dScene* >(pObj) != nullptr);
300 
301  // Trigger PageChangeCall
303 
304  if(!pUndoGroup || bIs3DScene)
305  {
307  {
308  bHaveToTakeRedoSet = false;
309 
310  moRedoSet.emplace( pObj->GetMergedItemSet() );
311 
312  if(bStyleSheet)
314 
315  if(pTextUndo)
316  {
317  // #i8508#
318  auto p = pObj->GetOutlinerParaObject();
319  if(p)
320  pTextRedo = *p;
321  }
322  }
323 
324  if(bStyleSheet)
325  {
327  SfxStyleSheet* pSheet = dynamic_cast< SfxStyleSheet* >(mxUndoStyleSheet.get());
328 
330  {
332  pObj->SetStyleSheet(pSheet, true);
333  }
334  else
335  {
336  OSL_ENSURE(false, "OOps, something went wrong in SdrUndoAttrObj (!)");
337  }
338  }
339 
341 
342  // Since ClearItem sets back everything to normal
343  // it also sets fit-to-size text to non-fit-to-size text and
344  // switches on autogrowheight (the default). That may lead to
345  // losing the geometry size info for the object when it is
346  // laid out again from AdjustTextFrameWidthAndHeight(). This makes
347  // rescuing the size of the object necessary.
348  const tools::Rectangle aSnapRect = pObj->GetSnapRect();
349  // SdrObjCustomShape::NbcSetSnapRect needs logic instead of snap rect
350  const tools::Rectangle aLogicRect = pObj->GetLogicRect();
351 
352  if(moUndoSet)
353  {
354  if(dynamic_cast<const SdrCaptionObj*>( pObj) != nullptr)
355  {
356  // do a more smooth item deletion here, else the text
357  // rect will be reformatted, especially when information regarding
358  // vertical text is changed. When clearing only set items it's
359  // slower, but safer regarding such information (it's not changed
360  // usually)
361  SfxWhichIter aIter(*moUndoSet);
362  sal_uInt16 nWhich(aIter.FirstWhich());
363 
364  while(nWhich)
365  {
366  if(SfxItemState::SET != moUndoSet->GetItemState(nWhich, false))
367  {
368  pObj->ClearMergedItem(nWhich);
369  }
370 
371  nWhich = aIter.NextWhich();
372  }
373  }
374  else
375  {
377  }
378 
380  }
381 
382  // Restore previous size here when it was changed.
383  if(aSnapRect != pObj->GetSnapRect())
384  {
385  if(dynamic_cast<const SdrObjCustomShape*>(pObj))
386  pObj->NbcSetSnapRect(aLogicRect);
387  else
388  pObj->NbcSetSnapRect(aSnapRect);
389  }
390 
391  pObj->GetProperties().BroadcastItemChange(aItemChange);
392 
393  if(pTextUndo)
394  {
396  }
397  }
398 
399  if(pUndoGroup)
400  {
401  pUndoGroup->Undo();
402  }
403 }
404 
406 {
408  bool bIs3DScene(dynamic_cast< E3dScene* >(pObj) != nullptr);
409 
410  if(!pUndoGroup || bIs3DScene)
411  {
412  if(bStyleSheet)
413  {
415  SfxStyleSheet* pSheet = dynamic_cast< SfxStyleSheet* >(mxRedoStyleSheet.get());
416 
418  {
420  pObj->SetStyleSheet(pSheet, true);
421  }
422  else
423  {
424  OSL_ENSURE(false, "OOps, something went wrong in SdrUndoAttrObj (!)");
425  }
426  }
427 
429 
430  const tools::Rectangle aSnapRect = pObj->GetSnapRect();
431  const tools::Rectangle aLogicRect = pObj->GetLogicRect();
432 
433  if(moRedoSet)
434  {
435  if(dynamic_cast<const SdrCaptionObj*>( pObj) != nullptr)
436  {
437  // do a more smooth item deletion here, else the text
438  // rect will be reformatted, especially when information regarding
439  // vertical text is changed. When clearing only set items it's
440  // slower, but safer regarding such information (it's not changed
441  // usually)
442  SfxWhichIter aIter(*moRedoSet);
443  sal_uInt16 nWhich(aIter.FirstWhich());
444 
445  while(nWhich)
446  {
447  if(SfxItemState::SET != moRedoSet->GetItemState(nWhich, false))
448  {
449  pObj->ClearMergedItem(nWhich);
450  }
451 
452  nWhich = aIter.NextWhich();
453  }
454  }
455  else
456  {
458  }
459 
461  }
462 
463  // Restore previous size here when it was changed.
464  if(aSnapRect != pObj->GetSnapRect())
465  {
466  if(dynamic_cast<const SdrObjCustomShape*>(pObj))
467  pObj->NbcSetSnapRect(aLogicRect);
468  else
469  pObj->NbcSetSnapRect(aSnapRect);
470  }
471 
472  pObj->GetProperties().BroadcastItemChange(aItemChange);
473 
474  // #i8508#
475  if(pTextRedo)
476  {
478  }
479  }
480 
481  if(pUndoGroup)
482  {
483  pUndoGroup->Redo();
484  }
485 
486  // Trigger PageChangeCall
488 }
489 
491 {
492  if(bStyleSheet)
493  {
494  return ImpGetDescriptionStr(STR_EditSetStylesheet);
495  }
496  else
497  {
498  return ImpGetDescriptionStr(STR_EditSetAttributes);
499  }
500 }
501 
503 {
504  if(bStyleSheet)
505  {
506  return ImpGetDescriptionStr(STR_EditSetStylesheet, true);
507  }
508  else
509  {
510  return ImpGetDescriptionStr(STR_EditSetAttributes, true);
511  }
512 }
513 
514 
516 
518 {
519  // Trigger PageChangeCall
521 
523 }
524 
526 {
528 
529  // Trigger PageChangeCall
531 }
532 
534 {
535  return ImpGetDescriptionStr(STR_EditMove);
536 }
537 
539 {
540  rView.MoveMarkedObj(aDistance);
541 }
542 
544 {
545  return rView.AreObjectsMarked();
546 }
547 
549 {
550  return ImpGetDescriptionStr(STR_EditMove,true);
551 }
552 
553 
555  : SdrUndoObj(rNewObj)
556  , mbSkipChangeLayout(false)
557 {
558  SdrObjList* pOL=rNewObj.GetSubList();
559  if (pOL!=nullptr && pOL->GetObjCount() && dynamic_cast<const E3dScene* >( &rNewObj) == nullptr)
560  {
561  // this is a group object!
562  // If this were 3D scene, we'd only add an Undo for the scene itself
563  // (which we do elsewhere).
565  const size_t nObjCount = pOL->GetObjCount();
566  for (size_t nObjNum = 0; nObjNum<nObjCount; ++nObjNum) {
567  pUndoGroup->AddAction(std::make_unique<SdrUndoGeoObj>(*pOL->GetObj(nObjNum)));
568  }
569  }
570  else
571  {
572  pUndoGeo = pObj->GetGeoData();
573  }
574 }
575 
577 {
578  pUndoGeo.reset();
579  pRedoGeo.reset();
580  pUndoGroup.reset();
581 }
582 
584 {
585  // Trigger PageChangeCall
587 
588  if(pUndoGroup)
589  {
590  pUndoGroup->Undo();
591 
592  // only repaint, no objectchange
593  pObj->ActionChanged();
594  }
595  else
596  {
597  pRedoGeo = pObj->GetGeoData();
598 
599  auto pTableObj = dynamic_cast<sdr::table::SdrTableObj*>(pObj);
600  if (pTableObj && mbSkipChangeLayout)
601  pTableObj->SetSkipChangeLayout(true);
603  if (pTableObj && mbSkipChangeLayout)
604  pTableObj->SetSkipChangeLayout(false);
605  }
606 }
607 
609 {
610  if(pUndoGroup)
611  {
612  pUndoGroup->Redo();
613 
614  // only repaint, no objectchange
615  pObj->ActionChanged();
616  }
617  else
618  {
619  pUndoGeo = pObj->GetGeoData();
621  }
622 
623  // Trigger PageChangeCall
625 }
626 
628 {
629  return ImpGetDescriptionStr(STR_DragMethObjOwn);
630 }
631 
633 : SdrUndoObj(rNewObj)
634 , m_aStartState(rStartState)
635 , m_aEndState()
636 {
637  SdrObjGroup* pDiagram(dynamic_cast<SdrObjGroup*>(&rNewObj));
638 
639  if(pDiagram && pDiagram->isDiagram())
640  {
641  m_aEndState = pDiagram->getDiagramHelper()->extractDiagramDataState();
642  }
643 }
644 
646 {
647 }
648 
650 {
651  if(nullptr == pObj)
652  return;
653 
654  SdrObjGroup* pDiagram(dynamic_cast<SdrObjGroup*>(pObj));
655 
656  if(nullptr == pDiagram || !pDiagram->isDiagram())
657  return;
658 
659  pDiagram->getDiagramHelper()->applyDiagramDataState(
660  bUndo ? m_aStartState : m_aEndState);
661  pDiagram->getDiagramHelper()->reLayout(*pDiagram);
662 }
663 
665 {
666  implUndoRedo(true);
667 }
668 
670 {
671  implUndoRedo(false);
672 }
673 
675 {
676  return ImpGetDescriptionStr(STR_DiagramModelDataChange);
677 }
678 
679 SdrUndoObjList::SdrUndoObjList(SdrObject& rNewObj, bool bOrdNumDirect)
680  : SdrUndoObj(rNewObj)
681  , bOwner(false)
682 {
684  if (bOrdNumDirect)
685  {
687  }
688  else
689  {
691  }
692 }
693 
695 {
696  SolarMutexGuard aGuard;
697 
698  if (pObj!=nullptr && IsOwner())
699  {
700  // Attribute have to go back to the regular Pool
701  SetOwner(false);
702 
703  // now delete
705  }
706 }
707 
709 {
710  bOwner = bNew;
711 }
712 
713 
715 {
716  // Trigger PageChangeCall
718 
719  DBG_ASSERT(!pObj->IsInserted(),"UndoRemoveObj: pObj has already been inserted.");
720  if (pObj->IsInserted())
721  return;
722 
723  // #i11426#
724  // For UNDOs in Calc/Writer it is necessary to adapt the anchor
725  // position of the target object.
726  Point aOwnerAnchorPos(0, 0);
727 
728  if (dynamic_cast< const SdrObjGroup* >(pObjList->getSdrObjectFromSdrObjList()) != nullptr)
729  {
730  aOwnerAnchorPos = pObjList->getSdrObjectFromSdrObjList()->GetAnchorPos();
731  }
732 
735 
736  // #i11426#
737  if(aOwnerAnchorPos.X() || aOwnerAnchorPos.Y())
738  {
739  pObj->NbcSetAnchorPos(aOwnerAnchorPos);
740  }
741 }
742 
744 {
745  DBG_ASSERT(pObj->IsInserted(),"RedoRemoveObj: pObj is not inserted.");
746  if (pObj->IsInserted())
747  {
751  }
752 
753  // Trigger PageChangeCall
755 }
756 
758 {
759 }
760 
761 
763 {
764  // Trigger PageChangeCall
766 
767  DBG_ASSERT(pObj->IsInserted(),"UndoInsertObj: pObj is not inserted.");
768  if (pObj->IsInserted())
769  {
771 
773  DBG_ASSERT(pChkObj==pObj,"UndoInsertObj: RemoveObjNum!=pObj");
774  }
775 }
776 
778 {
779  DBG_ASSERT(!pObj->IsInserted(),"RedoInsertObj: pObj is already inserted");
780  if (!pObj->IsInserted())
781  {
782  // Restore anchor position of an object,
783  // which becomes a member of a group, because its cleared in method
784  // <InsertObject(..)>. Needed for correct Redo in Writer. (#i45952#)
785  Point aAnchorPos( 0, 0 );
786 
787  if (dynamic_cast<const SdrObjGroup*>(pObjList->getSdrObjectFromSdrObjList()) != nullptr)
788  {
789  aAnchorPos = pObj->GetAnchorPos();
790  }
791 
793 
794  // Arcs lose position when grouped (#i45952#)
795  if ( aAnchorPos.X() || aAnchorPos.Y() )
796  {
797  pObj->NbcSetAnchorPos( aAnchorPos );
798  }
799  }
800 
801  // Trigger PageChangeCall
803 }
804 
805 SdrUndoDelObj::SdrUndoDelObj(SdrObject& rNewObj, bool bOrdNumDirect)
806 : SdrUndoRemoveObj(rNewObj,bOrdNumDirect)
807 {
808  SetOwner(true);
809 }
810 
812 {
814  DBG_ASSERT(IsOwner(),"UndoDeleteObj: pObj does not belong to UndoAction");
815  SetOwner(false);
816 }
817 
819 {
821  DBG_ASSERT(!IsOwner(),"RedoDeleteObj: pObj already belongs to UndoAction");
822  SetOwner(true);
823 }
824 
826 {
827  return ImpGetDescriptionStr(STR_EditDelete);
828 }
829 
831 {
832  rView.DeleteMarked();
833 }
834 
836 {
837  return rView.AreObjectsMarked();
838 }
839 
841 {
842  return ImpGetDescriptionStr(STR_EditDelete,true);
843 }
844 
845 
847 {
849  DBG_ASSERT(!IsOwner(),"RedoNewObj: pObj already belongs to UndoAction");
850  SetOwner(true);
851 }
852 
854 {
856  DBG_ASSERT(IsOwner(),"RedoNewObj: pObj does not belong to UndoAction");
857  SetOwner(false);
858 }
859 
860 OUString SdrUndoNewObj::GetComment( const SdrObject& _rForObject )
861 {
862  return GetDescriptionStringForObject( _rForObject, STR_UndoInsertObj );
863 }
864 
866 {
867  return ImpGetDescriptionStr(STR_UndoInsertObj);
868 }
869 
871  : SdrUndoObj(rOldObj1)
872  , bOldOwner(false)
873  , bNewOwner(false)
874  , pNewObj(&rNewObj1)
875 {
876  SetOldOwner(true);
878 }
879 
881 {
882  if (pObj!=nullptr && IsOldOwner())
883  {
884  // Attribute have to go back into the Pool
885  SetOldOwner(false);
886 
887  // now delete
889  }
890  if (pNewObj!=nullptr && IsNewOwner())
891  {
892  // Attribute have to go back into the Pool
893  SetNewOwner(false);
894 
895  // now delete
897  }
898 }
899 
901 {
902  // Trigger PageChangeCall
904 
905  if (IsOldOwner() && !IsNewOwner())
906  {
907  DBG_ASSERT(!pObj->IsInserted(),"SdrUndoReplaceObj::Undo(): Old object is already inserted!");
908  DBG_ASSERT(pNewObj->IsInserted(),"SdrUndoReplaceObj::Undo(): New object is not inserted!");
909  SetOldOwner(false);
910  SetNewOwner(true);
911 
914  }
915  else
916  {
917  OSL_FAIL("SdrUndoReplaceObj::Undo(): Wrong IsMine flags. Did you call Undo twice?");
918  }
919 }
920 
922 {
923  if (!IsOldOwner() && IsNewOwner())
924  {
925  DBG_ASSERT(!pNewObj->IsInserted(),"SdrUndoReplaceObj::Redo(): New object is already inserted!!");
926  DBG_ASSERT(pObj->IsInserted(),"SdrUndoReplaceObj::Redo(): Old object is not inserted!!");
927  SetOldOwner(true);
928  SetNewOwner(false);
929 
932 
933  }
934  else
935  {
936  OSL_FAIL("SdrUndoReplaceObj::Redo(): Wrong IsMine flags. Did you call Redo twice?");
937  }
938 
939  // Trigger PageChangeCall
941 }
942 
944 {
945  bNewOwner = bNew;
946 }
947 
949 {
950  bOldOwner = bNew;
951 }
952 
953 
955 {
956  return ImpGetDescriptionStr(STR_UndoCopyObj);
957 }
958 
959 
960 // #i11702#
961 
963  : SdrUndoObj(rObj)
964  , maOldLayer(aOldLayer)
965  , maNewLayer(aNewLayer)
966 {
967 }
968 
970 {
973 }
974 
976 {
979 }
980 
981 
982 SdrUndoObjOrdNum::SdrUndoObjOrdNum(SdrObject& rNewObj, sal_uInt32 nOldOrdNum1, sal_uInt32 nNewOrdNum1)
983  : SdrUndoObj(rNewObj)
984  , nOldOrdNum(nOldOrdNum1)
985  , nNewOrdNum(nNewOrdNum1)
986 {
987 }
988 
990 {
991  // Trigger PageChangeCall
993 
995  if (pOL==nullptr)
996  {
997  OSL_FAIL("UndoObjOrdNum: pObj does not have an ObjList.");
998  return;
999  }
1001 }
1002 
1004 {
1006  if (pOL==nullptr)
1007  {
1008  OSL_FAIL("RedoObjOrdNum: pObj does not have an ObjList.");
1009  return;
1010  }
1012 
1013  // Trigger PageChangeCall
1015 }
1016 
1018 {
1019  return ImpGetDescriptionStr(STR_UndoObjOrdNum);
1020 }
1021 
1023  ::std::vector<sal_Int32> const& rSortOrder)
1024  : SdrUndoAction(rPage.getSdrModelFromSdrPage())
1025  , m_OldSortOrder(rSortOrder.size())
1026  , m_NewSortOrder(rSortOrder)
1027  , m_nPage(rPage.GetPageNum())
1028 {
1029  // invert order
1030  for (size_t i = 0; i < rSortOrder.size(); ++i)
1031  {
1032  m_OldSortOrder[rSortOrder[i]] = i;
1033  }
1034 }
1035 
1036 void SdrUndoSort::Do(::std::vector<sal_Int32> & rSortOrder)
1037 {
1038  SdrPage & rPage(*rMod.GetPage(m_nPage));
1039  if (rPage.GetObjCount() != rSortOrder.size())
1040  {
1041  // can probably happen with sw's cursed SdrVirtObj mess - no good solution for that
1042  SAL_WARN("svx", "SdrUndoSort size mismatch");
1043  return;
1044  }
1045 
1046  // hopefully this can't throw
1047  rPage.sort(rSortOrder);
1048 }
1049 
1051 {
1052  Do(m_OldSortOrder);
1053 }
1054 
1056 {
1057  Do(m_NewSortOrder);
1058 }
1059 
1060 OUString SdrUndoSort::GetComment() const
1061 {
1062  return SvxResId(STR_SortShapes);
1063 }
1064 
1066  : SdrUndoObj(rNewObj)
1067  , bNewTextAvailable(false)
1068  , bEmptyPresObj(false)
1069  , mnText(nText)
1070 {
1071  SdrText* pText = static_cast< SdrTextObj*>( &rNewObj )->getText(mnText);
1072  if( pText && pText->GetOutlinerParaObject() )
1073  pOldText = *pText->GetOutlinerParaObject();
1074 
1075  bEmptyPresObj = rNewObj.IsEmptyPresObj();
1076 }
1077 
1079 {
1080  pOldText.reset();
1081  pNewText.reset();
1082 }
1083 
1085 {
1086  if (!pOldText || !pNewText)
1087  return pOldText || pNewText;
1088  return *pOldText != *pNewText;
1089 }
1090 
1092 {
1093  if (!bNewTextAvailable)
1094  {
1095  SdrText* pText = static_cast< SdrTextObj*>( pObj )->getText(mnText);
1096  if( pText && pText->GetOutlinerParaObject() )
1097  pNewText = *pText->GetOutlinerParaObject();
1098  bNewTextAvailable=true;
1099  }
1100 }
1101 
1103 {
1104  // only works with SdrTextObj
1105  SdrTextObj* pTarget = dynamic_cast< SdrTextObj* >(pObj);
1106 
1107  if(!pTarget)
1108  {
1109  OSL_ENSURE(false, "SdrUndoObjSetText::Undo with SdrObject not based on SdrTextObj (!)");
1110  return;
1111  }
1112 
1113  // Trigger PageChangeCall
1115 
1116  // save old text for Redo
1117  if(!bNewTextAvailable)
1118  {
1119  AfterSetText();
1120  }
1121 
1122  SdrText* pText = pTarget->getText(mnText);
1123  if (pText)
1124  {
1125  // copy text for Undo, because the original now belongs to SetOutlinerParaObject()
1126  pTarget->NbcSetOutlinerParaObjectForText(pOldText, pText);
1127  }
1128 
1129  pTarget->SetEmptyPresObj(bEmptyPresObj);
1130  pTarget->ActionChanged();
1131 
1132  // #i124389# if it's a table, also need to relayout TextFrame
1133  if(dynamic_cast< sdr::table::SdrTableObj* >(pTarget) != nullptr)
1134  {
1136  }
1137 
1138  // #i122410# SetOutlinerParaObject at SdrText does not trigger a
1139  // BroadcastObjectChange, but it is needed to make evtl. SlideSorters
1140  // update their preview.
1141  pTarget->BroadcastObjectChange();
1142 }
1143 
1145 {
1146  // only works with SdrTextObj
1147  SdrTextObj* pTarget = dynamic_cast< SdrTextObj* >(pObj);
1148 
1149  if(!pTarget)
1150  {
1151  OSL_ENSURE(false, "SdrUndoObjSetText::Redo with SdrObject not based on SdrTextObj (!)");
1152  return;
1153  }
1154 
1155  SdrText* pText = pTarget->getText(mnText);
1156  if (pText)
1157  {
1158  // copy text for Undo, because the original now belongs to SetOutlinerParaObject()
1159  pTarget->NbcSetOutlinerParaObjectForText( pNewText, pText );
1160  }
1161 
1162  pTarget->ActionChanged();
1163 
1164  // #i124389# if it's a table, also need to relayout TextFrame
1165  if(dynamic_cast< sdr::table::SdrTableObj* >(pTarget) != nullptr)
1166  {
1168  }
1169 
1170  // #i122410# NbcSetOutlinerParaObjectForText at SdrTextObj does not trigger a
1171  // BroadcastObjectChange, but it is needed to make evtl. SlideSorters
1172  // update their preview.
1173  pTarget->BroadcastObjectChange();
1174 
1175  // Trigger PageChangeCall
1177 }
1178 
1180 {
1181  return ImpGetDescriptionStr(STR_UndoObjSetText);
1182 }
1183 
1185 {
1186  return ImpGetDescriptionStr(STR_UndoObjSetText);
1187 }
1188 
1190 {
1191  if (!(bNewTextAvailable && rView.AreObjectsMarked()))
1192  return;
1193 
1194  const SdrMarkList& rML=rView.GetMarkedObjectList();
1195 
1196  const bool bUndo = rView.IsUndoEnabled();
1197  if( bUndo )
1198  {
1199  OUString aStr = ImpGetDescriptionStr(STR_UndoObjSetText);
1200  rView.BegUndo(aStr);
1201  }
1202 
1203  const size_t nCount=rML.GetMarkCount();
1204  for (size_t nm=0; nm<nCount; ++nm)
1205  {
1206  SdrObject* pObj2=rML.GetMark(nm)->GetMarkedSdrObj();
1207  SdrTextObj* pTextObj=dynamic_cast<SdrTextObj*>( pObj2 );
1208  if (pTextObj!=nullptr)
1209  {
1210  if( bUndo )
1211  rView.AddUndo(std::make_unique<SdrUndoObjSetText>(*pTextObj,0));
1212 
1213  pTextObj->SetOutlinerParaObject(pNewText);
1214  }
1215  }
1216 
1217  if( bUndo )
1218  rView.EndUndo();
1219 }
1220 
1222 {
1223  bool bOk = false;
1224  if (bNewTextAvailable && rView.AreObjectsMarked()) {
1225  bOk=true;
1226  }
1227  return bOk;
1228 }
1229 
1230 // Undo/Redo for setting object's name (#i73249#)
1232  const ObjStrAttrType eObjStrAttr,
1233  const OUString& sOldStr,
1234  const OUString& sNewStr)
1235  : SdrUndoObj( rNewObj )
1236  , meObjStrAttr( eObjStrAttr )
1237  , msOldStr( sOldStr )
1238  , msNewStr( sNewStr )
1239 {
1240 }
1241 
1243 {
1245 
1246  switch ( meObjStrAttr )
1247  {
1248  case ObjStrAttrType::Name:
1249  pObj->SetName( msOldStr );
1250  break;
1251  case ObjStrAttrType::Title:
1252  pObj->SetTitle( msOldStr );
1253  break;
1256  break;
1257  }
1258 }
1259 
1261 {
1262  switch ( meObjStrAttr )
1263  {
1264  case ObjStrAttrType::Name:
1265  pObj->SetName( msNewStr );
1266  break;
1267  case ObjStrAttrType::Title:
1268  pObj->SetTitle( msNewStr );
1269  break;
1272  break;
1273  }
1274 
1276 }
1277 
1279 {
1280  OUString aStr;
1281  switch ( meObjStrAttr )
1282  {
1283  case ObjStrAttrType::Name:
1284  aStr = ImpGetDescriptionStr( STR_UndoObjName) +
1285  " '" + msNewStr + "'";
1286  break;
1287  case ObjStrAttrType::Title:
1288  aStr = ImpGetDescriptionStr( STR_UndoObjTitle );
1289  break;
1291  aStr = ImpGetDescriptionStr( STR_UndoObjDescription );
1292  break;
1293  }
1294 
1295  return aStr;
1296 }
1297 
1298 
1299 SdrUndoLayer::SdrUndoLayer(sal_uInt16 nLayerNum, SdrLayerAdmin& rNewLayerAdmin, SdrModel& rNewModel)
1300  : SdrUndoAction(rNewModel)
1301  , pLayer(rNewLayerAdmin.GetLayer(nLayerNum))
1302  , pLayerAdmin(&rNewLayerAdmin)
1303  , nNum(nLayerNum)
1304  , bItsMine(false)
1305 {
1306 }
1307 
1309 {
1310  if (bItsMine)
1311  {
1312  delete pLayer;
1313  }
1314 }
1315 
1316 
1318 {
1319  DBG_ASSERT(!bItsMine,"SdrUndoNewLayer::Undo(): Layer already belongs to UndoAction.");
1320  bItsMine=true;
1321  SdrLayer* pCmpLayer= pLayerAdmin->RemoveLayer(nNum).release();
1322  DBG_ASSERT(pCmpLayer==pLayer,"SdrUndoNewLayer::Undo(): Removed layer is != pLayer.");
1323 }
1324 
1326 {
1327  DBG_ASSERT(bItsMine,"SdrUndoNewLayer::Undo(): Layer does not belong to UndoAction.");
1328  bItsMine=false;
1329  pLayerAdmin->InsertLayer(std::unique_ptr<SdrLayer>(pLayer),nNum);
1330 }
1331 
1333 {
1334  return SvxResId(STR_UndoNewLayer);
1335 }
1336 
1337 
1339 {
1340  DBG_ASSERT(bItsMine,"SdrUndoDelLayer::Undo(): Layer does not belong to UndoAction.");
1341  bItsMine=false;
1342  pLayerAdmin->InsertLayer(std::unique_ptr<SdrLayer>(pLayer),nNum);
1343 }
1344 
1346 {
1347  DBG_ASSERT(!bItsMine,"SdrUndoDelLayer::Undo(): Layer already belongs to UndoAction.");
1348  bItsMine=true;
1349  SdrLayer* pCmpLayer= pLayerAdmin->RemoveLayer(nNum).release();
1350  DBG_ASSERT(pCmpLayer==pLayer,"SdrUndoDelLayer::Redo(): Removed layer is != pLayer.");
1351 }
1352 
1354 {
1355  return SvxResId(STR_UndoDelLayer);
1356 }
1357 
1358 
1360 : SdrUndoAction(rNewPg.getSdrModelFromSdrPage())
1361  ,mxPage(&rNewPg)
1362 {
1363 }
1364 
1366 
1367 void SdrUndoPage::ImpInsertPage(sal_uInt16 nNum)
1368 {
1369  DBG_ASSERT(!mxPage->IsInserted(),"SdrUndoPage::ImpInsertPage(): mxPage is already inserted.");
1370  if (!mxPage->IsInserted())
1371  {
1372  if (mxPage->IsMasterPage())
1373  {
1374  rMod.InsertMasterPage(mxPage.get(), nNum);
1375  }
1376  else
1377  {
1378  rMod.InsertPage(mxPage.get(), nNum);
1379  }
1380  }
1381 }
1382 
1383 void SdrUndoPage::ImpRemovePage(sal_uInt16 nNum)
1384 {
1385  DBG_ASSERT(mxPage->IsInserted(),"SdrUndoPage::ImpRemovePage(): mxPage is not inserted.");
1386  if (!mxPage->IsInserted())
1387  return;
1388 
1389  rtl::Reference<SdrPage> pChkPg;
1390  if (mxPage->IsMasterPage())
1391  {
1392  pChkPg = rMod.RemoveMasterPage(nNum);
1393  }
1394  else
1395  {
1396  pChkPg = rMod.RemovePage(nNum);
1397  }
1398  DBG_ASSERT(pChkPg==mxPage,"SdrUndoPage::ImpRemovePage(): RemovePage!=mxPage");
1399 }
1400 
1401 void SdrUndoPage::ImpMovePage(sal_uInt16 nOldNum, sal_uInt16 nNewNum)
1402 {
1403  DBG_ASSERT(mxPage->IsInserted(),"SdrUndoPage::ImpMovePage(): mxPage is not inserted.");
1404  if (mxPage->IsInserted())
1405  {
1406  if (mxPage->IsMasterPage())
1407  {
1408  rMod.MoveMasterPage(nOldNum,nNewNum);
1409  }
1410  else
1411  {
1412  rMod.MovePage(nOldNum,nNewNum);
1413  }
1414  }
1415 }
1416 
1418 {
1419  return SvxResId(pStrCacheID);
1420 }
1421 
1422 
1424  : SdrUndoPage(rNewPg)
1425 {
1426  nPageNum=rNewPg.GetPageNum();
1427 }
1428 
1430 {
1431 }
1432 
1433 
1435  : SdrUndoPageList(rNewPg)
1436  , mbHasFillBitmap(false)
1437 {
1438  // keep fill bitmap separately to remove it from pool if not used elsewhere
1439  if (mxPage->IsMasterPage())
1440  {
1441  SfxStyleSheet* const pStyleSheet = mxPage->getSdrPageProperties().GetStyleSheet();
1442  if (pStyleSheet)
1443  queryFillBitmap(pStyleSheet->GetItemSet());
1444  }
1445  else
1446  {
1447  queryFillBitmap(mxPage->getSdrPageProperties().GetItemSet());
1448  }
1449  if (bool(mpFillBitmapItem))
1450  clearFillBitmap();
1451 
1452  // now remember the master page relationships
1453  if(!mxPage->IsMasterPage())
1454  return;
1455 
1456  sal_uInt16 nPageCnt(rMod.GetPageCount());
1457 
1458  for(sal_uInt16 nPageNum2(0); nPageNum2 < nPageCnt; nPageNum2++)
1459  {
1460  SdrPage* pDrawPage = rMod.GetPage(nPageNum2);
1461 
1462  if(pDrawPage->TRG_HasMasterPage())
1463  {
1464  SdrPage& rMasterPage = pDrawPage->TRG_GetMasterPage();
1465 
1466  if(mxPage.get() == &rMasterPage)
1467  {
1468  if(!pUndoGroup)
1469  {
1470  pUndoGroup.reset( new SdrUndoGroup(rMod) );
1471  }
1472 
1474  }
1475  }
1476  }
1477 }
1478 
1480 {
1481 }
1482 
1484 {
1485  if (bool(mpFillBitmapItem))
1488  if (pUndoGroup!=nullptr)
1489  {
1490  // recover master page relationships
1491  pUndoGroup->Undo();
1492  }
1493 }
1494 
1496 {
1498  if (bool(mpFillBitmapItem))
1499  clearFillBitmap();
1500 }
1501 
1503 {
1504  return ImpGetDescriptionStr(STR_UndoDelPage);
1505 }
1506 
1508 {
1509  return ImpGetDescriptionStr(STR_UndoDelPage);
1510 }
1511 
1513 {
1514 }
1515 
1517 {
1518  return false;
1519 }
1520 
1522 {
1523  if (const XFillBitmapItem *pItem = rItemSet.GetItemIfSet(XATTR_FILLBITMAP, false))
1524  mpFillBitmapItem.reset(pItem->Clone());
1525  if (const XFillStyleItem *pItem = rItemSet.GetItemIfSet(XATTR_FILLSTYLE, false))
1526  mbHasFillBitmap = pItem->GetValue() == css::drawing::FillStyle_BITMAP;
1527 }
1528 
1530 {
1531  if (mxPage->IsMasterPage())
1532  {
1533  SfxStyleSheet* const pStyleSheet = mxPage->getSdrPageProperties().GetStyleSheet();
1534  assert(bool(pStyleSheet)); // who took away my stylesheet?
1535  if (pStyleSheet->GetListenerCount() == 1)
1536  {
1537  SfxItemSet& rItemSet = pStyleSheet->GetItemSet();
1538  rItemSet.ClearItem(XATTR_FILLBITMAP);
1539  if (mbHasFillBitmap)
1540  rItemSet.ClearItem(XATTR_FILLSTYLE);
1541  }
1542  }
1543  else
1544  {
1545  SdrPageProperties &rPageProps = mxPage->getSdrPageProperties();
1546  rPageProps.ClearItem(XATTR_FILLBITMAP);
1547  if (mbHasFillBitmap)
1548  rPageProps.ClearItem(XATTR_FILLSTYLE);
1549  }
1550 }
1551 
1553 {
1554  if (mxPage->IsMasterPage())
1555  {
1556  SfxStyleSheet* const pStyleSheet = mxPage->getSdrPageProperties().GetStyleSheet();
1557  assert(bool(pStyleSheet)); // who took away my stylesheet?
1558  if (pStyleSheet->GetListenerCount() == 1)
1559  {
1560  SfxItemSet& rItemSet = pStyleSheet->GetItemSet();
1561  rItemSet.Put(*mpFillBitmapItem);
1562  if (mbHasFillBitmap)
1563  rItemSet.Put(XFillStyleItem(css::drawing::FillStyle_BITMAP));
1564  }
1565  }
1566  else
1567  {
1568  SdrPageProperties &rPageProps = mxPage->getSdrPageProperties();
1569  rPageProps.PutItem(*mpFillBitmapItem);
1570  if (mbHasFillBitmap)
1571  rPageProps.PutItem(XFillStyleItem(css::drawing::FillStyle_BITMAP));
1572  }
1573 }
1574 
1575 
1577 {
1579 }
1580 
1582 {
1584 }
1585 
1587 {
1588  return ImpGetDescriptionStr(STR_UndoNewPage);
1589 }
1590 
1591 
1593 {
1594  return ImpGetDescriptionStr(STR_UndoCopPage);
1595 }
1596 
1598 {
1599  return ImpGetDescriptionStr(STR_UndoCopPage);
1600 }
1601 
1603 {
1604 
1605 }
1606 
1608 {
1609  return false;
1610 }
1611 
1612 
1614 {
1616 }
1617 
1619 {
1621 }
1622 
1624 {
1625  return ImpGetDescriptionStr(STR_UndoMovPage);
1626 }
1627 
1629  : SdrUndoPage(rChangedPage)
1630  , mbOldHadMasterPage(mxPage->TRG_HasMasterPage())
1631  , maOldMasterPageNumber(0)
1632 {
1633  // get current state from page
1634  if(mbOldHadMasterPage)
1635  {
1636  maOldSet = mxPage->TRG_GetMasterPageVisibleLayers();
1637  maOldMasterPageNumber = mxPage->TRG_GetMasterPage().GetPageNum();
1638  }
1639 }
1640 
1641 SdrUndoPageMasterPage::~SdrUndoPageMasterPage()
1642 {
1643 }
1644 
1646 : SdrUndoPageMasterPage(rChangedPage)
1647 {
1648 }
1649 
1651 {
1652  if(mbOldHadMasterPage)
1653  {
1654  mxPage->TRG_SetMasterPage(*mxPage->getSdrModelFromSdrPage().GetMasterPage(maOldMasterPageNumber));
1655  mxPage->TRG_SetMasterPageVisibleLayers(maOldSet);
1656  }
1657 }
1658 
1660 {
1661  mxPage->TRG_ClearMasterPage();
1662 }
1663 
1665 {
1666  return ImpGetDescriptionStr(STR_UndoDelPageMasterDscr);
1667 }
1668 
1670  : SdrUndoPageMasterPage(rChangedPage)
1671  , mbNewHadMasterPage(false)
1672  , maNewMasterPageNumber(0)
1673 {
1674 }
1675 
1677 {
1678  // remember values from new page
1679  if(mxPage->TRG_HasMasterPage())
1680  {
1681  mbNewHadMasterPage = true;
1682  maNewSet = mxPage->TRG_GetMasterPageVisibleLayers();
1683  maNewMasterPageNumber = mxPage->TRG_GetMasterPage().GetPageNum();
1684  }
1685 
1686  // restore old values
1687  if(mbOldHadMasterPage)
1688  {
1689  mxPage->TRG_ClearMasterPage();
1690  mxPage->TRG_SetMasterPage(*mxPage->getSdrModelFromSdrPage().GetMasterPage(maOldMasterPageNumber));
1691  mxPage->TRG_SetMasterPageVisibleLayers(maOldSet);
1692  }
1693 }
1694 
1696 {
1697  // restore new values
1698  if(mbNewHadMasterPage)
1699  {
1700  mxPage->TRG_ClearMasterPage();
1701  mxPage->TRG_SetMasterPage(*mxPage->getSdrModelFromSdrPage().GetMasterPage(maNewMasterPageNumber));
1702  mxPage->TRG_SetMasterPageVisibleLayers(maNewSet);
1703  }
1704 }
1705 
1707 {
1708  return ImpGetDescriptionStr(STR_UndoChgPageMasterDscr);
1709 }
1710 
1711 
1713 
1714 // shapes
1715 
1716 std::unique_ptr<SdrUndoAction> SdrUndoFactory::CreateUndoMoveObject( SdrObject& rObject, const Size& rDist )
1717 {
1718  return std::make_unique<SdrUndoMoveObj>( rObject, rDist );
1719 }
1720 
1721 std::unique_ptr<SdrUndoAction> SdrUndoFactory::CreateUndoGeoObject( SdrObject& rObject )
1722 {
1723  return std::make_unique<SdrUndoGeoObj>( rObject );
1724 }
1725 
1726 // Diagram ModelData changes
1727 std::unique_ptr<SdrUndoAction> SdrUndoFactory::CreateUndoDiagramModelData( SdrObject& rObject, std::shared_ptr< svx::diagram::DiagramDataState >& rStartState )
1728 {
1729  return std::make_unique<SdrUndoDiagramModelData>( rObject, rStartState );
1730 }
1731 
1732 std::unique_ptr<SdrUndoAction> SdrUndoFactory::CreateUndoAttrObject( SdrObject& rObject, bool bStyleSheet1, bool bSaveText )
1733 {
1734  return std::make_unique<SdrUndoAttrObj>( rObject, bStyleSheet1, bSaveText );
1735 }
1736 
1737 std::unique_ptr<SdrUndoAction> SdrUndoFactory::CreateUndoRemoveObject(SdrObject& rObject)
1738 {
1739  return std::make_unique<SdrUndoRemoveObj>(rObject);
1740 }
1741 
1742 std::unique_ptr<SdrUndoAction> SdrUndoFactory::CreateUndoInsertObject( SdrObject& rObject, bool bOrdNumDirect )
1743 {
1744  return std::make_unique<SdrUndoInsertObj>( rObject, bOrdNumDirect );
1745 }
1746 
1747 std::unique_ptr<SdrUndoAction> SdrUndoFactory::CreateUndoDeleteObject( SdrObject& rObject, bool bOrdNumDirect )
1748 {
1749  return std::make_unique<SdrUndoDelObj>( rObject, bOrdNumDirect );
1750 }
1751 
1752 std::unique_ptr<SdrUndoAction> SdrUndoFactory::CreateUndoNewObject( SdrObject& rObject, bool bOrdNumDirect )
1753 {
1754  return std::make_unique<SdrUndoNewObj>( rObject, bOrdNumDirect );
1755 }
1756 
1757 std::unique_ptr<SdrUndoAction> SdrUndoFactory::CreateUndoCopyObject( SdrObject& rObject, bool bOrdNumDirect )
1758 {
1759  return std::make_unique<SdrUndoCopyObj>( rObject, bOrdNumDirect );
1760 }
1761 
1762 std::unique_ptr<SdrUndoAction> SdrUndoFactory::CreateUndoObjectOrdNum( SdrObject& rObject, sal_uInt32 nOldOrdNum1, sal_uInt32 nNewOrdNum1)
1763 {
1764  return std::make_unique<SdrUndoObjOrdNum>( rObject, nOldOrdNum1, nNewOrdNum1 );
1765 }
1766 
1767 std::unique_ptr<SdrUndoAction> SdrUndoFactory::CreateUndoSort(SdrPage & rPage, ::std::vector<sal_Int32> const& rSortOrder)
1768 {
1769  return std::make_unique<SdrUndoSort>(rPage, rSortOrder);
1770 }
1771 
1772 std::unique_ptr<SdrUndoAction> SdrUndoFactory::CreateUndoReplaceObject( SdrObject& rOldObject, SdrObject& rNewObject )
1773 {
1774  return std::make_unique<SdrUndoReplaceObj>( rOldObject, rNewObject );
1775 }
1776 
1777 std::unique_ptr<SdrUndoAction> SdrUndoFactory::CreateUndoObjectLayerChange( SdrObject& rObject, SdrLayerID aOldLayer, SdrLayerID aNewLayer )
1778 {
1779  return std::make_unique<SdrUndoObjectLayerChange>( rObject, aOldLayer, aNewLayer );
1780 }
1781 
1782 std::unique_ptr<SdrUndoAction> SdrUndoFactory::CreateUndoObjectSetText( SdrObject& rNewObj, sal_Int32 nText )
1783 {
1784  return std::make_unique<SdrUndoObjSetText>( rNewObj, nText );
1785 }
1786 
1787 std::unique_ptr<SdrUndoAction> SdrUndoFactory::CreateUndoObjectStrAttr( SdrObject& rObject,
1788  SdrUndoObjStrAttr::ObjStrAttrType eObjStrAttrType,
1789  const OUString& sOldStr,
1790  const OUString& sNewStr )
1791 {
1792  return std::make_unique<SdrUndoObjStrAttr>( rObject, eObjStrAttrType, sOldStr, sNewStr );
1793 }
1794 
1795 
1796 // layer
1797 std::unique_ptr<SdrUndoAction> SdrUndoFactory::CreateUndoNewLayer(sal_uInt16 nLayerNum, SdrLayerAdmin& rNewLayerAdmin, SdrModel& rNewModel)
1798 {
1799  return std::make_unique<SdrUndoNewLayer>( nLayerNum, rNewLayerAdmin, rNewModel );
1800 }
1801 
1802 std::unique_ptr<SdrUndoAction> SdrUndoFactory::CreateUndoDeleteLayer(sal_uInt16 nLayerNum, SdrLayerAdmin& rNewLayerAdmin, SdrModel& rNewModel)
1803 {
1804  return std::make_unique<SdrUndoDelLayer>( nLayerNum, rNewLayerAdmin, rNewModel );
1805 }
1806 
1807 // page
1808 std::unique_ptr<SdrUndoAction> SdrUndoFactory::CreateUndoDeletePage(SdrPage& rPage)
1809 {
1810  return std::make_unique<SdrUndoDelPage>(rPage);
1811 }
1812 
1813 std::unique_ptr<SdrUndoAction> SdrUndoFactory::CreateUndoNewPage(SdrPage& rPage)
1814 {
1815  return std::make_unique<SdrUndoNewPage>( rPage );
1816 }
1817 
1818 std::unique_ptr<SdrUndoAction> SdrUndoFactory::CreateUndoCopyPage(SdrPage& rPage)
1819 {
1820  return std::make_unique<SdrUndoCopyPage>( rPage );
1821 }
1822 
1823 std::unique_ptr<SdrUndoAction> SdrUndoFactory::CreateUndoSetPageNum(SdrPage& rNewPg, sal_uInt16 nOldPageNum1, sal_uInt16 nNewPageNum1)
1824 {
1825  return std::make_unique<SdrUndoSetPageNum>( rNewPg, nOldPageNum1, nNewPageNum1 );
1826 }
1827  // master page
1828 std::unique_ptr<SdrUndoAction> SdrUndoFactory::CreateUndoPageRemoveMasterPage(SdrPage& rChangedPage)
1829 {
1830  return std::make_unique<SdrUndoPageRemoveMasterPage>( rChangedPage );
1831 }
1832 
1833 std::unique_ptr<SdrUndoAction> SdrUndoFactory::CreateUndoPageChangeMasterPage(SdrPage& rChangedPage)
1834 {
1835  return std::make_unique<SdrUndoPageChangeMasterPage>(rChangedPage);
1836 }
1837 
1838 
1839 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SdrPage & TRG_GetMasterPage() const
Definition: svdpage.cxx:1651
virtual rtl::Reference< SdrPage > RemoveMasterPage(sal_uInt16 nPgNum)
Definition: svdmodel.cxx:1259
virtual void Redo() override
Definition: svdundo.cxx:1345
virtual void Undo() override
Definition: svdundo.cxx:296
ViewShellId GetViewShellId() const override
See SfxUndoAction::GetViewShellId().
Definition: svdundo.cxx:105
void MoveMasterPage(sal_uInt16 nPgNum, sal_uInt16 nNewPos)
Definition: svdmodel.cxx:1285
void MovMarkedToBtm()
Definition: svdedtv2.cxx:159
void SetNewOwner(bool bNew)
Definition: svdundo.cxx:943
static std::unique_ptr< SdrUndoAction > CreateUndoObjectStrAttr(SdrObject &rObject, SdrUndoObjStrAttr::ObjStrAttrType eObjStrAttrType, const OUString &sOldStr, const OUString &sNewStr)
Definition: svdundo.cxx:1787
void SetOwner(bool bNew)
Definition: svdundo.cxx:708
virtual bool CanRepeat(SfxRepeatTarget &rView) const override
Definition: svdundo.cxx:70
virtual OUString GetComment() const override
Definition: svdundo.cxx:627
virtual OUString GetComment() const override
Definition: svdundo.cxx:1664
virtual ~SdrUndoAttrObj() override
Definition: svdundo.cxx:287
size_t GetMarkCount() const
Definition: svdmark.hxx:178
virtual OUString GetComment() const override
Definition: svdundo.cxx:1332
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) const
virtual bool NbcAdjustTextFrameWidthAndHeight(bool bHgt=true, bool bWdt=true)
Definition: svdotxat.cxx:241
OUString aComment
Definition: svdundo.hxx:97
virtual bool CanSdrRepeat(SdrView &rView) const override
Definition: svdundo.cxx:1221
sal_uInt32 nOldOrdNum
Definition: svdundo.hxx:390
virtual void Redo() override
Definition: svdundo.cxx:777
virtual void Redo() override
Definition: svdundo.cxx:1003
void ClearItem(const sal_uInt16 nWhich=0)
Definition: svdpage.cxx:1255
virtual std::unique_ptr< SdrUndoAction > CreateUndoPageChangeMasterPage(SdrPage &rChangedPage)
Definition: svdundo.cxx:1833
SdrUndoAction(SdrModel &rNewMod)
Definition: svdundo.cxx:61
std::optional< SfxItemSet > moRedoSet
Definition: svdundo.hxx:153
virtual void InsertMasterPage(SdrPage *pPage, sal_uInt16 nPos=0xFFFF)
Definition: svdmodel.cxx:1236
virtual void SdrRepeat(SdrView &rView) override
Definition: svdundo.cxx:538
virtual void Undo() override
Definition: svdundo.cxx:989
void SetName(const OUString &rStr, const bool bSetChanged=true)
Definition: svdobj.cxx:755
bool IsOwner() const
Definition: svdundo.hxx:269
SdrObjList * pObjList
Definition: svdundo.hxx:357
SdrUndoLayer(sal_uInt16 nLayerNum, SdrLayerAdmin &rNewLayerAdmin, SdrModel &rNewModel)
Definition: svdundo.cxx:1299
virtual OUString GetRepeatComment(SfxRepeatTarget &rView) const override
Definition: svdundo.cxx:84
virtual SdrText * getText(sal_Int32 nIndex) const override
returns the nth available text.
Definition: svdotext.cxx:2074
bool bItsMine
Definition: svdundo.hxx:509
void PutItem(const SfxPoolItem &rItem)
Definition: svdpage.cxx:1248
virtual bool CanSdrRepeat(SdrView &rView) const override
Definition: svdundo.cxx:835
bool AreObjectsMarked() const
Definition: svdmrkv.hxx:266
bool IsUndoEnabled() const
Definition: svdedtv.cxx:1073
virtual ~SdrUndoGroup() override
Definition: svdundo.cxx:115
virtual bool CanSdrRepeat(SdrView &rView) const
Definition: svdundo.cxx:91
virtual ~SdrUndoMoveObj() override
Definition: svdundo.cxx:515
ABC for all UndoActions that have something to do with SdrPages.
Definition: svdundo.hxx:558
virtual void Redo() override
Definition: svdundo.cxx:525
virtual void InsertPage(SdrPage *pPage, sal_uInt16 nPos=0xFFFF)
Definition: svdmodel.cxx:1183
sal_uInt16 nNewPageNum
Definition: svdundo.hxx:662
constexpr TypedWhichId< XFillStyleItem > XATTR_FILLSTYLE(XATTR_FILL_FIRST)
void SetStyleSheet(SfxStyleSheet *pNewStyleSheet, bool bDontRemoveHardAttr)
Definition: svdobj.cxx:2247
SdrUndoGroup(SdrModel &rNewMod)
Definition: svdundo.cxx:110
virtual OUString GetComment() const override
Definition: svdundo.cxx:1017
SdrLayerIDSet maOldSet
Definition: svdundo.hxx:688
SdrUndoPage(SdrPage &rNewPg)
Definition: svdundo.cxx:1359
Abstract base class (ABC) for all UndoActions of DrawingEngine.
Definition: svdundo.hxx:60
SdrObject * GetObj(size_t nNum) const
Definition: svdpage.cxx:807
bool IsInserted() const
Definition: svdobj.hxx:739
bool IsReverseOrderPossible() const
Definition: svdedtv.hxx:390
size_t GetObjCount() const
Definition: svdpage.cxx:801
SdrLayer * pLayer
Definition: svdundo.hxx:506
OUString ImpGetDescriptionStr(TranslateId pStrCacheID, bool bRepeat=false) const
Definition: svdundo.cxx:215
virtual ~SdrUndoDelPage() override
Definition: svdundo.cxx:1479
virtual const OUString & GetParent() const
void BegUndo()
Definition: svdedtv.hxx:178
SdrUndoObjList(SdrObject &rNewObj, bool bOrdNumDirect)
Definition: svdundo.cxx:679
sal_uInt16 FirstWhich()
void PutMarkedToTop()
Definition: svdedtv2.cxx:249
std::unique_ptr< SdrUndoGroup > pUndoGroup
Definition: svdundo.hxx:168
virtual void Undo() override
Definition: svdundo.cxx:714
virtual ~SdrUndoFactory()
Definition: svdundo.cxx:1712
virtual OUString TakeObjNameSingul() const
Definition: svdobj.cxx:1075
virtual OUString GetComment() const override
Definition: svdundo.cxx:1586
virtual ~SdrUndoPageList() override
Definition: svdundo.cxx:1429
SdrMark * GetMark(size_t nNum) const
Definition: svdmark.cxx:230
virtual ~SdrUndoLayer() override
Definition: svdundo.cxx:1308
virtual void Redo() override
Definition: svdundo.cxx:130
std::shared_ptr< DiagramDataState > DiagramDataStatePtr
Definition: datamodel.hxx:171
virtual SfxItemSet & GetItemSet()
virtual OUString GetComment() const override
Definition: svdundo.cxx:1502
void SetEmptyPresObj(bool bEpt)
Definition: svdobj.cxx:2567
sal_uInt16 const m_nPage
Definition: svdundo.hxx:407
SdrUndoDelObj(SdrObject &rNewObj, bool bOrdNumDirect=false)
Definition: svdundo.cxx:805
virtual void SdrRepeat(SdrView &rView)
Definition: svdundo.cxx:96
std::optional< OutlinerParaObject > pNewText
Definition: svdundo.hxx:441
static void Free(SdrObject *&_rpObject)
Definition: svdobj.cxx:471
virtual void Redo() override
Definition: svdundo.cxx:1325
void implUndoRedo(bool bUndo)
Definition: svdundo.cxx:649
virtual sdr::properties::BaseProperties & GetProperties() const
Definition: svdobj.cxx:210
SfxStyleFamily GetFamily() const
ABC for manipulation of a PageList: New Page, DeletePage, MovePage (ChangePageNum).
Definition: svdundo.hxx:579
virtual void InsertObject(SdrObject *pObj, size_t nPos=SAL_MAX_SIZE)
Definition: svdpage.cxx:329
void SetOutlinerParaObject(std::optional< OutlinerParaObject > pTextObject)
Definition: svdobj.cxx:1796
virtual SdrObjList * GetSubList() const
Definition: svdobj.cxx:738
virtual void Redo() override
Definition: svdundo.cxx:405
virtual bool CanSdrRepeat(SdrView &rView) const override
Definition: svdundo.cxx:543
virtual ~SdrUndoRemoveObj() override
Definition: svdundo.cxx:757
virtual void SdrRepeat(SdrView &rView) override
Definition: svdundo.cxx:1512
std::shared_ptr< svx::diagram::DiagramDataState > m_aStartState
Definition: svdundo.hxx:234
sal_Int32 mnText
Definition: svdundo.hxx:444
sal_uInt16 NextWhich()
void clearFillBitmap()
Definition: svdundo.cxx:1529
NONE
virtual void Redo() override
Definition: svdundo.cxx:1055
virtual const tools::Rectangle & GetSnapRect() const
Definition: svdobj.cxx:1660
virtual std::unique_ptr< SdrUndoAction > CreateUndoDeletePage(SdrPage &rPage)
Definition: svdundo.cxx:1808
virtual std::unique_ptr< SdrUndoAction > CreateUndoDeleteObject(SdrObject &rObject, bool bOrdNumDirect=false)
Definition: svdundo.cxx:1747
SdrView * NextView()
Definition: svdviter.cxx:158
virtual void Undo() override
Definition: svdundo.cxx:1650
virtual void Redo() override
Definition: svdundo.cxx:608
constexpr tools::Long Width() const
SdrModel & rMod
Definition: svdundo.hxx:63
OutlinerParaObject * GetOutlinerParaObject()
Definition: svdtext.cxx:89
static void ImplUnmarkObject(SdrObject *pObj)
Definition: svdundo.cxx:52
virtual OUString GetSdrRepeatComment() const override
Definition: svdundo.cxx:1184
SdrUndoObjStrAttr(SdrObject &rNewObj, const ObjStrAttrType eObjStrAttr, const OUString &sOldStr, const OUString &sNewStr)
Definition: svdundo.cxx:1231
virtual std::unique_ptr< SdrObjGeoData > GetGeoData() const
Definition: svdobj.cxx:1948
void ClearMergedItem(const sal_uInt16 nWhich=0)
Definition: svdobj.cxx:1987
std::unique_ptr< SdrLayer > RemoveLayer(sal_uInt16 nPos)
Definition: svdlayer.cxx:170
SdrRepeatFunc
Definition: svdtypes.hxx:65
void SetOldOwner(bool bNew)
Definition: svdundo.cxx:948
virtual OUString GetSdrRepeatComment() const
Definition: svdundo.cxx:100
const OUString & GetName() const
SdrUndoObjSetText(SdrObject &rNewObj, sal_Int32 nText)
Definition: svdundo.cxx:1065
SdrPage * getSdrPageFromSdrObject() const
Definition: svdobj.cxx:269
virtual void Redo() override
Definition: svdundo.cxx:1144
static void ensureStyleSheetInStyleSheetPool(SfxStyleSheetBasePool &rStyleSheetPool, SfxStyleSheet &rSheet)
Definition: svdundo.cxx:232
void MovMarkedToTop()
Definition: svdedtv2.cxx:72
const std::shared_ptr< IDiagramHelper > & getDiagramHelper()
Definition: svdogrp.hxx:119
ViewShellId m_nViewShellId
Definition: svdundo.hxx:64
std::unique_ptr< SdrUndoGroup > pUndoGroup
Definition: svdundo.hxx:216
int nCount
OUString SvxResId(TranslateId aId)
Definition: dialmgr.cxx:24
virtual OUString GetComment() const override
Definition: svdundo.cxx:1592
virtual OUString GetComment() const override
Definition: svdundo.cxx:825
static SfxViewShell * Current()
SdrUndoPageChangeMasterPage(SdrPage &rChangedPage)
Definition: svdundo.cxx:1669
SfxStyleSheet * GetStyleSheet() const
Definition: svdobj.cxx:2242
void ConvertMarkedToPolyObj()
Definition: svdedtv2.cxx:2100
void queryFillBitmap(const SfxItemSet &rItemSet)
Definition: svdundo.cxx:1521
virtual void Undo() override
Definition: svdundo.cxx:1317
virtual OUString GetComment() const override
Definition: svdundo.cxx:1353
void SetMergedItemSet(const SfxItemSet &rSet, bool bClearAllItems=false)
Definition: svdobj.cxx:1997
static std::unique_ptr< SdrUndoAction > CreateUndoSort(SdrPage &rPage,::std::vector< sal_Int32 > const &rSortOrder)
Definition: svdundo.cxx:1767
SdrUndoReplaceObj(SdrObject &rOldObj1, SdrObject &rNewObj1)
Definition: svdundo.cxx:870
bool IsCombinePossible(bool bNoPolyPoly=false) const
Definition: svdedtv.cxx:469
virtual void Undo() override
Definition: svdundo.cxx:1576
virtual void Undo() override
Definition: svdundo.cxx:969
void BroadcastItemChange(const ItemChangeBroadcaster &rChange)
Definition: properties.cxx:108
virtual rtl::Reference< SdrPage > RemovePage(sal_uInt16 nPgNum)
Definition: svdmodel.cxx:1208
virtual OUString GetSdrRepeatComment() const override
Definition: svdundo.cxx:190
void EndUndo()
Definition: svdedtv.cxx:303
sal_uInt32 GetOrdNumDirect() const
Definition: svdobj.hxx:838
virtual bool SetParent(const OUString &) override
virtual std::unique_ptr< SdrUndoAction > CreateUndoNewLayer(sal_uInt16 nLayerNum, SdrLayerAdmin &rNewLayerAdmin, SdrModel &rNewModel)
Definition: svdundo.cxx:1797
bool IsConvertToPolyObjPossible() const
Definition: svdedtv.hxx:351
void ConvertMarkedToPathObj(bool bLineToArea)
Definition: svdedtv2.cxx:2095
const OUString msOldStr
Definition: svdundo.hxx:489
virtual void Redo() override
Definition: svdundo.cxx:853
void NbcSetOutlinerParaObjectForText(std::optional< OutlinerParaObject > pTextObject, SdrText *pText)
Definition: svdotext.cxx:1353
bool IsToBtmPossible() const
Definition: svdedtv.hxx:389
virtual std::unique_ptr< SdrUndoAction > CreateUndoSetPageNum(SdrPage &rNewPg, sal_uInt16 nOldPageNum1, sal_uInt16 nNewPageNum1)
Definition: svdundo.cxx:1823
SdrObject * GetMarkedSdrObj() const
Definition: svdmark.hxx:68
virtual ~SdrUndoObjList() override
Definition: svdundo.cxx:694
virtual ~SdrUndoReplaceObj() override
Definition: svdundo.cxx:880
virtual void Undo() override
Definition: svdundo.cxx:762
virtual void Undo() override
Definition: svdundo.cxx:517
void ImpMovePage(sal_uInt16 nOldNum, sal_uInt16 nNewNum)
Definition: svdundo.cxx:1401
void AddUndo(std::unique_ptr< SdrUndoAction > pUndo)
Definition: svdedtv.hxx:182
virtual void SetLayer(SdrLayerID nLayer)
Definition: svdobj.cxx:690
bool mbSkipChangeLayout
If we have a table object, should its layout change?
Definition: svdundo.hxx:218
SdrUndoPageList(SdrPage &rNewPg)
Definition: svdundo.cxx:1423
sal_uInt16 ClearItem(sal_uInt16 nWhich=0)
rtl::Reference< SdrPage > mxPage
Definition: svdundo.hxx:561
virtual std::unique_ptr< SdrUndoAction > CreateUndoMoveObject(SdrObject &rObject, const Size &rDist)
Definition: svdundo.cxx:1716
virtual std::unique_ptr< SdrUndoAction > CreateUndoCopyPage(SdrPage &rPage)
Definition: svdundo.cxx:1818
virtual void Undo() override
Definition: svdundo.cxx:1613
virtual void Redo() override
Definition: svdundo.cxx:669
std::unique_ptr< SfxPoolItem > mpFillBitmapItem
Definition: svdundo.hxx:599
virtual std::unique_ptr< SdrUndoAction > CreateUndoObjectSetText(SdrObject &rNewObj, sal_Int32 nText)
Definition: svdundo.cxx:1782
sal_uInt16 nNum
Definition: svdundo.hxx:508
virtual std::unique_ptr< SdrUndoAction > CreateUndoReplaceObject(SdrObject &rOldObject, SdrObject &rNewObject)
Definition: svdundo.cxx:1772
::std::vector< sal_Int32 > m_OldSortOrder
Definition: svdundo.hxx:405
#define DBG_ASSERT(sCon, aError)
SdrUndoAttrObj(SdrObject &rNewObj, bool bStyleSheet1=false, bool bSaveText=false)
Definition: svdundo.cxx:248
int i
virtual void Undo() override
Definition: svdundo.cxx:664
virtual void Undo() override
Definition: svdundo.cxx:1676
void AddAction(std::unique_ptr< SdrUndoAction > pAct)
Definition: svdundo.cxx:119
constexpr TypedWhichId< XFillBitmapItem > XATTR_FILLBITMAP(XATTR_FILL_FIRST+4)
virtual OUString GetComment() const override
Definition: svdundo.cxx:954
virtual std::unique_ptr< SdrUndoAction > CreateUndoCopyObject(SdrObject &rObject, bool bOrdNumDirect=false)
Definition: svdundo.cxx:1757
virtual void Redo() override
Definition: svdundo.cxx:975
virtual std::unique_ptr< SdrUndoAction > CreateUndoRemoveObject(SdrObject &rObject)
Definition: svdundo.cxx:1737
std::unique_ptr< SdrObjGeoData > pUndoGeo
Definition: svdundo.hxx:213
virtual void Undo() override
Definition: svdundo.cxx:1050
virtual ~SdrUndoAction() override
Definition: svdundo.cxx:68
virtual std::unique_ptr< SdrUndoAction > CreateUndoInsertObject(SdrObject &rObject, bool bOrdNumDirect=false)
Definition: svdundo.cxx:1742
SdrUndoDiagramModelData(SdrObject &rNewObj, std::shared_ptr< svx::diagram::DiagramDataState > &rStartState)
Definition: svdundo.cxx:632
virtual ~SdrUndoDiagramModelData() override
Definition: svdundo.cxx:645
void BroadcastObjectChange() const
Definition: svdobj.cxx:1001
virtual OUString GetSdrRepeatComment() const override
Definition: svdundo.cxx:840
Removing an Object from an ObjectList.
Definition: svdundo.hxx:280
const SdrMarkList & GetMarkedObjectList() const
Definition: svdmrkv.hxx:258
virtual void SetGeoData(const SdrObjGeoData &rGeo)
Definition: svdobj.cxx:1955
bool IsToTopPossible() const
Definition: svdedtv.hxx:388
const SdrPage * GetPage(sal_uInt16 nPgNum) const
Definition: svdmodel.cxx:1801
void ActionChanged() const
Definition: svdobj.cxx:263
virtual void Redo() override
Definition: svdundo.cxx:1260
::std::vector< sal_Int32 > m_NewSortOrder
Definition: svdundo.hxx:406
virtual std::unique_ptr< SdrUndoAction > CreateUndoDeleteLayer(sal_uInt16 nLayerNum, SdrLayerAdmin &rNewLayerAdmin, SdrModel &rNewModel)
Definition: svdundo.cxx:1802
virtual void Repeat(SfxRepeatTarget &rView) override
Definition: svdundo.cxx:77
void ImpInsertPage(sal_uInt16 nNum)
Definition: svdundo.cxx:1367
void CombineMarkedObjects(bool bNoPolyPoly=true)
Definition: svdedtv2.cxx:1286
SdrModel & getSdrModelFromSdrObject() const
Definition: svdobj.cxx:279
sal_uInt32 GetOrdNum() const
The order number (aka ZOrder, aka z-index) determines whether a SdrObject is located above or below a...
Definition: svdobj.cxx:892
bool isDiagram() const
Definition: svdogrp.hxx:118
bool IsOldOwner() const
Definition: svdundo.hxx:370
static OUString GetDescriptionStringForObject(const SdrObject &_rForObject, TranslateId pStrCacheID, bool bRepeat=false)
Definition: svdundo.cxx:201
size
SdrUndoPageMasterPage(SdrPage &rChangedPage)
Definition: svdundo.cxx:1628
virtual void Move(const Size &rSiz)
Definition: svdobj.cxx:1529
SdrObject * pObj
Definition: svdundo.hxx:130
virtual void Redo() override
Definition: svdundo.cxx:1581
virtual void Undo() override
Definition: svdundo.cxx:1483
virtual OUString GetComment() const override
Definition: svdundo.cxx:1179
void ImpRemovePage(sal_uInt16 nNum)
Definition: svdundo.cxx:1383
static OUString ImpGetDescriptionStr(TranslateId pStrCacheID)
Definition: svdundo.cxx:1417
bool TRG_HasMasterPage() const
Definition: svdpage.hxx:495
bool IsNewOwner() const
Definition: svdundo.hxx:367
Abstract DrawObject.
Definition: svdobj.hxx:259
const ObjStrAttrType meObjStrAttr
Definition: svdundo.hxx:488
virtual void Undo() override
Definition: svdundo.cxx:583
virtual SdrObject * RemoveObject(size_t nObjNum)
Definition: svdpage.cxx:407
virtual bool CanSdrRepeat(SdrView &rView) const override
Definition: svdundo.cxx:1516
SdrUndoFactory & GetSdrUndoFactory() const
returns the models undo factory.
Definition: svdmodel.cxx:1856
void UnGroupMarked()
Definition: svdedtv2.cxx:1879
std::optional< OutlinerParaObject > pTextUndo
Definition: svdundo.hxx:162
SdrUndoGeoObj(SdrObject &rNewObj)
Definition: svdundo.cxx:554
virtual OUString GetComment() const override
Definition: svdundo.cxx:1623
virtual void Undo() override
Definition: svdundo.cxx:900
sal_uInt16 maOldMasterPageNumber
Definition: svdundo.hxx:689
virtual void Undo() override
Definition: svdundo.cxx:846
virtual std::unique_ptr< SdrUndoAction > CreateUndoGeoObject(SdrObject &rObject)
Definition: svdundo.cxx:1721
Aggregation of arbitrarily many UndoActions to a single UndoAction.
Definition: svdundo.hxx:92
virtual std::unique_ptr< SdrUndoAction > CreateUndoObjectLayerChange(SdrObject &rObject, SdrLayerID aOldLayer, SdrLayerID aNewLayer)
Definition: svdundo.cxx:1777
bool bHaveToTakeRedoSet
Definition: svdundo.hxx:159
SdrObjList * pObjList
Definition: svdundo.hxx:262
bool bNewTextAvailable
Definition: svdundo.hxx:442
virtual OUString GetSdrRepeatComment() const override
Definition: svdundo.cxx:1507
std::unique_ptr< SdrObjGeoData > pRedoGeo
Definition: svdundo.hxx:214
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
void InsertLayer(std::unique_ptr< SdrLayer > pLayer, sal_uInt16 nPos)
Definition: svdlayer.cxx:160
ABC for all UndoActions that have something to do with MasterPage relationships.
Definition: svdundo.hxx:684
void Broadcast(const SfxHint &rHint)
Abstract base class for all UndoActions that handle objects.
Definition: svdundo.hxx:127
virtual ~SdrUndoGeoObj() override
Definition: svdundo.cxx:576
SdrLayerAdmin * pLayerAdmin
Definition: svdundo.hxx:507
virtual void Undo() override
Definition: svdundo.cxx:811
bool mbHasFillBitmap
Definition: svdundo.hxx:600
SdrUndoDelPage(SdrPage &rNewPg)
Definition: svdundo.cxx:1434
void ImpShowPageOfThisObject()
Definition: svdundo.cxx:223
virtual SdrObject * ReplaceObject(SdrObject *pNewObj, size_t nObjNum)
Replace existing object by different one.
Definition: svdpage.cxx:463
bool IsDifferent() const
Definition: svdundo.cxx:1084
virtual OUString GetComment() const override
Definition: svdundo.cxx:136
virtual void NbcSetSnapRect(const tools::Rectangle &rRect)
Definition: svdobj.cxx:1665
virtual void Undo() override
Definition: svdundo.cxx:124
void GroupMarked()
Definition: svdedtv2.cxx:1779
void DismantleMarkedObjects(bool bMakeLines=false)
Definition: svdedtv2.cxx:1720
sal_uInt32 nNewOrdNum
Definition: svdundo.hxx:391
constexpr tools::Long Height() const
bool IsGroupPossible() const
Definition: svdedtv.hxx:342
std::optional< OutlinerParaObject > pOldText
Definition: svdundo.hxx:439
SdrUndoObjectLayerChange(SdrObject &rObj, SdrLayerID aOldLayer, SdrLayerID aNewLayer)
Definition: svdundo.cxx:962
virtual std::unique_ptr< SdrUndoAction > CreateUndoNewPage(SdrPage &rPage)
Definition: svdundo.cxx:1813
SdrUndoObj(SdrObject &rNewObj)
Definition: svdundo.cxx:195
sal_uInt16 nOldPageNum
Definition: svdundo.hxx:661
SfxStyleSheetBasePool * GetStyleSheetPool() const
Definition: svdmodel.hxx:541
const SfxItemSet & GetMergedItemSet() const
Definition: svdobj.cxx:1972
virtual void Redo() override
Definition: svdundo.cxx:1695
virtual void Undo() override
Definition: svdundo.cxx:1338
virtual void SdrRepeat(SdrView &rView) override
Definition: svdundo.cxx:830
virtual void DeleteMarked()
Definition: svdview.cxx:1409
virtual void Redo() override
Definition: svdundo.cxx:743
sal_uInt16 maNewMasterPageNumber
Definition: svdundo.hxx:723
void SetDescription(const OUString &rStr)
Definition: svdobj.cxx:848
void Do(::std::vector< sal_Int32 > &rSortOrder)
Definition: svdundo.cxx:1036
bool IsUnGroupPossible() const
Definition: svdedtv.hxx:343
virtual void Undo() override
Definition: svdundo.cxx:1242
virtual void Redo() override
Definition: svdundo.cxx:921
virtual OUString GetComment() const override
Definition: svdundo.cxx:1278
void * p
OUString aObjDescription
Definition: svdundo.hxx:98
virtual OUString GetSdrRepeatComment() const override
Definition: svdundo.cxx:548
virtual std::unique_ptr< SdrUndoAction > CreateUndoObjectOrdNum(SdrObject &rObject, sal_uInt32 nOldOrdNum1, sal_uInt32 nNewOrdNum1)
Definition: svdundo.cxx:1762
const Point & GetAnchorPos() const
Definition: svdobj.cxx:1651
SdrUndoSort(const SdrPage &rPage,::std::vector< sal_Int32 > const &rSortOrder)
Definition: svdundo.cxx:1022
void Insert(SfxStyleSheetBase *)
rtl::Reference< SfxStyleSheetBase > mxRedoStyleSheet
Definition: svdundo.hxx:157
virtual void MovePage(sal_uInt16 nPgNum, sal_uInt16 nNewPos)
Definition: svdmodel.cxx:1223
virtual ~SdrUndoObjSetText() override
Definition: svdundo.cxx:1078
void restoreFillBitmap()
Definition: svdundo.cxx:1552
Helper for 3d object changes affecting 2d geometry.
virtual void SdrRepeat(SdrView &rView) override
Definition: svdundo.cxx:1602
virtual void Undo() override
Definition: svdundo.cxx:1102
#define SAL_WARN(area, stream)
virtual std::unique_ptr< SdrUndoAction > CreateUndoDiagramModelData(SdrObject &rObject, std::shared_ptr< svx::diagram::DiagramDataState > &rStartState)
Definition: svdundo.cxx:1727
size_t GetListenerCount() const
sal_uInt32 nOrdNum
Definition: svdundo.hxx:263
virtual void NbcSetAnchorPos(const Point &rPnt)
Definition: svdobj.cxx:1633
virtual SdrObject * SetObjectOrdNum(size_t nOldObjNum, size_t nNewObjNum)
Modify ZOrder of an SdrObject.
Definition: svdpage.cxx:527
bool bStyleSheet
Definition: svdundo.hxx:158
std::vector< std::unique_ptr< SdrUndoAction > > maActions
Definition: svdundo.hxx:94
virtual OUString GetComment() const override
Definition: svdundo.cxx:865
void ReverseOrderOfMarked()
Definition: svdedtv2.cxx:435
virtual void Redo() override
Definition: svdundo.cxx:1659
virtual const tools::Rectangle & GetLogicRect() const
Definition: svdobj.cxx:1670
SdrUndoObjOrdNum(SdrObject &rNewObj, sal_uInt32 nOldOrdNum1, sal_uInt32 nNewOrdNum1)
Definition: svdundo.cxx:982
void PutMarkedToBtm()
Definition: svdedtv2.cxx:350
virtual void SdrRepeat(SdrView &rView) override
Definition: svdundo.cxx:166
A SdrPage contains exactly one SdrObjList and a description of the physical page dimensions (size / m...
Definition: svdpage.hxx:373
virtual OUString GetComment() const override
Definition: svdundo.cxx:533
SdrObjList * getParentSdrObjListFromSdrObject() const
Definition: svdobj.cxx:305
bool IsConvertToPathObjPossible() const
Definition: svdedtv.hxx:350
bool IsImportMtfPossible() const
Definition: svdedtv.hxx:409
virtual std::unique_ptr< SdrUndoAction > CreateUndoAttrObject(SdrObject &rObject, bool bStyleSheet1=false, bool bSaveText=false)
Definition: svdundo.cxx:1732
virtual void Redo() override
Definition: svdundo.cxx:1495
sal_uInt16 nPageNum
Definition: svdundo.hxx:582
virtual OUString GetSdrRepeatComment() const override
Definition: svdundo.cxx:502
sal_uInt16 GetPageNum() const
Definition: svdpage.cxx:1596
virtual std::unique_ptr< SdrUndoAction > CreateUndoPageRemoveMasterPage(SdrPage &rChangedPage)
Definition: svdundo.cxx:1828
SdrRepeatFunc eFunction
Definition: svdundo.hxx:100
void SetSkipChangeLayout(bool bSkipChangeLayout)
Next time layouting would be done, skip it (to layout at the end of multiple actions).
Definition: svdotable.cxx:2052
void DoImportMarkedMtf(SvdProgressInfo *pProgrInfo=nullptr)
Definition: svdedtv2.cxx:2117
SdrUndoPageRemoveMasterPage(SdrPage &rChangedPage)
Definition: svdundo.cxx:1645
virtual SfxStyleSheetBase * Find(const OUString &, SfxStyleFamily eFam, SfxStyleSearchBits n=SfxStyleSearchBits::All)
std::optional< SfxItemSet > moUndoSet
Definition: svdundo.hxx:152
const OUString msNewStr
Definition: svdundo.hxx:490
virtual OUString GetComment() const override
Definition: svdundo.cxx:1060
virtual void Redo() override
Definition: svdundo.cxx:818
SdrView * FirstView()
Definition: svdviter.cxx:152
virtual OUString GetComment() const override
Definition: svdundo.cxx:490
virtual SdrObject * getSdrObjectFromSdrObjList() const
Definition: svdpage.cxx:123
virtual OutlinerParaObject * GetOutlinerParaObject() const
Definition: svdobj.cxx:1831
virtual OUString GetSdrRepeatComment() const override
Definition: svdundo.cxx:1597
virtual bool CanSdrRepeat(SdrView &rView) const override
Definition: svdundo.cxx:141
aStr
std::shared_ptr< svx::diagram::DiagramDataState > m_aEndState
Definition: svdundo.hxx:235
void SetTitle(const OUString &rStr)
Definition: svdobj.cxx:804
SdrObject * pNewObj
Definition: svdundo.hxx:358
rtl::Reference< SfxStyleSheetBase > mxUndoStyleSheet
Definition: svdundo.hxx:156
bool IsDismantlePossible(bool bMakeLines=false) const
Definition: svdedtv.cxx:476
std::optional< OutlinerParaObject > pTextRedo
Definition: svdundo.hxx:165
virtual void Redo() override
Definition: svdundo.cxx:1618
virtual std::unique_ptr< SdrUndoAction > CreateUndoNewObject(SdrObject &rObject, bool bOrdNumDirect=false)
Definition: svdundo.cxx:1752
sal_uInt16 GetPageCount() const
Definition: svdmodel.cxx:1811
sal_uInt16 nPos
virtual void SdrRepeat(SdrView &rView) override
Definition: svdundo.cxx:1189
virtual OUString GetComment() const override
Definition: svdundo.cxx:674
bool m_bDetectedRangeSegmentation false
std::unique_ptr< SdrUndoGroup > pUndoGroup
Definition: svdundo.hxx:598
void MoveMarkedObj(const Size &rSiz, bool bCopy=false)
Definition: svdedtv1.cxx:183
virtual OUString GetComment() const override
Definition: svdundo.cxx:1706
virtual bool CanSdrRepeat(SdrView &rView) const override
Definition: svdundo.cxx:1607
bool IsEmptyPresObj() const
Definition: svdobj.hxx:827