1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 24 // MARKER(update_precomp.py): autogen include statement, do not remove 25 #include "precompiled_svx.hxx" 26 27 #include <svx/svdundo.hxx> 28 #include "svx/svditext.hxx" 29 #include <svx/svdotext.hxx> 30 #include <svx/svdobj.hxx> 31 #include <svx/svdpage.hxx> 32 #include <svx/svdlayer.hxx> 33 #include <svx/svdmodel.hxx> 34 #include <svx/svdview.hxx> 35 #include "svx/svdstr.hrc" // Namen aus der Resource 36 #include "svx/svdglob.hxx" // StringCache 37 #include <svx/scene3d.hxx> 38 #include <editeng/outlobj.hxx> 39 #include <svx/svdogrp.hxx> 40 #include <svx/sdr/properties/itemsettools.hxx> 41 #include <svx/sdr/properties/properties.hxx> 42 #include <svx/svdocapt.hxx> 43 #include <svl/whiter.hxx> 44 #include <svx/e3dsceneupdater.hxx> 45 46 #include "svx/svdviter.hxx" 47 48 //////////////////////////////////////////////////////////////////////////////////////////////////// 49 50 // iterates over all views and unmarks this SdrObject if it is marked 51 static void ImplUnmarkObject( SdrObject* pObj ) 52 { 53 SdrViewIter aIter( pObj ); 54 for ( SdrView* pView = aIter.FirstView(); pView; pView = aIter.NextView() ) 55 { 56 pView->MarkObj( pObj, pView->GetSdrPageView(), sal_True ); 57 } 58 } 59 60 //////////////////////////////////////////////////////////////////////////////////////////////////// 61 62 TYPEINIT1(SdrUndoAction,SfxUndoAction); 63 64 sal_Bool SdrUndoAction::CanRepeat(SfxRepeatTarget& rView) const 65 { 66 SdrView* pV=PTR_CAST(SdrView,&rView); 67 if (pV!=NULL) return CanSdrRepeat(*pV); 68 return sal_False; 69 } 70 71 void SdrUndoAction::Repeat(SfxRepeatTarget& rView) 72 { 73 SdrView* pV=PTR_CAST(SdrView,&rView); 74 if (pV!=NULL) SdrRepeat(*pV); 75 DBG_ASSERT(pV!=NULL,"Repeat: Uebergebenes SfxRepeatTarget ist keine SdrView"); 76 } 77 78 XubString SdrUndoAction::GetRepeatComment(SfxRepeatTarget& rView) const 79 { 80 SdrView* pV=PTR_CAST(SdrView,&rView); 81 if (pV!=NULL) return GetSdrRepeatComment(*pV); 82 return String(); 83 } 84 85 bool SdrUndoAction::CanSdrRepeat(SdrView& /*rView*/) const 86 { 87 return sal_False; 88 } 89 90 void SdrUndoAction::SdrRepeat(SdrView& /*rView*/) 91 { 92 } 93 94 XubString SdrUndoAction::GetSdrRepeatComment(SdrView& /*rView*/) const 95 { 96 return String(); 97 } 98 99 //////////////////////////////////////////////////////////////////////////////////////////////////// 100 101 SdrUndoGroup::SdrUndoGroup(SdrModel& rNewMod) 102 : SdrUndoAction(rNewMod), 103 aBuf(1024,32,32), 104 eFunction(SDRREPFUNC_OBJ_NONE) /*#72642#*/ 105 {} 106 107 SdrUndoGroup::SdrUndoGroup(SdrModel& rNewMod,const String& rStr) 108 : SdrUndoAction(rNewMod), 109 aBuf(1024,32,32), 110 aComment(rStr), 111 eFunction(SDRREPFUNC_OBJ_NONE) 112 {} 113 114 SdrUndoGroup::~SdrUndoGroup() 115 { 116 Clear(); 117 } 118 119 void SdrUndoGroup::Clear() 120 { 121 for (sal_uIntPtr nu=0; nu<GetActionCount(); nu++) { 122 SdrUndoAction* pAct=GetAction(nu); 123 delete pAct; 124 } 125 aBuf.Clear(); 126 } 127 128 void SdrUndoGroup::AddAction(SdrUndoAction* pAct) 129 { 130 aBuf.Insert(pAct,CONTAINER_APPEND); 131 } 132 133 void SdrUndoGroup::push_front( SdrUndoAction* pAct ) 134 { 135 aBuf.Insert(pAct, (sal_uIntPtr)0 ); 136 } 137 138 void SdrUndoGroup::Undo() 139 { 140 for (sal_uIntPtr nu=GetActionCount(); nu>0;) { 141 nu--; 142 SdrUndoAction* pAct=GetAction(nu); 143 pAct->Undo(); 144 } 145 } 146 147 void SdrUndoGroup::Redo() 148 { 149 for (sal_uIntPtr nu=0; nu<GetActionCount(); nu++) { 150 SdrUndoAction* pAct=GetAction(nu); 151 pAct->Redo(); 152 } 153 } 154 155 XubString SdrUndoGroup::GetComment() const 156 { 157 XubString aRet(aComment); 158 sal_Char aSearchText[] = "%1"; 159 String aSearchString(aSearchText, sizeof(aSearchText)-1); 160 161 aRet.SearchAndReplace(aSearchString, aObjDescription); 162 163 return aRet; 164 } 165 166 bool SdrUndoGroup::CanSdrRepeat(SdrView& rView) const 167 { 168 switch (eFunction) { 169 case SDRREPFUNC_OBJ_NONE : return sal_False; 170 case SDRREPFUNC_OBJ_DELETE : return rView.AreObjectsMarked(); 171 case SDRREPFUNC_OBJ_COMBINE_POLYPOLY: return rView.IsCombinePossible(sal_False); 172 case SDRREPFUNC_OBJ_COMBINE_ONEPOLY : return rView.IsCombinePossible(sal_True); 173 case SDRREPFUNC_OBJ_DISMANTLE_POLYS : return rView.IsDismantlePossible(sal_False); 174 case SDRREPFUNC_OBJ_DISMANTLE_LINES : return rView.IsDismantlePossible(sal_True); 175 case SDRREPFUNC_OBJ_CONVERTTOPOLY : return rView.IsConvertToPolyObjPossible(sal_False); 176 case SDRREPFUNC_OBJ_CONVERTTOPATH : return rView.IsConvertToPathObjPossible(sal_False); 177 case SDRREPFUNC_OBJ_GROUP : return rView.IsGroupPossible(); 178 case SDRREPFUNC_OBJ_UNGROUP : return rView.IsUnGroupPossible(); 179 case SDRREPFUNC_OBJ_PUTTOTOP : return rView.IsToTopPossible(); 180 case SDRREPFUNC_OBJ_PUTTOBTM : return rView.IsToBtmPossible(); 181 case SDRREPFUNC_OBJ_MOVTOTOP : return rView.IsToTopPossible(); 182 case SDRREPFUNC_OBJ_MOVTOBTM : return rView.IsToBtmPossible(); 183 case SDRREPFUNC_OBJ_REVORDER : return rView.IsReverseOrderPossible(); 184 case SDRREPFUNC_OBJ_IMPORTMTF : return rView.IsImportMtfPossible(); 185 default: break; 186 } // switch 187 return sal_False; 188 } 189 190 void SdrUndoGroup::SdrRepeat(SdrView& rView) 191 { 192 switch (eFunction) { 193 case SDRREPFUNC_OBJ_NONE : break; 194 case SDRREPFUNC_OBJ_DELETE : rView.DeleteMarked(); break; 195 case SDRREPFUNC_OBJ_COMBINE_POLYPOLY: rView.CombineMarkedObjects(sal_False); break; 196 case SDRREPFUNC_OBJ_COMBINE_ONEPOLY : rView.CombineMarkedObjects(sal_True); break; 197 case SDRREPFUNC_OBJ_DISMANTLE_POLYS : rView.DismantleMarkedObjects(sal_False); break; 198 case SDRREPFUNC_OBJ_DISMANTLE_LINES : rView.DismantleMarkedObjects(sal_True); break; 199 case SDRREPFUNC_OBJ_CONVERTTOPOLY : rView.ConvertMarkedToPolyObj(sal_False); break; 200 case SDRREPFUNC_OBJ_CONVERTTOPATH : rView.ConvertMarkedToPathObj(sal_False); break; 201 case SDRREPFUNC_OBJ_GROUP : rView.GroupMarked(); break; 202 case SDRREPFUNC_OBJ_UNGROUP : rView.UnGroupMarked(); break; 203 case SDRREPFUNC_OBJ_PUTTOTOP : rView.PutMarkedToTop(); break; 204 case SDRREPFUNC_OBJ_PUTTOBTM : rView.PutMarkedToBtm(); break; 205 case SDRREPFUNC_OBJ_MOVTOTOP : rView.MovMarkedToTop(); break; 206 case SDRREPFUNC_OBJ_MOVTOBTM : rView.MovMarkedToBtm(); break; 207 case SDRREPFUNC_OBJ_REVORDER : rView.ReverseOrderOfMarked(); break; 208 case SDRREPFUNC_OBJ_IMPORTMTF : rView.DoImportMarkedMtf(); break; 209 default: break; 210 } // switch 211 } 212 213 XubString SdrUndoGroup::GetSdrRepeatComment(SdrView& /*rView*/) const 214 { 215 XubString aRet(aComment); 216 sal_Char aSearchText[] = "%1"; 217 String aSearchString(aSearchText, sizeof(aSearchText)-1); 218 219 aRet.SearchAndReplace(aSearchString, ImpGetResStr(STR_ObjNameSingulPlural)); 220 221 return aRet; 222 } 223 224 //////////////////////////////////////////////////////////////////////////////////////////////////// 225 //////////////////////////////////////////////////////////////////////////////////////////////////// 226 // 227 // @@@@ @@@@@ @@@@@@ @@@@@ @@@@ @@@@@@ @@@@ 228 // @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ 229 // @@ @@ @@ @@ @@ @@ @@ @@ @@ 230 // @@ @@ @@@@@ @@ @@@@ @@ @@ @@@@ 231 // @@ @@ @@ @@ @@ @@ @@ @@ @@ 232 // @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ 233 // @@@@ @@@@@ @@@@ @@@@@ @@@@ @@ @@@@ 234 // 235 //////////////////////////////////////////////////////////////////////////////////////////////////// 236 //////////////////////////////////////////////////////////////////////////////////////////////////// 237 238 SdrUndoObj::SdrUndoObj(SdrObject& rNewObj): 239 SdrUndoAction(*rNewObj.GetModel()), 240 pObj(&rNewObj) 241 { 242 } 243 244 void SdrUndoObj::GetDescriptionStringForObject( const SdrObject& _rForObject, sal_uInt16 nStrCacheID, String& rStr, FASTBOOL bRepeat ) 245 { 246 rStr = ImpGetResStr(nStrCacheID); 247 sal_Char aSearchText[] = "%1"; 248 String aSearchString(aSearchText, sizeof(aSearchText)-1); 249 250 xub_StrLen nPos = rStr.Search(aSearchString); 251 252 if(nPos != STRING_NOTFOUND) 253 { 254 rStr.Erase(nPos, 2); 255 256 if(bRepeat) 257 { 258 rStr.Insert(ImpGetResStr(STR_ObjNameSingulPlural), nPos); 259 } 260 else 261 { 262 XubString aStr; 263 264 _rForObject.TakeObjNameSingul(aStr); 265 rStr.Insert(aStr, nPos); 266 } 267 } 268 } 269 270 void SdrUndoObj::ImpTakeDescriptionStr(sal_uInt16 nStrCacheID, XubString& rStr, FASTBOOL bRepeat) const 271 { 272 if ( pObj ) 273 GetDescriptionStringForObject( *pObj, nStrCacheID, rStr, bRepeat ); 274 } 275 276 // #94278# common call method for evtl. page change when UNDO/REDO 277 // is triggered 278 void SdrUndoObj::ImpShowPageOfThisObject() 279 { 280 if(pObj && pObj->IsInserted() && pObj->GetPage() && pObj->GetModel()) 281 { 282 SdrHint aHint(HINT_SWITCHTOPAGE); 283 284 aHint.SetObject(pObj); 285 aHint.SetPage(pObj->GetPage()); 286 287 pObj->GetModel()->Broadcast(aHint); 288 } 289 } 290 291 //////////////////////////////////////////////////////////////////////////////////////////////////// 292 293 void SdrUndoAttrObj::ensureStyleSheetInStyleSheetPool(SfxStyleSheetBasePool& rStyleSheetPool, SfxStyleSheet& rSheet) 294 { 295 SfxStyleSheetBase* pThere = rStyleSheetPool.Find(rSheet.GetName(), rSheet.GetFamily()); 296 297 if(!pThere) 298 { 299 // re-insert remembered style which was removed in the meantime. To do this 300 // without assertion, do it without parent and set parent after insertion 301 const UniString aParent(rSheet.GetParent()); 302 303 rSheet.SetParent(UniString()); 304 rStyleSheetPool.Insert(&rSheet); 305 rSheet.SetParent(aParent); 306 } 307 } 308 309 SdrUndoAttrObj::SdrUndoAttrObj(SdrObject& rNewObj, FASTBOOL bStyleSheet1, FASTBOOL bSaveText) 310 : SdrUndoObj(rNewObj), 311 pUndoSet(NULL), 312 pRedoSet(NULL), 313 pRepeatSet(NULL), 314 mxUndoStyleSheet(), 315 mxRedoStyleSheet(), 316 bHaveToTakeRedoSet(sal_True), 317 pTextUndo(NULL), 318 319 // #i8508# 320 pTextRedo(NULL), 321 322 pUndoGroup(NULL) 323 { 324 bStyleSheet = bStyleSheet1; 325 326 SdrObjList* pOL = rNewObj.GetSubList(); 327 sal_Bool bIsGroup(pOL!=NULL && pOL->GetObjCount()); 328 sal_Bool bIs3DScene(bIsGroup && pObj->ISA(E3dScene)); 329 330 if(bIsGroup) 331 { 332 // Aha, Gruppenobjekt 333 pUndoGroup = new SdrUndoGroup(*pObj->GetModel()); 334 sal_uInt32 nObjAnz(pOL->GetObjCount()); 335 336 for(sal_uInt32 nObjNum(0); nObjNum < nObjAnz; nObjNum++) 337 { 338 pUndoGroup->AddAction( 339 new SdrUndoAttrObj(*pOL->GetObj(nObjNum), bStyleSheet1)); 340 } 341 } 342 343 if(!bIsGroup || bIs3DScene) 344 { 345 if(pUndoSet) 346 { 347 delete pUndoSet; 348 } 349 350 pUndoSet = new SfxItemSet(pObj->GetMergedItemSet()); 351 352 if(bStyleSheet) 353 mxUndoStyleSheet = pObj->GetStyleSheet(); 354 355 if(bSaveText) 356 { 357 pTextUndo = pObj->GetOutlinerParaObject(); 358 if(pTextUndo) 359 pTextUndo = new OutlinerParaObject(*pTextUndo); 360 } 361 } 362 } 363 364 SdrUndoAttrObj::~SdrUndoAttrObj() 365 { 366 if(pUndoSet) 367 delete pUndoSet; 368 if(pRedoSet) 369 delete pRedoSet; 370 if(pRepeatSet) 371 delete pRepeatSet; 372 if(pUndoGroup) 373 delete pUndoGroup; 374 if(pTextUndo) 375 delete pTextUndo; 376 377 // #i8508# 378 if(pTextRedo) 379 delete pTextRedo; 380 } 381 382 void SdrUndoAttrObj::SetRepeatAttr(const SfxItemSet& rSet) 383 { 384 if(pRepeatSet) 385 delete pRepeatSet; 386 387 pRepeatSet = new SfxItemSet(rSet); 388 } 389 390 void SdrUndoAttrObj::Undo() 391 { 392 E3DModifySceneSnapRectUpdater aUpdater(pObj); 393 sal_Bool bIs3DScene(pObj && pObj->ISA(E3dScene)); 394 395 // #94278# Trigger PageChangeCall 396 ImpShowPageOfThisObject(); 397 398 if(!pUndoGroup || bIs3DScene) 399 { 400 if(bHaveToTakeRedoSet) 401 { 402 bHaveToTakeRedoSet = sal_False; 403 404 if(pRedoSet) 405 { 406 delete pRedoSet; 407 } 408 409 pRedoSet = new SfxItemSet(pObj->GetMergedItemSet()); 410 411 if(bStyleSheet) 412 mxRedoStyleSheet = pObj->GetStyleSheet(); 413 414 if(pTextUndo) 415 { 416 // #i8508# 417 pTextRedo = pObj->GetOutlinerParaObject(); 418 419 if(pTextRedo) 420 pTextRedo = new OutlinerParaObject(*pTextRedo); 421 } 422 } 423 424 if(bStyleSheet) 425 { 426 mxRedoStyleSheet = pObj->GetStyleSheet(); 427 SfxStyleSheet* pSheet = dynamic_cast< SfxStyleSheet* >(mxUndoStyleSheet.get()); 428 429 if(pSheet && pObj->GetModel() && pObj->GetModel()->GetStyleSheetPool()) 430 { 431 ensureStyleSheetInStyleSheetPool(*pObj->GetModel()->GetStyleSheetPool(), *pSheet); 432 pObj->SetStyleSheet(pSheet, sal_True); 433 } 434 else 435 { 436 OSL_ENSURE(false, "OOps, something went wrong in SdrUndoAttrObj (!)"); 437 } 438 } 439 440 sdr::properties::ItemChangeBroadcaster aItemChange(*pObj); 441 442 // #105122# Since ClearItem sets back everything to normal 443 // it also sets fit-to-size text to non-fit-to-size text and 444 // switches on autogrowheight (the default). That may lead to 445 // loosing the geometry size info for the object when it is 446 // re-layouted from AdjustTextFrameWidthAndHeight(). This makes 447 // rescuing the size of the object necessary. 448 const Rectangle aSnapRect = pObj->GetSnapRect(); 449 450 if(pUndoSet) 451 { 452 // #109587# 453 if(pObj->ISA(SdrCaptionObj)) 454 { 455 // do a more smooth item deletion here, else the text 456 // rect will be reformatted, especially when information regarding 457 // vertical text is changed. When clearing only set items it's 458 // slower, but safer regarding such information (it's not changed 459 // usually) 460 SfxWhichIter aIter(*pUndoSet); 461 sal_uInt16 nWhich(aIter.FirstWhich()); 462 463 while(nWhich) 464 { 465 if(SFX_ITEM_SET != pUndoSet->GetItemState(nWhich, sal_False)) 466 { 467 pObj->ClearMergedItem(nWhich); 468 } 469 470 nWhich = aIter.NextWhich(); 471 } 472 } 473 else 474 { 475 pObj->ClearMergedItem(); 476 } 477 478 pObj->SetMergedItemSet(*pUndoSet); 479 } 480 481 // #105122# Restore prev size here when it was changed. 482 if(aSnapRect != pObj->GetSnapRect()) 483 { 484 pObj->NbcSetSnapRect(aSnapRect); 485 } 486 487 pObj->GetProperties().BroadcastItemChange(aItemChange); 488 489 if(pTextUndo) 490 { 491 pObj->SetOutlinerParaObject(new OutlinerParaObject(*pTextUndo)); 492 } 493 } 494 495 if(pUndoGroup) 496 { 497 pUndoGroup->Undo(); 498 } 499 } 500 501 void SdrUndoAttrObj::Redo() 502 { 503 E3DModifySceneSnapRectUpdater aUpdater(pObj); 504 sal_Bool bIs3DScene(pObj && pObj->ISA(E3dScene)); 505 506 if(!pUndoGroup || bIs3DScene) 507 { 508 if(bStyleSheet) 509 { 510 mxUndoStyleSheet = pObj->GetStyleSheet(); 511 SfxStyleSheet* pSheet = dynamic_cast< SfxStyleSheet* >(mxRedoStyleSheet.get()); 512 513 if(pSheet && pObj->GetModel() && pObj->GetModel()->GetStyleSheetPool()) 514 { 515 ensureStyleSheetInStyleSheetPool(*pObj->GetModel()->GetStyleSheetPool(), *pSheet); 516 pObj->SetStyleSheet(pSheet, sal_True); 517 } 518 else 519 { 520 OSL_ENSURE(false, "OOps, something went wrong in SdrUndoAttrObj (!)"); 521 } 522 } 523 524 sdr::properties::ItemChangeBroadcaster aItemChange(*pObj); 525 526 // #105122# 527 const Rectangle aSnapRect = pObj->GetSnapRect(); 528 529 if(pRedoSet) 530 { 531 // #109587# 532 if(pObj->ISA(SdrCaptionObj)) 533 { 534 // do a more smooth item deletion here, else the text 535 // rect will be reformatted, especially when information regarding 536 // vertical text is changed. When clearing only set items it's 537 // slower, but safer regarding such information (it's not changed 538 // usually) 539 SfxWhichIter aIter(*pRedoSet); 540 sal_uInt16 nWhich(aIter.FirstWhich()); 541 542 while(nWhich) 543 { 544 if(SFX_ITEM_SET != pRedoSet->GetItemState(nWhich, sal_False)) 545 { 546 pObj->ClearMergedItem(nWhich); 547 } 548 549 nWhich = aIter.NextWhich(); 550 } 551 } 552 else 553 { 554 pObj->ClearMergedItem(); 555 } 556 557 pObj->SetMergedItemSet(*pRedoSet); 558 } 559 560 // #105122# Restore prev size here when it was changed. 561 if(aSnapRect != pObj->GetSnapRect()) 562 { 563 pObj->NbcSetSnapRect(aSnapRect); 564 } 565 566 pObj->GetProperties().BroadcastItemChange(aItemChange); 567 568 // #i8508# 569 if(pTextRedo) 570 { 571 pObj->SetOutlinerParaObject(new OutlinerParaObject(*pTextRedo)); 572 } 573 } 574 575 if(pUndoGroup) 576 { 577 pUndoGroup->Redo(); 578 } 579 580 // #94278# Trigger PageChangeCall 581 ImpShowPageOfThisObject(); 582 } 583 584 XubString SdrUndoAttrObj::GetComment() const 585 { 586 XubString aStr; 587 588 if(bStyleSheet) 589 { 590 ImpTakeDescriptionStr(STR_EditSetStylesheet, aStr); 591 } 592 else 593 { 594 ImpTakeDescriptionStr(STR_EditSetAttributes, aStr); 595 } 596 597 return aStr; 598 } 599 600 void SdrUndoAttrObj::SdrRepeat(SdrView& rView) 601 { 602 if(pRepeatSet) 603 { 604 rView.SetAttrToMarked(*pRepeatSet, sal_False); 605 } 606 } 607 608 bool SdrUndoAttrObj::CanSdrRepeat(SdrView& rView) const 609 { 610 return (pRepeatSet!=0L && rView.AreObjectsMarked()); 611 } 612 613 XubString SdrUndoAttrObj::GetSdrRepeatComment(SdrView& /*rView*/) const 614 { 615 XubString aStr; 616 617 if(bStyleSheet) 618 { 619 ImpTakeDescriptionStr(STR_EditSetStylesheet, aStr, sal_True); 620 } 621 else 622 { 623 ImpTakeDescriptionStr(STR_EditSetAttributes, aStr, sal_True); 624 } 625 626 return aStr; 627 } 628 629 //////////////////////////////////////////////////////////////////////////////////////////////////// 630 631 void SdrUndoMoveObj::Undo() 632 { 633 // #94278# Trigger PageChangeCall 634 ImpShowPageOfThisObject(); 635 636 pObj->Move(Size(-aDistance.Width(),-aDistance.Height())); 637 } 638 639 void SdrUndoMoveObj::Redo() 640 { 641 pObj->Move(Size(aDistance.Width(),aDistance.Height())); 642 643 // #94278# Trigger PageChangeCall 644 ImpShowPageOfThisObject(); 645 } 646 647 XubString SdrUndoMoveObj::GetComment() const 648 { 649 XubString aStr; 650 ImpTakeDescriptionStr(STR_EditMove,aStr); 651 return aStr; 652 } 653 654 void SdrUndoMoveObj::SdrRepeat(SdrView& rView) 655 { 656 rView.MoveMarkedObj(aDistance); 657 } 658 659 bool SdrUndoMoveObj::CanSdrRepeat(SdrView& rView) const 660 { 661 return rView.AreObjectsMarked(); 662 } 663 664 XubString SdrUndoMoveObj::GetSdrRepeatComment(SdrView& /*rView*/) const 665 { 666 XubString aStr; 667 ImpTakeDescriptionStr(STR_EditMove,aStr,sal_True); 668 return aStr; 669 } 670 671 //////////////////////////////////////////////////////////////////////////////////////////////////// 672 673 SdrUndoGeoObj::SdrUndoGeoObj(SdrObject& rNewObj): 674 SdrUndoObj(rNewObj), 675 pUndoGeo(NULL), 676 pRedoGeo(NULL), 677 pUndoGroup(NULL) 678 { 679 SdrObjList* pOL=rNewObj.GetSubList(); 680 if (pOL!=NULL && pOL->GetObjCount() && !rNewObj.ISA(E3dScene)) 681 { 682 // Aha, Gruppenobjekt 683 // AW: Aber keine 3D-Szene, dann nur fuer die Szene selbst den Undo anlegen 684 pUndoGroup=new SdrUndoGroup(*pObj->GetModel()); 685 sal_uIntPtr nObjAnz=pOL->GetObjCount(); 686 for (sal_uIntPtr nObjNum=0; nObjNum<nObjAnz; nObjNum++) { 687 pUndoGroup->AddAction(new SdrUndoGeoObj(*pOL->GetObj(nObjNum))); 688 } 689 } else { 690 pUndoGeo=pObj->GetGeoData(); 691 } 692 } 693 694 SdrUndoGeoObj::~SdrUndoGeoObj() 695 { 696 if (pUndoGeo!=NULL) delete pUndoGeo; 697 if (pRedoGeo!=NULL) delete pRedoGeo; 698 if (pUndoGroup!=NULL) delete pUndoGroup; 699 } 700 701 void SdrUndoGeoObj::Undo() 702 { 703 // #94278# Trigger PageChangeCall 704 ImpShowPageOfThisObject(); 705 706 if(pUndoGroup) 707 { 708 pUndoGroup->Undo(); 709 710 // #97172# 711 // only repaint, no objectchange 712 pObj->ActionChanged(); 713 } 714 else 715 { 716 if (pRedoGeo!=NULL) delete pRedoGeo; 717 pRedoGeo=pObj->GetGeoData(); 718 pObj->SetGeoData(*pUndoGeo); 719 } 720 } 721 722 void SdrUndoGeoObj::Redo() 723 { 724 if(pUndoGroup) 725 { 726 pUndoGroup->Redo(); 727 728 // #97172# 729 // only repaint, no objectchange 730 pObj->ActionChanged(); 731 } 732 else 733 { 734 if (pUndoGeo!=NULL) delete pUndoGeo; 735 pUndoGeo=pObj->GetGeoData(); 736 pObj->SetGeoData(*pRedoGeo); 737 } 738 739 // #94278# Trigger PageChangeCall 740 ImpShowPageOfThisObject(); 741 } 742 743 XubString SdrUndoGeoObj::GetComment() const 744 { 745 XubString aStr; 746 ImpTakeDescriptionStr(STR_DragMethObjOwn,aStr); 747 return aStr; 748 } 749 750 //////////////////////////////////////////////////////////////////////////////////////////////////// 751 752 SdrUndoObjList::SdrUndoObjList(SdrObject& rNewObj, bool bOrdNumDirect) 753 : SdrUndoObj(rNewObj), 754 bOwner(sal_False), 755 pView(NULL), 756 pPageView(NULL) 757 { 758 pObjList=pObj->GetObjList(); 759 if (bOrdNumDirect) { 760 nOrdNum=pObj->GetOrdNumDirect(); 761 } else { 762 nOrdNum=pObj->GetOrdNum(); 763 } 764 } 765 766 SdrUndoObjList::~SdrUndoObjList() 767 { 768 if (pObj!=NULL && IsOwner()) 769 { 770 // Attribute muessen wieder in den regulaeren Pool 771 SetOwner(sal_False); 772 773 // nun loeschen 774 SdrObject::Free( pObj ); 775 } 776 } 777 778 void SdrUndoObjList::SetOwner(bool bNew) 779 { 780 bOwner = bNew; 781 } 782 783 //////////////////////////////////////////////////////////////////////////////////////////////////// 784 785 void SdrUndoRemoveObj::Undo() 786 { 787 // #94278# Trigger PageChangeCall 788 ImpShowPageOfThisObject(); 789 790 DBG_ASSERT(!pObj->IsInserted(),"UndoRemoveObj: pObj ist bereits Inserted"); 791 if (!pObj->IsInserted()) 792 { 793 // #i11426# 794 // For UNDOs in Calc/Writer it is necessary to adapt the anchor 795 // pos of the target object. 796 Point aOwnerAnchorPos(0, 0); 797 798 if(pObjList 799 && pObjList->GetOwnerObj() 800 && pObjList->GetOwnerObj()->ISA(SdrObjGroup)) 801 { 802 aOwnerAnchorPos = pObjList->GetOwnerObj()->GetAnchorPos(); 803 } 804 805 E3DModifySceneSnapRectUpdater aUpdater(pObjList->GetOwnerObj()); 806 SdrInsertReason aReason(SDRREASON_UNDO); 807 pObjList->InsertObject(pObj,nOrdNum,&aReason); 808 809 // #i11426# 810 if(aOwnerAnchorPos.X() || aOwnerAnchorPos.Y()) 811 { 812 pObj->NbcSetAnchorPos(aOwnerAnchorPos); 813 } 814 } 815 } 816 817 void SdrUndoRemoveObj::Redo() 818 { 819 DBG_ASSERT(pObj->IsInserted(),"RedoRemoveObj: pObj ist nicht Inserted"); 820 if (pObj->IsInserted()) 821 { 822 ImplUnmarkObject( pObj ); 823 E3DModifySceneSnapRectUpdater aUpdater(pObj); 824 pObjList->RemoveObject(nOrdNum); 825 } 826 827 // #94278# Trigger PageChangeCall 828 ImpShowPageOfThisObject(); 829 } 830 831 //////////////////////////////////////////////////////////////////////////////////////////////////// 832 833 void SdrUndoInsertObj::Undo() 834 { 835 // #94278# Trigger PageChangeCall 836 ImpShowPageOfThisObject(); 837 838 DBG_ASSERT(pObj->IsInserted(),"UndoInsertObj: pObj ist nicht Inserted"); 839 if (pObj->IsInserted()) 840 { 841 ImplUnmarkObject( pObj ); 842 843 #ifdef DBG_UTIL 844 SdrObject* pChkObj= 845 #endif 846 pObjList->RemoveObject(nOrdNum); 847 DBG_ASSERT(pChkObj==pObj,"UndoInsertObj: RemoveObjNum!=pObj"); 848 } 849 } 850 851 void SdrUndoInsertObj::Redo() 852 { 853 DBG_ASSERT(!pObj->IsInserted(),"RedoInsertObj: pObj ist bereits Inserted"); 854 if (!pObj->IsInserted()) 855 { 856 // --> OD 2005-05-10 #i45952# - restore anchor position of an object, 857 // which becomes a member of a group, because its cleared in method 858 // <InsertObject(..)>. Needed for correct ReDo in Writer. 859 Point aAnchorPos( 0, 0 ); 860 if ( pObjList && 861 pObjList->GetOwnerObj() && 862 pObjList->GetOwnerObj()->ISA(SdrObjGroup) ) 863 { 864 aAnchorPos = pObj->GetAnchorPos(); 865 } 866 // <-- 867 868 SdrInsertReason aReason(SDRREASON_UNDO); 869 pObjList->InsertObject(pObj,nOrdNum,&aReason); 870 871 // --> OD 2005-05-10 #i45952# 872 if ( aAnchorPos.X() || aAnchorPos.Y() ) 873 { 874 pObj->NbcSetAnchorPos( aAnchorPos ); 875 } 876 // <-- 877 } 878 879 // #94278# Trigger PageChangeCall 880 ImpShowPageOfThisObject(); 881 } 882 883 //////////////////////////////////////////////////////////////////////////////////////////////////// 884 885 void SdrUndoDelObj::Undo() 886 { 887 SdrUndoRemoveObj::Undo(); 888 DBG_ASSERT(IsOwner(),"UndoDeleteObj: pObj gehoert nicht der UndoAction"); 889 SetOwner(sal_False); 890 } 891 892 void SdrUndoDelObj::Redo() 893 { 894 SdrUndoRemoveObj::Redo(); 895 DBG_ASSERT(!IsOwner(),"RedoDeleteObj: pObj gehoert bereits der UndoAction"); 896 SetOwner(sal_True); 897 } 898 899 XubString SdrUndoDelObj::GetComment() const 900 { 901 XubString aStr; 902 ImpTakeDescriptionStr(STR_EditDelete,aStr); 903 return aStr; 904 } 905 906 void SdrUndoDelObj::SdrRepeat(SdrView& rView) 907 { 908 rView.DeleteMarked(); 909 } 910 911 bool SdrUndoDelObj::CanSdrRepeat(SdrView& rView) const 912 { 913 return rView.AreObjectsMarked(); 914 } 915 916 XubString SdrUndoDelObj::GetSdrRepeatComment(SdrView& /*rView*/) const 917 { 918 XubString aStr; 919 ImpTakeDescriptionStr(STR_EditDelete,aStr,sal_True); 920 return aStr; 921 } 922 923 //////////////////////////////////////////////////////////////////////////////////////////////////// 924 925 void SdrUndoNewObj::Undo() 926 { 927 SdrUndoInsertObj::Undo(); 928 DBG_ASSERT(!IsOwner(),"RedoNewObj: pObj gehoert bereits der UndoAction"); 929 SetOwner(sal_True); 930 } 931 932 void SdrUndoNewObj::Redo() 933 { 934 SdrUndoInsertObj::Redo(); 935 DBG_ASSERT(IsOwner(),"RedoNewObj: pObj gehoert nicht der UndoAction"); 936 SetOwner(sal_False); 937 } 938 939 String SdrUndoNewObj::GetComment( const SdrObject& _rForObject ) 940 { 941 String sComment; 942 GetDescriptionStringForObject( _rForObject, STR_UndoInsertObj, sComment ); 943 return sComment; 944 } 945 946 XubString SdrUndoNewObj::GetComment() const 947 { 948 XubString aStr; 949 ImpTakeDescriptionStr(STR_UndoInsertObj,aStr); 950 return aStr; 951 } 952 953 SdrUndoReplaceObj::SdrUndoReplaceObj(SdrObject& rOldObj1, SdrObject& rNewObj1, bool bOrdNumDirect) 954 : SdrUndoObj(rOldObj1), 955 bOldOwner(sal_False), 956 bNewOwner(sal_False), 957 pNewObj(&rNewObj1) 958 { 959 SetOldOwner(sal_True); 960 961 pObjList=pObj->GetObjList(); 962 if (bOrdNumDirect) { 963 nOrdNum=pObj->GetOrdNumDirect(); 964 } else { 965 nOrdNum=pObj->GetOrdNum(); 966 } 967 } 968 969 SdrUndoReplaceObj::~SdrUndoReplaceObj() 970 { 971 if (pObj!=NULL && IsOldOwner()) 972 { 973 // Attribute muessen wieder in den regulaeren Pool 974 SetOldOwner(sal_False); 975 976 // nun loeschen 977 SdrObject::Free( pObj ); 978 } 979 if (pNewObj!=NULL && IsNewOwner()) 980 { 981 // Attribute muessen wieder in den regulaeren Pool 982 SetNewOwner(sal_False); 983 984 // nun loeschen 985 SdrObject::Free( pNewObj ); 986 } 987 } 988 989 void SdrUndoReplaceObj::Undo() 990 { 991 // #94278# Trigger PageChangeCall 992 ImpShowPageOfThisObject(); 993 994 if (IsOldOwner() && !IsNewOwner()) 995 { 996 DBG_ASSERT(!pObj->IsInserted(),"SdrUndoReplaceObj::Undo(): Altes Objekt ist bereits inserted!"); 997 DBG_ASSERT(pNewObj->IsInserted(),"SdrUndoReplaceObj::Undo(): Neues Objekt ist nicht inserted!"); 998 SetOldOwner(sal_False); 999 SetNewOwner(sal_True); 1000 1001 ImplUnmarkObject( pNewObj ); 1002 pObjList->ReplaceObject(pObj,nOrdNum); 1003 } 1004 else 1005 { 1006 DBG_ERROR("SdrUndoReplaceObj::Undo(): IsMine-Flags stehen verkehrt. Doppelter Undo-Aufruf?"); 1007 } 1008 } 1009 1010 void SdrUndoReplaceObj::Redo() 1011 { 1012 if (!IsOldOwner() && IsNewOwner()) 1013 { 1014 DBG_ASSERT(!pNewObj->IsInserted(),"SdrUndoReplaceObj::Redo(): Neues Objekt ist bereits inserted!"); 1015 DBG_ASSERT(pObj->IsInserted(),"SdrUndoReplaceObj::Redo(): Altes Objekt ist nicht inserted!"); 1016 SetOldOwner(sal_True); 1017 SetNewOwner(sal_False); 1018 1019 ImplUnmarkObject( pObj ); 1020 pObjList->ReplaceObject(pNewObj,nOrdNum); 1021 1022 } 1023 else 1024 { 1025 DBG_ERROR("SdrUndoReplaceObj::Redo(): IsMine-Flags stehen verkehrt. Doppelter Redo-Aufruf?"); 1026 } 1027 1028 // #94278# Trigger PageChangeCall 1029 ImpShowPageOfThisObject(); 1030 } 1031 1032 void SdrUndoReplaceObj::SetNewOwner(bool bNew) 1033 { 1034 bNewOwner = bNew; 1035 } 1036 1037 void SdrUndoReplaceObj::SetOldOwner(bool bNew) 1038 { 1039 bOldOwner = bNew; 1040 } 1041 1042 //////////////////////////////////////////////////////////////////////////////////////////////////// 1043 1044 XubString SdrUndoCopyObj::GetComment() const 1045 { 1046 XubString aStr; 1047 ImpTakeDescriptionStr(STR_UndoCopyObj,aStr); 1048 return aStr; 1049 } 1050 1051 //////////////////////////////////////////////////////////////////////////////////////////////////// 1052 // #i11702# 1053 1054 SdrUndoObjectLayerChange::SdrUndoObjectLayerChange(SdrObject& rObj, SdrLayerID aOldLayer, SdrLayerID aNewLayer) 1055 : SdrUndoObj(rObj), 1056 maOldLayer(aOldLayer), 1057 maNewLayer(aNewLayer) 1058 { 1059 } 1060 1061 void SdrUndoObjectLayerChange::Undo() 1062 { 1063 ImpShowPageOfThisObject(); 1064 pObj->SetLayer(maOldLayer); 1065 } 1066 1067 void SdrUndoObjectLayerChange::Redo() 1068 { 1069 pObj->SetLayer(maNewLayer); 1070 ImpShowPageOfThisObject(); 1071 } 1072 1073 //////////////////////////////////////////////////////////////////////////////////////////////////// 1074 1075 SdrUndoObjOrdNum::SdrUndoObjOrdNum(SdrObject& rNewObj, sal_uInt32 nOldOrdNum1, sal_uInt32 nNewOrdNum1): 1076 SdrUndoObj(rNewObj), 1077 nOldOrdNum(nOldOrdNum1), 1078 nNewOrdNum(nNewOrdNum1) 1079 { 1080 } 1081 1082 void SdrUndoObjOrdNum::Undo() 1083 { 1084 // #94278# Trigger PageChangeCall 1085 ImpShowPageOfThisObject(); 1086 1087 SdrObjList* pOL=pObj->GetObjList(); 1088 if (pOL==NULL) { 1089 DBG_ERROR("UndoObjOrdNum: pObj hat keine ObjList"); 1090 return; 1091 } 1092 pOL->SetObjectOrdNum(nNewOrdNum,nOldOrdNum); 1093 } 1094 1095 void SdrUndoObjOrdNum::Redo() 1096 { 1097 SdrObjList* pOL=pObj->GetObjList(); 1098 if (pOL==NULL) { 1099 DBG_ERROR("RedoObjOrdNum: pObj hat keine ObjList"); 1100 return; 1101 } 1102 pOL->SetObjectOrdNum(nOldOrdNum,nNewOrdNum); 1103 1104 // #94278# Trigger PageChangeCall 1105 ImpShowPageOfThisObject(); 1106 } 1107 1108 XubString SdrUndoObjOrdNum::GetComment() const 1109 { 1110 XubString aStr; 1111 ImpTakeDescriptionStr(STR_UndoObjOrdNum,aStr); 1112 return aStr; 1113 } 1114 1115 //////////////////////////////////////////////////////////////////////////////////////////////////// 1116 1117 SdrUndoObjSetText::SdrUndoObjSetText(SdrObject& rNewObj, sal_Int32 nText) 1118 : SdrUndoObj(rNewObj) 1119 , pOldText(NULL) 1120 , pNewText(NULL) 1121 , bNewTextAvailable(sal_False) 1122 , bEmptyPresObj(sal_False) 1123 , mnText(nText) 1124 { 1125 SdrText* pText = static_cast< SdrTextObj*>( &rNewObj )->getText(mnText); 1126 if( pText && pText->GetOutlinerParaObject() ) 1127 pOldText = new OutlinerParaObject(*pText->GetOutlinerParaObject()); 1128 1129 bEmptyPresObj = rNewObj.IsEmptyPresObj(); 1130 } 1131 1132 SdrUndoObjSetText::~SdrUndoObjSetText() 1133 { 1134 if ( pOldText ) 1135 delete pOldText; 1136 if ( pNewText ) 1137 delete pNewText; 1138 } 1139 1140 void SdrUndoObjSetText::AfterSetText() 1141 { 1142 if (!bNewTextAvailable) 1143 { 1144 SdrText* pText = static_cast< SdrTextObj*>( pObj )->getText(mnText); 1145 if( pText && pText->GetOutlinerParaObject() ) 1146 pNewText = new OutlinerParaObject(*pText->GetOutlinerParaObject()); 1147 bNewTextAvailable=sal_True; 1148 } 1149 } 1150 1151 void SdrUndoObjSetText::Undo() 1152 { 1153 // #94278# Trigger PageChangeCall 1154 ImpShowPageOfThisObject(); 1155 1156 // alten Text sichern fuer Redo 1157 if (!bNewTextAvailable) 1158 AfterSetText(); 1159 1160 // Text fuer Undo kopieren, denn SetOutlinerParaObject() ist Eigentumsuebereignung 1161 OutlinerParaObject* pText1 = pOldText; 1162 if(pText1) 1163 pText1 = new OutlinerParaObject(*pText1); 1164 1165 SdrText* pText = static_cast< SdrTextObj*>( pObj )->getText(mnText); 1166 if( pText ) 1167 pText->SetOutlinerParaObject(pText1); 1168 1169 pObj->SetEmptyPresObj( bEmptyPresObj ); 1170 pObj->ActionChanged(); 1171 } 1172 1173 void SdrUndoObjSetText::Redo() 1174 { 1175 // Text fuer Undo kopieren, denn SetOutlinerParaObject() ist Eigentumsuebereignung 1176 OutlinerParaObject* pText1 = pNewText; 1177 1178 if(pText1) 1179 pText1 = new OutlinerParaObject(*pText1); 1180 1181 SdrText* pText = static_cast< SdrTextObj*>( pObj )->getText(mnText); 1182 if( pText ) 1183 static_cast< SdrTextObj* >( pObj )->NbcSetOutlinerParaObjectForText( pText1, pText ); 1184 1185 pObj->ActionChanged(); 1186 1187 // #94278# Trigger PageChangeCall 1188 ImpShowPageOfThisObject(); 1189 } 1190 1191 XubString SdrUndoObjSetText::GetComment() const 1192 { 1193 XubString aStr; 1194 ImpTakeDescriptionStr(STR_UndoObjSetText,aStr); 1195 return aStr; 1196 } 1197 1198 XubString SdrUndoObjSetText::GetSdrRepeatComment(SdrView& /*rView*/) const 1199 { 1200 XubString aStr; 1201 ImpTakeDescriptionStr(STR_UndoObjSetText,aStr); 1202 return aStr; 1203 } 1204 1205 void SdrUndoObjSetText::SdrRepeat(SdrView& rView) 1206 { 1207 if (bNewTextAvailable && rView.AreObjectsMarked()) 1208 { 1209 const SdrMarkList& rML=rView.GetMarkedObjectList(); 1210 1211 const bool bUndo = rView.IsUndoEnabled(); 1212 if( bUndo ) 1213 { 1214 XubString aStr; 1215 ImpTakeDescriptionStr(STR_UndoObjSetText,aStr); 1216 rView.BegUndo(aStr); 1217 } 1218 1219 sal_uIntPtr nAnz=rML.GetMarkCount(); 1220 for (sal_uIntPtr nm=0; nm<nAnz; nm++) 1221 { 1222 SdrObject* pObj2=rML.GetMark(nm)->GetMarkedSdrObj(); 1223 SdrTextObj* pTextObj=PTR_CAST(SdrTextObj,pObj2); 1224 if (pTextObj!=NULL) 1225 { 1226 if( bUndo ) 1227 rView.AddUndo(new SdrUndoObjSetText(*pTextObj,0)); 1228 1229 OutlinerParaObject* pText1=pNewText; 1230 if (pText1!=NULL) 1231 pText1 = new OutlinerParaObject(*pText1); 1232 pTextObj->SetOutlinerParaObject(pText1); 1233 } 1234 } 1235 1236 if( bUndo ) 1237 rView.EndUndo(); 1238 } 1239 } 1240 1241 bool SdrUndoObjSetText::CanSdrRepeat(SdrView& rView) const 1242 { 1243 bool bOk=sal_False; 1244 if (bNewTextAvailable && rView.AreObjectsMarked()) { 1245 bOk=sal_True; 1246 } 1247 return bOk; 1248 } 1249 1250 // --> OD 2009-07-09 #i73249# 1251 SdrUndoObjStrAttr::SdrUndoObjStrAttr( SdrObject& rNewObj, 1252 const ObjStrAttrType eObjStrAttr, 1253 const String& sOldStr, 1254 const String& sNewStr) 1255 : SdrUndoObj( rNewObj ), 1256 meObjStrAttr( eObjStrAttr ), 1257 msOldStr( sOldStr ), 1258 msNewStr( sNewStr ) 1259 { 1260 } 1261 1262 void SdrUndoObjStrAttr::Undo() 1263 { 1264 ImpShowPageOfThisObject(); 1265 1266 switch ( meObjStrAttr ) 1267 { 1268 case OBJ_NAME: 1269 { 1270 pObj->SetName( msOldStr ); 1271 } 1272 break; 1273 case OBJ_TITLE: 1274 { 1275 pObj->SetTitle( msOldStr ); 1276 } 1277 break; 1278 case OBJ_DESCRIPTION: 1279 { 1280 pObj->SetDescription( msOldStr ); 1281 } 1282 break; 1283 } 1284 } 1285 1286 void SdrUndoObjStrAttr::Redo() 1287 { 1288 switch ( meObjStrAttr ) 1289 { 1290 case OBJ_NAME: 1291 { 1292 pObj->SetName( msNewStr ); 1293 } 1294 break; 1295 case OBJ_TITLE: 1296 { 1297 pObj->SetTitle( msNewStr ); 1298 } 1299 break; 1300 case OBJ_DESCRIPTION: 1301 { 1302 pObj->SetDescription( msNewStr ); 1303 } 1304 break; 1305 } 1306 1307 ImpShowPageOfThisObject(); 1308 } 1309 1310 String SdrUndoObjStrAttr::GetComment() const 1311 { 1312 String aStr; 1313 switch ( meObjStrAttr ) 1314 { 1315 case OBJ_NAME: 1316 { 1317 ImpTakeDescriptionStr( STR_UndoObjName, aStr ); 1318 aStr += sal_Unicode(' '); 1319 aStr += sal_Unicode('\''); 1320 aStr += msNewStr; 1321 aStr += sal_Unicode('\''); 1322 } 1323 break; 1324 case OBJ_TITLE: 1325 { 1326 ImpTakeDescriptionStr( STR_UndoObjTitle, aStr ); 1327 } 1328 break; 1329 case OBJ_DESCRIPTION: 1330 { 1331 ImpTakeDescriptionStr( STR_UndoObjDescription, aStr ); 1332 } 1333 break; 1334 } 1335 1336 return aStr; 1337 } 1338 1339 //////////////////////////////////////////////////////////////////////////////////////////////////// 1340 //////////////////////////////////////////////////////////////////////////////////////////////////// 1341 // 1342 // @@ @@@@ @@ @@ @@@@@ @@@@@ 1343 // @@ @@ @@ @@ @@ @@ @@ @@ 1344 // @@ @@ @@ @@ @@ @@ @@ @@ 1345 // @@ @@@@@@ @@@@ @@@@ @@@@@ 1346 // @@ @@ @@ @@ @@ @@ @@ 1347 // @@ @@ @@ @@ @@ @@ @@ 1348 // @@@@@ @@ @@ @@ @@@@@ @@ @@ 1349 // 1350 //////////////////////////////////////////////////////////////////////////////////////////////////// 1351 //////////////////////////////////////////////////////////////////////////////////////////////////// 1352 1353 SdrUndoLayer::SdrUndoLayer(sal_uInt16 nLayerNum, SdrLayerAdmin& rNewLayerAdmin, SdrModel& rNewModel): 1354 SdrUndoAction(rNewModel), 1355 pLayer(rNewLayerAdmin.GetLayer(nLayerNum)), 1356 pLayerAdmin(&rNewLayerAdmin), 1357 nNum(nLayerNum), 1358 bItsMine(sal_False) 1359 { 1360 } 1361 1362 SdrUndoLayer::~SdrUndoLayer() 1363 { 1364 if (bItsMine) { 1365 delete pLayer; 1366 } 1367 } 1368 1369 //////////////////////////////////////////////////////////////////////////////////////////////////// 1370 1371 void SdrUndoNewLayer::Undo() 1372 { 1373 DBG_ASSERT(!bItsMine,"SdrUndoNewLayer::Undo(): Layer gehoert bereits der UndoAction"); 1374 bItsMine=sal_True; 1375 #ifdef DBG_UTIL 1376 SdrLayer* pCmpLayer= 1377 #endif 1378 pLayerAdmin->RemoveLayer(nNum); 1379 DBG_ASSERT(pCmpLayer==pLayer,"SdrUndoNewLayer::Undo(): Removter Layer ist != pLayer"); 1380 } 1381 1382 void SdrUndoNewLayer::Redo() 1383 { 1384 DBG_ASSERT(bItsMine,"SdrUndoNewLayer::Undo(): Layer gehoert nicht der UndoAction"); 1385 bItsMine=sal_False; 1386 pLayerAdmin->InsertLayer(pLayer,nNum); 1387 } 1388 1389 XubString SdrUndoNewLayer::GetComment() const 1390 { 1391 return ImpGetResStr(STR_UndoNewLayer); 1392 } 1393 1394 //////////////////////////////////////////////////////////////////////////////////////////////////// 1395 1396 void SdrUndoDelLayer::Undo() 1397 { 1398 DBG_ASSERT(bItsMine,"SdrUndoDelLayer::Undo(): Layer gehoert nicht der UndoAction"); 1399 bItsMine=sal_False; 1400 pLayerAdmin->InsertLayer(pLayer,nNum); 1401 } 1402 1403 void SdrUndoDelLayer::Redo() 1404 { 1405 DBG_ASSERT(!bItsMine,"SdrUndoDelLayer::Undo(): Layer gehoert bereits der UndoAction"); 1406 bItsMine=sal_True; 1407 #ifdef DBG_UTIL 1408 SdrLayer* pCmpLayer= 1409 #endif 1410 pLayerAdmin->RemoveLayer(nNum); 1411 DBG_ASSERT(pCmpLayer==pLayer,"SdrUndoDelLayer::Redo(): Removter Layer ist != pLayer"); 1412 } 1413 1414 XubString SdrUndoDelLayer::GetComment() const 1415 { 1416 return ImpGetResStr(STR_UndoDelLayer); 1417 } 1418 1419 //////////////////////////////////////////////////////////////////////////////////////////////////// 1420 1421 void SdrUndoMoveLayer::Undo() 1422 { 1423 #ifdef DBG_UTIL 1424 SdrLayer* pCmpLayer= 1425 #endif 1426 pLayerAdmin->RemoveLayer(nNeuPos); 1427 DBG_ASSERT(pCmpLayer==pLayer,"SdrUndoMoveLayer::Undo(): Removter Layer ist != pLayer"); 1428 pLayerAdmin->InsertLayer(pLayer,nNum); 1429 } 1430 1431 void SdrUndoMoveLayer::Redo() 1432 { 1433 #ifdef DBG_UTIL 1434 SdrLayer* pCmpLayer= 1435 #endif 1436 pLayerAdmin->RemoveLayer(nNum); 1437 DBG_ASSERT(pCmpLayer==pLayer,"SdrUndoMoveLayer::Redo(): Removter Layer ist != pLayer"); 1438 pLayerAdmin->InsertLayer(pLayer,nNeuPos); 1439 } 1440 1441 XubString SdrUndoMoveLayer::GetComment() const 1442 { 1443 return ImpGetResStr(STR_UndoMovLayer); 1444 } 1445 1446 //////////////////////////////////////////////////////////////////////////////////////////////////// 1447 //////////////////////////////////////////////////////////////////////////////////////////////////// 1448 // 1449 // @@@@@ @@@@ @@@@ @@@@@ @@@@ 1450 // @@ @@ @@ @@ @@ @@ @@ @@ @@ 1451 // @@ @@ @@ @@ @@ @@ @@ 1452 // @@@@@ @@@@@@ @@ @@@ @@@@ @@@@ 1453 // @@ @@ @@ @@ @@ @@ @@ 1454 // @@ @@ @@ @@ @@ @@ @@ @@ 1455 // @@ @@ @@ @@@@@ @@@@@ @@@@ 1456 // 1457 //////////////////////////////////////////////////////////////////////////////////////////////////// 1458 //////////////////////////////////////////////////////////////////////////////////////////////////// 1459 1460 SdrUndoPage::SdrUndoPage(SdrPage& rNewPg) 1461 : SdrUndoAction(*rNewPg.GetModel()), 1462 mrPage(rNewPg) 1463 { 1464 } 1465 1466 void SdrUndoPage::ImpInsertPage(sal_uInt16 nNum) 1467 { 1468 DBG_ASSERT(!mrPage.IsInserted(),"SdrUndoPage::ImpInsertPage(): mrPage ist bereits Inserted"); 1469 if (!mrPage.IsInserted()) { 1470 if (mrPage.IsMasterPage()) { 1471 rMod.InsertMasterPage(&mrPage,nNum); 1472 } else { 1473 rMod.InsertPage(&mrPage,nNum); 1474 } 1475 } 1476 } 1477 1478 void SdrUndoPage::ImpRemovePage(sal_uInt16 nNum) 1479 { 1480 DBG_ASSERT(mrPage.IsInserted(),"SdrUndoPage::ImpRemovePage(): mrPage ist nicht Inserted"); 1481 if (mrPage.IsInserted()) { 1482 SdrPage* pChkPg=NULL; 1483 if (mrPage.IsMasterPage()) { 1484 pChkPg=rMod.RemoveMasterPage(nNum); 1485 } else { 1486 pChkPg=rMod.RemovePage(nNum); 1487 } 1488 DBG_ASSERT(pChkPg==&mrPage,"SdrUndoPage::ImpRemovePage(): RemovePage!=&mrPage"); 1489 } 1490 } 1491 1492 void SdrUndoPage::ImpMovePage(sal_uInt16 nOldNum, sal_uInt16 nNewNum) 1493 { 1494 DBG_ASSERT(mrPage.IsInserted(),"SdrUndoPage::ImpMovePage(): mrPage ist nicht Inserted"); 1495 if (mrPage.IsInserted()) { 1496 if (mrPage.IsMasterPage()) { 1497 rMod.MoveMasterPage(nOldNum,nNewNum); 1498 } else { 1499 rMod.MovePage(nOldNum,nNewNum); 1500 } 1501 } 1502 } 1503 1504 void SdrUndoPage::ImpTakeDescriptionStr(sal_uInt16 nStrCacheID, XubString& rStr, sal_uInt16 /*n*/, FASTBOOL /*bRepeat*/) const 1505 { 1506 rStr=ImpGetResStr(nStrCacheID); 1507 } 1508 1509 //////////////////////////////////////////////////////////////////////////////////////////////////// 1510 1511 SdrUndoPageList::SdrUndoPageList(SdrPage& rNewPg): 1512 SdrUndoPage(rNewPg), 1513 bItsMine(sal_False) 1514 { 1515 nPageNum=rNewPg.GetPageNum(); 1516 } 1517 1518 SdrUndoPageList::~SdrUndoPageList() 1519 { 1520 if(bItsMine) 1521 { 1522 delete (&mrPage); 1523 } 1524 } 1525 1526 //////////////////////////////////////////////////////////////////////////////////////////////////// 1527 1528 SdrUndoDelPage::SdrUndoDelPage(SdrPage& rNewPg): 1529 SdrUndoPageList(rNewPg), 1530 pUndoGroup(NULL) 1531 { 1532 bItsMine = sal_True; 1533 1534 // Und nun ggf. die MasterPage-Beziehungen merken 1535 if(mrPage.IsMasterPage()) 1536 { 1537 sal_uInt16 nPageAnz(rMod.GetPageCount()); 1538 1539 for(sal_uInt16 nPageNum2(0); nPageNum2 < nPageAnz; nPageNum2++) 1540 { 1541 SdrPage* pDrawPage = rMod.GetPage(nPageNum2); 1542 1543 if(pDrawPage->TRG_HasMasterPage()) 1544 { 1545 SdrPage& rMasterPage = pDrawPage->TRG_GetMasterPage(); 1546 1547 if(&mrPage == &rMasterPage) 1548 { 1549 if(!pUndoGroup) 1550 { 1551 pUndoGroup = new SdrUndoGroup(rMod); 1552 } 1553 1554 pUndoGroup->AddAction(rMod.GetSdrUndoFactory().CreateUndoPageRemoveMasterPage(*pDrawPage)); 1555 } 1556 } 1557 } 1558 } 1559 } 1560 1561 SdrUndoDelPage::~SdrUndoDelPage() 1562 { 1563 if (pUndoGroup!=NULL) { 1564 delete pUndoGroup; 1565 } 1566 } 1567 1568 void SdrUndoDelPage::Undo() 1569 { 1570 ImpInsertPage(nPageNum); 1571 if (pUndoGroup!=NULL) { // MasterPage-Beziehungen wiederherstellen 1572 pUndoGroup->Undo(); 1573 } 1574 DBG_ASSERT(bItsMine,"UndoDeletePage: mrPage gehoert nicht der UndoAction"); 1575 bItsMine=sal_False; 1576 } 1577 1578 void SdrUndoDelPage::Redo() 1579 { 1580 ImpRemovePage(nPageNum); 1581 // Die MasterPage-Beziehungen werden ggf. von selbst geloesst 1582 DBG_ASSERT(!bItsMine,"RedoDeletePage: mrPage gehoert bereits der UndoAction"); 1583 bItsMine=sal_True; 1584 } 1585 1586 XubString SdrUndoDelPage::GetComment() const 1587 { 1588 XubString aStr; 1589 ImpTakeDescriptionStr(STR_UndoDelPage,aStr,0,sal_False); 1590 return aStr; 1591 } 1592 1593 XubString SdrUndoDelPage::GetSdrRepeatComment(SdrView& /*rView*/) const 1594 { 1595 XubString aStr; 1596 ImpTakeDescriptionStr(STR_UndoDelPage,aStr,0,sal_False); 1597 return aStr; 1598 } 1599 1600 void SdrUndoDelPage::SdrRepeat(SdrView& /*rView*/) 1601 { 1602 } 1603 1604 bool SdrUndoDelPage::CanSdrRepeat(SdrView& /*rView*/) const 1605 { 1606 return sal_False; 1607 } 1608 1609 //////////////////////////////////////////////////////////////////////////////////////////////////// 1610 1611 void SdrUndoNewPage::Undo() 1612 { 1613 ImpRemovePage(nPageNum); 1614 DBG_ASSERT(!bItsMine,"UndoNewPage: mrPage gehoert bereits der UndoAction"); 1615 bItsMine=sal_True; 1616 } 1617 1618 void SdrUndoNewPage::Redo() 1619 { 1620 ImpInsertPage(nPageNum); 1621 DBG_ASSERT(bItsMine,"RedoNewPage: mrPage gehoert nicht der UndoAction"); 1622 bItsMine=sal_False; 1623 } 1624 1625 XubString SdrUndoNewPage::GetComment() const 1626 { 1627 XubString aStr; 1628 ImpTakeDescriptionStr(STR_UndoNewPage,aStr,0,sal_False); 1629 return aStr; 1630 } 1631 1632 //////////////////////////////////////////////////////////////////////////////////////////////////// 1633 1634 XubString SdrUndoCopyPage::GetComment() const 1635 { 1636 XubString aStr; 1637 ImpTakeDescriptionStr(STR_UndoCopPage,aStr,0,sal_False); 1638 return aStr; 1639 } 1640 1641 XubString SdrUndoCopyPage::GetSdrRepeatComment(SdrView& /*rView*/) const 1642 { 1643 XubString aStr; 1644 ImpTakeDescriptionStr(STR_UndoCopPage,aStr,0,sal_False); 1645 return aStr; 1646 } 1647 1648 void SdrUndoCopyPage::SdrRepeat(SdrView& /*rView*/) 1649 { 1650 1651 } 1652 1653 bool SdrUndoCopyPage::CanSdrRepeat(SdrView& /*rView*/) const 1654 { 1655 return sal_False; 1656 } 1657 1658 //////////////////////////////////////////////////////////////////////////////////////////////////// 1659 1660 void SdrUndoSetPageNum::Undo() 1661 { 1662 ImpMovePage(nNewPageNum,nOldPageNum); 1663 } 1664 1665 void SdrUndoSetPageNum::Redo() 1666 { 1667 ImpMovePage(nOldPageNum,nNewPageNum); 1668 } 1669 1670 XubString SdrUndoSetPageNum::GetComment() const 1671 { 1672 XubString aStr; 1673 ImpTakeDescriptionStr(STR_UndoMovPage,aStr,0,sal_False); 1674 return aStr; 1675 } 1676 1677 //////////////////////////////////////////////////////////////////////////////////////////////////// 1678 // 1679 // @@ @@ @@@@ @@@@ @@@@@@ @@@@@ @@@@@ @@@@@ @@@@ @@@@ @@@@@ @@@@ 1680 // @@@ @@@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ 1681 // @@@@@@@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ 1682 // @@@@@@@ @@@@@@ @@@@ @@ @@@@ @@@@@ @@@@@ @@@@@@ @@ @@@ @@@@ @@@@ 1683 // @@ @ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ 1684 // @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ @@ 1685 // @@ @@ @@ @@ @@@@ @@ @@@@@ @@ @@ @@ @@ @@ @@@@@ @@@@@ @@@@ 1686 // 1687 //////////////////////////////////////////////////////////////////////////////////////////////////// 1688 1689 SdrUndoPageMasterPage::SdrUndoPageMasterPage(SdrPage& rChangedPage) 1690 : SdrUndoPage(rChangedPage), 1691 mbOldHadMasterPage(mrPage.TRG_HasMasterPage()) 1692 { 1693 // get current state from page 1694 if(mbOldHadMasterPage) 1695 { 1696 maOldSet = mrPage.TRG_GetMasterPageVisibleLayers(); 1697 maOldMasterPageNumber = mrPage.TRG_GetMasterPage().GetPageNum(); 1698 } 1699 } 1700 1701 SdrUndoPageMasterPage::~SdrUndoPageMasterPage() 1702 { 1703 } 1704 1705 //////////////////////////////////////////////////////////////////////////////////////////////////// 1706 1707 SdrUndoPageRemoveMasterPage::SdrUndoPageRemoveMasterPage(SdrPage& rChangedPage) 1708 : SdrUndoPageMasterPage(rChangedPage) 1709 { 1710 } 1711 1712 void SdrUndoPageRemoveMasterPage::Undo() 1713 { 1714 if(mbOldHadMasterPage) 1715 { 1716 mrPage.TRG_SetMasterPage(*mrPage.GetModel()->GetMasterPage(maOldMasterPageNumber)); 1717 mrPage.TRG_SetMasterPageVisibleLayers(maOldSet); 1718 } 1719 } 1720 1721 void SdrUndoPageRemoveMasterPage::Redo() 1722 { 1723 mrPage.TRG_ClearMasterPage(); 1724 } 1725 1726 XubString SdrUndoPageRemoveMasterPage::GetComment() const 1727 { 1728 XubString aStr; 1729 ImpTakeDescriptionStr(STR_UndoDelPageMasterDscr,aStr,0,sal_False); 1730 return aStr; 1731 } 1732 1733 //////////////////////////////////////////////////////////////////////////////////////////////////// 1734 1735 SdrUndoPageChangeMasterPage::SdrUndoPageChangeMasterPage(SdrPage& rChangedPage) 1736 : SdrUndoPageMasterPage(rChangedPage), 1737 mbNewHadMasterPage(sal_False) 1738 { 1739 } 1740 1741 void SdrUndoPageChangeMasterPage::Undo() 1742 { 1743 // remember values from new page 1744 if(mrPage.TRG_HasMasterPage()) 1745 { 1746 mbNewHadMasterPage = sal_True; 1747 maNewSet = mrPage.TRG_GetMasterPageVisibleLayers(); 1748 maNewMasterPageNumber = mrPage.TRG_GetMasterPage().GetPageNum(); 1749 } 1750 1751 // restore old values 1752 if(mbOldHadMasterPage) 1753 { 1754 mrPage.TRG_ClearMasterPage(); 1755 mrPage.TRG_SetMasterPage(*mrPage.GetModel()->GetMasterPage(maOldMasterPageNumber)); 1756 mrPage.TRG_SetMasterPageVisibleLayers(maOldSet); 1757 } 1758 } 1759 1760 void SdrUndoPageChangeMasterPage::Redo() 1761 { 1762 // restore new values 1763 if(mbNewHadMasterPage) 1764 { 1765 mrPage.TRG_ClearMasterPage(); 1766 mrPage.TRG_SetMasterPage(*mrPage.GetModel()->GetMasterPage(maNewMasterPageNumber)); 1767 mrPage.TRG_SetMasterPageVisibleLayers(maNewSet); 1768 } 1769 } 1770 1771 XubString SdrUndoPageChangeMasterPage::GetComment() const 1772 { 1773 XubString aStr; 1774 ImpTakeDescriptionStr(STR_UndoChgPageMasterDscr,aStr,0,sal_False); 1775 return aStr; 1776 } 1777 1778 /////////////////////////////////////////////////////////////////////// 1779 SdrUndoFactory::~SdrUndoFactory(){} 1780 // shapes 1781 SdrUndoAction* SdrUndoFactory::CreateUndoMoveObject( SdrObject& rObject ) 1782 { 1783 return new SdrUndoMoveObj( rObject ); 1784 } 1785 1786 SdrUndoAction* SdrUndoFactory::CreateUndoMoveObject( SdrObject& rObject, const Size& rDist ) 1787 { 1788 return new SdrUndoMoveObj( rObject, rDist ); 1789 } 1790 1791 SdrUndoAction* SdrUndoFactory::CreateUndoGeoObject( SdrObject& rObject ) 1792 { 1793 return new SdrUndoGeoObj( rObject ); 1794 } 1795 1796 SdrUndoAction* SdrUndoFactory::CreateUndoAttrObject( SdrObject& rObject, bool bStyleSheet1, bool bSaveText ) 1797 { 1798 return new SdrUndoAttrObj( rObject, bStyleSheet1 ? sal_True : sal_False, bSaveText ? sal_True : sal_False ); 1799 } 1800 1801 SdrUndoAction* SdrUndoFactory::CreateUndoRemoveObject( SdrObject& rObject, bool bOrdNumDirect ) 1802 { 1803 return new SdrUndoRemoveObj( rObject, bOrdNumDirect ? sal_True : sal_False ); 1804 } 1805 1806 SdrUndoAction* SdrUndoFactory::CreateUndoInsertObject( SdrObject& rObject, bool bOrdNumDirect ) 1807 { 1808 return new SdrUndoInsertObj( rObject, bOrdNumDirect ? sal_True : sal_False ); 1809 } 1810 1811 SdrUndoAction* SdrUndoFactory::CreateUndoDeleteObject( SdrObject& rObject, bool bOrdNumDirect ) 1812 { 1813 return new SdrUndoDelObj( rObject, bOrdNumDirect ? sal_True : sal_False ); 1814 } 1815 1816 SdrUndoAction* SdrUndoFactory::CreateUndoNewObject( SdrObject& rObject, bool bOrdNumDirect ) 1817 { 1818 return new SdrUndoNewObj( rObject, bOrdNumDirect ? sal_True : sal_False ); 1819 } 1820 1821 SdrUndoAction* SdrUndoFactory::CreateUndoCopyObject( SdrObject& rObject, bool bOrdNumDirect ) 1822 { 1823 return new SdrUndoCopyObj( rObject, bOrdNumDirect ? sal_True : sal_False ); 1824 } 1825 1826 SdrUndoAction* SdrUndoFactory::CreateUndoObjectOrdNum( SdrObject& rObject, sal_uInt32 nOldOrdNum1, sal_uInt32 nNewOrdNum1) 1827 { 1828 return new SdrUndoObjOrdNum( rObject, nOldOrdNum1, nNewOrdNum1 ); 1829 } 1830 1831 SdrUndoAction* SdrUndoFactory::CreateUndoReplaceObject( SdrObject& rOldObject, SdrObject& rNewObject, bool bOrdNumDirect ) 1832 { 1833 return new SdrUndoReplaceObj( rOldObject, rNewObject, bOrdNumDirect ? sal_True : sal_False ); 1834 } 1835 1836 SdrUndoAction* SdrUndoFactory::CreateUndoObjectLayerChange( SdrObject& rObject, SdrLayerID aOldLayer, SdrLayerID aNewLayer ) 1837 { 1838 return new SdrUndoObjectLayerChange( rObject, aOldLayer, aNewLayer ); 1839 } 1840 1841 SdrUndoAction* SdrUndoFactory::CreateUndoObjectSetText( SdrObject& rNewObj, sal_Int32 nText ) 1842 { 1843 return new SdrUndoObjSetText( rNewObj, nText ); 1844 } 1845 1846 SdrUndoAction* SdrUndoFactory::CreateUndoObjectStrAttr( SdrObject& rObject, 1847 SdrUndoObjStrAttr::ObjStrAttrType eObjStrAttrType, 1848 String sOldStr, 1849 String sNewStr ) 1850 { 1851 return new SdrUndoObjStrAttr( rObject, eObjStrAttrType, sOldStr, sNewStr ); 1852 } 1853 1854 1855 // layer 1856 SdrUndoAction* SdrUndoFactory::CreateUndoNewLayer(sal_uInt16 nLayerNum, SdrLayerAdmin& rNewLayerAdmin, SdrModel& rNewModel) 1857 { 1858 return new SdrUndoNewLayer( nLayerNum, rNewLayerAdmin, rNewModel ); 1859 } 1860 1861 SdrUndoAction* SdrUndoFactory::CreateUndoDeleteLayer(sal_uInt16 nLayerNum, SdrLayerAdmin& rNewLayerAdmin, SdrModel& rNewModel) 1862 { 1863 return new SdrUndoDelLayer( nLayerNum, rNewLayerAdmin, rNewModel ); 1864 } 1865 1866 SdrUndoAction* SdrUndoFactory::CreateUndoMoveLayer(sal_uInt16 nLayerNum, SdrLayerAdmin& rNewLayerAdmin, SdrModel& rNewModel, sal_uInt16 nNeuPos1) 1867 { 1868 return new SdrUndoMoveLayer( nLayerNum, rNewLayerAdmin, rNewModel, nNeuPos1 ); 1869 } 1870 1871 // page 1872 SdrUndoAction* SdrUndoFactory::CreateUndoDeletePage(SdrPage& rPage) 1873 { 1874 return new SdrUndoDelPage( rPage ); 1875 } 1876 1877 SdrUndoAction* SdrUndoFactory::CreateUndoNewPage(SdrPage& rPage) 1878 { 1879 return new SdrUndoNewPage( rPage ); 1880 } 1881 1882 SdrUndoAction* SdrUndoFactory::CreateUndoCopyPage(SdrPage& rPage) 1883 { 1884 return new SdrUndoCopyPage( rPage ); 1885 } 1886 1887 SdrUndoAction* SdrUndoFactory::CreateUndoSetPageNum(SdrPage& rNewPg, sal_uInt16 nOldPageNum1, sal_uInt16 nNewPageNum1) 1888 { 1889 return new SdrUndoSetPageNum( rNewPg, nOldPageNum1, nNewPageNum1 ); 1890 } 1891 // master page 1892 SdrUndoAction* SdrUndoFactory::CreateUndoPageRemoveMasterPage(SdrPage& rChangedPage) 1893 { 1894 return new SdrUndoPageRemoveMasterPage( rChangedPage ); 1895 } 1896 1897 SdrUndoAction* SdrUndoFactory::CreateUndoPageChangeMasterPage(SdrPage& rChangedPage) 1898 { 1899 return new SdrUndoPageChangeMasterPage(rChangedPage); 1900 } 1901 1902 // eof 1903