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{
56 SdrViewIter aIter( pObj );
57 for ( SdrView* pView = aIter.FirstView(); pView; pView = aIter.NextView() )
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
1219
1220SdrUndoLayer::SdrUndoLayer(sal_uInt16 nLayerNum, SdrLayerAdmin& rNewLayerAdmin, SdrModel& rNewModel)
1221 : SdrUndoAction(rNewModel)
1222 , pLayer(rNewLayerAdmin.GetLayer(nLayerNum))
1223 , pLayerAdmin(&rNewLayerAdmin)
1224 , nNum(nLayerNum)
1225 , bItsMine(false)
1226{
1227}
1228
1230{
1231 if (bItsMine)
1232 {
1233 delete pLayer;
1234 }
1235}
1236
1238{
1239 DBG_ASSERT(!bItsMine,"SdrUndoNewLayer::Undo(): Layer already belongs to UndoAction.");
1240 bItsMine=true;
1241 // coverity[leaked_storage] - owned by this SdrUndoNewLayer as pLayer
1242 SdrLayer* pCmpLayer = pLayerAdmin->RemoveLayer(nNum).release();
1243 assert(pCmpLayer == pLayer && "SdrUndoNewLayer::Undo(): Removed layer is != pLayer."); (void)pCmpLayer;
1244}
1245
1247{
1248 DBG_ASSERT(bItsMine,"SdrUndoNewLayer::Undo(): Layer does not belong to UndoAction.");
1249 bItsMine=false;
1250 pLayerAdmin->InsertLayer(std::unique_ptr<SdrLayer>(pLayer),nNum);
1251}
1252
1254{
1255 return SvxResId(STR_UndoNewLayer);
1256}
1257
1258
1260{
1261 DBG_ASSERT(bItsMine,"SdrUndoDelLayer::Undo(): Layer does not belong to UndoAction.");
1262 bItsMine=false;
1263 pLayerAdmin->InsertLayer(std::unique_ptr<SdrLayer>(pLayer),nNum);
1264}
1265
1267{
1268 DBG_ASSERT(!bItsMine,"SdrUndoDelLayer::Undo(): Layer already belongs to UndoAction.");
1269 bItsMine=true;
1270 // coverity[leaked_storage] - owned by this SdrUndoNewLayer as pLayer
1271 SdrLayer* pCmpLayer= pLayerAdmin->RemoveLayer(nNum).release();
1272 assert(pCmpLayer == pLayer && "SdrUndoDelLayer::Redo(): Removed layer is != pLayer."); (void)pCmpLayer;
1273}
1274
1276{
1277 return SvxResId(STR_UndoDelLayer);
1278}
1279
1280
1282: SdrUndoAction(rNewPg.getSdrModelFromSdrPage())
1283 ,mxPage(&rNewPg)
1284{
1285}
1286
1288
1289void SdrUndoPage::ImpInsertPage(sal_uInt16 nNum)
1290{
1291 DBG_ASSERT(!mxPage->IsInserted(),"SdrUndoPage::ImpInsertPage(): mxPage is already inserted.");
1292 if (!mxPage->IsInserted())
1293 {
1294 if (mxPage->IsMasterPage())
1295 {
1296 rMod.InsertMasterPage(mxPage.get(), nNum);
1297 }
1298 else
1299 {
1300 rMod.InsertPage(mxPage.get(), nNum);
1301 }
1302 }
1303}
1304
1305void SdrUndoPage::ImpRemovePage(sal_uInt16 nNum)
1306{
1307 DBG_ASSERT(mxPage->IsInserted(),"SdrUndoPage::ImpRemovePage(): mxPage is not inserted.");
1308 if (!mxPage->IsInserted())
1309 return;
1310
1312 if (mxPage->IsMasterPage())
1313 {
1314 pChkPg = rMod.RemoveMasterPage(nNum);
1315 }
1316 else
1317 {
1318 pChkPg = rMod.RemovePage(nNum);
1319 }
1320 DBG_ASSERT(pChkPg==mxPage,"SdrUndoPage::ImpRemovePage(): RemovePage!=mxPage");
1321}
1322
1323void SdrUndoPage::ImpMovePage(sal_uInt16 nOldNum, sal_uInt16 nNewNum)
1324{
1325 DBG_ASSERT(mxPage->IsInserted(),"SdrUndoPage::ImpMovePage(): mxPage is not inserted.");
1326 if (mxPage->IsInserted())
1327 {
1328 if (mxPage->IsMasterPage())
1329 {
1330 rMod.MoveMasterPage(nOldNum,nNewNum);
1331 }
1332 else
1333 {
1334 rMod.MovePage(nOldNum,nNewNum);
1335 }
1336 }
1337}
1338
1340{
1341 return SvxResId(pStrCacheID);
1342}
1343
1344
1346 : SdrUndoPage(rNewPg)
1347{
1348 nPageNum=rNewPg.GetPageNum();
1349}
1350
1352{
1353}
1354
1355
1357 : SdrUndoPageList(rNewPg)
1358 , mbHasFillBitmap(false)
1359{
1360 // keep fill bitmap separately to remove it from pool if not used elsewhere
1361 if (mxPage->IsMasterPage())
1362 {
1363 SfxStyleSheet* const pStyleSheet = mxPage->getSdrPageProperties().GetStyleSheet();
1364 if (pStyleSheet)
1365 queryFillBitmap(pStyleSheet->GetItemSet());
1366 }
1367 else
1368 {
1369 queryFillBitmap(mxPage->getSdrPageProperties().GetItemSet());
1370 }
1371 if (bool(mpFillBitmapItem))
1373
1374 // now remember the master page relationships
1375 if(!mxPage->IsMasterPage())
1376 return;
1377
1378 sal_uInt16 nPageCnt(rMod.GetPageCount());
1379
1380 for(sal_uInt16 nPageNum2(0); nPageNum2 < nPageCnt; nPageNum2++)
1381 {
1382 SdrPage* pDrawPage = rMod.GetPage(nPageNum2);
1383
1384 if(pDrawPage->TRG_HasMasterPage())
1385 {
1386 SdrPage& rMasterPage = pDrawPage->TRG_GetMasterPage();
1387
1388 if(mxPage.get() == &rMasterPage)
1389 {
1390 if(!pUndoGroup)
1391 {
1392 pUndoGroup.reset( new SdrUndoGroup(rMod) );
1393 }
1394
1396 }
1397 }
1398 }
1399}
1400
1402{
1403}
1404
1406{
1407 if (bool(mpFillBitmapItem))
1410 if (pUndoGroup!=nullptr)
1411 {
1412 // recover master page relationships
1413 pUndoGroup->Undo();
1414 }
1415}
1416
1418{
1420 if (bool(mpFillBitmapItem))
1422}
1423
1425{
1426 return ImpGetDescriptionStr(STR_UndoDelPage);
1427}
1428
1430{
1431 return ImpGetDescriptionStr(STR_UndoDelPage);
1432}
1433
1435{
1436}
1437
1439{
1440 return false;
1441}
1442
1444{
1445 if (const XFillBitmapItem *pItem = rItemSet.GetItemIfSet(XATTR_FILLBITMAP, false))
1446 mpFillBitmapItem.reset(pItem->Clone());
1447 if (const XFillStyleItem *pItem = rItemSet.GetItemIfSet(XATTR_FILLSTYLE, false))
1448 mbHasFillBitmap = pItem->GetValue() == css::drawing::FillStyle_BITMAP;
1449}
1450
1452{
1453 if (mxPage->IsMasterPage())
1454 {
1455 SfxStyleSheet* const pStyleSheet = mxPage->getSdrPageProperties().GetStyleSheet();
1456 assert(bool(pStyleSheet)); // who took away my stylesheet?
1457 if (pStyleSheet->GetListenerCount() == 1)
1458 {
1459 SfxItemSet& rItemSet = pStyleSheet->GetItemSet();
1460 rItemSet.ClearItem(XATTR_FILLBITMAP);
1461 if (mbHasFillBitmap)
1462 rItemSet.ClearItem(XATTR_FILLSTYLE);
1463 }
1464 }
1465 else
1466 {
1467 SdrPageProperties &rPageProps = mxPage->getSdrPageProperties();
1468 rPageProps.ClearItem(XATTR_FILLBITMAP);
1469 if (mbHasFillBitmap)
1470 rPageProps.ClearItem(XATTR_FILLSTYLE);
1471 }
1472}
1473
1475{
1476 if (mxPage->IsMasterPage())
1477 {
1478 SfxStyleSheet* const pStyleSheet = mxPage->getSdrPageProperties().GetStyleSheet();
1479 assert(bool(pStyleSheet)); // who took away my stylesheet?
1480 if (pStyleSheet->GetListenerCount() == 1)
1481 {
1482 SfxItemSet& rItemSet = pStyleSheet->GetItemSet();
1483 rItemSet.Put(*mpFillBitmapItem);
1484 if (mbHasFillBitmap)
1485 rItemSet.Put(XFillStyleItem(css::drawing::FillStyle_BITMAP));
1486 }
1487 }
1488 else
1489 {
1490 SdrPageProperties &rPageProps = mxPage->getSdrPageProperties();
1491 rPageProps.PutItem(*mpFillBitmapItem);
1492 if (mbHasFillBitmap)
1493 rPageProps.PutItem(XFillStyleItem(css::drawing::FillStyle_BITMAP));
1494 }
1495}
1496
1497
1499{
1501}
1502
1504{
1506}
1507
1509{
1510 return ImpGetDescriptionStr(STR_UndoNewPage);
1511}
1512
1513
1515{
1516 return ImpGetDescriptionStr(STR_UndoCopPage);
1517}
1518
1520{
1521 return ImpGetDescriptionStr(STR_UndoCopPage);
1522}
1523
1525{
1526
1527}
1528
1530{
1531 return false;
1532}
1533
1534
1536{
1538}
1539
1541{
1543}
1544
1546{
1547 return ImpGetDescriptionStr(STR_UndoMovPage);
1548}
1549
1551 : SdrUndoPage(rChangedPage)
1552 , mbOldHadMasterPage(mxPage->TRG_HasMasterPage())
1553 , maOldMasterPageNumber(0)
1554{
1555 // get current state from page
1557 {
1558 maOldSet = mxPage->TRG_GetMasterPageVisibleLayers();
1559 maOldMasterPageNumber = mxPage->TRG_GetMasterPage().GetPageNum();
1560 }
1561}
1562
1563SdrUndoPageMasterPage::~SdrUndoPageMasterPage()
1564{
1565}
1566
1568: SdrUndoPageMasterPage(rChangedPage)
1569{
1570}
1571
1573{
1575 {
1576 mxPage->TRG_SetMasterPage(*mxPage->getSdrModelFromSdrPage().GetMasterPage(maOldMasterPageNumber));
1577 mxPage->TRG_SetMasterPageVisibleLayers(maOldSet);
1578 }
1579}
1580
1582{
1583 mxPage->TRG_ClearMasterPage();
1584}
1585
1587{
1588 return ImpGetDescriptionStr(STR_UndoDelPageMasterDscr);
1589}
1590
1592 : SdrUndoPageMasterPage(rChangedPage)
1593 , mbNewHadMasterPage(false)
1594 , maNewMasterPageNumber(0)
1595{
1596}
1597
1599{
1600 // remember values from new page
1601 if(mxPage->TRG_HasMasterPage())
1602 {
1603 mbNewHadMasterPage = true;
1604 maNewSet = mxPage->TRG_GetMasterPageVisibleLayers();
1605 maNewMasterPageNumber = mxPage->TRG_GetMasterPage().GetPageNum();
1606 }
1607
1608 // restore old values
1610 {
1611 mxPage->TRG_ClearMasterPage();
1612 mxPage->TRG_SetMasterPage(*mxPage->getSdrModelFromSdrPage().GetMasterPage(maOldMasterPageNumber));
1613 mxPage->TRG_SetMasterPageVisibleLayers(maOldSet);
1614 }
1615}
1616
1618{
1619 // restore new values
1621 {
1622 mxPage->TRG_ClearMasterPage();
1623 mxPage->TRG_SetMasterPage(*mxPage->getSdrModelFromSdrPage().GetMasterPage(maNewMasterPageNumber));
1624 mxPage->TRG_SetMasterPageVisibleLayers(maNewSet);
1625 }
1626}
1627
1629{
1630 return ImpGetDescriptionStr(STR_UndoChgPageMasterDscr);
1631}
1632
1633
1635
1636// shapes
1637
1638std::unique_ptr<SdrUndoAction> SdrUndoFactory::CreateUndoMoveObject( SdrObject& rObject, const Size& rDist )
1639{
1640 return std::make_unique<SdrUndoMoveObj>( rObject, rDist );
1641}
1642
1643std::unique_ptr<SdrUndoAction> SdrUndoFactory::CreateUndoGeoObject( SdrObject& rObject )
1644{
1645 return std::make_unique<SdrUndoGeoObj>( rObject );
1646}
1647
1648// Diagram ModelData changes
1649std::unique_ptr<SdrUndoAction> SdrUndoFactory::CreateUndoDiagramModelData( SdrObject& rObject, std::shared_ptr< svx::diagram::DiagramDataState >& rStartState )
1650{
1651 return std::make_unique<SdrUndoDiagramModelData>( rObject, rStartState );
1652}
1653
1654std::unique_ptr<SdrUndoAction> SdrUndoFactory::CreateUndoAttrObject( SdrObject& rObject, bool bStyleSheet1, bool bSaveText )
1655{
1656 return std::make_unique<SdrUndoAttrObj>( rObject, bStyleSheet1, bSaveText );
1657}
1658
1659std::unique_ptr<SdrUndoAction> SdrUndoFactory::CreateUndoRemoveObject(SdrObject& rObject)
1660{
1661 return std::make_unique<SdrUndoRemoveObj>(rObject);
1662}
1663
1664std::unique_ptr<SdrUndoAction> SdrUndoFactory::CreateUndoInsertObject( SdrObject& rObject, bool bOrdNumDirect )
1665{
1666 return std::make_unique<SdrUndoInsertObj>( rObject, bOrdNumDirect );
1667}
1668
1669std::unique_ptr<SdrUndoAction> SdrUndoFactory::CreateUndoDeleteObject( SdrObject& rObject, bool bOrdNumDirect )
1670{
1671 return std::make_unique<SdrUndoDelObj>( rObject, bOrdNumDirect );
1672}
1673
1674std::unique_ptr<SdrUndoAction> SdrUndoFactory::CreateUndoNewObject( SdrObject& rObject, bool bOrdNumDirect )
1675{
1676 return std::make_unique<SdrUndoNewObj>( rObject, bOrdNumDirect );
1677}
1678
1679std::unique_ptr<SdrUndoAction> SdrUndoFactory::CreateUndoCopyObject( SdrObject& rObject, bool bOrdNumDirect )
1680{
1681 return std::make_unique<SdrUndoCopyObj>( rObject, bOrdNumDirect );
1682}
1683
1684std::unique_ptr<SdrUndoAction> SdrUndoFactory::CreateUndoObjectOrdNum( SdrObject& rObject, sal_uInt32 nOldOrdNum1, sal_uInt32 nNewOrdNum1)
1685{
1686 return std::make_unique<SdrUndoObjOrdNum>( rObject, nOldOrdNum1, nNewOrdNum1 );
1687}
1688
1689std::unique_ptr<SdrUndoAction> SdrUndoFactory::CreateUndoSort(SdrPage & rPage, ::std::vector<sal_Int32> const& rSortOrder)
1690{
1691 return std::make_unique<SdrUndoSort>(rPage, rSortOrder);
1692}
1693
1694std::unique_ptr<SdrUndoAction> SdrUndoFactory::CreateUndoReplaceObject( SdrObject& rOldObject, SdrObject& rNewObject )
1695{
1696 return std::make_unique<SdrUndoReplaceObj>( rOldObject, rNewObject );
1697}
1698
1699std::unique_ptr<SdrUndoAction> SdrUndoFactory::CreateUndoObjectLayerChange( SdrObject& rObject, SdrLayerID aOldLayer, SdrLayerID aNewLayer )
1700{
1701 return std::make_unique<SdrUndoObjectLayerChange>( rObject, aOldLayer, aNewLayer );
1702}
1703
1704std::unique_ptr<SdrUndoAction> SdrUndoFactory::CreateUndoObjectSetText( SdrObject& rNewObj, sal_Int32 nText )
1705{
1706 return std::make_unique<SdrUndoObjSetText>( rNewObj, nText );
1707}
1708
1709std::unique_ptr<SdrUndoAction> SdrUndoFactory::CreateUndoObjectStrAttr( SdrObject& rObject,
1710 SdrUndoObjStrAttr::ObjStrAttrType eObjStrAttrType,
1711 const OUString& sOldStr,
1712 const OUString& sNewStr )
1713{
1714 return std::make_unique<SdrUndoObjStrAttr>( rObject, eObjStrAttrType, sOldStr, sNewStr );
1715}
1716
1717
1718// layer
1719std::unique_ptr<SdrUndoAction> SdrUndoFactory::CreateUndoNewLayer(sal_uInt16 nLayerNum, SdrLayerAdmin& rNewLayerAdmin, SdrModel& rNewModel)
1720{
1721 return std::make_unique<SdrUndoNewLayer>( nLayerNum, rNewLayerAdmin, rNewModel );
1722}
1723
1724std::unique_ptr<SdrUndoAction> SdrUndoFactory::CreateUndoDeleteLayer(sal_uInt16 nLayerNum, SdrLayerAdmin& rNewLayerAdmin, SdrModel& rNewModel)
1725{
1726 return std::make_unique<SdrUndoDelLayer>( nLayerNum, rNewLayerAdmin, rNewModel );
1727}
1728
1729// page
1730std::unique_ptr<SdrUndoAction> SdrUndoFactory::CreateUndoDeletePage(SdrPage& rPage)
1731{
1732 return std::make_unique<SdrUndoDelPage>(rPage);
1733}
1734
1735std::unique_ptr<SdrUndoAction> SdrUndoFactory::CreateUndoNewPage(SdrPage& rPage)
1736{
1737 return std::make_unique<SdrUndoNewPage>( rPage );
1738}
1739
1740std::unique_ptr<SdrUndoAction> SdrUndoFactory::CreateUndoCopyPage(SdrPage& rPage)
1741{
1742 return std::make_unique<SdrUndoCopyPage>( rPage );
1743}
1744
1745std::unique_ptr<SdrUndoAction> SdrUndoFactory::CreateUndoSetPageNum(SdrPage& rNewPg, sal_uInt16 nOldPageNum1, sal_uInt16 nNewPageNum1)
1746{
1747 return std::make_unique<SdrUndoSetPageNum>( rNewPg, nOldPageNum1, nNewPageNum1 );
1748}
1749 // master page
1750std::unique_ptr<SdrUndoAction> SdrUndoFactory::CreateUndoPageRemoveMasterPage(SdrPage& rChangedPage)
1751{
1752 return std::make_unique<SdrUndoPageRemoveMasterPage>( rChangedPage );
1753}
1754
1755std::unique_ptr<SdrUndoAction> SdrUndoFactory::CreateUndoPageChangeMasterPage(SdrPage& rChangedPage)
1756{
1757 return std::make_unique<SdrUndoPageChangeMasterPage>(rChangedPage);
1758}
1759
1760
1761/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Helper for 3d object changes affecting 2d geometry.
bool IsConvertToPolyObjPossible() const
Definition: svdedtv.hxx:351
bool IsUnGroupPossible() const
Definition: svdedtv.hxx:343
void PutMarkedToTop()
Definition: svdedtv2.cxx:249
void UnGroupMarked()
Definition: svdedtv2.cxx:1877
bool IsUndoEnabled() const
Definition: svdedtv.cxx:1059
void ConvertMarkedToPathObj(bool bLineToArea)
Definition: svdedtv2.cxx:2082
void ReverseOrderOfMarked()
Definition: svdedtv2.cxx:435
bool IsConvertToPathObjPossible() const
Definition: svdedtv.hxx:350
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:182
void GroupMarked()
Definition: svdedtv2.cxx:1776
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:409
void MovMarkedToBtm()
Definition: svdedtv2.cxx:159
void DoImportMarkedMtf(SvdProgressInfo *pProgrInfo=nullptr)
Definition: svdedtv2.cxx:2104
bool IsReverseOrderPossible() const
Definition: svdedtv.hxx:390
void CombineMarkedObjects(bool bNoPolyPoly=true)
Definition: svdedtv2.cxx:1286
bool IsToTopPossible() const
Definition: svdedtv.hxx:388
void ConvertMarkedToPolyObj()
Definition: svdedtv2.cxx:2087
void PutMarkedToBtm()
Definition: svdedtv2.cxx:350
bool IsToBtmPossible() const
Definition: svdedtv.hxx:389
void MoveMarkedObj(const Size &rSiz, bool bCopy=false)
Definition: svdedtv1.cxx:183
bool IsGroupPossible() const
Definition: svdedtv.hxx:342
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
SdrObject * GetMarkedSdrObj() const
Definition: svdmark.hxx:68
virtual rtl::Reference< SdrPage > RemovePage(sal_uInt16 nPgNum)
Definition: svdmodel.cxx:1200
virtual void InsertPage(SdrPage *pPage, sal_uInt16 nPos=0xFFFF)
Definition: svdmodel.cxx:1175
virtual rtl::Reference< SdrPage > RemoveMasterPage(sal_uInt16 nPgNum)
Definition: svdmodel.cxx:1251
virtual void MovePage(sal_uInt16 nPgNum, sal_uInt16 nNewPos)
Definition: svdmodel.cxx:1215
SdrUndoFactory & GetSdrUndoFactory() const
returns the models undo factory.
Definition: svdmodel.cxx:1845
virtual void InsertMasterPage(SdrPage *pPage, sal_uInt16 nPos=0xFFFF)
Definition: svdmodel.cxx:1228
void MoveMasterPage(sal_uInt16 nPgNum, sal_uInt16 nNewPos)
Definition: svdmodel.cxx:1277
const SdrPage * GetPage(sal_uInt16 nPgNum) const
Definition: svdmodel.cxx:1790
sal_uInt16 GetPageCount() const
Definition: svdmodel.cxx:1800
virtual rtl::Reference< SdrObject > ReplaceObject(SdrObject *pNewObj, size_t nObjNum)
Replace existing object by different one.
Definition: svdpage.cxx:466
virtual SdrObject * SetObjectOrdNum(size_t nOldObjNum, size_t nNewObjNum)
Modify ZOrder of an SdrObject.
Definition: svdpage.cxx:530
virtual void InsertObject(SdrObject *pObj, size_t nPos=SAL_MAX_SIZE)
Definition: svdpage.cxx:332
SdrObject * GetObj(size_t nNum) const
Definition: svdpage.cxx:822
size_t GetObjCount() const
Definition: svdpage.cxx:816
void sort(std::vector< sal_Int32 > &sortOrder)
Definition: svdpage.cxx:618
virtual rtl::Reference< SdrObject > RemoveObject(size_t nObjNum)
Definition: svdpage.cxx:410
virtual SdrObject * getSdrObjectFromSdrObjList() const
Definition: svdpage.cxx:128
Abstract DrawObject.
Definition: svdobj.hxx:261
const Point & GetAnchorPos() const
Definition: svdobj.cxx:1656
void ActionChanged() const
Definition: svdobj.cxx:273
void SetOutlinerParaObject(std::optional< OutlinerParaObject > pTextObject)
Definition: svdobj.cxx:1801
void BroadcastObjectChange() const
Definition: svdobj.cxx:978
bool isDiagram() const
Definition: svdobj.hxx:265
virtual const std::shared_ptr< svx::diagram::IDiagramHelper > & getDiagramHelper() const
Definition: svdobj.cxx:207
void SetEmptyPresObj(bool bEpt)
Definition: svdobj.cxx:2571
virtual SdrObjList * GetSubList() const
Definition: svdobj.cxx:715
bool IsEmptyPresObj() const
Definition: svdobj.hxx:839
virtual OUString TakeObjNameSingul() const
Definition: svdobj.cxx:1052
void PutItem(const SfxPoolItem &rItem)
Definition: svdpage.cxx:1263
void ClearItem(const sal_uInt16 nWhich=0)
Definition: svdpage.cxx:1270
A SdrPage contains exactly one SdrObjList and a description of the physical page dimensions (size / m...
Definition: svdpage.hxx:377
SdrPage & TRG_GetMasterPage() const
Definition: svdpage.cxx:1666
sal_uInt16 GetPageNum() const
Definition: svdpage.cxx:1611
bool TRG_HasMasterPage() const
Definition: svdpage.hxx:498
void NbcSetOutlinerParaObjectForText(std::optional< OutlinerParaObject > pTextObject, SdrText *pText)
Definition: svdotext.cxx:1367
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:2088
OutlinerParaObject * GetOutlinerParaObject()
Definition: svdtext.cxx:88
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:1524
virtual bool CanSdrRepeat(SdrView &rView) const override
Definition: svdundo.cxx:1529
virtual OUString GetComment() const override
Definition: svdundo.cxx:1514
virtual OUString GetSdrRepeatComment() const override
Definition: svdundo.cxx:1519
virtual OUString GetComment() const override
Definition: svdundo.cxx:1275
virtual void Redo() override
Definition: svdundo.cxx:1266
virtual void Undo() override
Definition: svdundo.cxx:1259
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:584
virtual ~SdrUndoDelPage() override
Definition: svdundo.cxx:1401
virtual OUString GetComment() const override
Definition: svdundo.cxx:1424
virtual void SdrRepeat(SdrView &rView) override
Definition: svdundo.cxx:1434
SdrUndoDelPage(SdrPage &rNewPg)
Definition: svdundo.cxx:1356
virtual bool CanSdrRepeat(SdrView &rView) const override
Definition: svdundo.cxx:1438
bool mbHasFillBitmap
Definition: svdundo.hxx:585
void queryFillBitmap(const SfxItemSet &rItemSet)
Definition: svdundo.cxx:1443
void restoreFillBitmap()
Definition: svdundo.cxx:1474
virtual void Undo() override
Definition: svdundo.cxx:1405
virtual void Redo() override
Definition: svdundo.cxx:1417
std::unique_ptr< SdrUndoGroup > pUndoGroup
Definition: svdundo.hxx:583
void clearFillBitmap()
Definition: svdundo.cxx:1451
virtual OUString GetSdrRepeatComment() const override
Definition: svdundo.cxx:1429
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:1634
static std::unique_ptr< SdrUndoAction > CreateUndoSort(SdrPage &rPage, ::std::vector< sal_Int32 > const &rSortOrder)
Definition: svdundo.cxx:1689
virtual std::unique_ptr< SdrUndoAction > CreateUndoCopyPage(SdrPage &rPage)
Definition: svdundo.cxx:1740
virtual std::unique_ptr< SdrUndoAction > CreateUndoObjectOrdNum(SdrObject &rObject, sal_uInt32 nOldOrdNum1, sal_uInt32 nNewOrdNum1)
Definition: svdundo.cxx:1684
virtual std::unique_ptr< SdrUndoAction > CreateUndoCopyObject(SdrObject &rObject, bool bOrdNumDirect=false)
Definition: svdundo.cxx:1679
virtual std::unique_ptr< SdrUndoAction > CreateUndoObjectSetText(SdrObject &rNewObj, sal_Int32 nText)
Definition: svdundo.cxx:1704
virtual std::unique_ptr< SdrUndoAction > CreateUndoReplaceObject(SdrObject &rOldObject, SdrObject &rNewObject)
Definition: svdundo.cxx:1694
static std::unique_ptr< SdrUndoAction > CreateUndoObjectStrAttr(SdrObject &rObject, SdrUndoObjStrAttr::ObjStrAttrType eObjStrAttrType, const OUString &sOldStr, const OUString &sNewStr)
Definition: svdundo.cxx:1709
virtual std::unique_ptr< SdrUndoAction > CreateUndoDeleteLayer(sal_uInt16 nLayerNum, SdrLayerAdmin &rNewLayerAdmin, SdrModel &rNewModel)
Definition: svdundo.cxx:1724
virtual std::unique_ptr< SdrUndoAction > CreateUndoPageChangeMasterPage(SdrPage &rChangedPage)
Definition: svdundo.cxx:1755
virtual std::unique_ptr< SdrUndoAction > CreateUndoPageRemoveMasterPage(SdrPage &rChangedPage)
Definition: svdundo.cxx:1750
virtual std::unique_ptr< SdrUndoAction > CreateUndoDeletePage(SdrPage &rPage)
Definition: svdundo.cxx:1730
virtual std::unique_ptr< SdrUndoAction > CreateUndoNewPage(SdrPage &rPage)
Definition: svdundo.cxx:1735
virtual std::unique_ptr< SdrUndoAction > CreateUndoRemoveObject(SdrObject &rObject)
Definition: svdundo.cxx:1659
virtual std::unique_ptr< SdrUndoAction > CreateUndoDiagramModelData(SdrObject &rObject, std::shared_ptr< svx::diagram::DiagramDataState > &rStartState)
Definition: svdundo.cxx:1649
virtual std::unique_ptr< SdrUndoAction > CreateUndoNewObject(SdrObject &rObject, bool bOrdNumDirect=false)
Definition: svdundo.cxx:1674
virtual std::unique_ptr< SdrUndoAction > CreateUndoNewLayer(sal_uInt16 nLayerNum, SdrLayerAdmin &rNewLayerAdmin, SdrModel &rNewModel)
Definition: svdundo.cxx:1719
virtual std::unique_ptr< SdrUndoAction > CreateUndoAttrObject(SdrObject &rObject, bool bStyleSheet1=false, bool bSaveText=false)
Definition: svdundo.cxx:1654
virtual std::unique_ptr< SdrUndoAction > CreateUndoInsertObject(SdrObject &rObject, bool bOrdNumDirect=false)
Definition: svdundo.cxx:1664
virtual std::unique_ptr< SdrUndoAction > CreateUndoDeleteObject(SdrObject &rObject, bool bOrdNumDirect=false)
Definition: svdundo.cxx:1669
virtual std::unique_ptr< SdrUndoAction > CreateUndoSetPageNum(SdrPage &rNewPg, sal_uInt16 nOldPageNum1, sal_uInt16 nNewPageNum1)
Definition: svdundo.cxx:1745
virtual std::unique_ptr< SdrUndoAction > CreateUndoMoveObject(SdrObject &rObject, const Size &rDist)
Definition: svdundo.cxx:1638
virtual std::unique_ptr< SdrUndoAction > CreateUndoObjectLayerChange(SdrObject &rObject, SdrLayerID aOldLayer, SdrLayerID aNewLayer)
Definition: svdundo.cxx:1699
virtual std::unique_ptr< SdrUndoAction > CreateUndoGeoObject(SdrObject &rObject)
Definition: svdundo.cxx:1643
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:494
sal_uInt16 nNum
Definition: svdundo.hxx:493
SdrLayer * pLayer
Definition: svdundo.hxx:491
SdrLayerAdmin * pLayerAdmin
Definition: svdundo.hxx:492
SdrUndoLayer(sal_uInt16 nLayerNum, SdrLayerAdmin &rNewLayerAdmin, SdrModel &rNewModel)
Definition: svdundo.cxx:1220
virtual ~SdrUndoLayer() override
Definition: svdundo.cxx:1229
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:1246
virtual void Undo() override
Definition: svdundo.cxx:1237
virtual OUString GetComment() const override
Definition: svdundo.cxx:1253
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:1503
virtual void Undo() override
Definition: svdundo.cxx:1498
virtual OUString GetComment() const override
Definition: svdundo.cxx:1508
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:1598
virtual void Redo() override
Definition: svdundo.cxx:1617
sal_uInt16 maNewMasterPageNumber
Definition: svdundo.hxx:708
virtual OUString GetComment() const override
Definition: svdundo.cxx:1628
SdrUndoPageChangeMasterPage(SdrPage &rChangedPage)
Definition: svdundo.cxx:1591
ABC for manipulation of a PageList: New Page, DeletePage, MovePage (ChangePageNum).
Definition: svdundo.hxx:565
virtual ~SdrUndoPageList() override
Definition: svdundo.cxx:1351
SdrUndoPageList(SdrPage &rNewPg)
Definition: svdundo.cxx:1345
sal_uInt16 nPageNum
Definition: svdundo.hxx:567
ABC for all UndoActions that have something to do with MasterPage relationships.
Definition: svdundo.hxx:670
SdrUndoPageMasterPage(SdrPage &rChangedPage)
Definition: svdundo.cxx:1550
SdrLayerIDSet maOldSet
Definition: svdundo.hxx:673
sal_uInt16 maOldMasterPageNumber
Definition: svdundo.hxx:674
virtual void Redo() override
Definition: svdundo.cxx:1581
virtual void Undo() override
Definition: svdundo.cxx:1572
SdrUndoPageRemoveMasterPage(SdrPage &rChangedPage)
Definition: svdundo.cxx:1567
virtual OUString GetComment() const override
Definition: svdundo.cxx:1586
ABC for all UndoActions that have something to do with SdrPages.
Definition: svdundo.hxx:544
static OUString ImpGetDescriptionStr(TranslateId pStrCacheID)
Definition: svdundo.cxx:1339
SdrUndoPage(SdrPage &rNewPg)
Definition: svdundo.cxx:1281
void ImpInsertPage(sal_uInt16 nNum)
Definition: svdundo.cxx:1289
void ImpMovePage(sal_uInt16 nOldNum, sal_uInt16 nNewNum)
Definition: svdundo.cxx:1323
void ImpRemovePage(sal_uInt16 nNum)
Definition: svdundo.cxx:1305
rtl::Reference< SdrPage > mxPage
Definition: svdundo.hxx:546
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:646
virtual void Redo() override
Definition: svdundo.cxx:1540
virtual OUString GetComment() const override
Definition: svdundo.cxx:1545
sal_uInt16 nNewPageNum
Definition: svdundo.hxx:647
virtual void Undo() override
Definition: svdundo.cxx:1535
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
SdrView * NextView()
Definition: svdviter.cxx:159
SdrView * FirstView()
Definition: svdviter.cxx:153
virtual void DeleteMarked()
Definition: svdview.cxx:1409
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)
virtual SfxStyleSheetBase * Find(const OUString &, SfxStyleFamily eFam, SfxStyleSearchBits n=SfxStyleSearchBits::All) const
void Insert(SfxStyleSheetBase *)
virtual const OUString & GetParent() const
const OUString & GetName() const
SfxStyleFamily GetFamily() const
virtual SfxItemSet & GetItemSet()
virtual bool SetParent(const OUString &) override
static 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:2076
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
NONE
size
int i
std::shared_ptr< DiagramDataState > DiagramDataStatePtr
Definition: datamodel.hxx:171
SdrTextObj * DynCastSdrTextObj(SdrObject *pObj)
Definition: svdobj.cxx:3217
E3dScene * DynCastE3dScene(SdrObject *pObj)
Definition: svdobj.cxx:3203
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)