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.
This commit is contained in:
Thorsten Behrens
2011-04-08 16:44:28 +02:00
parent 55961e2dfd
commit 09b546cf9c
36 changed files with 114 additions and 143 deletions

View File

@@ -183,10 +183,7 @@ namespace canvas
return ::com::sun::star::uno::makeAny(mxWindow); return ::com::sun::star::uno::makeAny(mxWindow);
} }
#if defined __SUNPRO_CC virtual void disposeThis()
using Base::disposing;
#endif
virtual void SAL_CALL disposing()
{ {
typename BaseType::MutexType aGuard( BaseType::m_aMutex ); typename BaseType::MutexType aGuard( BaseType::m_aMutex );
@@ -197,7 +194,7 @@ namespace canvas
} }
// pass on to base class // pass on to base class
BaseType::disposing(); BaseType::disposeThis();
} }
::com::sun::star::awt::Rectangle transformBounds( const ::com::sun::star::awt::Rectangle& rBounds ) ::com::sun::star::awt::Rectangle transformBounds( const ::com::sun::star::awt::Rectangle& rBounds )
@@ -234,12 +231,14 @@ namespace canvas
} }
// XWindowListener // 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 ); typename BaseType::MutexType aGuard( BaseType::m_aMutex );
if( Source.Source == mxWindow ) if( Source.Source == mxWindow )
mxWindow.clear(); mxWindow.clear();
BaseType::disposeEventSource(Source);
} }
virtual void SAL_CALL windowResized( const ::com::sun::star::awt::WindowEvent& e ) throw (::com::sun::star::uno::RuntimeException) virtual void SAL_CALL windowResized( const ::com::sun::star::awt::WindowEvent& e ) throw (::com::sun::star::uno::RuntimeException)

View File

@@ -120,17 +120,14 @@ namespace canvas
{ {
} }
#if defined __SUNPRO_CC virtual void disposeThis()
using Base::disposing;
#endif
virtual void SAL_CALL disposing()
{ {
MutexType aGuard( BaseType::m_aMutex ); MutexType aGuard( BaseType::m_aMutex );
maCanvasHelper.disposing(); maCanvasHelper.disposing();
// pass on to base class // pass on to base class
BaseType::disposing(); BaseType::disposeThis();
} }
// XCanvas // XCanvas

View File

@@ -103,14 +103,14 @@ namespace canvas
@derive when overriding this method in derived classes, @derive when overriding this method in derived classes,
<em>always</em> call the base class' method! <em>always</em> call the base class' method!
*/ */
virtual void SAL_CALL disposing() virtual void disposeThis()
{ {
typename BaseType::MutexType aGuard( BaseType::m_aMutex ); typename BaseType::MutexType aGuard( BaseType::m_aMutex );
maSpriteHelper.disposing(); maSpriteHelper.disposing();
// pass on to base class // pass on to base class
BaseType::disposing(); BaseType::disposeThis();
} }
// XCanvas: selectively override base's methods here, for opacity tracking // XCanvas: selectively override base's methods here, for opacity tracking

View File

@@ -26,30 +26,37 @@
* *
************************************************************************/ ************************************************************************/
#ifndef INCLUDED_CANVAS_BASEMUTEXHELPER_HXX #ifndef INCLUDED_CANVAS_DISAMBIGUATIONHELPER_HXX
#define INCLUDED_CANVAS_BASEMUTEXHELPER_HXX #define INCLUDED_CANVAS_DISAMBIGUATIONHELPER_HXX
#include <osl/mutex.hxx> #include <osl/mutex.hxx>
/* Definition of the BaseMutexHelper class */ /* Definition of the DisambiguationHelper class */
namespace canvas namespace canvas
{ {
/** Base class, deriving from ::comphelper::OBaseMutex and /** Base class, initializing its own baseclass with m_aMutex.
initializing its own baseclass with m_aMutex.
This is necessary to make the CanvasBase, GraphicDeviceBase, This is necessary to make the CanvasBase, GraphicDeviceBase,
etc. classes freely combinable - letting them perform this etc. classes freely combinable - letting them perform this
initialization would prohibit deriving e.g. CanvasBase from initialization would prohibit deriving e.g. CanvasBase from
GraphicDeviceBase. 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 BaseMutexHelper : public Base template< class Base > class DisambiguationHelper : public Base
{ {
public: public:
typedef Base BaseType; typedef Base BaseType;
/** Construct BaseMutexHelper /** Construct DisambiguationHelper
This method is the whole purpose of this template: This method is the whole purpose of this template:
initializing a base class with the provided m_aMutex initializing a base class with the provided m_aMutex
@@ -57,16 +64,27 @@ namespace canvas
as they require the lifetime of the mutex to extend as they require the lifetime of the mutex to extend
theirs). theirs).
*/ */
BaseMutexHelper() : DisambiguationHelper() :
BaseType( m_aMutex ) 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: protected:
mutable ::osl::Mutex m_aMutex; mutable ::osl::Mutex m_aMutex;
}; };
} }
#endif /* INCLUDED_CANVAS_BASEMUTEXHELPER_HXX */ #endif /* INCLUDED_CANVAS_DISAMBIGUATIONHELPER_HXX */
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@@ -95,7 +95,7 @@ namespace canvas
@tpl Mutex @tpl Mutex
Lock strategy to use. Defaults to using the 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 entered, an object of type Mutex is created with m_aMutex as
the sole parameter, and destroyed again when the method scope the sole parameter, and destroyed again when the method scope
is left. is left.
@@ -144,17 +144,14 @@ namespace canvas
_1))); _1)));
} }
#if defined __SUNPRO_CC virtual void disposeThis()
using Base::disposing;
#endif
virtual void SAL_CALL disposing()
{ {
MutexType aGuard( BaseType::m_aMutex ); MutexType aGuard( BaseType::m_aMutex );
maDeviceHelper.disposing(); maDeviceHelper.disposing();
// pass on to base class // pass on to base class
cppu::WeakComponentImplHelperBase::disposing(); BaseType::disposeThis();
} }
// XGraphicDevice // XGraphicDevice

