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