diff options
author | Marco Cecchetti <marco.cecchetti@collabora.com> | 2017-01-01 12:43:45 +0100 |
---|---|---|
committer | Marco Cecchetti <mrcekets@gmail.com> | 2017-03-15 13:23:11 +0000 |
commit | d369d433f759b1e9b6cfce80b94320d9f1267fbc (patch) | |
tree | bd2e7b258c0be6522e63e8d10fa60a8c5285fc90 /include | |
parent | c501fbe8cd7cfd8048aca1bce89144e7ca0d702a (diff) |
Calc: safer life cycle handling for OutputDevice in SdrPaintWindow
Change-Id: I5469332c4ef98bce8cd9c2caff5bf61dbf102b23
Reviewed-on: https://gerrit.libreoffice.org/32688
Reviewed-by: Marco Cecchetti <mrcekets@gmail.com>
Tested-by: Marco Cecchetti <mrcekets@gmail.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 6519984252b8..614bbe0bb187 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; @@ -102,7 +102,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 @@ -115,13 +115,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; @@ -141,7 +141,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 |