svdundo.cxx (52dfbe32) svdundo.cxx (6b46875c)
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

--- 276 unchanged lines hidden (view full) ---

285 aHint.SetPage(pObj->GetPage());
286
287 pObj->GetModel()->Broadcast(aHint);
288 }
289}
290
291////////////////////////////////////////////////////////////////////////////////////////////////////
292
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

--- 276 unchanged lines hidden (view full) ---

285 aHint.SetPage(pObj->GetPage());
286
287 pObj->GetModel()->Broadcast(aHint);
288 }
289}
290
291////////////////////////////////////////////////////////////////////////////////////////////////////
292
293void 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
293SdrUndoAttrObj::SdrUndoAttrObj(SdrObject& rNewObj, FASTBOOL bStyleSheet1, FASTBOOL bSaveText)
294: SdrUndoObj(rNewObj),
295 pUndoSet(NULL),
296 pRedoSet(NULL),
297 pRepeatSet(NULL),
309SdrUndoAttrObj::SdrUndoAttrObj(SdrObject& rNewObj, FASTBOOL bStyleSheet1, FASTBOOL bSaveText)
310: SdrUndoObj(rNewObj),
311 pUndoSet(NULL),
312 pRedoSet(NULL),
313 pRepeatSet(NULL),
298 pUndoStyleSheet(NULL),
299 pRedoStyleSheet(NULL),
300 pRepeatStyleSheet(NULL),
314 mxUndoStyleSheet(),
315 mxRedoStyleSheet(),
301 bHaveToTakeRedoSet(sal_True),
302 pTextUndo(NULL),
303
304 // #i8508#
305 pTextRedo(NULL),
306
307 pUndoGroup(NULL)
308{

--- 21 unchanged lines hidden (view full) ---

330 if(pUndoSet)
331 {
332 delete pUndoSet;
333 }
334
335 pUndoSet = new SfxItemSet(pObj->GetMergedItemSet());
336
337 if(bStyleSheet)
316 bHaveToTakeRedoSet(sal_True),
317 pTextUndo(NULL),
318
319 // #i8508#
320 pTextRedo(NULL),
321
322 pUndoGroup(NULL)
323{

--- 21 unchanged lines hidden (view full) ---

345 if(pUndoSet)
346 {
347 delete pUndoSet;
348 }
349
350 pUndoSet = new SfxItemSet(pObj->GetMergedItemSet());
351
352 if(bStyleSheet)
338 pUndoStyleSheet = pObj->GetStyleSheet();
353 mxUndoStyleSheet = pObj->GetStyleSheet();
339
340 if(bSaveText)
341 {
342 pTextUndo = pObj->GetOutlinerParaObject();
343 if(pTextUndo)
344 pTextUndo = new OutlinerParaObject(*pTextUndo);
345 }
346 }

--- 42 unchanged lines hidden (view full) ---

389 if(pRedoSet)
390 {
391 delete pRedoSet;
392 }
393
394 pRedoSet = new SfxItemSet(pObj->GetMergedItemSet());
395
396 if(bStyleSheet)
354
355 if(bSaveText)
356 {
357 pTextUndo = pObj->GetOutlinerParaObject();
358 if(pTextUndo)
359 pTextUndo = new OutlinerParaObject(*pTextUndo);
360 }
361 }

--- 42 unchanged lines hidden (view full) ---

404 if(pRedoSet)
405 {
406 delete pRedoSet;
407 }
408
409 pRedoSet = new SfxItemSet(pObj->GetMergedItemSet());
410
411 if(bStyleSheet)
397 pRedoStyleSheet=pObj->GetStyleSheet();
412 mxRedoStyleSheet = pObj->GetStyleSheet();
398
399 if(pTextUndo)
400 {
401 // #i8508#
402 pTextRedo = pObj->GetOutlinerParaObject();
403
404 if(pTextRedo)
405 pTextRedo = new OutlinerParaObject(*pTextRedo);
406 }
407 }
408
409 if(bStyleSheet)
410 {
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 {
411 pRedoStyleSheet = pObj->GetStyleSheet();
412 pObj->SetStyleSheet(pUndoStyleSheet, sal_True);
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 }
413 }
414
415 sdr::properties::ItemChangeBroadcaster aItemChange(*pObj);
416
417 // #105122# Since ClearItem sets back everything to normal
418 // it also sets fit-to-size text to non-fit-to-size text and
419 // switches on autogrowheight (the default). That may lead to
420 // loosing the geometry size info for the object when it is

--- 56 unchanged lines hidden (view full) ---

477{
478 E3DModifySceneSnapRectUpdater aUpdater(pObj);
479 sal_Bool bIs3DScene(pObj && pObj->ISA(E3dScene));
480
481 if(!pUndoGroup || bIs3DScene)
482 {
483 if(bStyleSheet)
484 {
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

--- 56 unchanged lines hidden (view full) ---

502{
503 E3DModifySceneSnapRectUpdater aUpdater(pObj);
504 sal_Bool bIs3DScene(pObj && pObj->ISA(E3dScene));
505
506 if(!pUndoGroup || bIs3DScene)
507 {
508 if(bStyleSheet)
509 {
485 pUndoStyleSheet = pObj->GetStyleSheet();
486 pObj->SetStyleSheet(pRedoStyleSheet, sal_True);
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 }
487 }
488
489 sdr::properties::ItemChangeBroadcaster aItemChange(*pObj);
490
491 // #105122#
492 const Rectangle aSnapRect = pObj->GetSnapRect();
493
494 if(pRedoSet)

--- 1373 unchanged lines hidden ---
522 }
523
524 sdr::properties::ItemChangeBroadcaster aItemChange(*pObj);
525
526 // #105122#
527 const Rectangle aSnapRect = pObj->GetSnapRect();
528
529 if(pRedoSet)

--- 1373 unchanged lines hidden ---