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