View | Details | Raw Unified | Return to issue 120015
Collapse All | Expand All

(-)main/svx/inc/svx/svdundo.hxx (-2 / +6 lines)
Lines 33-44 Link Here
33
#include <svx/svdtypes.hxx> // fuer enum RepeatFuncts
33
#include <svx/svdtypes.hxx> // fuer enum RepeatFuncts
34
#include <svx/svdsob.hxx>
34
#include <svx/svdsob.hxx>
35
#include "svx/svxdllapi.h"
35
#include "svx/svxdllapi.h"
36
36
#include <svl/lstner.hxx> 
37
//************************************************************
37
//************************************************************
38
//   Vorausdeklarationen
38
//   Vorausdeklarationen
39
//************************************************************
39
//************************************************************
40
40
41
class SfxItemSet;
41
class SfxItemSet;
42
class SfxStyleSheetBase;
42
class SfxStyleSheet;
43
class SfxStyleSheet;
43
class SdrView;
44
class SdrView;
44
class SdrPageView;
45
class SdrPageView;
Lines 158-164 Link Here
158
//
159
//
159
//************************************************************
160
//************************************************************
160
161
161
class SVX_DLLPUBLIC SdrUndoAttrObj : public SdrUndoObj
162
class SVX_DLLPUBLIC SdrUndoAttrObj : public SdrUndoObj , public SfxListener    
162
{
163
{
163
protected:
164
protected:
164
	SfxItemSet*					pUndoSet;
165
	SfxItemSet*					pUndoSet;
Lines 193-198 Link Here
193
194
194
	virtual void SdrRepeat(SdrView& rView);
195
	virtual void SdrRepeat(SdrView& rView);
195
	virtual bool CanSdrRepeat(SdrView& rView) const;
196
	virtual bool CanSdrRepeat(SdrView& rView) const;
197
198
	virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint);
199
	void	ReplaceSpecStyleByDefault(SfxStyleSheetBase* pStyle, SfxStyleSheet* pDef);
196
};
200
};
197
201
198
//************************************************************
202
//************************************************************
(-)main/svx/source/svdraw/svdundo.cxx (+46 lines)
Lines 45-50 Link Here
45
45
46
#include "svx/svdviter.hxx"
46
#include "svx/svdviter.hxx"
47
47
48
49
#ifndef _SFXSTYLE_HXX
50
#include <svtools/style.hxx>
51
#endif
48
////////////////////////////////////////////////////////////////////////////////////////////////////
52
////////////////////////////////////////////////////////////////////////////////////////////////////
49
53
50
// iterates over all views and unmarks this SdrObject if it is marked
54
// iterates over all views and unmarks this SdrObject if it is marked
Lines 335-341 Link Here
335
		pUndoSet = new SfxItemSet(pObj->GetMergedItemSet());
339
		pUndoSet = new SfxItemSet(pObj->GetMergedItemSet());
336
340
337
		if(bStyleSheet)
341
		if(bStyleSheet)
342
		{
338
			pUndoStyleSheet = pObj->GetStyleSheet();
343
			pUndoStyleSheet = pObj->GetStyleSheet();
344
			if(pUndoStyleSheet && pUndoStyleSheet!=pObj->GetModel()->GetDefaultStyleSheet() )
345
				StartListening(*pUndoStyleSheet);     
346
		}
339
347
340
		if(bSaveText)
348
		if(bSaveText)
341
		{
349
		{
Lines 362-367 Link Here
362
	// #i8508#
370
	// #i8508#
363
	if(pTextRedo)
371
	if(pTextRedo)
364
		delete pTextRedo;
372
		delete pTextRedo;
373
374
    if(pUndoStyleSheet && pUndoStyleSheet!=pObj->GetModel()->GetDefaultStyleSheet())
375
		EndListening(*pUndoStyleSheet);    
376
	if(pRedoStyleSheet && pRedoStyleSheet !=pObj->GetModel()->GetDefaultStyleSheet())
377
		EndListening(*pRedoStyleSheet);    
365
}
378
}
366
379
367
void SdrUndoAttrObj::SetRepeatAttr(const SfxItemSet& rSet)
380
void SdrUndoAttrObj::SetRepeatAttr(const SfxItemSet& rSet)
Lines 372-377 Link Here
372
	pRepeatSet = new SfxItemSet(rSet);
385
	pRepeatSet = new SfxItemSet(rSet);
373
}
386
}
374
387
388
389
void SdrUndoAttrObj::Notify(SfxBroadcaster& /*rBC*/, const SfxHint& rHint)
390
{
391
	SfxStyleSheetHint *pStyleHint = PTR_CAST(SfxStyleSheetHint, &rHint);
392
393
	if(pStyleHint && pStyleHint->GetStyleSheet())
394
	{
395
			if(pStyleHint->GetHint() == SFX_STYLESHEET_ERASED  ||
396
				pStyleHint->GetHint() == SFX_STYLESHEET_INDESTRUCTION)
397
			{
398
				ReplaceSpecStyleByDefault(pStyleHint->GetStyleSheet(), pObj->GetModel()->GetDefaultStyleSheet());
399
			}
400
	}
401
}
402
403
void SdrUndoAttrObj::ReplaceSpecStyleByDefault(SfxStyleSheetBase* pStyle, SfxStyleSheet* pDef)
404
{
405
	if (pUndoStyleSheet == pStyle && pUndoStyleSheet != pObj->GetModel()->GetDefaultStyleSheet())
406
	{
407
		EndListening(*pUndoStyleSheet);  
408
		pUndoStyleSheet = pDef;
409
	}
410
	if (pRedoStyleSheet == pStyle  && pRedoStyleSheet != pObj->GetModel()->GetDefaultStyleSheet())
411
	{
412
		EndListening(*pRedoStyleSheet);  
413
		pRedoStyleSheet = pDef;
414
	}
415
	if (pRepeatStyleSheet == pStyle)
416
		pRepeatStyleSheet = pDef;
417
}
418
375
void SdrUndoAttrObj::Undo()
419
void SdrUndoAttrObj::Undo()
376
{
420
{
377
    E3DModifySceneSnapRectUpdater aUpdater(pObj);
421
    E3DModifySceneSnapRectUpdater aUpdater(pObj);
Lines 410-415 Link Here
410
		{
454
		{
411
			pRedoStyleSheet = pObj->GetStyleSheet();
455
			pRedoStyleSheet = pObj->GetStyleSheet();
412
			pObj->SetStyleSheet(pUndoStyleSheet, sal_True);
456
			pObj->SetStyleSheet(pUndoStyleSheet, sal_True);
457
			if(pRedoStyleSheet && pRedoStyleSheet != pObj->GetModel()->GetDefaultStyleSheet())
458
				StartListening(*pRedoStyleSheet);     
413
		}
459
		}
414
460
415
		sdr::properties::ItemChangeBroadcaster aItemChange(*pObj);
461
		sdr::properties::ItemChangeBroadcaster aItemChange(*pObj);

Return to issue 120015