View File

@@ -86,17 +86,14 @@ namespace canvas
{ {
} }
#if defined __SUNPRO_CC virtual void disposeThis()
using Base::disposing;
#endif
virtual void SAL_CALL disposing()
{ {
typename BaseType::MutexType aGuard( BaseType::m_aMutex ); typename BaseType::MutexType aGuard( BaseType::m_aMutex );
maRedrawManager.disposing(); maRedrawManager.disposing();
// pass on to base class // pass on to base class
BaseType::disposing(); BaseType::disposeThis();
} }
// XSpriteCanvas // XSpriteCanvas

View File

@@ -131,14 +131,14 @@ namespace cairocanvas
OSL_TRACE( "CairoCanvas destroyed" ); OSL_TRACE( "CairoCanvas destroyed" );
} }
void SAL_CALL Canvas::disposing() void Canvas::disposeThis()
{ {
::osl::MutexGuard aGuard( m_aMutex ); ::osl::MutexGuard aGuard( m_aMutex );
mxComponentContext.clear(); mxComponentContext.clear();
// forward to parent // forward to parent
CanvasBaseT::disposing(); CanvasBaseT::disposeThis();
} }
::rtl::OUString SAL_CALL Canvas::getServiceName( ) throw (uno::RuntimeException) ::rtl::OUString SAL_CALL Canvas::getServiceName( ) throw (uno::RuntimeException)

View File

@@ -47,7 +47,7 @@
#include <comphelper/uno3.hxx> #include <comphelper/uno3.hxx>
#include <canvas/base/spritecanvasbase.hxx> #include <canvas/base/spritecanvasbase.hxx>
#include <canvas/base/basemutexhelper.hxx> #include <canvas/base/disambiguationhelper.hxx>
#include <canvas/base/bufferedgraphicdevicebase.hxx> #include <canvas/base/bufferedgraphicdevicebase.hxx>
#include <basegfx/vector/b2isize.hxx> #include <basegfx/vector/b2isize.hxx>
@@ -69,7 +69,7 @@ namespace cairocanvas
::com::sun::star::util::XUpdatable, ::com::sun::star::util::XUpdatable,
::com::sun::star::beans::XPropertySet, ::com::sun::star::beans::XPropertySet,
::com::sun::star::lang::XServiceName > GraphicDeviceBase_Base; ::com::sun::star::lang::XServiceName > GraphicDeviceBase_Base;
typedef ::canvas::GraphicDeviceBase< ::canvas::BaseMutexHelper< GraphicDeviceBase_Base >, typedef ::canvas::GraphicDeviceBase< ::canvas::DisambiguationHelper< GraphicDeviceBase_Base >,
DeviceHelper, DeviceHelper,
::osl::MutexGuard, ::osl::MutexGuard,
::cppu::OWeakObject > CanvasBase_Base; ::cppu::OWeakObject > CanvasBase_Base;
@@ -122,12 +122,8 @@ namespace cairocanvas
/// For resource tracking /// For resource tracking
~Canvas(); ~Canvas();
#if defined __SUNPRO_CC
using CanvasBaseT::disposing;
#endif
/// Dispose all internal references /// Dispose all internal references
virtual void SAL_CALL disposing(); virtual void disposeThis();
// Forwarding the XComponent implementation to the // Forwarding the XComponent implementation to the
// cppu::ImplHelper templated base // cppu::ImplHelper templated base

View File

@@ -102,7 +102,7 @@ namespace cairocanvas
maCanvasHelper.clear(); maCanvasHelper.clear();
} }
void SAL_CALL CanvasBitmap::disposing() void CanvasBitmap::disposeThis()
{ {
mpSurfaceProvider.clear(); mpSurfaceProvider.clear();
@@ -110,7 +110,7 @@ namespace cairocanvas
mpBufferSurface.reset(); mpBufferSurface.reset();
// forward to parent // forward to parent
CanvasBitmap_Base::disposing(); CanvasBitmap_Base::disposeThis();
} }
SurfaceSharedPtr CanvasBitmap::getSurface() SurfaceSharedPtr CanvasBitmap::getSurface()

View File

@@ -58,7 +58,7 @@ namespace cairocanvas
::com::sun::star::lang::XServiceInfo, ::com::sun::star::lang::XServiceInfo,
::com::sun::star::beans::XFastPropertySet > CanvasBitmapBase_Base; ::com::sun::star::beans::XFastPropertySet > CanvasBitmapBase_Base;
class CanvasBitmapSpriteSurface_Base : class CanvasBitmapSpriteSurface_Base :
public ::canvas::BaseMutexHelper<CanvasBitmapBase_Base>, public ::canvas::DisambiguationHelper<CanvasBitmapBase_Base>,
public SurfaceProvider public SurfaceProvider
{ {
}; };
@@ -87,7 +87,7 @@ namespace cairocanvas
bool bHasAlpha ); bool bHasAlpha );
/// Dispose all internal references /// Dispose all internal references
virtual void SAL_CALL disposing(); virtual void disposeThis();
// Forwarding the XComponent implementation to the // Forwarding the XComponent implementation to the
// cppu::ImplHelper templated base // cppu::ImplHelper templated base

View File

