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  {
271  pUndoSet.reset( new SfxItemSet(pObj->GetMergedItemSet()) );
272 
273  if(bStyleSheet)
275 
276  if(bSaveText)
277  {
278  auto p = pObj->GetOutlinerParaObject();
279  if(p)
280  pTextUndo.reset( new OutlinerParaObject(*p) );
281  }
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  {
674  // #i11426#
675  // For UNDOs in Calc/Writer it is necessary to adapt the anchor
676  // position of the target object.
677  Point aOwnerAnchorPos(0, 0);
678 
679  if (dynamic_cast< const SdrObjGroup* >(pObjList->getSdrObjectFromSdrObjList()) != nullptr)
680  {
681  aOwnerAnchorPos = pObjList->getSdrObjectFromSdrObjList()->GetAnchorPos();
682  }
683 
686 
687  // #i11426#
688  if(aOwnerAnchorPos.X() || aOwnerAnchorPos.Y())
689  {
690  pObj->NbcSetAnchorPos(aOwnerAnchorPos);
691  }
692  }
693 }
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 (!bNewTextAvailable)
997  {
998  SdrText* pText = static_cast< SdrTextObj*>( pObj )->getText(mnText);
999  if( pText && pText->GetOutlinerParaObject() )
1000  pNewText.reset( new OutlinerParaObject(*pText->GetOutlinerParaObject()) );
1001  bNewTextAvailable=true;
1002  }
1003 }
1004 
1006 {
1007  // only works with SdrTextObj
1008  SdrTextObj* pTarget = dynamic_cast< SdrTextObj* >(pObj);
1009 
1010  if(!pTarget)
1011  {
1012  OSL_ENSURE(false, "SdrUndoObjSetText::Undo with SdrObject not based on SdrTextObj (!)");
1013  return;
1014  }
1015 
1016  // Trigger PageChangeCall
1018 
1019  // save old text for Redo
1020  if(!bNewTextAvailable)
1021  {
1022  AfterSetText();
1023  }
1024 
1025  SdrText* pText = pTarget->getText(mnText);
1026  if (pText)
1027  {
1028  // copy text for Undo, because the original now belongs to SetOutlinerParaObject()
1029  std::unique_ptr<OutlinerParaObject> pText1( pOldText ? new OutlinerParaObject(*pOldText) : nullptr );
1030  pTarget->NbcSetOutlinerParaObjectForText(std::move(pText1), pText);
1031  }
1032 
1033  pTarget->SetEmptyPresObj(bEmptyPresObj);
1034  pTarget->ActionChanged();
1035 
1036  // #i124389# if it's a table, also need to relayout TextFrame
1037  if(dynamic_cast< sdr::table::SdrTableObj* >(pTarget) != nullptr)
1038  {
1040  }
1041 
1042  // #i122410# SetOutlinerParaObject at SdrText does not trigger a
1043  // BroadcastObjectChange, but it is needed to make evtl. SlideSorters
1044  // update their preview.
1045  pTarget->BroadcastObjectChange();
1046 }
1047 
1049 {
1050  // only works with SdrTextObj
1051  SdrTextObj* pTarget = dynamic_cast< SdrTextObj* >(pObj);
1052 
1053  if(!pTarget)
1054  {
1055  OSL_ENSURE(false, "SdrUndoObjSetText::Redo with SdrObject not based on SdrTextObj (!)");
1056  return;
1057  }
1058 
1059  SdrText* pText = pTarget->getText(mnText);
1060  if (pText)
1061  {
1062  // copy text for Undo, because the original now belongs to SetOutlinerParaObject()
1063  std::unique_ptr<OutlinerParaObject> pText1( pNewText ? new OutlinerParaObject(*pNewText) : nullptr );
1064  pTarget->NbcSetOutlinerParaObjectForText( std::move(pText1), pText );
1065  }
1066 
1067  pTarget->ActionChanged();
1068 
1069  // #i124389# if it's a table, also need to relayout TextFrame
1070  if(dynamic_cast< sdr::table::SdrTableObj* >(pTarget) != nullptr)
1071  {
1073  }
1074 
1075  // #i122410# NbcSetOutlinerParaObjectForText at SdrTextObj does not trigger a
1076  // BroadcastObjectChange, but it is needed to make evtl. SlideSorters
1077  // update their preview.
1078  pTarget->BroadcastObjectChange();
1079 
1080  // Trigger PageChangeCall
1082 }
1083 
1085 {
1086  return ImpGetDescriptionStr(STR_UndoObjSetText);
1087 }
1088 
1090 {
1091  return ImpGetDescriptionStr(STR_UndoObjSetText);
1092 }
1093 
1095 {
1096  if (bNewTextAvailable && rView.AreObjectsMarked())
1097  {
1098  const SdrMarkList& rML=rView.GetMarkedObjectList();
1099 
1100  const bool bUndo = rView.IsUndoEnabled();
1101  if( bUndo )
1102  {
1103  OUString aStr = ImpGetDescriptionStr(STR_UndoObjSetText);
1104  rView.BegUndo(aStr);
1105  }
1106 
1107  const size_t nCount=rML.GetMarkCount();
1108  for (size_t nm=0; nm<nCount; ++nm)
1109  {
1110  SdrObject* pObj2=rML.GetMark(nm)->GetMarkedSdrObj();
1111  SdrTextObj* pTextObj=dynamic_cast<SdrTextObj*>( pObj2 );
1112  if (pTextObj!=nullptr)
1113  {
1114  if( bUndo )
1115  rView.AddUndo(std::make_unique<SdrUndoObjSetText>(*pTextObj,0));
1116 
1117  std::unique_ptr<OutlinerParaObject> pText1;
1118  if (pNewText)
1119  pText1.reset(new OutlinerParaObject(*pNewText));
1120  pTextObj->SetOutlinerParaObject(std::move(pText1));
1121  }
1122  }
1123 
1124  if( bUndo )
1125  rView.EndUndo();
1126  }
1127 }
1128 
1130 {
1131  bool bOk = false;
1132  if (bNewTextAvailable && rView.AreObjectsMarked()) {
1133  bOk=true;
1134  }
1135  return bOk;
1136 }
1137 
1138 // Undo/Redo for setting object's name (#i73249#)
1140  const ObjStrAttrType eObjStrAttr,
1141  const OUString& sOldStr,
1142  const OUString& sNewStr)
1143  : SdrUndoObj( rNewObj )
1144  , meObjStrAttr( eObjStrAttr )
1145  , msOldStr( sOldStr )
1146  , msNewStr( sNewStr )
1147 {
1148 }
1149 
1151 {
1153 
1154  switch ( meObjStrAttr )
1155  {
1156  case ObjStrAttrType::Name:
1157  pObj->SetName( msOldStr );
1158  break;
1159  case ObjStrAttrType::Title:
1160  pObj->SetTitle( msOldStr );
1161  break;
1164  break;
1165  }
1166 }
1167 
1169 {
1170  switch ( meObjStrAttr )
1171  {
1172  case ObjStrAttrType::Name:
1173  pObj->SetName( msNewStr );
1174  break;
1175  case ObjStrAttrType::Title:
1176  pObj->SetTitle( msNewStr );
1177  break;
1180  break;
1181  }
1182 
1184 }
1185 
1187 {
1188  OUString aStr;
1189  switch ( meObjStrAttr )
1190  {
1191  case ObjStrAttrType::Name:
1192  aStr = ImpGetDescriptionStr( STR_UndoObjName) +
1193  " '" + msNewStr + "'";
1194  break;
1195  case ObjStrAttrType::Title:
1196  aStr = ImpGetDescriptionStr( STR_UndoObjTitle );
1197  break;
1199  aStr = ImpGetDescriptionStr( STR_UndoObjDescription );
1200  break;
1201  }
1202 
1203  return aStr;
1204 }
1205 
1206 
1207 SdrUndoLayer::SdrUndoLayer(sal_uInt16 nLayerNum, SdrLayerAdmin& rNewLayerAdmin, SdrModel& rNewModel)
1208  : SdrUndoAction(rNewModel)
1209  , pLayer(rNewLayerAdmin.GetLayer(nLayerNum))
1210  , pLayerAdmin(&rNewLayerAdmin)
1211  , nNum(nLayerNum)
1212  , bItsMine(false)
1213 {
1214 }
1215 
1217 {
1218  if (bItsMine)
1219  {
1220  delete pLayer;
1221  }
1222 }
1223 
1224 
1226 {
1227  DBG_ASSERT(!bItsMine,"SdrUndoNewLayer::Undo(): Layer already belongs to UndoAction.");
1228  bItsMine=true;
1229  SdrLayer* pCmpLayer= pLayerAdmin->RemoveLayer(nNum).release();
1230  DBG_ASSERT(pCmpLayer==pLayer,"SdrUndoNewLayer::Undo(): Removed layer is != pLayer.");
1231 }
1232 
1234 {
1235  DBG_ASSERT(bItsMine,"SdrUndoNewLayer::Undo(): Layer does not belong to UndoAction.");
1236  bItsMine=false;
1237  pLayerAdmin->InsertLayer(std::unique_ptr<SdrLayer>(pLayer),nNum);
1238 }
1239 
1241 {
1242  return SvxResId(STR_UndoNewLayer);
1243 }
1244 
1245 
1247 {
1248  DBG_ASSERT(bItsMine,"SdrUndoDelLayer::Undo(): Layer does not belong to UndoAction.");
1249  bItsMine=false;
1250  pLayerAdmin->InsertLayer(std::unique_ptr<SdrLayer>(pLayer),nNum);
1251 }
1252 
1254 {
1255  DBG_ASSERT(!bItsMine,"SdrUndoDelLayer::Undo(): Layer already belongs to UndoAction.");
1256  bItsMine=true;
1257  SdrLayer* pCmpLayer= pLayerAdmin->RemoveLayer(nNum).release();
1258  DBG_ASSERT(pCmpLayer==pLayer,"SdrUndoDelLayer::Redo(): Removed layer is != pLayer.");
1259 }
1260 
1262 {
1263  return SvxResId(STR_UndoDelLayer);
1264 }
1265 
1266 
1268 : SdrUndoAction(rNewPg.getSdrModelFromSdrPage())
1269  ,mrPage(rNewPg)
1270 {
1271 }
1272 
1273 void SdrUndoPage::ImpInsertPage(sal_uInt16 nNum)
1274 {
1275  DBG_ASSERT(!mrPage.IsInserted(),"SdrUndoPage::ImpInsertPage(): mrPage is already inserted.");
1276  if (!mrPage.IsInserted())
1277  {
1278  if (mrPage.IsMasterPage())
1279  {
1280  rMod.InsertMasterPage(&mrPage,nNum);
1281  }
1282  else
1283  {
1284  rMod.InsertPage(&mrPage,nNum);
1285  }
1286  }
1287 }
1288 
1289 void SdrUndoPage::ImpRemovePage(sal_uInt16 nNum)
1290 {
1291  DBG_ASSERT(mrPage.IsInserted(),"SdrUndoPage::ImpRemovePage(): mrPage is not inserted.");
1292  if (mrPage.IsInserted())
1293  {
1294  SdrPage* pChkPg=nullptr;
1295  if (mrPage.IsMasterPage())
1296  {
1297  pChkPg=rMod.RemoveMasterPage(nNum);
1298  }
1299  else
1300  {
1301  pChkPg=rMod.RemovePage(nNum);
1302  }
1303  DBG_ASSERT(pChkPg==&mrPage,"SdrUndoPage::ImpRemovePage(): RemovePage!=&mrPage");
1304  }
1305 }
1306 
1307 void SdrUndoPage::ImpMovePage(sal_uInt16 nOldNum, sal_uInt16 nNewNum)
1308 {
1309  DBG_ASSERT(mrPage.IsInserted(),"SdrUndoPage::ImpMovePage(): mrPage is not inserted.");
1310  if (mrPage.IsInserted())
1311  {
1312  if (mrPage.IsMasterPage())
1313  {
1314  rMod.MoveMasterPage(nOldNum,nNewNum);
1315  }
1316  else
1317  {
1318  rMod.MovePage(nOldNum,nNewNum);
1319  }
1320  }
1321 }
1322 
1323 OUString SdrUndoPage::ImpGetDescriptionStr(const char* pStrCacheID)
1324 {
1325  return SvxResId(pStrCacheID);
1326 }
1327 
1328 
1330  : SdrUndoPage(rNewPg)
1331  , bItsMine(false)
1332 {
1333  nPageNum=rNewPg.GetPageNum();
1334 }
1335 
1337 {
1338  if(bItsMine)
1339  {
1340  delete &mrPage;
1341  }
1342 }
1343 
1344 
1346  : SdrUndoPageList(rNewPg)
1347  , mbHasFillBitmap(false)
1348 {
1349  bItsMine = true;
1350 
1351  // keep fill bitmap separately to remove it from pool if not used elsewhere
1352  if (mrPage.IsMasterPage())
1353  {
1354  SfxStyleSheet* const pStyleSheet = mrPage.getSdrPageProperties().GetStyleSheet();
1355  if (pStyleSheet)
1356  queryFillBitmap(pStyleSheet->GetItemSet());
1357  }
1358  else
1359  {
1361  }
1362  if (bool(mpFillBitmapItem))
1363  clearFillBitmap();
1364 
1365  // now remember the master page relationships
1366  if(mrPage.IsMasterPage())
1367  {
1368  sal_uInt16 nPageCnt(rMod.GetPageCount());
1369 
1370  for(sal_uInt16 nPageNum2(0); nPageNum2 < nPageCnt; nPageNum2++)
1371  {
1372  SdrPage* pDrawPage = rMod.GetPage(nPageNum2);
1373 
1374  if(pDrawPage->TRG_HasMasterPage())
1375  {
1376  SdrPage& rMasterPage = pDrawPage->TRG_GetMasterPage();
1377 
1378  if(&mrPage == &rMasterPage)
1379  {
1380  if(!pUndoGroup)
1381  {
1382  pUndoGroup.reset( new SdrUndoGroup(rMod) );
1383  }
1384 
1386  }
1387  }
1388  }
1389  }
1390 }
1391 
1393 {
1394 }
1395 
1397 {
1398  if (bool(mpFillBitmapItem))
1401  if (pUndoGroup!=nullptr)
1402  {
1403  // recover master page relationships
1404  pUndoGroup->Undo();
1405  }
1406  DBG_ASSERT(bItsMine,"UndoDeletePage: mrPage does not belong to UndoAction.");
1407  bItsMine=false;
1408 }
1409 
1411 {
1413  if (bool(mpFillBitmapItem))
1414  clearFillBitmap();
1415  // master page relations are dissolved automatically
1416  DBG_ASSERT(!bItsMine,"RedoDeletePage: mrPage already belongs to UndoAction.");
1417  bItsMine=true;
1418 }
1419 
1421 {
1422  return ImpGetDescriptionStr(STR_UndoDelPage);
1423 }
1424 
1426 {
1427  return ImpGetDescriptionStr(STR_UndoDelPage);
1428 }
1429 
1431 {
1432 }
1433 
1435 {
1436  return false;
1437 }
1438 
1440 {
1441  const SfxPoolItem *pItem = nullptr;
1442  if (rItemSet.GetItemState(XATTR_FILLBITMAP, false, &pItem) == SfxItemState::SET)
1443  mpFillBitmapItem.reset(pItem->Clone());
1444  if (rItemSet.GetItemState(XATTR_FILLSTYLE, false, &pItem) == SfxItemState::SET)
1445  mbHasFillBitmap = static_cast<const XFillStyleItem*>(pItem)->GetValue() == css::drawing::FillStyle_BITMAP;
1446 }
1447 
1449 {
1450  if (mrPage.IsMasterPage())
1451  {
1452  SfxStyleSheet* const pStyleSheet = mrPage.getSdrPageProperties().GetStyleSheet();
1453  assert(bool(pStyleSheet)); // who took away my stylesheet?
1454  if (pStyleSheet->GetListenerCount() == 1)
1455  {
1456  SfxItemSet& rItemSet = pStyleSheet->GetItemSet();
1457  rItemSet.ClearItem(XATTR_FILLBITMAP);
1458  if (mbHasFillBitmap)
1459  rItemSet.ClearItem(XATTR_FILLSTYLE);
1460  }
1461  }
1462  else
1463  {
1465  rPageProps.ClearItem(XATTR_FILLBITMAP);
1466  if (mbHasFillBitmap)
1467  rPageProps.ClearItem(XATTR_FILLSTYLE);
1468  }
1469 }
1470 
1472 {
1473  if (mrPage.IsMasterPage())
1474  {
1475  SfxStyleSheet* const pStyleSheet = mrPage.getSdrPageProperties().GetStyleSheet();
1476  assert(bool(pStyleSheet)); // who took away my stylesheet?
1477  if (pStyleSheet->GetListenerCount() == 1)
1478  {
1479  SfxItemSet& rItemSet = pStyleSheet->GetItemSet();
1480  rItemSet.Put(*mpFillBitmapItem);
1481  if (mbHasFillBitmap)
1482  rItemSet.Put(XFillStyleItem(css::drawing::FillStyle_BITMAP));
1483  }
1484  }
1485  else
1486  {
1488  rPageProps.PutItem(*mpFillBitmapItem);
1489  if (mbHasFillBitmap)
1490  rPageProps.PutItem(XFillStyleItem(css::drawing::FillStyle_BITMAP));
1491  }
1492 }
1493 
1494 
1496 {
1498  DBG_ASSERT(!bItsMine,"UndoNewPage: mrPage already belongs to UndoAction.");
1499  bItsMine=true;
1500 }
1501 
1503 {
1505  DBG_ASSERT(bItsMine,"RedoNewPage: mrPage does not belong to UndoAction.");
1506  bItsMine=false;
1507 }
1508 
1510 {
1511  return ImpGetDescriptionStr(STR_UndoNewPage);
1512 }
1513 
1514 
1516 {
1517  return ImpGetDescriptionStr(STR_UndoCopPage);
1518 }
1519 
1521 {
1522  return ImpGetDescriptionStr(STR_UndoCopPage);
1523 }
1524 
1526 {
1527 
1528 }
1529 
1531 {
1532  return false;
1533 }
1534 
1535 
1537 {
1539 }
1540 
1542 {
1544 }
1545 
1547 {
1548  return ImpGetDescriptionStr(STR_UndoMovPage);
1549 }
1550 
1552  : SdrUndoPage(rChangedPage)
1553  , mbOldHadMasterPage(mrPage.TRG_HasMasterPage())
1554  , maOldMasterPageNumber(0)
1555 {
1556  // get current state from page
1557  if(mbOldHadMasterPage)
1558  {
1561  }
1562 }
1563 
1564 SdrUndoPageMasterPage::~SdrUndoPageMasterPage()
1565 {
1566 }
1567 
1569 : SdrUndoPageMasterPage(rChangedPage)
1570 {
1571 }
1572 
1574 {
1575  if(mbOldHadMasterPage)
1576  {
1579  }
1580 }
1581 
1583 {
1585 }
1586 
1588 {
1589  return ImpGetDescriptionStr(STR_UndoDelPageMasterDscr);
1590 }
1591 
1593  : SdrUndoPageMasterPage(rChangedPage)
1594  , mbNewHadMasterPage(false)
1595  , maNewMasterPageNumber(0)
1596 {
1597 }
1598 
1600 {
1601  // remember values from new page
1603  {
1604  mbNewHadMasterPage = true;
1607  }
1608 
1609  // restore old values
1610  if(mbOldHadMasterPage)
1611  {
1615  }
1616 }
1617 
1619 {
1620  // restore new values
1621  if(mbNewHadMasterPage)
1622  {
1626  }
1627 }
1628 
1630 {
1631  return ImpGetDescriptionStr(STR_UndoChgPageMasterDscr);
1632 }
1633 
1634 
1636 
1637 // shapes
1638 
1639 std::unique_ptr<SdrUndoAction> SdrUndoFactory::CreateUndoMoveObject( SdrObject& rObject, const Size& rDist )
1640 {
1641  return std::make_unique<SdrUndoMoveObj>( rObject, rDist );
1642 }
1643 
1644 std::unique_ptr<SdrUndoAction> SdrUndoFactory::CreateUndoGeoObject( SdrObject& rObject )
1645 {
1646  return std::make_unique<SdrUndoGeoObj>( rObject );
1647 }
1648 
1649 std::unique_ptr<SdrUndoAction> SdrUndoFactory::CreateUndoAttrObject( SdrObject& rObject, bool bStyleSheet1, bool bSaveText )
1650 {
1651  return std::make_unique<SdrUndoAttrObj>( rObject, bStyleSheet1, bSaveText );
1652 }
1653 
1654 std::unique_ptr<SdrUndoAction> SdrUndoFactory::CreateUndoRemoveObject(SdrObject& rObject)
1655 {
1656  return std::make_unique<SdrUndoRemoveObj>(rObject);
1657 }
1658 
1659 std::unique_ptr<SdrUndoAction> SdrUndoFactory::CreateUndoInsertObject( SdrObject& rObject, bool bOrdNumDirect )
1660 {
1661  return std::make_unique<SdrUndoInsertObj>( rObject, bOrdNumDirect );
1662 }
1663 
1664 std::unique_ptr<SdrUndoAction> SdrUndoFactory::CreateUndoDeleteObject( SdrObject& rObject, bool bOrdNumDirect )
1665 {
1666  return std::make_unique<SdrUndoDelObj>( rObject, bOrdNumDirect );
1667 }
1668 
1669 std::unique_ptr<SdrUndoAction> SdrUndoFactory::CreateUndoNewObject( SdrObject& rObject, bool bOrdNumDirect )
1670 {
1671  return std::make_unique<SdrUndoNewObj>( rObject, bOrdNumDirect );
1672 }
1673 
1674 std::unique_ptr<SdrUndoAction> SdrUndoFactory::CreateUndoCopyObject( SdrObject& rObject, bool bOrdNumDirect )
1675 {
1676  return std::make_unique<SdrUndoCopyObj>( rObject, bOrdNumDirect );
1677 }
1678 
1679 std::unique_ptr<SdrUndoAction> SdrUndoFactory::CreateUndoObjectOrdNum( SdrObject& rObject, sal_uInt32 nOldOrdNum1, sal_uInt32 nNewOrdNum1)
1680 {
1681  return std::make_unique<SdrUndoObjOrdNum>( rObject, nOldOrdNum1, nNewOrdNum1 );
1682 }
1683 
1684 std::unique_ptr<SdrUndoAction> SdrUndoFactory::CreateUndoReplaceObject( SdrObject& rOldObject, SdrObject& rNewObject )
1685 {
1686  return std::make_unique<SdrUndoReplaceObj>( rOldObject, rNewObject );
1687 }
1688 
1689 std::unique_ptr<SdrUndoAction> SdrUndoFactory::CreateUndoObjectLayerChange( SdrObject& rObject, SdrLayerID aOldLayer, SdrLayerID aNewLayer )
1690 {
1691  return std::make_unique<SdrUndoObjectLayerChange>( rObject, aOldLayer, aNewLayer );
1692 }
1693 
1694 std::unique_ptr<SdrUndoAction> SdrUndoFactory::CreateUndoObjectSetText( SdrObject& rNewObj, sal_Int32 nText )
1695 {
1696  return std::make_unique<SdrUndoObjSetText>( rNewObj, nText );
1697 }
1698 
1699 std::unique_ptr<SdrUndoAction> SdrUndoFactory::CreateUndoObjectStrAttr( SdrObject& rObject,
1700  SdrUndoObjStrAttr::ObjStrAttrType eObjStrAttrType,
1701  const OUString& sOldStr,
1702  const OUString& sNewStr )
1703 {
1704  return std::make_unique<SdrUndoObjStrAttr>( rObject, eObjStrAttrType, sOldStr, sNewStr );
1705 }
1706 
1707 
1708 // layer
1709 std::unique_ptr<SdrUndoAction> SdrUndoFactory::CreateUndoNewLayer(sal_uInt16 nLayerNum, SdrLayerAdmin& rNewLayerAdmin, SdrModel& rNewModel)
1710 {
1711  return std::make_unique<SdrUndoNewLayer>( nLayerNum, rNewLayerAdmin, rNewModel );
1712 }
1713 
1714 std::unique_ptr<SdrUndoAction> SdrUndoFactory::CreateUndoDeleteLayer(sal_uInt16 nLayerNum, SdrLayerAdmin& rNewLayerAdmin, SdrModel& rNewModel)
1715 {
1716  return std::make_unique<SdrUndoDelLayer>( nLayerNum, rNewLayerAdmin, rNewModel );
1717 }
1718 
1719 // page
1720 std::unique_ptr<SdrUndoAction> SdrUndoFactory::CreateUndoDeletePage(SdrPage& rPage)
1721 {
1722  return std::make_unique<SdrUndoDelPage>(rPage);
1723 }
1724 
1725 std::unique_ptr<SdrUndoAction> SdrUndoFactory::CreateUndoNewPage(SdrPage& rPage)
1726 {
1727  return std::make_unique<SdrUndoNewPage>( rPage );
1728 }
1729 
1730 std::unique_ptr<SdrUndoAction> SdrUndoFactory::CreateUndoCopyPage(SdrPage& rPage)
1731 {
1732  return std::make_unique<SdrUndoCopyPage>( rPage );
1733 }
1734 
1735 std::unique_ptr<SdrUndoAction> SdrUndoFactory::CreateUndoSetPageNum(SdrPage& rNewPg, sal_uInt16 nOldPageNum1, sal_uInt16 nNewPageNum1)
1736 {
1737  return std::make_unique<SdrUndoSetPageNum>( rNewPg, nOldPageNum1, nNewPageNum1 );
1738 }
1739  // master page
1740 std::unique_ptr<SdrUndoAction> SdrUndoFactory::CreateUndoPageRemoveMasterPage(SdrPage& rChangedPage)
1741 {
1742  return std::make_unique<SdrUndoPageRemoveMasterPage>( rChangedPage );
1743 }
1744 
1745 std::unique_ptr<SdrUndoAction> SdrUndoFactory::CreateUndoPageChangeMasterPage(SdrPage& rChangedPage)
1746 {
1747  return std::make_unique<SdrUndoPageChangeMasterPage>(rChangedPage);
1748 }
1749 
1750 
1751 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SdrPage & TRG_GetMasterPage() const
Definition: svdpage.cxx:1556
static OUString GetDescriptionStringForObject(const SdrObject &_rForObject, const char *pStrCacheID, bool bRepeat=false)
Definition: svdundo.cxx:197
long Width() const
virtual void Redo() override
Definition: svdundo.cxx:1253
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:157
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:1699
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:1587
virtual ~SdrUndoAttrObj() override
Definition: svdundo.cxx:285
size_t GetMarkCount() const
Definition: svdmark.hxx:180
virtual OUString GetComment() const override
Definition: svdundo.cxx:1240
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:1129
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:1206
virtual std::unique_ptr< SdrUndoAction > CreateUndoPageChangeMasterPage(SdrPage &rChangedPage)
Definition: svdundo.cxx:1745
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
long Height() const
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:1207
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:2049
bool bItsMine
Definition: svdundo.hxx:469
void PutItem(const SfxPoolItem &rItem)
Definition: svdpage.cxx:1199
virtual bool CanSdrRepeat(SdrView &rView) const override
Definition: svdundo.cxx:787
bool AreObjectsMarked() const
Definition: svdmrkv.hxx:260
bool IsUndoEnabled() const
Definition: svdedtv.cxx:1027
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:2145
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:1267
Abstract base class (ABC) for all UndoActions of DrawingEngine.
Definition: svdundo.hxx:54
SdrObject * GetObj(size_t nNum) const
Definition: svdpage.cxx:758
void AfterSetText()
Definition: svdundo.cxx:994
bool IsInserted() const
Definition: svdobj.hxx:793
bool IsReverseOrderPossible() const
Definition: svdedtv.hxx:386
size_t GetObjCount() const
Definition: svdpage.cxx:752
SdrLayer * pLayer
Definition: svdundo.hxx:466
virtual ~SdrUndoDelPage() override
Definition: svdundo.cxx:1392
virtual const OUString & GetParent() const
void BegUndo()
Definition: svdedtv.hxx:179
SdrUndoObjList(SdrObject &rNewObj, bool bOrdNumDirect)
Definition: svdundo.cxx:631
sal_uInt16 FirstWhich()
void PutMarkedToTop()
Definition: svdedtv2.cxx:247
std::unique_ptr< SdrUndoGroup > pUndoGroup
Definition: svdundo.hxx:164
virtual void Undo() override
Definition: svdundo.cxx:666
virtual ~SdrUndoFactory()
Definition: svdundo.cxx:1635
virtual OUString TakeObjNameSingul() const
Definition: svdobj.cxx:1018
void TRG_ClearMasterPage()
Definition: svdpage.cxx:1543
virtual OUString GetComment() const override
Definition: svdundo.cxx:1509
virtual ~SdrUndoPageList() override
Definition: svdundo.cxx:1336
SdrMark * GetMark(size_t nNum) const
Definition: svdmark.cxx:229
virtual ~SdrUndoLayer() override
Definition: svdundo.cxx:1216
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:1420
void SetEmptyPresObj(bool bEpt)
Definition: svdobj.cxx:2459
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:1233
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:1865
virtual ~SdrUndoRemoveObj() override
Definition: svdundo.cxx:709
virtual void SdrRepeat(SdrView &rView) override
Definition: svdundo.cxx:1430
sal_Int32 mnText
Definition: svdundo.hxx:404
sal_uInt16 NextWhich()
void clearFillBitmap()
Definition: svdundo.cxx:1448
NONE
virtual const tools::Rectangle & GetSnapRect() const
Definition: svdobj.cxx:1597
virtual std::unique_ptr< SdrUndoAction > CreateUndoDeletePage(SdrPage &rPage)
Definition: svdundo.cxx:1720
virtual std::unique_ptr< SdrUndoAction > CreateUndoDeleteObject(SdrObject &rObject, bool bOrdNumDirect=false)
Definition: svdundo.cxx:1664
SdrView * NextView()
Definition: svdviter.cxx:165
virtual void Undo() override
Definition: svdundo.cxx:1573
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:1089
SdrUndoObjStrAttr(SdrObject &rNewObj, const ObjStrAttrType eObjStrAttr, const OUString &sOldStr, const OUString &sNewStr)
Definition: svdundo.cxx:1139
void ClearMergedItem(const sal_uInt16 nWhich=0)
Definition: svdobj.cxx:1904
std::unique_ptr< SdrLayer > RemoveLayer(sal_uInt16 nPos)
Definition: svdlayer.cxx:168
SdrRepeatFunc
Definition: svdtypes.hxx:68
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:28
virtual void Redo() override
Definition: svdundo.cxx:1048
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
static void ensureStyleSheetInStyleSheetPool(SfxStyleSheetBasePool &rStyleSheetPool, SfxStyleSheet &rSheet)
Definition: svdundo.cxx:228
void MovMarkedToTop()
Definition: svdedtv2.cxx:70
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:1515
virtual OUString GetComment() const override
Definition: svdundo.cxx:777
static SfxViewShell * Current()
SdrUndoPageChangeMasterPage(SdrPage &rChangedPage)
Definition: svdundo.cxx:1592
SfxStyleSheet * GetStyleSheet() const
Definition: svdobj.cxx:2140
void ConvertMarkedToPolyObj()
Definition: svdedtv2.cxx:2049
void queryFillBitmap(const SfxItemSet &rItemSet)
Definition: svdundo.cxx:1439
virtual void Undo() override
Definition: svdundo.cxx:1225
virtual OUString GetComment() const override
Definition: svdundo.cxx:1261
void SetMergedItemSet(const SfxItemSet &rSet, bool bClearAllItems=false)
Definition: svdobj.cxx:1914
SdrUndoReplaceObj(SdrObject &rOldObj1, SdrObject &rNewObj1)
Definition: svdundo.cxx:822
bool IsCombinePossible(bool bNoPolyPoly=false) const
Definition: svdedtv.cxx:441
virtual void Undo() override
Definition: svdundo.cxx:1495
virtual void Undo() override
Definition: svdundo.cxx:921
void TRG_SetMasterPage(SdrPage &rNew)
Definition: svdpage.cxx:1531
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:275
sal_uInt32 GetOrdNumDirect() const
Definition: svdobj.hxx:892
virtual bool SetParent(const OUString &) override
virtual std::unique_ptr< SdrUndoAction > CreateUndoNewLayer(sal_uInt16 nLayerNum, SdrLayerAdmin &rNewLayerAdmin, SdrModel &rNewModel)
Definition: svdundo.cxx:1709
bool IsConvertToPolyObjPossible() const
Definition: svdedtv.hxx:347
void ConvertMarkedToPathObj(bool bLineToArea)
Definition: svdedtv2.cxx:2044
const OUString msOldStr
Definition: svdundo.hxx:449
virtual void Redo() override
Definition: svdundo.cxx:805
bool IsToBtmPossible() const
Definition: svdedtv.hxx:385
virtual std::unique_ptr< SdrUndoAction > CreateUndoSetPageNum(SdrPage &rNewPg, sal_uInt16 nOldPageNum1, sal_uInt16 nNewPageNum1)
Definition: svdundo.cxx:1735
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:1307
void AddUndo(std::unique_ptr< SdrUndoAction > pUndo)
Definition: svdedtv.hxx:183
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:1329
sal_uInt16 ClearItem(sal_uInt16 nWhich=0)
virtual std::unique_ptr< SdrUndoAction > CreateUndoMoveObject(SdrObject &rObject, const Size &rDist)
Definition: svdundo.cxx:1639
virtual std::unique_ptr< SdrUndoAction > CreateUndoCopyPage(SdrPage &rPage)
Definition: svdundo.cxx:1730
virtual void Undo() override
Definition: svdundo.cxx:1536
std::unique_ptr< SfxPoolItem > mpFillBitmapItem
Definition: svdundo.hxx:562
virtual std::unique_ptr< SdrUndoAction > CreateUndoObjectSetText(SdrObject &rNewObj, sal_Int32 nText)
Definition: svdundo.cxx:1694
sal_uInt16 nNum
Definition: svdundo.hxx:468
virtual std::unique_ptr< SdrUndoAction > CreateUndoReplaceObject(SdrObject &rOldObject, SdrObject &rNewObject)
Definition: svdundo.cxx:1684
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:1599
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:1674
virtual void Redo() override
Definition: svdundo.cxx:927
virtual std::unique_ptr< SdrUndoAction > CreateUndoRemoveObject(SdrObject &rObject)
Definition: svdundo.cxx:1654
const SdrLayerIDSet & TRG_GetMasterPageVisibleLayers() const
Definition: svdpage.cxx:1562
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:1659
void BroadcastObjectChange() const
Definition: svdobj.cxx:905
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:252
virtual void SetGeoData(const SdrObjGeoData &rGeo)
Definition: svdobj.cxx:1872
bool IsToTopPossible() const
Definition: svdedtv.hxx:384
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:1168
virtual std::unique_ptr< SdrUndoAction > CreateUndoDeleteLayer(sal_uInt16 nLayerNum, SdrLayerAdmin &rNewLayerAdmin, SdrModel &rNewModel)
Definition: svdundo.cxx:1714
virtual void Repeat(SfxRepeatTarget &rView) override
Definition: svdundo.cxx:73
void ImpInsertPage(sal_uInt16 nNum)
Definition: svdundo.cxx:1273
void CombineMarkedObjects(bool bNoPolyPoly=true)
Definition: svdedtv2.cxx:1282
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:796
bool IsOldOwner() const
Definition: svdundo.hxx:348
bool IsMasterPage() const
Definition: svdpage.hxx:450
SdrUndoPageMasterPage(SdrPage &rChangedPage)
Definition: svdundo.cxx:1551
const SfxItemSet & GetItemSet() const
Definition: svdpage.hxx:334
virtual void Move(const Size &rSiz)
Definition: svdobj.cxx:1467
SdrObject * pObj
Definition: svdundo.hxx:124
virtual void Redo() override
Definition: svdundo.cxx:1502
virtual void Undo() override
Definition: svdundo.cxx:1396
virtual OUString GetComment() const override
Definition: svdundo.cxx:1084
void ImpRemovePage(sal_uInt16 nNum)
Definition: svdundo.cxx:1289
SdrPageProperties & getSdrPageProperties()
Definition: svdpage.cxx:1755
bool TRG_HasMasterPage() const
Definition: svdpage.hxx:484
bool IsNewOwner() const
Definition: svdundo.hxx:345
Abstract DrawObject.
Definition: svdobj.hxx:312
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:1434
SdrUndoFactory & GetSdrUndoFactory() const
returns the models undo factory.
Definition: svdmodel.cxx:1961
void UnGroupMarked()
Definition: svdedtv2.cxx:1872
SdrUndoGeoObj(SdrObject &rNewObj)
Definition: svdundo.cxx:552
virtual OUString GetComment() const override
Definition: svdundo.cxx:1546
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:1644
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:1689
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:1425
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:1345
void ImpShowPageOfThisObject()
Definition: svdundo.cxx:219
virtual SdrObject * ReplaceObject(SdrObject *pNewObj, size_t nObjNum)
Replace existing object by different one.
Definition: svdpage.cxx:477
virtual OUString GetComment() const override
Definition: svdundo.cxx:132
virtual void NbcSetSnapRect(const tools::Rectangle &rRect)
Definition: svdobj.cxx:1602
virtual void Undo() override
Definition: svdundo.cxx:120
void GroupMarked()
Definition: svdedtv2.cxx:1772
void DismantleMarkedObjects(bool bMakeLines=false)
Definition: svdedtv2.cxx:1713
sal_uInt32 nNewOrdNum
Definition: svdundo.hxx:369
bool IsGroupPossible() const
Definition: svdedtv.hxx:338
SdrUndoObjectLayerChange(SdrObject &rObj, SdrLayerID aOldLayer, SdrLayerID aNewLayer)
Definition: svdundo.cxx:914
virtual std::unique_ptr< SdrUndoAction > CreateUndoNewPage(SdrPage &rPage)
Definition: svdundo.cxx:1725
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:1368
const SfxItemSet & GetMergedItemSet() const
Definition: svdobj.cxx:1889
virtual void Redo() override
Definition: svdundo.cxx:1618
virtual void Undo() override
Definition: svdundo.cxx:1246
virtual void SdrRepeat(SdrView &rView) override
Definition: svdundo.cxx:782
virtual void DeleteMarked()
Definition: svdview.cxx:1370
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:1733
void SetDescription(const OUString &rStr)
Definition: svdobj.cxx:752
bool IsUnGroupPossible() const
Definition: svdedtv.hxx:339
virtual void Undo() override
Definition: svdundo.cxx:1150
virtual void Redo() override
Definition: svdundo.cxx:873
virtual OUString GetComment() const override
Definition: svdundo.cxx:1186
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:1568
virtual std::unique_ptr< SdrUndoAction > CreateUndoObjectOrdNum(SdrObject &rObject, sal_uInt32 nOldOrdNum1, sal_uInt32 nNewOrdNum1)
Definition: svdundo.cxx:1679
static OUString ImpGetDescriptionStr(const char *pStrCacheID)
Definition: svdundo.cxx:1323
const Point & GetAnchorPos() const
Definition: svdobj.cxx:1588
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:1471
Helper for 3d object changes affecting 2d geometry.
virtual void SdrRepeat(SdrView &rView) override
Definition: svdundo.cxx:1525
virtual void Undo() override
Definition: svdundo.cxx:1005
size_t GetListenerCount() const
sal_uInt32 nOrdNum
Definition: svdundo.hxx:241
virtual void NbcSetAnchorPos(const Point &rPnt)
Definition: svdobj.cxx:1570
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:433
virtual void Redo() override
Definition: svdundo.cxx:1582
virtual const tools::Rectangle & GetLogicRect() const
Definition: svdobj.cxx:1607
SdrUndoObjOrdNum(SdrObject &rNewObj, sal_uInt32 nOldOrdNum1, sal_uInt32 nNewOrdNum1)
Definition: svdundo.cxx:934
void PutMarkedToBtm()
Definition: svdedtv2.cxx:348
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: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:1649
virtual void Redo() override
Definition: svdundo.cxx:1410
sal_uInt16 nPageNum
Definition: svdundo.hxx:541
virtual OUString GetSdrRepeatComment() const override
Definition: svdundo.cxx:500
sal_uInt16 GetPageNum() const
Definition: svdpage.cxx:1501
virtual std::unique_ptr< SdrUndoAction > CreateUndoPageRemoveMasterPage(SdrPage &rChangedPage)
Definition: svdundo.cxx:1740
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:2060
void DoImportMarkedMtf(SvdProgressInfo *pProgrInfo=nullptr)
Definition: svdedtv2.cxx:2066
SdrUndoPageRemoveMasterPage(SdrPage &rChangedPage)
Definition: svdundo.cxx:1568
virtual SfxStyleSheetBase * Find(const OUString &, SfxStyleFamily eFam, SfxStyleSearchBits n=SfxStyleSearchBits::All)
void SetName(const OUString &rStr)
Definition: svdobj.cxx:664
const OUString msNewStr
Definition: svdundo.hxx:450
virtual void Redo() override
Definition: svdundo.cxx:770
SdrView * FirstView()
Definition: svdviter.cxx:158
virtual OUString GetComment() const override
Definition: svdundo.cxx:488
virtual SdrObject * getSdrObjectFromSdrObjList() const
Definition: svdpage.cxx:137
virtual OutlinerParaObject * GetOutlinerParaObject() const
Definition: svdobj.cxx:1748
std::unique_ptr< OutlinerParaObject > pTextUndo
Definition: svdundo.hxx:157
virtual OUString GetSdrRepeatComment() const override
Definition: svdundo.cxx:1520
virtual bool CanSdrRepeat(SdrView &rView) const override
Definition: svdundo.cxx:137
aStr
void SetTitle(const OUString &rStr)
Definition: svdobj.cxx:708
SdrObject * pNewObj
Definition: svdundo.hxx:336
rtl::Reference< SfxStyleSheetBase > mxUndoStyleSheet
Definition: svdundo.hxx:150
bool IsDismantlePossible(bool bMakeLines=false) const
Definition: svdedtv.cxx:448
virtual void Redo() override
Definition: svdundo.cxx:1541
virtual std::unique_ptr< SdrUndoAction > CreateUndoNewObject(SdrObject &rObject, bool bOrdNumDirect=false)
Definition: svdundo.cxx:1669
sal_uInt16 GetPageCount() const
Definition: svdmodel.cxx:1916
sal_uInt16 nPos
virtual void SdrRepeat(SdrView &rView) override
Definition: svdundo.cxx:1094
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:1629
virtual bool CanSdrRepeat(SdrView &rView) const override
Definition: svdundo.cxx:1530
bool IsEmptyPresObj() const
Definition: svdobj.hxx:881