Kaydet (Commit) 09b546cf authored tarafından Thorsten Behrens's avatar Thorsten Behrens

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.
üst 55961e2d
......@@ -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)
......
......@@ -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
......
......@@ -103,14 +103,14 @@ namespace canvas
@derive when overriding this method in derived classes,
<em>always</em> 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
......
......@@ -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 <osl/mutex.hxx>
/* 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: */
......@@ -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
......
......@@ -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
......
......@@ -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)
......
......@@ -47,7 +47,7 @@
#include <comphelper/uno3.hxx>
#include <canvas/base/spritecanvasbase.hxx>
#include <canvas/base/basemutexhelper.hxx>
#include <canvas/base/disambiguationhelper.hxx>
#include <canvas/base/bufferedgraphicdevicebase.hxx>
#include <basegfx/vector/b2isize.hxx>
......@@ -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
......
......@@ -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()
......
......@@ -58,7 +58,7 @@ namespace cairocanvas
::com::sun::star::lang::XServiceInfo,
::com::sun::star::beans::XFastPropertySet > CanvasBitmapBase_Base;
class CanvasBitmapSpriteSurface_Base :
public ::canvas::BaseMutexHelper<CanvasBitmapBase_Base>,
public ::canvas::DisambiguationHelper<CanvasBitmapBase_Base>,
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
......
......@@ -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,
......
......@@ -42,7 +42,7 @@
#include <basegfx/vector/b2isize.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <canvas/base/basemutexhelper.hxx>
#include <canvas/base/disambiguationhelper.hxx>
#include <canvas/base/canvascustomspritebase.hxx>
#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
......
......@@ -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)
......
......@@ -45,7 +45,7 @@
#include <comphelper/uno3.hxx>
#include <canvas/base/spritecanvasbase.hxx>
#include <canvas/base/basemutexhelper.hxx>
#include <canvas/base/disambiguationhelper.hxx>
#include <canvas/base/bufferedgraphicdevicebase.hxx>
#include <basegfx/vector/b2isize.hxx>
......@@ -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
......
......@@ -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)
......
......@@ -45,7 +45,7 @@
#include <comphelper/uno3.hxx>
#include <canvas/base/integerbitmapbase.hxx>
#include <canvas/base/basemutexhelper.hxx>
#include <canvas/base/disambiguationhelper.hxx>
#include <canvas/base/graphicdevicebase.hxx>
#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
......
......@@ -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
......
......@@ -42,7 +42,7 @@
#include <cppuhelper/compbase3.hxx>
#include <comphelper/uno3.hxx>
#include <canvas/base/basemutexhelper.hxx>
#include <canvas/base/disambiguationhelper.hxx>
#include <canvas/base/integerbitmapbase.hxx>
#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);
......
......@@ -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"
......
......@@ -42,7 +42,7 @@
#include <basegfx/vector/b2isize.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <canvas/base/basemutexhelper.hxx>
#include <canvas/base/disambiguationhelper.hxx>
#include <canvas/base/canvascustomspritebase.hxx>
#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
......
......@@ -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)
......
......@@ -45,7 +45,7 @@
#include <comphelper/uno3.hxx>
#include <canvas/base/spritecanvasbase.hxx>
#include <canvas/base/basemutexhelper.hxx>
#include <canvas/base/disambiguationhelper.hxx>
#include <canvas/base/bufferedgraphicdevicebase.hxx>
#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
......
......@@ -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"
......
......@@ -40,6 +40,7 @@
#include <boost/shared_ptr.hpp>
#include <canvas/base/integerbitmapbase.hxx>
#include <canvas/base/disambiguationhelper.hxx>
#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);
......
......@@ -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
......
......@@ -42,7 +42,7 @@
#include <basegfx/vector/b2isize.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <canvas/base/basemutexhelper.hxx>
#include <canvas/base/disambiguationhelper.hxx>
#include <canvas/base/canvascustomspritebase.hxx>
#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
......
......@@ -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)
......
......@@ -45,7 +45,7 @@
#include <comphelper/uno3.hxx>
#include <canvas/base/spritecanvasbase.hxx>
#include <canvas/base/basemutexhelper.hxx>
#include <canvas/base/disambiguationhelper.hxx>
#include <canvas/base/bufferedgraphicdevicebase.hxx>
#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
......
......@@ -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)
......
......@@ -43,7 +43,7 @@
#include <cppuhelper/compbase7.hxx>
#include <comphelper/uno3.hxx>
#include <canvas/base/basemutexhelper.hxx>
#include <canvas/base/disambiguationhelper.hxx>
#include <canvas/base/integerbitmapbase.hxx>
#include <canvas/base/graphicdevicebase.hxx>
......@@ -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
......
......@@ -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"
......
......@@ -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);
......
......@@ -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"
......
......@@ -41,7 +41,7 @@
#include <vcl/virdev.hxx>
#include <canvas/vclwrapper.hxx>
#include <canvas/base/basemutexhelper.hxx>
#include <canvas/base/disambiguationhelper.hxx>
#include <canvas/base/spritesurface.hxx>
#include <canvas/base/canvascustomspritebase.hxx>
......@@ -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
......
......@@ -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)
......
......@@ -45,7 +45,7 @@
#include <comphelper/uno3.hxx>
#include <canvas/base/spritecanvasbase.hxx>
#include <canvas/base/basemutexhelper.hxx>
#include <canvas/base/disambiguationhelper.hxx>
#include <canvas/base/bufferedgraphicdevicebase.hxx>
#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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment