diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2015-03-19 17:21:42 +0000 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2015-04-10 12:22:58 +0100 |
commit | b129ee5021b7f56dfd936d53a46d274880edc0a9 (patch) | |
tree | 6a4ba9d0c514c7bad71be91c9e60ca7512b46885 | |
parent | 23d833dd3fba1c05a7d7552de6037cf3723bbfcc (diff) |
Move OutputDevice members to VclPtr: dbaccess, canvas.
Change-Id: Iae01ddcb6a0cde3be1bd79200e9177983be2f924
-rw-r--r-- | basctl/source/basicide/basdoc.cxx | 3 | ||||
-rw-r--r-- | basctl/source/basicide/basdoc.hxx | 2 | ||||
-rw-r--r-- | canvas/source/cairo/cairo_canvasfont.cxx | 2 | ||||
-rw-r--r-- | canvas/source/cairo/cairo_canvashelper.cxx | 4 | ||||
-rw-r--r-- | canvas/source/cairo/cairo_canvashelper.hxx | 4 | ||||
-rw-r--r-- | canvas/source/cairo/cairo_canvashelper_text.cxx | 4 | ||||
-rw-r--r-- | canvas/source/cairo/cairo_devicehelper.cxx | 2 | ||||
-rw-r--r-- | canvas/source/cairo/cairo_devicehelper.hxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/browser/dataview.cxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/inc/ConnectionLine.hxx | 2 | ||||
-rw-r--r-- | include/vcl/cairo.hxx | 3 | ||||
-rw-r--r-- | vcl/quartz/cairo_quartz_cairo.cxx | 4 | ||||
-rw-r--r-- | vcl/quartz/cairo_quartz_cairo.hxx | 2 | ||||
-rw-r--r-- | vcl/unx/generic/gdi/cairo_xlib_cairo.cxx | 4 | ||||
-rw-r--r-- | vcl/unx/generic/gdi/cairo_xlib_cairo.hxx | 2 | ||||
-rw-r--r-- | vcl/win/source/gdi/cairo_win32_cairo.cxx | 4 | ||||
-rw-r--r-- | vcl/win/source/gdi/cairo_win32_cairo.hxx | 2 |
17 files changed, 27 insertions, 21 deletions
diff --git a/basctl/source/basicide/basdoc.cxx b/basctl/source/basicide/basdoc.cxx index bb58c0943230..ee96c23795e0 100644 --- a/basctl/source/basicide/basdoc.cxx +++ b/basctl/source/basicide/basdoc.cxx @@ -66,7 +66,10 @@ SfxPrinter* DocShell::GetPrinter( bool bCreate ) void DocShell::SetPrinter( SfxPrinter* pPr ) { if (pPr != pPrinter.get()) + { + pPrinter.disposeAndClear(); pPrinter.reset(pPr); + } } void DocShell::FillClass( SvGlobalName*, SotClipboardFormatId*, OUString*, OUString*, OUString*, sal_Int32, bool bTemplate) const diff --git a/basctl/source/basicide/basdoc.hxx b/basctl/source/basicide/basdoc.hxx index 5b6210d5dcab..65bfb8961d51 100644 --- a/basctl/source/basicide/basdoc.hxx +++ b/basctl/source/basicide/basdoc.hxx @@ -33,7 +33,7 @@ namespace basctl class DocShell: public SfxObjectShell { - boost::scoped_ptr<SfxPrinter> pPrinter; + ScopedVclPtr<SfxPrinter> pPrinter; protected: virtual void Draw( OutputDevice *, const JobSetup & rSetup, diff --git a/canvas/source/cairo/cairo_canvasfont.cxx b/canvas/source/cairo/cairo_canvasfont.cxx index 62bf3e2a3a46..be07a54e3c56 100644 --- a/canvas/source/cairo/cairo_canvasfont.cxx +++ b/canvas/source/cairo/cairo_canvasfont.cxx @@ -63,7 +63,7 @@ namespace cairocanvas // adjust to stretched/shrunk font if( !::rtl::math::approxEqual( rFontMatrix.m00, rFontMatrix.m11) ) { - OutputDevice* pOutDev( mpRefDevice->getOutputDevice() ); + VclPtr<OutputDevice> pOutDev( mpRefDevice->getOutputDevice() ); if( pOutDev ) { diff --git a/canvas/source/cairo/cairo_canvashelper.cxx b/canvas/source/cairo/cairo_canvashelper.cxx index 6157ea671020..7a918f4b38be 100644 --- a/canvas/source/cairo/cairo_canvashelper.cxx +++ b/canvas/source/cairo/cairo_canvashelper.cxx @@ -83,7 +83,7 @@ namespace cairocanvas { mpSurface.reset(); mpCairo.reset(); - mpVirtualDevice.reset(); + mpVirtualDevice.disposeAndClear(); mpDevice = NULL; mpSurfaceProvider = NULL; } @@ -105,7 +105,7 @@ namespace cairocanvas void CanvasHelper::setSurface( const SurfaceSharedPtr& pSurface, bool bHasAlpha ) { mbHaveAlpha = bHasAlpha; - mpVirtualDevice.reset(); + mpVirtualDevice.disposeAndClear(); mpSurface = pSurface; mpCairo = pSurface->getCairo(); } diff --git a/canvas/source/cairo/cairo_canvashelper.hxx b/canvas/source/cairo/cairo_canvashelper.hxx index b67904d6ebf5..ed6f702a53aa 100644 --- a/canvas/source/cairo/cairo_canvashelper.hxx +++ b/canvas/source/cairo/cairo_canvashelper.hxx @@ -28,6 +28,8 @@ #include <basegfx/vector/b2dsize.hxx> #include <com/sun/star/rendering/XLinePolyPolygon2D.hpp> +#include <vcl/vclptr.hxx> +#include <vcl/virdev.hxx> #include <boost/utility.hpp> #include <vcl/cairo.hxx> @@ -269,7 +271,7 @@ namespace cairocanvas private: - boost::shared_ptr<VirtualDevice> mpVirtualDevice; + VclPtr<VirtualDevice> mpVirtualDevice; void useStates( const ::com::sun::star::rendering::ViewState& viewState, const ::com::sun::star::rendering::RenderState& renderState, diff --git a/canvas/source/cairo/cairo_canvashelper_text.cxx b/canvas/source/cairo/cairo_canvashelper_text.cxx index f3c4c05083c3..2a98ea7b6e09 100644 --- a/canvas/source/cairo/cairo_canvashelper_text.cxx +++ b/canvas/source/cairo/cairo_canvashelper_text.cxx @@ -175,7 +175,7 @@ namespace cairocanvas class DeviceSettingsGuard { private: - OutputDevice *mpVirtualDevice; + VclPtr<OutputDevice> mpVirtualDevice; cairo_t *mpCairo; bool mbMappingWasEnabled; public: @@ -272,7 +272,7 @@ namespace cairocanvas cairo_fill(mpCairo.get()); #endif ::Point aOutpos; - if( !setupTextOutput( *mpVirtualDevice, pOwner, aOutpos, viewState, renderState, xFont ) ) + if( !setupTextOutput( *mpVirtualDevice.get(), pOwner, aOutpos, viewState, renderState, xFont ) ) return uno::Reference< rendering::XCachedPrimitive >(NULL); // no output necessary // change text direction and layout mode diff --git a/canvas/source/cairo/cairo_devicehelper.cxx b/canvas/source/cairo/cairo_devicehelper.cxx index 9e7ba2e13ca5..684b61afcf2c 100644 --- a/canvas/source/cairo/cairo_devicehelper.cxx +++ b/canvas/source/cairo/cairo_devicehelper.cxx @@ -209,7 +209,7 @@ namespace cairocanvas uno::Any DeviceHelper::getDeviceHandle() const { - return uno::makeAny( reinterpret_cast< sal_Int64 >(mpRefDevice) ); + return uno::makeAny( reinterpret_cast< sal_Int64 >(mpRefDevice.get()) ); } uno::Any DeviceHelper::getSurfaceHandle() const diff --git a/canvas/source/cairo/cairo_devicehelper.hxx b/canvas/source/cairo/cairo_devicehelper.hxx index 81f71810d61d..eafc5065e10b 100644 --- a/canvas/source/cairo/cairo_devicehelper.hxx +++ b/canvas/source/cairo/cairo_devicehelper.hxx @@ -116,7 +116,7 @@ namespace cairocanvas */ SurfaceProvider* mpSurfaceProvider; - OutputDevice* mpRefDevice; + VclPtr<OutputDevice> mpRefDevice; ::cairo::SurfaceSharedPtr mpSurface; }; } diff --git a/dbaccess/source/ui/browser/dataview.cxx b/dbaccess/source/ui/browser/dataview.cxx index 0e8f397a6cc0..7c85660259b2 100644 --- a/dbaccess/source/ui/browser/dataview.cxx +++ b/dbaccess/source/ui/browser/dataview.cxx @@ -42,7 +42,7 @@ namespace dbaui class ColorChanger { protected: - OutputDevice* m_pDev; + VclPtr<OutputDevice> m_pDev; public: ColorChanger( OutputDevice* _pDev, const ::Color& _rNewLineColor, const ::Color& _rNewFillColor ) diff --git a/dbaccess/source/ui/inc/ConnectionLine.hxx b/dbaccess/source/ui/inc/ConnectionLine.hxx index dfa2695e364a..f5bef2a5d5d9 100644 --- a/dbaccess/source/ui/inc/ConnectionLine.hxx +++ b/dbaccess/source/ui/inc/ConnectionLine.hxx @@ -73,7 +73,7 @@ namespace dbaui /// draws a connectionline object on outputdevice struct TConnectionLineDrawFunctor : ::std::unary_function<OConnectionLine*,void> { - OutputDevice* pDevice; + VclPtr<OutputDevice> pDevice; TConnectionLineDrawFunctor(OutputDevice* _pDevice) { pDevice = _pDevice; diff --git a/include/vcl/cairo.hxx b/include/vcl/cairo.hxx index c8cc23e802b3..13983a84d63f 100644 --- a/include/vcl/cairo.hxx +++ b/include/vcl/cairo.hxx @@ -22,6 +22,7 @@ #include <sal/config.h> #include <boost/shared_ptr.hpp> +#include <vcl/vclptr.hxx> typedef struct _cairo_surface cairo_surface_t; typedef struct _cairo cairo_t; @@ -49,7 +50,7 @@ namespace cairo { virtual boost::shared_ptr<Surface> getSimilar(int cairo_content_type, int width, int height) const = 0; /// factory for VirDev on this surface - virtual boost::shared_ptr<VirtualDevice> createVirtualDevice() const = 0; + virtual VclPtr<VirtualDevice> createVirtualDevice() const = 0; /// Resize the surface (possibly destroying content), only possible for X11 typically /// so on failure caller must create a new surface instead diff --git a/vcl/quartz/cairo_quartz_cairo.cxx b/vcl/quartz/cairo_quartz_cairo.cxx index b3a05541c438..cec50a21b60d 100644 --- a/vcl/quartz/cairo_quartz_cairo.cxx +++ b/vcl/quartz/cairo_quartz_cairo.cxx @@ -244,12 +244,12 @@ namespace cairo * * @return The new virtual device **/ - boost::shared_ptr<VirtualDevice> QuartzSurface::createVirtualDevice() const + VclPtr<VirtualDevice> QuartzSurface::createVirtualDevice() const { SystemGraphicsData aSystemGraphicsData; aSystemGraphicsData.nSize = sizeof(SystemGraphicsData); aSystemGraphicsData.rCGContext = getCGContext(); - return boost::shared_ptr<VirtualDevice>( + return VclPtr<VirtualDevice>( new VirtualDevice( &aSystemGraphicsData, Size(1, 1), getDepth() )); } diff --git a/vcl/quartz/cairo_quartz_cairo.hxx b/vcl/quartz/cairo_quartz_cairo.hxx index a3f94d20abf3..9c31c42c6ab9 100644 --- a/vcl/quartz/cairo_quartz_cairo.hxx +++ b/vcl/quartz/cairo_quartz_cairo.hxx @@ -55,7 +55,7 @@ namespace cairo { virtual CairoSurfaceSharedPtr getCairoSurface() const { return mpSurface; } virtual SurfaceSharedPtr getSimilar( Content aContent, int width, int height ) const; - virtual boost::shared_ptr<VirtualDevice> createVirtualDevice() const; + virtual VclPtr<VirtualDevice> createVirtualDevice() const; virtual void flush() const; diff --git a/vcl/unx/generic/gdi/cairo_xlib_cairo.cxx b/vcl/unx/generic/gdi/cairo_xlib_cairo.cxx index bf58b95bf4bb..99944d1909b6 100644 --- a/vcl/unx/generic/gdi/cairo_xlib_cairo.cxx +++ b/vcl/unx/generic/gdi/cairo_xlib_cairo.cxx @@ -257,7 +257,7 @@ namespace cairo &cairo_surface_destroy ))); } - boost::shared_ptr<VirtualDevice> X11Surface::createVirtualDevice() const + VclPtr<VirtualDevice> X11Surface::createVirtualDevice() const { SystemGraphicsData aSystemGraphicsData; @@ -268,7 +268,7 @@ namespace cairo int width = cairo_xlib_surface_get_width(mpSurface.get()); int height = cairo_xlib_surface_get_height(mpSurface.get()); - return boost::shared_ptr<VirtualDevice>( + return VclPtr<VirtualDevice>( new VirtualDevice(&aSystemGraphicsData, Size(width, height), std::max(getDepth(), 0))); diff --git a/vcl/unx/generic/gdi/cairo_xlib_cairo.hxx b/vcl/unx/generic/gdi/cairo_xlib_cairo.hxx index 166ebaf0a882..5be944f87e42 100644 --- a/vcl/unx/generic/gdi/cairo_xlib_cairo.hxx +++ b/vcl/unx/generic/gdi/cairo_xlib_cairo.hxx @@ -87,7 +87,7 @@ namespace cairo { virtual CairoSurfaceSharedPtr getCairoSurface() const SAL_OVERRIDE { return mpSurface; } virtual SurfaceSharedPtr getSimilar(int cairo_content_type, int width, int height) const SAL_OVERRIDE; - virtual boost::shared_ptr<VirtualDevice> createVirtualDevice() const SAL_OVERRIDE; + virtual VclPtr<VirtualDevice> createVirtualDevice() const SAL_OVERRIDE; virtual bool Resize( int width, int height ) SAL_OVERRIDE; diff --git a/vcl/win/source/gdi/cairo_win32_cairo.cxx b/vcl/win/source/gdi/cairo_win32_cairo.cxx index 9cf81c7002de..357106724e1a 100644 --- a/vcl/win/source/gdi/cairo_win32_cairo.cxx +++ b/vcl/win/source/gdi/cairo_win32_cairo.cxx @@ -170,13 +170,13 @@ namespace cairo * * @return The new virtual device **/ - boost::shared_ptr<VirtualDevice> Win32Surface::createVirtualDevice() const + VclPtr<VirtualDevice> Win32Surface::createVirtualDevice() const { SystemGraphicsData aSystemGraphicsData; aSystemGraphicsData.nSize = sizeof(SystemGraphicsData); aSystemGraphicsData.hDC = cairo_win32_surface_get_dc( mpSurface.get() ); - return boost::shared_ptr<VirtualDevice>( + return VclPtr<VirtualDevice>( new VirtualDevice( &aSystemGraphicsData, Size(1, 1), sal::static_int_cast<USHORT>(getDepth()) )); } diff --git a/vcl/win/source/gdi/cairo_win32_cairo.hxx b/vcl/win/source/gdi/cairo_win32_cairo.hxx index dd1be37db7dd..5dee0eaa3dd8 100644 --- a/vcl/win/source/gdi/cairo_win32_cairo.hxx +++ b/vcl/win/source/gdi/cairo_win32_cairo.hxx @@ -43,7 +43,7 @@ namespace cairo { virtual CairoSurfaceSharedPtr getCairoSurface() const { return mpSurface; } virtual SurfaceSharedPtr getSimilar( int aContent, int width, int height ) const; - virtual boost::shared_ptr<VirtualDevice> createVirtualDevice() const; + virtual VclPtr<VirtualDevice> createVirtualDevice() const; virtual void flush() const; |