diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2015-03-18 20:52:22 +0000 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2015-04-10 12:02:53 +0100 |
commit | cf06c0135d44b8f553940d0fabe03918d61d8a8f (patch) | |
tree | 6477e25690a605b75a4c163fd6d74022f4b90c32 /editeng | |
parent | 4f72ab022425318b109e52a641e63f673fce653d (diff) |
start of unwinding reference OutputDevice & Printer lifecycle.
Change-Id: I066337f46a3c39d1eaba5e7a1f4e1278816a0b27
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/editeng/impedit.hxx | 14 | ||||
-rw-r--r-- | editeng/source/editeng/impedit2.cxx | 6 |
2 files changed, 7 insertions, 13 deletions
diff --git a/editeng/source/editeng/impedit.hxx b/editeng/source/editeng/impedit.hxx index 80101aa37617..ac5db16c7bf3 100644 --- a/editeng/source/editeng/impedit.hxx +++ b/editeng/source/editeng/impedit.hxx @@ -421,8 +421,8 @@ private: SfxStyleSheetPool* pStylePool; SfxItemPool* pTextObjectPool; - VirtualDevice* pVirtDev; - OutputDevice* pRefDev; + VclPtr< VirtualDevice> pVirtDev; + VclPtr< OutputDevice > pRefDev; svtools::ColorConfig* pColorConfig; mutable SvtCTLOptions* pCTLOptions; @@ -663,7 +663,7 @@ private: bool IsForceAutoColor() const { return bForceAutoColor; } inline VirtualDevice* GetVirtualDevice( const MapMode& rMapMode, sal_uLong nDrawMode ); - inline void EraseVirtualDevice(); + inline void EraseVirtualDevice() { pVirtDev.disposeAndClear(); } DECL_LINK(StatusTimerHdl, void *); DECL_LINK(IdleFormatHdl, void *); @@ -874,7 +874,7 @@ public: void UpdateParagraphsWithStyleSheet( SfxStyleSheet* pStyle ); void RemoveStyleFromParagraphs( SfxStyleSheet* pStyle ); - OutputDevice* GetRefDevice() const { return pRefDev; } + OutputDevice* GetRefDevice() const { return pRefDev.get(); } void SetRefDevice( OutputDevice* pRefDef ); const MapMode& GetRefMapMode() { return pRefDev->GetMapMode(); } @@ -1084,12 +1084,6 @@ inline VirtualDevice* ImpEditEngine::GetVirtualDevice( const MapMode& rMapMode, return pVirtDev; } -inline void ImpEditEngine::EraseVirtualDevice() -{ - delete pVirtDev; - pVirtDev = 0; -} - inline void ImpEditEngine::IdleFormatAndUpdate( EditView* pCurView ) { aIdleFormatter.DoIdleFormat( pCurView ); diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx index bb964c193105..14f0826eb86c 100644 --- a/editeng/source/editeng/impedit2.cxx +++ b/editeng/source/editeng/impedit2.cxx @@ -172,7 +172,7 @@ ImpEditEngine::~ImpEditEngine() bDowning = true; SetUpdateMode( false ); - delete pVirtDev; + pVirtDev.disposeAndClear(); delete pEmptyItemSet; delete pUndoManager; delete pTextRanger; @@ -180,14 +180,14 @@ ImpEditEngine::~ImpEditEngine() delete pColorConfig; delete pCTLOptions; if ( bOwnerOfRefDev ) - delete pRefDev; + pRefDev.disposeAndClear(); delete pSpellInfo; } void ImpEditEngine::SetRefDevice( OutputDevice* pRef ) { if ( bOwnerOfRefDev ) - delete pRefDev; + pRefDev.disposeAndClear(); if ( !pRef ) { |