@@ -78,7 +78,7 @@ namespace cairocanvas
maCanvasHelper.clear(); maCanvasHelper.clear();
} }
void SAL_CALL CanvasCustomSprite::disposing() void CanvasCustomSprite::disposeThis()
{ {
::osl::MutexGuard aGuard( m_aMutex ); ::osl::MutexGuard aGuard( m_aMutex );
@@ -86,7 +86,7 @@ namespace cairocanvas
mpBufferSurface.reset(); mpBufferSurface.reset();
// forward to parent // forward to parent
CanvasCustomSpriteBaseT::disposing(); CanvasCustomSpriteBaseT::disposeThis();
} }
void CanvasCustomSprite::redraw( const CairoSharedPtr& pCairo, void CanvasCustomSprite::redraw( const CairoSharedPtr& pCairo,

View File

@@ -42,7 +42,7 @@
#include <basegfx/vector/b2isize.hxx> #include <basegfx/vector/b2isize.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx> #include <basegfx/matrix/b2dhommatrix.hxx>
#include <canvas/base/basemutexhelper.hxx> #include <canvas/base/disambiguationhelper.hxx>
#include <canvas/base/canvascustomspritebase.hxx> #include <canvas/base/canvascustomspritebase.hxx>
#include "cairo_sprite.hxx" #include "cairo_sprite.hxx"
@@ -76,7 +76,7 @@ namespace cairocanvas
remain a base class that provides implementation, not to remain a base class that provides implementation, not to
enforce any specific interface on its derivees. 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 Sprite,
public SurfaceProvider public SurfaceProvider
{ {
@@ -111,7 +111,7 @@ namespace cairocanvas
CanvasCustomSprite( const ::com::sun::star::geometry::RealSize2D& rSpriteSize, CanvasCustomSprite( const ::com::sun::star::geometry::RealSize2D& rSpriteSize,
const SpriteCanvasRef& rRefDevice ); const SpriteCanvasRef& rRefDevice );
virtual void SAL_CALL disposing(); virtual void disposeThis();
// Forwarding the XComponent implementation to the // Forwarding the XComponent implementation to the
// cppu::ImplHelper templated base // cppu::ImplHelper templated base

View File

@@ -125,14 +125,14 @@ namespace cairocanvas
maArguments.realloc(0); maArguments.realloc(0);
} }
void SAL_CALL SpriteCanvas::disposing() void SpriteCanvas::disposeThis()
{ {
::osl::MutexGuard aGuard( m_aMutex ); ::osl::MutexGuard aGuard( m_aMutex );
mxComponentContext.clear(); mxComponentContext.clear();
// forward to parent // forward to parent
SpriteCanvasBaseT::disposing(); SpriteCanvasBaseT::disposeThis();
} }
::sal_Bool SAL_CALL SpriteCanvas::showBuffer( ::sal_Bool bUpdateAll ) throw (uno::RuntimeException) ::sal_Bool SAL_CALL SpriteCanvas::showBuffer( ::sal_Bool bUpdateAll ) throw (uno::RuntimeException)

View File

@@ -45,7 +45,7 @@
#include <comphelper/uno3.hxx> #include <comphelper/uno3.hxx>
#include <canvas/base/spritecanvasbase.hxx> #include <canvas/base/spritecanvasbase.hxx>
#include <canvas/base/basemutexhelper.hxx> #include <canvas/base/disambiguationhelper.hxx>
#include <canvas/base/bufferedgraphicdevicebase.hxx> #include <canvas/base/bufferedgraphicdevicebase.hxx>
#include <basegfx/vector/b2isize.hxx> #include <basegfx/vector/b2isize.hxx>
@@ -69,7 +69,7 @@ namespace cairocanvas
::com::sun::star::util::XUpdatable, ::com::sun::star::util::XUpdatable,
::com::sun::star::beans::XPropertySet, ::com::sun::star::beans::XPropertySet,
::com::sun::star::lang::XServiceName > WindowGraphicDeviceBase_Base; ::com::sun::star::lang::XServiceName > WindowGraphicDeviceBase_Base;
typedef ::canvas::BufferedGraphicDeviceBase< ::canvas::BaseMutexHelper< WindowGraphicDeviceBase_Base >, typedef ::canvas::BufferedGraphicDeviceBase< ::canvas::DisambiguationHelper< WindowGraphicDeviceBase_Base >,
SpriteDeviceHelper, SpriteDeviceHelper,
::osl::MutexGuard, ::osl::MutexGuard,
::cppu::OWeakObject > SpriteCanvasBase_Base; ::cppu::OWeakObject > SpriteCanvasBase_Base;
@@ -121,12 +121,8 @@ namespace cairocanvas
void initialize(); void initialize();
#if defined __SUNPRO_CC
using SpriteCanvasBaseT::disposing;
#endif
/// Dispose all internal references /// Dispose all internal references
virtual void SAL_CALL disposing(); virtual void disposeThis();
// Forwarding the XComponent implementation to the // Forwarding the XComponent implementation to the
// cppu::ImplHelper templated base // cppu::ImplHelper templated base

View File

@@ -124,14 +124,14 @@ namespace dxcanvas
maArguments.realloc(0); maArguments.realloc(0);
} }
void SAL_CALL Canvas::disposing() void Canvas::disposeThis()
{ {
::osl::MutexGuard aGuard( m_aMutex ); ::osl::MutexGuard aGuard( m_aMutex );
mxComponentContext.clear(); mxComponentContext.clear();
// forward to parent // forward to parent
CanvasBaseT::disposing(); CanvasBaseT::disposeThis();
} }
::rtl::OUString SAL_CALL Canvas::getServiceName( ) throw (uno::RuntimeException) ::rtl::OUString SAL_CALL Canvas::getServiceName( ) throw (uno::RuntimeException)
@@ -201,7 +201,7 @@ namespace dxcanvas
maArguments.realloc(0); maArguments.realloc(0);
} }
void SAL_CALL BitmapCanvas::disposing() void BitmapCanvas::disposeThis()
{ {
::osl::MutexGuard aGuard( m_aMutex ); ::osl::MutexGuard aGuard( m_aMutex );
@@ -209,7 +209,7 @@ namespace dxcanvas
mxComponentContext.clear(); mxComponentContext.clear();
// forward to parent // forward to parent
BitmapCanvasBaseT::disposing(); BitmapCanvasBaseT::disposeThis();
} }
::rtl::OUString SAL_CALL BitmapCanvas::getServiceName( ) throw (uno::RuntimeException) ::rtl::OUString SAL_CALL BitmapCanvas::getServiceName( ) throw (uno::RuntimeException)

