diff options
author | Marco Cecchetti <marco.cecchetti@collabora.com> | 2017-01-01 12:43:45 +0100 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2017-03-29 13:19:00 +0000 |
commit | f0c0d58467e28e24fedc6ce27b2db03e316dce9f (patch) | |
tree | b03aa22f0574bd18ecbca66fcf839a51aeeefa0a /include | |
parent | 92716ab11b8eaf3e2d490f7005f174f90c5b2420 (diff) |
Calc: safer life cycle handling for OutputDevice in SdrPaintWindow
Change-Id: I5469332c4ef98bce8cd9c2caff5bf61dbf102b23
Reviewed-on: https://gerrit.libreoffice.org/35216
Tested-by: Jan Holesovsky <kendy@collabora.com>
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/svx/sdrpaintwindow.hxx | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/include/svx/sdrpaintwindow.hxx b/include/svx/sdrpaintwindow.hxx index 25c51c52563b..bcb0b0a8c843 100644 --- a/include/svx/sdrpaintwindow.hxx +++ b/include/svx/sdrpaintwindow.hxx @@ -46,7 +46,7 @@ PaintTransparentChildren(vcl::Window & rWindow, Rectangle const& rPixelRect); class SdrPreRenderDevice { // The original OutputDevice - OutputDevice& mrOutputDevice; + VclPtr<OutputDevice> mpOutputDevice; // The VirtualDevice for PreRendering VclPtr<VirtualDevice> mpPreRenderDevice; @@ -65,7 +65,7 @@ class SVX_DLLPUBLIC SdrPaintWindow { private: // the OutputDevice this window represents - OutputDevice& mrOutputDevice; + VclPtr<OutputDevice> mpOutputDevice; /// In case mrOutputDevice is a buffer for a vcl::Window, this is the window. VclPtr<vcl::Window> mpWindow; @@ -95,7 +95,7 @@ public: // data read accesses SdrPaintView& GetPaintView() const { return mrPaintView; } - OutputDevice& GetOutputDevice() const { return mrOutputDevice; } + OutputDevice& GetOutputDevice() const { return *mpOutputDevice.get(); } vcl::Window* GetWindow() const { return mpWindow; } // OVERLAYMANAGER @@ -108,13 +108,13 @@ public: Rectangle GetVisibleArea() const; // Is OutDev a printer? - bool OutputToPrinter() const { return (OUTDEV_PRINTER == mrOutputDevice.GetOutDevType()); } + bool OutputToPrinter() const { return (OUTDEV_PRINTER == mpOutputDevice->GetOutDevType()); } // Is OutDev a window? - bool OutputToWindow() const { return (OUTDEV_WINDOW == mrOutputDevice.GetOutDevType()); } + bool OutputToWindow() const { return (OUTDEV_WINDOW == mpOutputDevice->GetOutDevType()); } // Is OutDev a VirtualDevice? - bool OutputToVirtualDevice() const { return (OUTDEV_VIRDEV == mrOutputDevice.GetOutDevType()); } + bool OutputToVirtualDevice() const { return (OUTDEV_VIRDEV == mpOutputDevice->GetOutDevType()); } // Is OutDev a recording MetaFile? bool OutputToRecordingMetaFile() const; @@ -134,7 +134,7 @@ public: void setTemporaryTarget(bool bNew) { mbTemporaryTarget = bNew; } // #i72889# get target output device, take into account output buffering - OutputDevice& GetTargetOutputDevice() { if(mpPreRenderDevice) return mpPreRenderDevice->GetPreRenderDevice(); else return mrOutputDevice; } + OutputDevice& GetTargetOutputDevice() { if(mpPreRenderDevice) return mpPreRenderDevice->GetPreRenderDevice(); else return *mpOutputDevice.get(); } }; // typedefs for a list of SdrPaintWindows |