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