View File

@@ -45,7 +45,7 @@
#include <comphelper/uno3.hxx> #include <comphelper/uno3.hxx>
#include <canvas/base/integerbitmapbase.hxx> #include <canvas/base/integerbitmapbase.hxx>
#include <canvas/base/basemutexhelper.hxx> #include <canvas/base/disambiguationhelper.hxx>
#include <canvas/base/graphicdevicebase.hxx> #include <canvas/base/graphicdevicebase.hxx>
#include "dx_bitmapprovider.hxx" #include "dx_bitmapprovider.hxx"
@@ -63,7 +63,7 @@ namespace dxcanvas
::com::sun::star::util::XUpdatable, ::com::sun::star::util::XUpdatable,
::com::sun::star::beans::XPropertySet, ::com::sun::star::beans::XPropertySet,
::com::sun::star::lang::XServiceName > GraphicDeviceBase1_Base; ::com::sun::star::lang::XServiceName > GraphicDeviceBase1_Base;
typedef ::canvas::GraphicDeviceBase< ::canvas::BaseMutexHelper< GraphicDeviceBase1_Base >, typedef ::canvas::GraphicDeviceBase< ::canvas::DisambiguationHelper< GraphicDeviceBase1_Base >,
DeviceHelper, DeviceHelper,
::osl::MutexGuard, ::osl::MutexGuard,
::cppu::OWeakObject > CanvasBase1_Base; ::cppu::OWeakObject > CanvasBase1_Base;
@@ -92,7 +92,7 @@ namespace dxcanvas
void initialize(); void initialize();
/// Dispose all internal references /// Dispose all internal references
virtual void SAL_CALL disposing(); virtual void disposeThis();
// Forwarding the XComponent implementation to the // Forwarding the XComponent implementation to the
// cppu::ImplHelper templated base // cppu::ImplHelper templated base
@@ -120,7 +120,7 @@ namespace dxcanvas
::com::sun::star::util::XUpdatable, ::com::sun::star::util::XUpdatable,
::com::sun::star::beans::XPropertySet, ::com::sun::star::beans::XPropertySet,
::com::sun::star::lang::XServiceName > GraphicDeviceBase2_Base; ::com::sun::star::lang::XServiceName > GraphicDeviceBase2_Base;
typedef ::canvas::GraphicDeviceBase< ::canvas::BaseMutexHelper< GraphicDeviceBase2_Base >, typedef ::canvas::GraphicDeviceBase< ::canvas::DisambiguationHelper< GraphicDeviceBase2_Base >,
DeviceHelper, DeviceHelper,
::osl::MutexGuard, ::osl::MutexGuard,
::cppu::OWeakObject > CanvasBase2_Base; ::cppu::OWeakObject > CanvasBase2_Base;
@@ -149,7 +149,7 @@ namespace dxcanvas
void initialize(); void initialize();
/// Dispose all internal references /// Dispose all internal references
virtual void SAL_CALL disposing(); virtual void disposeThis();
// Forwarding the XComponent implementation to the // Forwarding the XComponent implementation to the
// cppu::ImplHelper templated base // cppu::ImplHelper templated base

View File

@@ -60,13 +60,13 @@ namespace dxcanvas
maCanvasHelper.setTarget( mpBitmap ); maCanvasHelper.setTarget( mpBitmap );
} }
void SAL_CALL CanvasBitmap::disposing() void CanvasBitmap::disposeThis()
{ {
mpBitmap.reset(); mpBitmap.reset();
mpDevice.clear(); mpDevice.clear();
// forward to parent // forward to parent
CanvasBitmap_Base::disposing(); CanvasBitmap_Base::disposeThis();
} }
struct AlphaDIB struct AlphaDIB

View File

@@ -42,7 +42,7 @@
#include <cppuhelper/compbase3.hxx> #include <cppuhelper/compbase3.hxx>
#include <comphelper/uno3.hxx> #include <comphelper/uno3.hxx>
#include <canvas/base/basemutexhelper.hxx> #include <canvas/base/disambiguationhelper.hxx>
#include <canvas/base/integerbitmapbase.hxx> #include <canvas/base/integerbitmapbase.hxx>
#include "dx_bitmapprovider.hxx" #include "dx_bitmapprovider.hxx"
@@ -60,7 +60,7 @@ namespace dxcanvas
::com::sun::star::rendering::XIntegerBitmap, ::com::sun::star::rendering::XIntegerBitmap,
::com::sun::star::lang::XServiceInfo, ::com::sun::star::lang::XServiceInfo,
::com::sun::star::beans::XFastPropertySet > CanvasBitmapBase_Base; ::com::sun::star::beans::XFastPropertySet > CanvasBitmapBase_Base;
typedef ::canvas::IntegerBitmapBase< ::canvas::BaseMutexHelper< CanvasBitmapBase_Base >, typedef ::canvas::IntegerBitmapBase< ::canvas::DisambiguationHelper< CanvasBitmapBase_Base >,
BitmapCanvasHelper, BitmapCanvasHelper,
::osl::MutexGuard, ::osl::MutexGuard,
::cppu::OWeakObject > CanvasBitmap_Base; ::cppu::OWeakObject > CanvasBitmap_Base;
@@ -80,7 +80,7 @@ namespace dxcanvas
const DeviceRef& rDevice ); const DeviceRef& rDevice );
/// Dispose all internal references /// Dispose all internal references
virtual void SAL_CALL disposing(); virtual void disposeThis();
// XServiceInfo // XServiceInfo
virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw (::com::sun::star::uno::RuntimeException); virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw (::com::sun::star::uno::RuntimeException);

