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