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/basemutexhelper.hxx b/canvas/inc/canvas/base/disambiguationhelper.hxx
similarity index 62%
rename from canvas/inc/canvas/base/basemutexhelper.hxx
rename to canvas/inc/canvas/base/disambiguationhelper.hxx
index c1c7eed8455e..b58ed29ea289 100644
--- a/canvas/inc/canvas/base/basemutexhelper.hxx
+++ b/canvas/inc/canvas/base/disambiguationhelper.hxx
@@ -26,30 +26,37 @@
*
************************************************************************/
-#ifndef INCLUDED_CANVAS_BASEMUTEXHELPER_HXX
-#define INCLUDED_CANVAS_BASEMUTEXHELPER_HXX
+#ifndef INCLUDED_CANVAS_DISAMBIGUATIONHELPER_HXX
+#define INCLUDED_CANVAS_DISAMBIGUATIONHELPER_HXX
#include
-/* Definition of the BaseMutexHelper class */
+/* Definition of the DisambiguationHelper class */
namespace canvas
{
- /** Base class, deriving from ::comphelper::OBaseMutex and
- initializing its own baseclass with m_aMutex.
+ /** 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 BaseMutexHelper : public Base
+ template< class Base > class DisambiguationHelper : public Base
{
public:
typedef Base BaseType;
- /** Construct BaseMutexHelper
+ /** Construct DisambiguationHelper
This method is the whole purpose of this template:
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
theirs).
*/
- BaseMutexHelper() :
+ 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_BASEMUTEXHELPER_HXX */
+#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