View File

@@ -83,7 +83,7 @@ namespace dxcanvas
maCanvasHelper.clear(); maCanvasHelper.clear();
} }
void SAL_CALL CanvasCustomSprite::disposing() void CanvasCustomSprite::disposeThis()
{ {
::osl::MutexGuard aGuard( m_aMutex ); ::osl::MutexGuard aGuard( m_aMutex );
@@ -91,7 +91,7 @@ namespace dxcanvas
mpSpriteCanvas.clear(); mpSpriteCanvas.clear();
// forward to parent // forward to parent
CanvasCustomSpriteBaseT::disposing(); CanvasCustomSpriteBaseT::disposeThis();
} }
#define IMPLEMENTATION_NAME "DXCanvas.CanvasCustomSprite" #define IMPLEMENTATION_NAME "DXCanvas.CanvasCustomSprite"

View File

@@ -42,7 +42,7 @@
#include <basegfx/vector/b2isize.hxx> #include <basegfx/vector/b2isize.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx> #include <basegfx/matrix/b2dhommatrix.hxx>
#include <canvas/base/basemutexhelper.hxx> #include <canvas/base/disambiguationhelper.hxx>
#include <canvas/base/canvascustomspritebase.hxx> #include <canvas/base/canvascustomspritebase.hxx>
#include "dx_sprite.hxx" #include "dx_sprite.hxx"
@@ -75,7 +75,7 @@ namespace dxcanvas
remain a base class that provides implementation, not to remain a base class that provides implementation, not to
enforce any specific interface on its derivees. 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 Sprite
{ {
}; };
@@ -111,7 +111,7 @@ namespace dxcanvas
const ::canvas::ISurfaceProxyManagerSharedPtr& rSurfaceProxy, const ::canvas::ISurfaceProxyManagerSharedPtr& rSurfaceProxy,
bool bShowSpriteBounds ); bool bShowSpriteBounds );
virtual void SAL_CALL disposing(); virtual void disposeThis();
// Forwarding the XComponent implementation to the // Forwarding the XComponent implementation to the
// cppu::ImplHelper templated base // cppu::ImplHelper templated base

View File

@@ -126,14 +126,14 @@ namespace dxcanvas
maArguments.realloc(0); maArguments.realloc(0);
} }
void SAL_CALL SpriteCanvas::disposing() void SpriteCanvas::disposeThis()
{ {
::osl::MutexGuard aGuard( m_aMutex ); ::osl::MutexGuard aGuard( m_aMutex );
mxComponentContext.clear(); mxComponentContext.clear();
// forward to parent // forward to parent
SpriteCanvasBaseT::disposing(); SpriteCanvasBaseT::disposeThis();
} }
::sal_Bool SAL_CALL SpriteCanvas::showBuffer( ::sal_Bool bUpdateAll ) throw (uno::RuntimeException) ::sal_Bool SAL_CALL SpriteCanvas::showBuffer( ::sal_Bool bUpdateAll ) throw (uno::RuntimeException)

View File

@@ -45,7 +45,7 @@
#include <comphelper/uno3.hxx> #include <comphelper/uno3.hxx>
#include <canvas/base/spritecanvasbase.hxx> #include <canvas/base/spritecanvasbase.hxx>
#include <canvas/base/basemutexhelper.hxx> #include <canvas/base/disambiguationhelper.hxx>
#include <canvas/base/bufferedgraphicdevicebase.hxx> #include <canvas/base/bufferedgraphicdevicebase.hxx>
#include "dx_bitmapprovider.hxx" #include "dx_bitmapprovider.hxx"
@@ -66,7 +66,8 @@ namespace dxcanvas
::com::sun::star::util::XUpdatable, ::com::sun::star::util::XUpdatable,
::com::sun::star::beans::XPropertySet, ::com::sun::star::beans::XPropertySet,
::com::sun::star::lang::XServiceName > WindowGraphicDeviceBase_Base; ::com::sun::star::lang::XServiceName > WindowGraphicDeviceBase_Base;
typedef ::canvas::BufferedGraphicDeviceBase< ::canvas::BaseMutexHelper< WindowGraphicDeviceBase_Base >, typedef ::canvas::BufferedGraphicDeviceBase< ::canvas::DisambiguationHelper<
::canvas::DisposingDisambiguate< WindowGraphicDeviceBase_Base > >,
SpriteDeviceHelper, SpriteDeviceHelper,
::osl::MutexGuard, ::osl::MutexGuard,
::cppu::OWeakObject > SpriteCanvasBase_Base; ::cppu::OWeakObject > SpriteCanvasBase_Base;
@@ -117,7 +118,7 @@ namespace dxcanvas
void initialize(); void initialize();
/// Dispose all internal references /// Dispose all internal references
virtual void SAL_CALL disposing(); virtual void disposeThis();
// Forwarding the XComponent implementation to the // Forwarding the XComponent implementation to the
// cppu::ImplHelper templated base // cppu::ImplHelper templated base

