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