From 09b546cf9c1d0d9f78066e70a0348c7678cdcb14 Mon Sep 17 00:00:00 2001 From: Thorsten Behrens Date: Fri, 8 Apr 2011 16:44:28 +0200 Subject: Fix overloaded-virtual warning in canvas With enabled -Woverloaded-virtual gcc warning (see http://lists.freedesktop.org/archives/libreoffice/2011-March/009567.html), canvas exposed a nasty clash between WeakComponentImplHelper::disposing and XEventListener::disposing. Fixed by overriding *once* in baseclass, and then calling disambiguated, renamed methods. --- canvas/inc/canvas/base/basemutexhelper.hxx | 72 ----------------- .../inc/canvas/base/bufferedgraphicdevicebase.hxx | 11 ++- canvas/inc/canvas/base/canvasbase.hxx | 7 +- canvas/inc/canvas/base/canvascustomspritebase.hxx | 4 +- canvas/inc/canvas/base/disambiguationhelper.hxx | 90 ++++++++++++++++++++++ canvas/inc/canvas/base/graphicdevicebase.hxx | 9 +-- canvas/inc/canvas/base/spritecanvasbase.hxx | 7 +- canvas/source/cairo/cairo_canvas.cxx | 4 +- canvas/source/cairo/cairo_canvas.hxx | 10 +-- canvas/source/cairo/cairo_canvasbitmap.cxx | 4 +- canvas/source/cairo/cairo_canvasbitmap.hxx | 4 +- canvas/source/cairo/cairo_canvascustomsprite.cxx | 4 +- canvas/source/cairo/cairo_canvascustomsprite.hxx | 6 +- canvas/source/cairo/cairo_spritecanvas.cxx | 4 +- canvas/source/cairo/cairo_spritecanvas.hxx | 10 +-- canvas/source/directx/dx_canvas.cxx | 8 +- canvas/source/directx/dx_canvas.hxx | 10 +-- canvas/source/directx/dx_canvasbitmap.cxx | 4 +- canvas/source/directx/dx_canvasbitmap.hxx | 6 +- canvas/source/directx/dx_canvascustomsprite.cxx | 4 +- canvas/source/directx/dx_canvascustomsprite.hxx | 6 +- canvas/source/directx/dx_spritecanvas.cxx | 4 +- canvas/source/directx/dx_spritecanvas.hxx | 7 +- canvas/source/null/null_canvasbitmap.cxx | 4 +- canvas/source/null/null_canvasbitmap.hxx | 5 +- canvas/source/null/null_canvascustomsprite.cxx | 4 +- canvas/source/null/null_canvascustomsprite.hxx | 8 +- canvas/source/null/null_spritecanvas.cxx | 4 +- canvas/source/null/null_spritecanvas.hxx | 10 +-- canvas/source/vcl/canvas.cxx | 4 +- canvas/source/vcl/canvas.hxx | 10 +-- canvas/source/vcl/canvasbitmap.cxx | 6 -- canvas/source/vcl/canvasbitmap.hxx | 5 +- canvas/source/vcl/canvascustomsprite.cxx | 8 -- canvas/source/vcl/canvascustomsprite.hxx | 6 +- canvas/source/vcl/spritecanvas.cxx | 4 +- canvas/source/vcl/spritecanvas.hxx | 10 +-- 37 files changed, 177 insertions(+), 206 deletions(-) delete mode 100644 canvas/inc/canvas/base/basemutexhelper.hxx create mode 100644 canvas/inc/canvas/base/disambiguationhelper.hxx (limited to 'canvas') diff --git a/canvas/inc/canvas/base/basemutexhelper.hxx b/canvas/inc/canvas/base/basemutexhelper.hxx deleted file mode 100644 index c1c7eed8455e..000000000000 --- a/canvas/inc/canvas/base/basemutexhelper.hxx +++ /dev/null @@ -1,72 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef INCLUDED_CANVAS_BASEMUTEXHELPER_HXX -#define INCLUDED_CANVAS_BASEMUTEXHELPER_HXX - -#include - - -/* Definition of the BaseMutexHelper class */ - -namespace canvas -{ - /** Base class, deriving from ::comphelper::OBaseMutex and - initializing its own baseclass with m_aMutex. - - This is necessary to make the CanvasBase, GraphicDeviceBase, - etc. classes freely combinable - letting them perform this - initialization would prohibit deriving e.g. CanvasBase from - GraphicDeviceBase. - */ - template< class Base > class BaseMutexHelper : public Base - { - public: - typedef Base BaseType; - - /** Construct BaseMutexHelper - - This method is the whole purpose of this template: - initializing a base class with the provided m_aMutex - member (the WeakComponentImplHelper templates need that, - as they require the lifetime of the mutex to extend - theirs). - */ - BaseMutexHelper() : - BaseType( m_aMutex ) - { - } - -protected: - mutable ::osl::Mutex m_aMutex; - }; -} - -#endif /* INCLUDED_CANVAS_BASEMUTEXHELPER_HXX */ - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/canvas/inc/canvas/base/bufferedgraphicdevicebase.hxx b/canvas/inc/canvas/base/bufferedgraphicdevicebase.hxx index 9e31473ba589..9317c8230bc6 100644 --- a/canvas/inc/canvas/base/bufferedgraphicdevicebase.hxx +++ b/canvas/inc/canvas/base/bufferedgraphicdevicebase.hxx @@ -183,10 +183,7 @@ namespace canvas return ::com::sun::star::uno::makeAny(mxWindow); } -#if defined __SUNPRO_CC - using Base::disposing; -#endif - virtual void SAL_CALL disposing() + virtual void disposeThis() { typename BaseType::MutexType aGuard( BaseType::m_aMutex ); @@ -197,7 +194,7 @@ namespace canvas } // pass on to base class - BaseType::disposing(); + BaseType::disposeThis(); } ::com::sun::star::awt::Rectangle transformBounds( const ::com::sun::star::awt::Rectangle& rBounds ) @@ -234,12 +231,14 @@ namespace canvas } // XWindowListener - virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException) + virtual void SAL_CALL disposeEventSource( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException) { typename BaseType::MutexType aGuard( BaseType::m_aMutex ); if( Source.Source == mxWindow ) mxWindow.clear(); + + BaseType::disposeEventSource(Source); } virtual void SAL_CALL windowResized( const ::com::sun::star::awt::WindowEvent& e ) throw (::com::sun::star::uno::RuntimeException) diff --git a/canvas/inc/canvas/base/canvasbase.hxx b/canvas/inc/canvas/base/canvasbase.hxx index 204355da93c3..7afcf9f8aea7 100644 --- a/canvas/inc/canvas/base/canvasbase.hxx +++ b/canvas/inc/canvas/base/canvasbase.hxx @@ -120,17 +120,14 @@ namespace canvas { } -#if defined __SUNPRO_CC - using Base::disposing; -#endif - virtual void SAL_CALL disposing() + virtual void disposeThis() { MutexType aGuard( BaseType::m_aMutex ); maCanvasHelper.disposing(); // pass on to base class - BaseType::disposing(); + BaseType::disposeThis(); } // XCanvas diff --git a/canvas/inc/canvas/base/canvascustomspritebase.hxx b/canvas/inc/canvas/base/canvascustomspritebase.hxx index ec4477ab9cc9..a5c026a74311 100644 --- a/canvas/inc/canvas/base/canvascustomspritebase.hxx +++ b/canvas/inc/canvas/base/canvascustomspritebase.hxx @@ -103,14 +103,14 @@ namespace canvas @derive when overriding this method in derived classes, always call the base class' method! */ - virtual void SAL_CALL disposing() + virtual void disposeThis() { typename BaseType::MutexType aGuard( BaseType::m_aMutex ); maSpriteHelper.disposing(); // pass on to base class - BaseType::disposing(); + BaseType::disposeThis(); } // XCanvas: selectively override base's methods here, for opacity tracking diff --git a/canvas/inc/canvas/base/disambiguationhelper.hxx b/canvas/inc/canvas/base/disambiguationhelper.hxx new file mode 100644 index 000000000000..b58ed29ea289 --- /dev/null +++ b/canvas/inc/canvas/base/disambiguationhelper.hxx @@ -0,0 +1,90 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef INCLUDED_CANVAS_DISAMBIGUATIONHELPER_HXX +#define INCLUDED_CANVAS_DISAMBIGUATIONHELPER_HXX + +#include + + +/* Definition of the DisambiguationHelper class */ + +namespace canvas +{ + /** Base class, initializing its own baseclass with m_aMutex. + + This is necessary to make the CanvasBase, GraphicDeviceBase, + etc. classes freely combinable - letting them perform this + initialization would prohibit deriving e.g. CanvasBase from + GraphicDeviceBase. + + On top of that, disambiguates XEventListener::disposing and + WeakComponentImplHelper::disposing. + + Having two virtual methods with the same name, and not + overriding them in every derived class, will hide one of + them. Later trying to override the same method, will generate + a new vtable slot, and lead to very hard to spot errors. + */ + template< class Base > class DisambiguationHelper : public Base + { + public: + typedef Base BaseType; + + /** Construct DisambiguationHelper + + This method is the whole purpose of this template: + initializing a base class with the provided m_aMutex + member (the WeakComponentImplHelper templates need that, + as they require the lifetime of the mutex to extend + theirs). + */ + DisambiguationHelper() : + BaseType( m_aMutex ) + { + } + + virtual void SAL_CALL disposing() + { disposeThis(); } + + virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException) + { disposeEventSource(Source); } + + virtual void disposeThis() + {} + virtual void disposeEventSource( const ::com::sun::star::lang::EventObject& ) throw (::com::sun::star::uno::RuntimeException) + {} + +protected: + mutable ::osl::Mutex m_aMutex; + }; +} + +#endif /* INCLUDED_CANVAS_DISAMBIGUATIONHELPER_HXX */ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/canvas/inc/canvas/base/graphicdevicebase.hxx b/canvas/inc/canvas/base/graphicdevicebase.hxx index 62424e4cdabd..b8baee2417b9 100644 --- a/canvas/inc/canvas/base/graphicdevicebase.hxx +++ b/canvas/inc/canvas/base/graphicdevicebase.hxx @@ -95,7 +95,7 @@ namespace canvas @tpl Mutex Lock strategy to use. Defaults to using the - BaseMutexHelper-provided lock. Everytime one of the methods is + DisambiguationHelper-provided lock. Everytime one of the methods is entered, an object of type Mutex is created with m_aMutex as the sole parameter, and destroyed again when the method scope is left. @@ -144,17 +144,14 @@ namespace canvas _1))); } -#if defined __SUNPRO_CC - using Base::disposing; -#endif - virtual void SAL_CALL disposing() + virtual void disposeThis() { MutexType aGuard( BaseType::m_aMutex ); maDeviceHelper.disposing(); // pass on to base class - cppu::WeakComponentImplHelperBase::disposing(); + BaseType::disposeThis(); } // XGraphicDevice diff --git a/canvas/inc/canvas/base/spritecanvasbase.hxx b/canvas/inc/canvas/base/spritecanvasbase.hxx index 1cf255fe5579..47134abfc2d5 100644 --- a/canvas/inc/canvas/base/spritecanvasbase.hxx +++ b/canvas/inc/canvas/base/spritecanvasbase.hxx @@ -86,17 +86,14 @@ namespace canvas { } -#if defined __SUNPRO_CC - using Base::disposing; -#endif - virtual void SAL_CALL disposing() + virtual void disposeThis() { typename BaseType::MutexType aGuard( BaseType::m_aMutex ); maRedrawManager.disposing(); // pass on to base class - BaseType::disposing(); + BaseType::disposeThis(); } // XSpriteCanvas diff --git a/canvas/source/cairo/cairo_canvas.cxx b/canvas/source/cairo/cairo_canvas.cxx index 9903dade4863..802006d59110 100644 --- a/canvas/source/cairo/cairo_canvas.cxx +++ b/canvas/source/cairo/cairo_canvas.cxx @@ -131,14 +131,14 @@ namespace cairocanvas OSL_TRACE( "CairoCanvas destroyed" ); } - void SAL_CALL Canvas::disposing() + void Canvas::disposeThis() { ::osl::MutexGuard aGuard( m_aMutex ); mxComponentContext.clear(); // forward to parent - CanvasBaseT::disposing(); + CanvasBaseT::disposeThis(); } ::rtl::OUString SAL_CALL Canvas::getServiceName( ) throw (uno::RuntimeException) diff --git a/canvas/source/cairo/cairo_canvas.hxx b/canvas/source/cairo/cairo_canvas.hxx index 02837d03f6b6..aec8713f8fe9 100644 --- a/canvas/source/cairo/cairo_canvas.hxx +++ b/canvas/source/cairo/cairo_canvas.hxx @@ -47,7 +47,7 @@ #include #include -#include +#include #include #include @@ -69,7 +69,7 @@ namespace cairocanvas ::com::sun::star::util::XUpdatable, ::com::sun::star::beans::XPropertySet, ::com::sun::star::lang::XServiceName > GraphicDeviceBase_Base; - typedef ::canvas::GraphicDeviceBase< ::canvas::BaseMutexHelper< GraphicDeviceBase_Base >, + typedef ::canvas::GraphicDeviceBase< ::canvas::DisambiguationHelper< GraphicDeviceBase_Base >, DeviceHelper, ::osl::MutexGuard, ::cppu::OWeakObject > CanvasBase_Base; @@ -122,12 +122,8 @@ namespace cairocanvas /// For resource tracking ~Canvas(); -#if defined __SUNPRO_CC - using CanvasBaseT::disposing; -#endif - /// Dispose all internal references - virtual void SAL_CALL disposing(); + virtual void disposeThis(); // Forwarding the XComponent implementation to the // cppu::ImplHelper templated base diff --git a/canvas/source/cairo/cairo_canvasbitmap.cxx b/canvas/source/cairo/cairo_canvasbitmap.cxx index 33ee53ffcf2a..63761b848af8 100644 --- a/canvas/source/cairo/cairo_canvasbitmap.cxx +++ b/canvas/source/cairo/cairo_canvasbitmap.cxx @@ -102,7 +102,7 @@ namespace cairocanvas maCanvasHelper.clear(); } - void SAL_CALL CanvasBitmap::disposing() + void CanvasBitmap::disposeThis() { mpSurfaceProvider.clear(); @@ -110,7 +110,7 @@ namespace cairocanvas mpBufferSurface.reset(); // forward to parent - CanvasBitmap_Base::disposing(); + CanvasBitmap_Base::disposeThis(); } SurfaceSharedPtr CanvasBitmap::getSurface() diff --git a/canvas/source/cairo/cairo_canvasbitmap.hxx b/canvas/source/cairo/cairo_canvasbitmap.hxx index 532ce8d26b41..1626c9240ff6 100644 --- a/canvas/source/cairo/cairo_canvasbitmap.hxx +++ b/canvas/source/cairo/cairo_canvasbitmap.hxx @@ -58,7 +58,7 @@ namespace cairocanvas ::com::sun::star::lang::XServiceInfo, ::com::sun::star::beans::XFastPropertySet > CanvasBitmapBase_Base; class CanvasBitmapSpriteSurface_Base : - public ::canvas::BaseMutexHelper, + public ::canvas::DisambiguationHelper, public SurfaceProvider { }; @@ -87,7 +87,7 @@ namespace cairocanvas bool bHasAlpha ); /// Dispose all internal references - virtual void SAL_CALL disposing(); + virtual void disposeThis(); // Forwarding the XComponent implementation to the // cppu::ImplHelper templated base diff --git a/canvas/source/cairo/cairo_canvascustomsprite.cxx b/canvas/source/cairo/cairo_canvascustomsprite.cxx index b78bf44c3313..5c7852c41dec 100644 --- a/canvas/source/cairo/cairo_canvascustomsprite.cxx +++ b/canvas/source/cairo/cairo_canvascustomsprite.cxx @@ -78,7 +78,7 @@ namespace cairocanvas maCanvasHelper.clear(); } - void SAL_CALL CanvasCustomSprite::disposing() + void CanvasCustomSprite::disposeThis() { ::osl::MutexGuard aGuard( m_aMutex ); @@ -86,7 +86,7 @@ namespace cairocanvas mpBufferSurface.reset(); // forward to parent - CanvasCustomSpriteBaseT::disposing(); + CanvasCustomSpriteBaseT::disposeThis(); } void CanvasCustomSprite::redraw( const CairoSharedPtr& pCairo, diff --git a/canvas/source/cairo/cairo_canvascustomsprite.hxx b/canvas/source/cairo/cairo_canvascustomsprite.hxx index d9b525716690..52dac5233138 100644 --- a/canvas/source/cairo/cairo_canvascustomsprite.hxx +++ b/canvas/source/cairo/cairo_canvascustomsprite.hxx @@ -42,7 +42,7 @@ #include #include -#include +#include #include #include "cairo_sprite.hxx" @@ -76,7 +76,7 @@ namespace cairocanvas remain a base class that provides implementation, not to enforce any specific interface on its derivees. */ - class CanvasCustomSpriteSpriteBase_Base : public ::canvas::BaseMutexHelper< CanvasCustomSpriteBase_Base >, + class CanvasCustomSpriteSpriteBase_Base : public ::canvas::DisambiguationHelper< CanvasCustomSpriteBase_Base >, public Sprite, public SurfaceProvider { @@ -111,7 +111,7 @@ namespace cairocanvas CanvasCustomSprite( const ::com::sun::star::geometry::RealSize2D& rSpriteSize, const SpriteCanvasRef& rRefDevice ); - virtual void SAL_CALL disposing(); + virtual void disposeThis(); // Forwarding the XComponent implementation to the // cppu::ImplHelper templated base diff --git a/canvas/source/cairo/cairo_spritecanvas.cxx b/canvas/source/cairo/cairo_spritecanvas.cxx index a04c3e755eba..f55f861d3839 100644 --- a/canvas/source/cairo/cairo_spritecanvas.cxx +++ b/canvas/source/cairo/cairo_spritecanvas.cxx @@ -125,14 +125,14 @@ namespace cairocanvas maArguments.realloc(0); } - void SAL_CALL SpriteCanvas::disposing() + void SpriteCanvas::disposeThis() { ::osl::MutexGuard aGuard( m_aMutex ); mxComponentContext.clear(); // forward to parent - SpriteCanvasBaseT::disposing(); + SpriteCanvasBaseT::disposeThis(); } ::sal_Bool SAL_CALL SpriteCanvas::showBuffer( ::sal_Bool bUpdateAll ) throw (uno::RuntimeException) diff --git a/canvas/source/cairo/cairo_spritecanvas.hxx b/canvas/source/cairo/cairo_spritecanvas.hxx index 54cd3a181cec..b64fd1474c6e 100644 --- a/canvas/source/cairo/cairo_spritecanvas.hxx +++ b/canvas/source/cairo/cairo_spritecanvas.hxx @@ -45,7 +45,7 @@ #include #include -#include +#include #include #include @@ -69,7 +69,7 @@ namespace cairocanvas ::com::sun::star::util::XUpdatable, ::com::sun::star::beans::XPropertySet, ::com::sun::star::lang::XServiceName > WindowGraphicDeviceBase_Base; - typedef ::canvas::BufferedGraphicDeviceBase< ::canvas::BaseMutexHelper< WindowGraphicDeviceBase_Base >, + typedef ::canvas::BufferedGraphicDeviceBase< ::canvas::DisambiguationHelper< WindowGraphicDeviceBase_Base >, SpriteDeviceHelper, ::osl::MutexGuard, ::cppu::OWeakObject > SpriteCanvasBase_Base; @@ -121,12 +121,8 @@ namespace cairocanvas void initialize(); -#if defined __SUNPRO_CC - using SpriteCanvasBaseT::disposing; -#endif - /// Dispose all internal references - virtual void SAL_CALL disposing(); + virtual void disposeThis(); // Forwarding the XComponent implementation to the // cppu::ImplHelper templated base diff --git a/canvas/source/directx/dx_canvas.cxx b/canvas/source/directx/dx_canvas.cxx index 956c115f5d9b..c29319b3974e 100644 --- a/canvas/source/directx/dx_canvas.cxx +++ b/canvas/source/directx/dx_canvas.cxx @@ -124,14 +124,14 @@ namespace dxcanvas maArguments.realloc(0); } - void SAL_CALL Canvas::disposing() + void Canvas::disposeThis() { ::osl::MutexGuard aGuard( m_aMutex ); mxComponentContext.clear(); // forward to parent - CanvasBaseT::disposing(); + CanvasBaseT::disposeThis(); } ::rtl::OUString SAL_CALL Canvas::getServiceName( ) throw (uno::RuntimeException) @@ -201,7 +201,7 @@ namespace dxcanvas maArguments.realloc(0); } - void SAL_CALL BitmapCanvas::disposing() + void BitmapCanvas::disposeThis() { ::osl::MutexGuard aGuard( m_aMutex ); @@ -209,7 +209,7 @@ namespace dxcanvas mxComponentContext.clear(); // forward to parent - BitmapCanvasBaseT::disposing(); + BitmapCanvasBaseT::disposeThis(); } ::rtl::OUString SAL_CALL BitmapCanvas::getServiceName( ) throw (uno::RuntimeException) diff --git a/canvas/source/directx/dx_canvas.hxx b/canvas/source/directx/dx_canvas.hxx index 760bd31aa244..32810ede36e5 100644 --- a/canvas/source/directx/dx_canvas.hxx +++ b/canvas/source/directx/dx_canvas.hxx @@ -45,7 +45,7 @@ #include #include -#include +#include #include #include "dx_bitmapprovider.hxx" @@ -63,7 +63,7 @@ namespace dxcanvas ::com::sun::star::util::XUpdatable, ::com::sun::star::beans::XPropertySet, ::com::sun::star::lang::XServiceName > GraphicDeviceBase1_Base; - typedef ::canvas::GraphicDeviceBase< ::canvas::BaseMutexHelper< GraphicDeviceBase1_Base >, + typedef ::canvas::GraphicDeviceBase< ::canvas::DisambiguationHelper< GraphicDeviceBase1_Base >, DeviceHelper, ::osl::MutexGuard, ::cppu::OWeakObject > CanvasBase1_Base; @@ -92,7 +92,7 @@ namespace dxcanvas void initialize(); /// Dispose all internal references - virtual void SAL_CALL disposing(); + virtual void disposeThis(); // Forwarding the XComponent implementation to the // cppu::ImplHelper templated base @@ -120,7 +120,7 @@ namespace dxcanvas ::com::sun::star::util::XUpdatable, ::com::sun::star::beans::XPropertySet, ::com::sun::star::lang::XServiceName > GraphicDeviceBase2_Base; - typedef ::canvas::GraphicDeviceBase< ::canvas::BaseMutexHelper< GraphicDeviceBase2_Base >, + typedef ::canvas::GraphicDeviceBase< ::canvas::DisambiguationHelper< GraphicDeviceBase2_Base >, DeviceHelper, ::osl::MutexGuard, ::cppu::OWeakObject > CanvasBase2_Base; @@ -149,7 +149,7 @@ namespace dxcanvas void initialize(); /// Dispose all internal references - virtual void SAL_CALL disposing(); + virtual void disposeThis(); // Forwarding the XComponent implementation to the // cppu::ImplHelper templated base diff --git a/canvas/source/directx/dx_canvasbitmap.cxx b/canvas/source/directx/dx_canvasbitmap.cxx index ad8680d44db1..7ad5b18800de 100644 --- a/canvas/source/directx/dx_canvasbitmap.cxx +++ b/canvas/source/directx/dx_canvasbitmap.cxx @@ -60,13 +60,13 @@ namespace dxcanvas maCanvasHelper.setTarget( mpBitmap ); } - void SAL_CALL CanvasBitmap::disposing() + void CanvasBitmap::disposeThis() { mpBitmap.reset(); mpDevice.clear(); // forward to parent - CanvasBitmap_Base::disposing(); + CanvasBitmap_Base::disposeThis(); } struct AlphaDIB diff --git a/canvas/source/directx/dx_canvasbitmap.hxx b/canvas/source/directx/dx_canvasbitmap.hxx index b64840ddaded..7a80e2b96796 100644 --- a/canvas/source/directx/dx_canvasbitmap.hxx +++ b/canvas/source/directx/dx_canvasbitmap.hxx @@ -42,7 +42,7 @@ #include #include -#include +#include #include #include "dx_bitmapprovider.hxx" @@ -60,7 +60,7 @@ namespace dxcanvas ::com::sun::star::rendering::XIntegerBitmap, ::com::sun::star::lang::XServiceInfo, ::com::sun::star::beans::XFastPropertySet > CanvasBitmapBase_Base; - typedef ::canvas::IntegerBitmapBase< ::canvas::BaseMutexHelper< CanvasBitmapBase_Base >, + typedef ::canvas::IntegerBitmapBase< ::canvas::DisambiguationHelper< CanvasBitmapBase_Base >, BitmapCanvasHelper, ::osl::MutexGuard, ::cppu::OWeakObject > CanvasBitmap_Base; @@ -80,7 +80,7 @@ namespace dxcanvas const DeviceRef& rDevice ); /// Dispose all internal references - virtual void SAL_CALL disposing(); + virtual void disposeThis(); // XServiceInfo virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw (::com::sun::star::uno::RuntimeException); diff --git a/canvas/source/directx/dx_canvascustomsprite.cxx b/canvas/source/directx/dx_canvascustomsprite.cxx index 73334b1698a5..138b2c36dc3c 100644 --- a/canvas/source/directx/dx_canvascustomsprite.cxx +++ b/canvas/source/directx/dx_canvascustomsprite.cxx @@ -83,7 +83,7 @@ namespace dxcanvas maCanvasHelper.clear(); } - void SAL_CALL CanvasCustomSprite::disposing() + void CanvasCustomSprite::disposeThis() { ::osl::MutexGuard aGuard( m_aMutex ); @@ -91,7 +91,7 @@ namespace dxcanvas mpSpriteCanvas.clear(); // forward to parent - CanvasCustomSpriteBaseT::disposing(); + CanvasCustomSpriteBaseT::disposeThis(); } #define IMPLEMENTATION_NAME "DXCanvas.CanvasCustomSprite" diff --git a/canvas/source/directx/dx_canvascustomsprite.hxx b/canvas/source/directx/dx_canvascustomsprite.hxx index 38b9bd85b2e4..8e6c534683ce 100644 --- a/canvas/source/directx/dx_canvascustomsprite.hxx +++ b/canvas/source/directx/dx_canvascustomsprite.hxx @@ -42,7 +42,7 @@ #include #include -#include +#include #include #include "dx_sprite.hxx" @@ -75,7 +75,7 @@ namespace dxcanvas remain a base class that provides implementation, not to enforce any specific interface on its derivees. */ - class CanvasCustomSpriteSpriteBase_Base : public ::canvas::BaseMutexHelper< CanvasCustomSpriteBase_Base >, + class CanvasCustomSpriteSpriteBase_Base : public ::canvas::DisambiguationHelper< CanvasCustomSpriteBase_Base >, public Sprite { }; @@ -111,7 +111,7 @@ namespace dxcanvas const ::canvas::ISurfaceProxyManagerSharedPtr& rSurfaceProxy, bool bShowSpriteBounds ); - virtual void SAL_CALL disposing(); + virtual void disposeThis(); // Forwarding the XComponent implementation to the // cppu::ImplHelper templated base diff --git a/canvas/source/directx/dx_spritecanvas.cxx b/canvas/source/directx/dx_spritecanvas.cxx index 2e2131b44c15..430f4639cb92 100644 --- a/canvas/source/directx/dx_spritecanvas.cxx +++ b/canvas/source/directx/dx_spritecanvas.cxx @@ -126,14 +126,14 @@ namespace dxcanvas maArguments.realloc(0); } - void SAL_CALL SpriteCanvas::disposing() + void SpriteCanvas::disposeThis() { ::osl::MutexGuard aGuard( m_aMutex ); mxComponentContext.clear(); // forward to parent - SpriteCanvasBaseT::disposing(); + SpriteCanvasBaseT::disposeThis(); } ::sal_Bool SAL_CALL SpriteCanvas::showBuffer( ::sal_Bool bUpdateAll ) throw (uno::RuntimeException) diff --git a/canvas/source/directx/dx_spritecanvas.hxx b/canvas/source/directx/dx_spritecanvas.hxx index ec6d3785d536..bd76ad60b6d1 100644 --- a/canvas/source/directx/dx_spritecanvas.hxx +++ b/canvas/source/directx/dx_spritecanvas.hxx @@ -45,7 +45,7 @@ #include #include -#include +#include #include #include "dx_bitmapprovider.hxx" @@ -66,7 +66,8 @@ namespace dxcanvas ::com::sun::star::util::XUpdatable, ::com::sun::star::beans::XPropertySet, ::com::sun::star::lang::XServiceName > WindowGraphicDeviceBase_Base; - typedef ::canvas::BufferedGraphicDeviceBase< ::canvas::BaseMutexHelper< WindowGraphicDeviceBase_Base >, + typedef ::canvas::BufferedGraphicDeviceBase< ::canvas::DisambiguationHelper< + ::canvas::DisposingDisambiguate< WindowGraphicDeviceBase_Base > >, SpriteDeviceHelper, ::osl::MutexGuard, ::cppu::OWeakObject > SpriteCanvasBase_Base; @@ -117,7 +118,7 @@ namespace dxcanvas void initialize(); /// Dispose all internal references - virtual void SAL_CALL disposing(); + virtual void disposeThis(); // Forwarding the XComponent implementation to the // cppu::ImplHelper templated base diff --git a/canvas/source/null/null_canvasbitmap.cxx b/canvas/source/null/null_canvasbitmap.cxx index 473b5c6459d7..92ee7b8094f5 100644 --- a/canvas/source/null/null_canvasbitmap.cxx +++ b/canvas/source/null/null_canvasbitmap.cxx @@ -53,12 +53,12 @@ namespace nullcanvas bHasAlpha ); } - void SAL_CALL CanvasBitmap::disposing() + void CanvasBitmap::disposeThis() { mpDevice.clear(); // forward to parent - CanvasBitmap_Base::disposing(); + CanvasBitmap_Base::disposeThis(); } #define IMPLEMENTATION_NAME "NullCanvas.CanvasBitmap" diff --git a/canvas/source/null/null_canvasbitmap.hxx b/canvas/source/null/null_canvasbitmap.hxx index 65f078dd3507..fa0577c8c02a 100644 --- a/canvas/source/null/null_canvasbitmap.hxx +++ b/canvas/source/null/null_canvasbitmap.hxx @@ -40,6 +40,7 @@ #include #include +#include #include "null_canvashelper.hxx" #include "null_spritecanvas.hxx" @@ -53,7 +54,7 @@ namespace nullcanvas typedef ::cppu::WeakComponentImplHelper3< ::com::sun::star::rendering::XBitmapCanvas, ::com::sun::star::rendering::XIntegerBitmap, ::com::sun::star::lang::XServiceInfo > CanvasBitmapBase_Base; - typedef ::canvas::IntegerBitmapBase< ::canvas::BaseMutexHelper< CanvasBitmapBase_Base >, + typedef ::canvas::IntegerBitmapBase< ::canvas::DisambiguationHelper< CanvasBitmapBase_Base >, CanvasHelper, ::osl::MutexGuard, ::cppu::OWeakObject > CanvasBitmap_Base; @@ -75,7 +76,7 @@ namespace nullcanvas bool bHasAlpha ); /// Dispose all internal references - virtual void SAL_CALL disposing(); + virtual void disposeThis(); // XServiceInfo virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw (::com::sun::star::uno::RuntimeException); diff --git a/canvas/source/null/null_canvascustomsprite.cxx b/canvas/source/null/null_canvascustomsprite.cxx index cef8535a5c33..36dbc9a69871 100644 --- a/canvas/source/null/null_canvascustomsprite.cxx +++ b/canvas/source/null/null_canvascustomsprite.cxx @@ -66,14 +66,14 @@ namespace nullcanvas rRefDevice ); } - void SAL_CALL CanvasCustomSprite::disposing() + void CanvasCustomSprite::disposeThis() { ::osl::MutexGuard aGuard( m_aMutex ); mpSpriteCanvas.clear(); // forward to parent - CanvasCustomSpriteBaseT::disposing(); + CanvasCustomSpriteBaseT::disposeThis(); } void CanvasCustomSprite::redraw() const diff --git a/canvas/source/null/null_canvascustomsprite.hxx b/canvas/source/null/null_canvascustomsprite.hxx index 905f3513dc9e..17aa1f92d9a7 100644 --- a/canvas/source/null/null_canvascustomsprite.hxx +++ b/canvas/source/null/null_canvascustomsprite.hxx @@ -42,7 +42,7 @@ #include #include -#include +#include #include #include "sprite.hxx" @@ -75,8 +75,8 @@ namespace nullcanvas remain a base class that provides implementation, not to enforce any specific interface on its derivees. */ - class CanvasCustomSpriteSpriteBase_Base : public ::canvas::BaseMutexHelper< CanvasCustomSpriteBase_Base >, - public Sprite + class CanvasCustomSpriteSpriteBase_Base : public ::canvas::DisambiguationHelper< CanvasCustomSpriteBase_Base >, + public Sprite { }; @@ -109,7 +109,7 @@ namespace nullcanvas CanvasCustomSprite( const ::com::sun::star::geometry::RealSize2D& rSpriteSize, const SpriteCanvasRef& rRefDevice ); - virtual void SAL_CALL disposing(); + virtual void disposeThis(); // Forwarding the XComponent implementation to the // cppu::ImplHelper templated base diff --git a/canvas/source/null/null_spritecanvas.cxx b/canvas/source/null/null_spritecanvas.cxx index 82b6144707eb..509e3656f8fa 100644 --- a/canvas/source/null/null_spritecanvas.cxx +++ b/canvas/source/null/null_spritecanvas.cxx @@ -100,14 +100,14 @@ namespace nullcanvas maArguments.realloc(0); } - void SAL_CALL SpriteCanvas::disposing() + void SpriteCanvas::disposeThis() { ::osl::MutexGuard aGuard( m_aMutex ); mxComponentContext.clear(); // forward to parent - SpriteCanvasBaseT::disposing(); + SpriteCanvasBaseT::disposeThis(); } ::sal_Bool SAL_CALL SpriteCanvas::showBuffer( ::sal_Bool bUpdateAll ) throw (uno::RuntimeException) diff --git a/canvas/source/null/null_spritecanvas.hxx b/canvas/source/null/null_spritecanvas.hxx index 67f14b80b062..165d73aa4db4 100644 --- a/canvas/source/null/null_spritecanvas.hxx +++ b/canvas/source/null/null_spritecanvas.hxx @@ -45,7 +45,7 @@ #include #include -#include +#include #include #include "null_spritecanvashelper.hxx" @@ -63,7 +63,7 @@ namespace nullcanvas ::com::sun::star::awt::XWindowListener, ::com::sun::star::beans::XPropertySet, ::com::sun::star::lang::XServiceName > WindowGraphicDeviceBase_Base; - typedef ::canvas::BufferedGraphicDeviceBase< ::canvas::BaseMutexHelper< WindowGraphicDeviceBase_Base >, + typedef ::canvas::BufferedGraphicDeviceBase< ::canvas::DisambiguationHelper< WindowGraphicDeviceBase_Base >, DeviceHelper, ::osl::MutexGuard, ::cppu::OWeakObject > SpriteCanvasBase_Base; @@ -114,12 +114,8 @@ namespace nullcanvas void initialize(); -#if defined __SUNPRO_CC - using SpriteCanvasBaseT::disposing; -#endif - /// Dispose all internal references - virtual void SAL_CALL disposing(); + virtual void disposeThis(); // Forwarding the XComponent implementation to the // cppu::ImplHelper templated base diff --git a/canvas/source/vcl/canvas.cxx b/canvas/source/vcl/canvas.cxx index 81ce996015c2..c3dd0c569f89 100644 --- a/canvas/source/vcl/canvas.cxx +++ b/canvas/source/vcl/canvas.cxx @@ -133,14 +133,14 @@ namespace vclcanvas OSL_TRACE( "Canvas destroyed" ); } - void SAL_CALL Canvas::disposing() + void Canvas::disposeThis() { SolarMutexGuard aGuard; mxComponentContext.clear(); // forward to parent - CanvasBaseT::disposing(); + CanvasBaseT::disposeThis(); } ::rtl::OUString SAL_CALL Canvas::getServiceName( ) throw (::com::sun::star::uno::RuntimeException) diff --git a/canvas/source/vcl/canvas.hxx b/canvas/source/vcl/canvas.hxx index 555340970a8f..16d5c5abd5b3 100644 --- a/canvas/source/vcl/canvas.hxx +++ b/canvas/source/vcl/canvas.hxx @@ -43,7 +43,7 @@ #include #include -#include +#include #include #include @@ -64,7 +64,7 @@ namespace vclcanvas ::com::sun::star::util::XUpdatable, ::com::sun::star::beans::XPropertySet, ::com::sun::star::lang::XServiceName > GraphicDeviceBase_Base; - typedef ::canvas::GraphicDeviceBase< ::canvas::BaseMutexHelper< GraphicDeviceBase_Base >, + typedef ::canvas::GraphicDeviceBase< ::canvas::DisambiguationHelper< GraphicDeviceBase_Base >, DeviceHelper, tools::LocalGuard, ::cppu::OWeakObject > CanvasBase_Base; @@ -96,12 +96,8 @@ namespace vclcanvas /// For resource tracking ~Canvas(); -#if defined __SUNPRO_CC - using CanvasBaseT::disposing; -#endif - /// Dispose all internal references - virtual void SAL_CALL disposing(); + virtual void disposeThis(); // Forwarding the XComponent implementation to the // cppu::ImplHelper templated base diff --git a/canvas/source/vcl/canvasbitmap.cxx b/canvas/source/vcl/canvasbitmap.cxx index 1f8840afc264..84f5a8db58c3 100644 --- a/canvas/source/vcl/canvasbitmap.cxx +++ b/canvas/source/vcl/canvasbitmap.cxx @@ -82,12 +82,6 @@ namespace vclcanvas maCanvasHelper.init( rBitmap, rDevice, rOutDevProvider ); } - void SAL_CALL CanvasBitmap::disposing() - { - // forward to base - CanvasBitmap_Base::disposing(); - } - #define IMPLEMENTATION_NAME "VCLCanvas.CanvasBitmap" #define SERVICE_NAME "com.sun.star.rendering.CanvasBitmap" diff --git a/canvas/source/vcl/canvasbitmap.hxx b/canvas/source/vcl/canvasbitmap.hxx index a8b20725c629..540b190b76a1 100644 --- a/canvas/source/vcl/canvasbitmap.hxx +++ b/canvas/source/vcl/canvasbitmap.hxx @@ -57,7 +57,7 @@ namespace vclcanvas ::com::sun::star::rendering::XIntegerBitmap, ::com::sun::star::lang::XServiceInfo, ::com::sun::star::beans::XFastPropertySet > CanvasBitmapBase_Base; - typedef ::canvas::IntegerBitmapBase< ::canvas::BaseMutexHelper< CanvasBitmapBase_Base >, + typedef ::canvas::IntegerBitmapBase< ::canvas::DisambiguationHelper< CanvasBitmapBase_Base >, CanvasBitmapHelper, tools::LocalGuard, ::cppu::OWeakObject > CanvasBitmap_Base; @@ -87,9 +87,6 @@ namespace vclcanvas ::com::sun::star::rendering::XGraphicDevice& rDevice, const OutDevProviderSharedPtr& rOutDevProvider ); - // overridden because of mpDevice - virtual void SAL_CALL disposing(); - // XServiceInfo virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw (::com::sun::star::uno::RuntimeException); virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException); diff --git a/canvas/source/vcl/canvascustomsprite.cxx b/canvas/source/vcl/canvascustomsprite.cxx index 010422b6e093..2fcf6311485b 100644 --- a/canvas/source/vcl/canvascustomsprite.cxx +++ b/canvas/source/vcl/canvascustomsprite.cxx @@ -129,14 +129,6 @@ namespace vclcanvas maCanvasHelper.clear(); } - void SAL_CALL CanvasCustomSprite::disposing() - { - SolarMutexGuard aGuard; - - // forward to parent - CanvasCustomSpriteBaseT::disposing(); - } - #define IMPLEMENTATION_NAME "VCLCanvas.CanvasCustomSprite" #define SERVICE_NAME "com.sun.star.rendering.CanvasCustomSprite" diff --git a/canvas/source/vcl/canvascustomsprite.hxx b/canvas/source/vcl/canvascustomsprite.hxx index 1753f80194d9..6acaddafd545 100644 --- a/canvas/source/vcl/canvascustomsprite.hxx +++ b/canvas/source/vcl/canvascustomsprite.hxx @@ -41,7 +41,7 @@ #include #include -#include +#include #include #include @@ -77,7 +77,7 @@ namespace vclcanvas remain a base class that provides implementation, not to enforce any specific interface on its derivees. */ - class CanvasCustomSpriteSpriteBase_Base : public ::canvas::BaseMutexHelper< CanvasCustomSpriteBase_Base >, + class CanvasCustomSpriteSpriteBase_Base : public ::canvas::DisambiguationHelper< CanvasCustomSpriteBase_Base >, public Sprite { }; @@ -100,8 +100,6 @@ namespace vclcanvas const OutDevProviderSharedPtr& rOutDevProvider, bool bShowSpriteBounds ); - virtual void SAL_CALL disposing(); - // Forwarding the XComponent implementation to the // cppu::ImplHelper templated base // Classname Base doing refcount Base implementing the XComponent interface diff --git a/canvas/source/vcl/spritecanvas.cxx b/canvas/source/vcl/spritecanvas.cxx index b06bd1c77e9e..14c2446dcab7 100644 --- a/canvas/source/vcl/spritecanvas.cxx +++ b/canvas/source/vcl/spritecanvas.cxx @@ -129,14 +129,14 @@ namespace vclcanvas } - void SAL_CALL SpriteCanvas::disposing() + void SpriteCanvas::disposeThis() { SolarMutexGuard aGuard; mxComponentContext.clear(); // forward to parent - SpriteCanvasBaseT::disposing(); + SpriteCanvasBaseT::disposeThis(); } ::sal_Bool SAL_CALL SpriteCanvas::showBuffer( ::sal_Bool bUpdateAll ) throw (uno::RuntimeException) diff --git a/canvas/source/vcl/spritecanvas.hxx b/canvas/source/vcl/spritecanvas.hxx index 15688fca0ee3..26500fc93552 100644 --- a/canvas/source/vcl/spritecanvas.hxx +++ b/canvas/source/vcl/spritecanvas.hxx @@ -45,7 +45,7 @@ #include #include -#include +#include #include #include "spritecanvashelper.hxx" @@ -68,7 +68,7 @@ namespace vclcanvas ::com::sun::star::util::XUpdatable, ::com::sun::star::beans::XPropertySet, ::com::sun::star::lang::XServiceName > WindowGraphicDeviceBase_Base; - typedef ::canvas::BufferedGraphicDeviceBase< ::canvas::BaseMutexHelper< WindowGraphicDeviceBase_Base >, + typedef ::canvas::BufferedGraphicDeviceBase< ::canvas::DisambiguationHelper< WindowGraphicDeviceBase_Base >, SpriteDeviceHelper, tools::LocalGuard, ::cppu::OWeakObject > SpriteCanvasBase_Base; @@ -123,12 +123,8 @@ namespace vclcanvas /// For resource tracking ~SpriteCanvas(); -#if defined __SUNPRO_CC - using SpriteCanvasBaseT::disposing; -#endif - /// Dispose all internal references - virtual void SAL_CALL disposing(); + virtual void disposeThis(); // Forwarding the XComponent implementation to the // cppu::ImplHelper templated base -- cgit