View File

@@ -53,12 +53,12 @@ namespace nullcanvas
bHasAlpha ); bHasAlpha );
} }
void SAL_CALL CanvasBitmap::disposing() void CanvasBitmap::disposeThis()
{ {
mpDevice.clear(); mpDevice.clear();
// forward to parent // forward to parent
CanvasBitmap_Base::disposing(); CanvasBitmap_Base::disposeThis();
} }
#define IMPLEMENTATION_NAME "NullCanvas.CanvasBitmap" #define IMPLEMENTATION_NAME "NullCanvas.CanvasBitmap"

View File

@@ -40,6 +40,7 @@
#include <boost/shared_ptr.hpp> #include <boost/shared_ptr.hpp>
#include <canvas/base/integerbitmapbase.hxx> #include <canvas/base/integerbitmapbase.hxx>
#include <canvas/base/disambiguationhelper.hxx>
#include "null_canvashelper.hxx" #include "null_canvashelper.hxx"
#include "null_spritecanvas.hxx" #include "null_spritecanvas.hxx"
@@ -53,7 +54,7 @@ namespace nullcanvas
typedef ::cppu::WeakComponentImplHelper3< ::com::sun::star::rendering::XBitmapCanvas, typedef ::cppu::WeakComponentImplHelper3< ::com::sun::star::rendering::XBitmapCanvas,
::com::sun::star::rendering::XIntegerBitmap, ::com::sun::star::rendering::XIntegerBitmap,
::com::sun::star::lang::XServiceInfo > CanvasBitmapBase_Base; ::com::sun::star::lang::XServiceInfo > CanvasBitmapBase_Base;
typedef ::canvas::IntegerBitmapBase< ::canvas::BaseMutexHelper< CanvasBitmapBase_Base >, typedef ::canvas::IntegerBitmapBase< ::canvas::DisambiguationHelper< CanvasBitmapBase_Base >,
CanvasHelper, CanvasHelper,
::osl::MutexGuard, ::osl::MutexGuard,
::cppu::OWeakObject > CanvasBitmap_Base; ::cppu::OWeakObject > CanvasBitmap_Base;
@@ -75,7 +76,7 @@ namespace nullcanvas
bool bHasAlpha ); bool bHasAlpha );
/// Dispose all internal references /// Dispose all internal references
virtual void SAL_CALL disposing(); virtual void disposeThis();
// XServiceInfo // XServiceInfo
virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw (::com::sun::star::uno::RuntimeException); virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw (::com::sun::star::uno::RuntimeException);

View File

@@ -66,14 +66,14 @@ namespace nullcanvas
rRefDevice ); rRefDevice );
} }
void SAL_CALL CanvasCustomSprite::disposing() void CanvasCustomSprite::disposeThis()
{ {
::osl::MutexGuard aGuard( m_aMutex ); ::osl::MutexGuard aGuard( m_aMutex );
mpSpriteCanvas.clear(); mpSpriteCanvas.clear();
// forward to parent // forward to parent
CanvasCustomSpriteBaseT::disposing(); CanvasCustomSpriteBaseT::disposeThis();
} }
void CanvasCustomSprite::redraw() const void CanvasCustomSprite::redraw() const

View File

@@ -42,7 +42,7 @@
#include <basegfx/vector/b2isize.hxx> #include <basegfx/vector/b2isize.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx> #include <basegfx/matrix/b2dhommatrix.hxx>
#include <canvas/base/basemutexhelper.hxx> #include <canvas/base/disambiguationhelper.hxx>
#include <canvas/base/canvascustomspritebase.hxx> #include <canvas/base/canvascustomspritebase.hxx>
#include "sprite.hxx" #include "sprite.hxx"
@@ -75,8 +75,8 @@ namespace nullcanvas
remain a base class that provides implementation, not to remain a base class that provides implementation, not to
enforce any specific interface on its derivees. 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 Sprite
{ {
}; };
@@ -109,7 +109,7 @@ namespace nullcanvas
CanvasCustomSprite( const ::com::sun::star::geometry::RealSize2D& rSpriteSize, CanvasCustomSprite( const ::com::sun::star::geometry::RealSize2D& rSpriteSize,
const SpriteCanvasRef& rRefDevice ); const SpriteCanvasRef& rRefDevice );
virtual void SAL_CALL disposing(); virtual void disposeThis();
// Forwarding the XComponent implementation to the // Forwarding the XComponent implementation to the
// cppu::ImplHelper templated base // cppu::ImplHelper templated base

View File

@@ -100,14 +100,14 @@ namespace nullcanvas
maArguments.realloc(0); maArguments.realloc(0);
} }
void SAL_CALL SpriteCanvas::disposing() void SpriteCanvas::disposeThis()
{ {
::osl::MutexGuard aGuard( m_aMutex ); ::osl::MutexGuard aGuard( m_aMutex );
mxComponentContext.clear(); mxComponentContext.clear();
// forward to parent // forward to parent
SpriteCanvasBaseT::disposing(); SpriteCanvasBaseT::disposeThis();
} }
::sal_Bool SAL_CALL SpriteCanvas::showBuffer( ::sal_Bool bUpdateAll ) throw (uno::RuntimeException) ::sal_Bool SAL_CALL SpriteCanvas::showBuffer( ::sal_Bool bUpdateAll ) throw (uno::RuntimeException)

View File

@@ -45,7 +45,7 @@
#include <comphelper/uno3.hxx> #include <comphelper/uno3.hxx>
#include <canvas/base/spritecanvasbase.hxx> #include <canvas/base/spritecanvasbase.hxx>
#include <canvas/base/basemutexhelper.hxx> #include <canvas/base/disambiguationhelper.hxx>
#include <canvas/base/bufferedgraphicdevicebase.hxx> #include <canvas/base/bufferedgraphicdevicebase.hxx>
#include "null_spritecanvashelper.hxx" #include "null_spritecanvashelper.hxx"
@@ -63,7 +63,7 @@ namespace nullcanvas
::com::sun::star::awt::XWindowListener, ::com::sun::star::awt::XWindowListener,
::com::sun::star::beans::XPropertySet, ::com::sun::star::beans::XPropertySet,
::com::sun::star::lang::XServiceName > WindowGraphicDeviceBase_Base; ::com::sun::star::lang::XServiceName > WindowGraphicDeviceBase_Base;
typedef ::canvas::BufferedGraphicDeviceBase< ::canvas::BaseMutexHelper< WindowGraphicDeviceBase_Base >, typedef ::canvas::BufferedGraphicDeviceBase< ::canvas::DisambiguationHelper< WindowGraphicDeviceBase_Base >,
DeviceHelper, DeviceHelper,
::osl::MutexGuard, ::osl::MutexGuard,
::cppu::OWeakObject > SpriteCanvasBase_Base; ::cppu::OWeakObject > SpriteCanvasBase_Base;
@@ -114,12 +114,8 @@ namespace nullcanvas
void initialize(); void initialize();
#if defined __SUNPRO_CC
using SpriteCanvasBaseT::disposing;
#endif
/// Dispose all internal references /// Dispose all internal references
virtual void SAL_CALL disposing(); virtual void disposeThis();
// Forwarding the XComponent implementation to the // Forwarding the XComponent implementation to the
// cppu::ImplHelper templated base // cppu::ImplHelper templated base

View File

@@ -133,14 +133,14 @@ namespace vclcanvas
OSL_TRACE( "Canvas destroyed" ); OSL_TRACE( "Canvas destroyed" );
} }
void SAL_CALL Canvas::disposing() void Canvas::disposeThis()
{ {
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
mxComponentContext.clear(); mxComponentContext.clear();
// forward to parent // forward to parent
CanvasBaseT::disposing(); CanvasBaseT::disposeThis();
} }
::rtl::OUString SAL_CALL Canvas::getServiceName( ) throw (::com::sun::star::uno::RuntimeException) ::rtl::OUString SAL_CALL Canvas::getServiceName( ) throw (::com::sun::star::uno::RuntimeException)

View File

@@ -43,7 +43,7 @@
#include <cppuhelper/compbase7.hxx> #include <cppuhelper/compbase7.hxx>
#include <comphelper/uno3.hxx> #include <comphelper/uno3.hxx>
#include <canvas/base/basemutexhelper.hxx> #include <canvas/base/disambiguationhelper.hxx>
#include <canvas/base/integerbitmapbase.hxx> #include <canvas/base/integerbitmapbase.hxx>
#include <canvas/base/graphicdevicebase.hxx> #include <canvas/base/graphicdevicebase.hxx>
@@ -64,7 +64,7 @@ namespace vclcanvas
::com::sun::star::util::XUpdatable, ::com::sun::star::util::XUpdatable,
::com::sun::star::beans::XPropertySet, ::com::sun::star::beans::XPropertySet,
::com::sun::star::lang::XServiceName > GraphicDeviceBase_Base; ::com::sun::star::lang::XServiceName > GraphicDeviceBase_Base;
typedef ::canvas::GraphicDeviceBase< ::canvas::BaseMutexHelper< GraphicDeviceBase_Base >, typedef ::canvas::GraphicDeviceBase< ::canvas::DisambiguationHelper< GraphicDeviceBase_Base >,
DeviceHelper, DeviceHelper,
tools::LocalGuard, tools::LocalGuard,
::cppu::OWeakObject > CanvasBase_Base; ::cppu::OWeakObject > CanvasBase_Base;
@@ -96,12 +96,8 @@ namespace vclcanvas
/// For resource tracking /// For resource tracking
~Canvas(); ~Canvas();
#if defined __SUNPRO_CC
using CanvasBaseT::disposing;
#endif
/// Dispose all internal references /// Dispose all internal references
virtual void SAL_CALL disposing(); virtual void disposeThis();
// Forwarding the XComponent implementation to the // Forwarding the XComponent implementation to the
// cppu::ImplHelper templated base // cppu::ImplHelper templated base

View File

@@ -82,12 +82,6 @@ namespace vclcanvas
maCanvasHelper.init( rBitmap, rDevice, rOutDevProvider ); maCanvasHelper.init( rBitmap, rDevice, rOutDevProvider );
} }
void SAL_CALL CanvasBitmap::disposing()
{
// forward to base
CanvasBitmap_Base::disposing();
}
#define IMPLEMENTATION_NAME "VCLCanvas.CanvasBitmap" #define IMPLEMENTATION_NAME "VCLCanvas.CanvasBitmap"
#define SERVICE_NAME "com.sun.star.rendering.CanvasBitmap" #define SERVICE_NAME "com.sun.star.rendering.CanvasBitmap"

View File

@@ -57,7 +57,7 @@ namespace vclcanvas
::com::sun::star::rendering::XIntegerBitmap, ::com::sun::star::rendering::XIntegerBitmap,
::com::sun::star::lang::XServiceInfo, ::com::sun::star::lang::XServiceInfo,
::com::sun::star::beans::XFastPropertySet > CanvasBitmapBase_Base; ::com::sun::star::beans::XFastPropertySet > CanvasBitmapBase_Base;
typedef ::canvas::IntegerBitmapBase< ::canvas::BaseMutexHelper< CanvasBitmapBase_Base >, typedef ::canvas::IntegerBitmapBase< ::canvas::DisambiguationHelper< CanvasBitmapBase_Base >,
CanvasBitmapHelper, CanvasBitmapHelper,
tools::LocalGuard, tools::LocalGuard,
::cppu::OWeakObject > CanvasBitmap_Base; ::cppu::OWeakObject > CanvasBitmap_Base;
@@ -87,9 +87,6 @@ namespace vclcanvas
::com::sun::star::rendering::XGraphicDevice& rDevice, ::com::sun::star::rendering::XGraphicDevice& rDevice,
const OutDevProviderSharedPtr& rOutDevProvider ); const OutDevProviderSharedPtr& rOutDevProvider );
// overridden because of mpDevice
virtual void SAL_CALL disposing();
// XServiceInfo // XServiceInfo
virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw (::com::sun::star::uno::RuntimeException); 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); virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException);

View File

@@ -129,14 +129,6 @@ namespace vclcanvas
maCanvasHelper.clear(); maCanvasHelper.clear();
} }
void SAL_CALL CanvasCustomSprite::disposing()
{
SolarMutexGuard aGuard;
// forward to parent
CanvasCustomSpriteBaseT::disposing();
}
#define IMPLEMENTATION_NAME "VCLCanvas.CanvasCustomSprite" #define IMPLEMENTATION_NAME "VCLCanvas.CanvasCustomSprite"
#define SERVICE_NAME "com.sun.star.rendering.CanvasCustomSprite" #define SERVICE_NAME "com.sun.star.rendering.CanvasCustomSprite"

View File

@@ -41,7 +41,7 @@
#include <vcl/virdev.hxx> #include <vcl/virdev.hxx>
#include <canvas/vclwrapper.hxx> #include <canvas/vclwrapper.hxx>
#include <canvas/base/basemutexhelper.hxx> #include <canvas/base/disambiguationhelper.hxx>
#include <canvas/base/spritesurface.hxx> #include <canvas/base/spritesurface.hxx>
#include <canvas/base/canvascustomspritebase.hxx> #include <canvas/base/canvascustomspritebase.hxx>
@@ -77,7 +77,7 @@ namespace vclcanvas
remain a base class that provides implementation, not to remain a base class that provides implementation, not to
enforce any specific interface on its derivees. 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 Sprite
{ {
}; };
@@ -100,8 +100,6 @@ namespace vclcanvas
const OutDevProviderSharedPtr& rOutDevProvider, const OutDevProviderSharedPtr& rOutDevProvider,
bool bShowSpriteBounds ); bool bShowSpriteBounds );
virtual void SAL_CALL disposing();
// Forwarding the XComponent implementation to the // Forwarding the XComponent implementation to the
// cppu::ImplHelper templated base // cppu::ImplHelper templated base
// Classname Base doing refcount Base implementing the XComponent interface // Classname Base doing refcount Base implementing the XComponent interface

View File

@@ -129,14 +129,14 @@ namespace vclcanvas
} }
void SAL_CALL SpriteCanvas::disposing() void SpriteCanvas::disposeThis()
{ {
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
mxComponentContext.clear(); mxComponentContext.clear();
// forward to parent // forward to parent
SpriteCanvasBaseT::disposing(); SpriteCanvasBaseT::disposeThis();
} }
::sal_Bool SAL_CALL SpriteCanvas::showBuffer( ::sal_Bool bUpdateAll ) throw (uno::RuntimeException) ::sal_Bool SAL_CALL SpriteCanvas::showBuffer( ::sal_Bool bUpdateAll ) throw (uno::RuntimeException)

View File

@@ -45,7 +45,7 @@
#include <comphelper/uno3.hxx> #include <comphelper/uno3.hxx>
#include <canvas/base/spritecanvasbase.hxx> #include <canvas/base/spritecanvasbase.hxx>
#include <canvas/base/basemutexhelper.hxx> #include <canvas/base/disambiguationhelper.hxx>
#include <canvas/base/bufferedgraphicdevicebase.hxx> #include <canvas/base/bufferedgraphicdevicebase.hxx>
#include "spritecanvashelper.hxx" #include "spritecanvashelper.hxx"
@@ -68,7 +68,7 @@ namespace vclcanvas
::com::sun::star::util::XUpdatable, ::com::sun::star::util::XUpdatable,
::com::sun::star::beans::XPropertySet, ::com::sun::star::beans::XPropertySet,
::com::sun::star::lang::XServiceName > WindowGraphicDeviceBase_Base; ::com::sun::star::lang::XServiceName > WindowGraphicDeviceBase_Base;
typedef ::canvas::BufferedGraphicDeviceBase< ::canvas::BaseMutexHelper< WindowGraphicDeviceBase_Base >, typedef ::canvas::BufferedGraphicDeviceBase< ::canvas::DisambiguationHelper< WindowGraphicDeviceBase_Base >,
SpriteDeviceHelper, SpriteDeviceHelper,
tools::LocalGuard, tools::LocalGuard,
::cppu::OWeakObject > SpriteCanvasBase_Base; ::cppu::OWeakObject > SpriteCanvasBase_Base;
@@ -123,12 +123,8 @@ namespace vclcanvas
/// For resource tracking /// For resource tracking
~SpriteCanvas(); ~SpriteCanvas();
#if defined __SUNPRO_CC
using SpriteCanvasBaseT::disposing;
#endif
/// Dispose all internal references /// Dispose all internal references
virtual void SAL_CALL disposing(); virtual void disposeThis();
// Forwarding the XComponent implementation to the // Forwarding the XComponent implementation to the
// cppu::ImplHelper templated base // cppu::ImplHelper templated base