[Libreoffice-commits] core.git: 4 commits - accessibility/source comphelper/source framework/Library_fwe.mk include/comphelper include/connectivity include/svtools include/toolkit sfx2/Library_sfx.mk svtools/Library_svt.mk svtools/source svx/source
Noel Grandin
noel at peralex.com
Tue Jul 8 06:18:42 PDT 2014
accessibility/source/helper/acc_factory.cxx | 24 --------
comphelper/source/misc/asyncnotification.cxx | 18 ------
framework/Library_fwe.mk | 1
include/comphelper/asyncnotification.hxx | 9 ---
include/connectivity/CommonTools.hxx | 30 +---------
include/svtools/accessiblefactory.hxx | 5 +
include/svtools/toolpanel/decklayouter.hxx | 3 -
include/svtools/toolpanel/drawerlayouter.hxx | 7 --
include/svtools/toolpanel/refbase.hxx | 75 ---------------------------
include/svtools/toolpanel/tablayouter.hxx | 8 --
include/svtools/toolpanel/toolpanel.hxx | 9 +--
include/toolkit/helper/accessiblefactory.hxx | 2
sfx2/Library_sfx.mk | 1
svtools/Library_svt.mk | 1
svtools/source/misc/svtaccessiblefactory.cxx | 24 --------
svtools/source/table/defaultinputhandler.cxx | 10 +--
svtools/source/table/mousefunction.cxx | 21 -------
svtools/source/table/mousefunction.hxx | 37 ++-----------
svtools/source/toolpanel/drawerlayouter.cxx | 3 -
svtools/source/toolpanel/dummypanel.cxx | 3 -
svtools/source/toolpanel/dummypanel.hxx | 7 --
svtools/source/toolpanel/refbase.cxx | 50 ------------------
svtools/source/toolpanel/tablayouter.cxx | 3 -
svtools/source/toolpanel/toolpanel.cxx | 4 -
svx/source/form/fmscriptingenv.cxx | 25 ---------
svx/source/inc/fmscriptingenv.hxx | 3 -
26 files changed, 39 insertions(+), 344 deletions(-)
New commits:
commit f692c88e6062889aa12bf6cd7a71f63d177a37c4
Author: Noel Grandin <noel at peralex.com>
Date: Tue Jul 8 15:15:42 2014 +0200
use SimpleReferenceObject in comphelper module
to replace hand-rolled version
Change-Id: Ie4e66d2f1f893c04be589877ef53f470ca74c9eb
diff --git a/comphelper/source/misc/asyncnotification.cxx b/comphelper/source/misc/asyncnotification.cxx
index a8c018c..dafe1a7 100644
--- a/comphelper/source/misc/asyncnotification.cxx
+++ b/comphelper/source/misc/asyncnotification.cxx
@@ -38,7 +38,6 @@ namespace comphelper
AnyEvent::AnyEvent()
- :m_refCount( 0 )
{
}
@@ -48,23 +47,6 @@ namespace comphelper
}
- oslInterlockedCount SAL_CALL AnyEvent::acquire()
- {
- return osl_atomic_increment( &m_refCount );
- }
-
-
- oslInterlockedCount SAL_CALL AnyEvent::release()
- {
- if ( 0 == osl_atomic_decrement( &m_refCount ) )
- {
- delete this;
- return 0;
- }
- return m_refCount;
- }
-
-
//= ProcessableEvent
struct ProcessableEvent
diff --git a/framework/Library_fwe.mk b/framework/Library_fwe.mk
index ab5f460..ee08654 100644
--- a/framework/Library_fwe.mk
+++ b/framework/Library_fwe.mk
@@ -41,6 +41,7 @@ $(eval $(call gb_Library_use_libraries,fwe,\
cppuhelper \
fwi \
sal \
+ salhelper \
i18nlangtag \
svl \
svt \
diff --git a/include/comphelper/asyncnotification.hxx b/include/comphelper/asyncnotification.hxx
index 19f9fa8..9320976 100644
--- a/include/comphelper/asyncnotification.hxx
+++ b/include/comphelper/asyncnotification.hxx
@@ -27,6 +27,7 @@
#include <rtl/ref.hxx>
#include <sal/types.h>
#include <salhelper/thread.hxx>
+#include <salhelper/simplereferenceobject.hxx>
namespace comphelper
@@ -38,17 +39,11 @@ namespace comphelper
/** the very basic instance to hold a description of an event
*/
- class COMPHELPER_DLLPUBLIC AnyEvent : ::rtl::IReference
+ class COMPHELPER_DLLPUBLIC AnyEvent : public salhelper::SimpleReferenceObject
{
- private:
- oslInterlockedCount m_refCount;
-
public:
AnyEvent();
- virtual oslInterlockedCount SAL_CALL acquire() SAL_OVERRIDE;
- virtual oslInterlockedCount SAL_CALL release() SAL_OVERRIDE;
-
protected:
virtual ~AnyEvent();
commit 48cc4f1b8cf06a8e56c12e659a71f72d609568cd
Author: Noel Grandin <noel at peralex.com>
Date: Tue Jul 8 14:21:40 2014 +0200
use SimpleReferenceObject in connectivity module
to replace hand-rolled version
Change-Id: I7a7bf7f8f7d4f8a73ee842e7aba5eab5a254d8eb
diff --git a/include/connectivity/CommonTools.hxx b/include/connectivity/CommonTools.hxx
index d099905..4199c9c 100644
--- a/include/connectivity/CommonTools.hxx
+++ b/include/connectivity/CommonTools.hxx
@@ -37,6 +37,7 @@
#include <com/sun/star/uno/XComponentContext.hpp>
#include <connectivity/dbtoolsdllapi.hxx>
#include <cppuhelper/supportsservice.hxx>
+#include <salhelper/simplereferenceobject.hxx>
namespace com { namespace sun { namespace star { namespace util {
struct Date;
@@ -63,19 +64,18 @@ namespace connectivity
typedef std::map<OUString,OSQLTable,comphelper::UStringMixLess> OSQLTables;
// class ORefVector allows reference counting on a std::vector
- template< class VectorVal > class ORefVector
+ template< class VectorVal > class ORefVector : public salhelper::SimpleReferenceObject
{
std::vector< VectorVal > m_vector;
- oslInterlockedCount m_refCount;
protected:
virtual ~ORefVector(){}
public:
typedef std::vector< VectorVal > Vector;
- ORefVector() : m_refCount(0) {}
- ORefVector(size_t _st) : m_vector(_st) , m_refCount(0) {}
- ORefVector(const ORefVector& _rRH) : m_vector(_rRH.m_vector),m_refCount(0)
+ ORefVector() {}
+ ORefVector(size_t _st) : m_vector(_st) {}
+ ORefVector(const ORefVector& _rRH) : m_vector(_rRH.m_vector)
{
}
ORefVector& operator=(const ORefVector& _rRH)
@@ -89,26 +89,6 @@ namespace connectivity
std::vector< VectorVal > & get() { return m_vector; }
std::vector< VectorVal > const & get() const { return m_vector; }
-
- inline static void * SAL_CALL operator new( size_t nSize )
- { return ::rtl_allocateMemory( nSize ); }
- inline static void SAL_CALL operator delete( void * pMem )
- { ::rtl_freeMemory( pMem ); }
- inline static void * SAL_CALL operator new( size_t, void * pMem )
- { return pMem; }
- inline static void SAL_CALL operator delete( void *, void * )
- {}
-
- void acquire()
- {
- osl_atomic_increment( &m_refCount );
- }
- void release()
- {
- if (! osl_atomic_decrement( &m_refCount ))
- delete this;
- }
-
};
// class ORowVector incudes refcounting and initialze himself
commit f219bfb26f98e6afaf19fe892d5bac746c82ef96
Author: Noel Grandin <noel at peralex.com>
Date: Tue Jul 8 14:05:21 2014 +0200
use SimpleReferenceObject in svx module
to replace hand-rolled version
Change-Id: I084a21161ae44991199fbd2b12d61dcb7d592408
diff --git a/svx/source/form/fmscriptingenv.cxx b/svx/source/form/fmscriptingenv.cxx
index 5c9b5b9..120dcb5 100644
--- a/svx/source/form/fmscriptingenv.cxx
+++ b/svx/source/form/fmscriptingenv.cxx
@@ -148,7 +148,6 @@ namespace svxform
private:
::osl::Mutex m_aMutex;
- oslInterlockedCount m_refCount;
ListenerImplementation m_pScriptListener;
FmFormModel& m_rFormModel;
bool m_bDisposed;
@@ -165,10 +164,6 @@ namespace svxform
virtual void revokeEventAttacherManager( const Reference< XEventAttacherManager >& _rxManager ) SAL_OVERRIDE;
virtual void dispose() SAL_OVERRIDE;
- // IReference
- virtual oslInterlockedCount SAL_CALL acquire() SAL_OVERRIDE;
- virtual oslInterlockedCount SAL_CALL release() SAL_OVERRIDE;
-
private:
void impl_registerOrRevoke_throw( const Reference< XEventAttacherManager >& _rxManager, bool _bRegister );
};
@@ -804,8 +799,7 @@ namespace svxform
FormScriptingEnvironment::FormScriptingEnvironment( FmFormModel& _rModel )
- :m_refCount( 0 )
- ,m_pScriptListener( NULL )
+ :m_pScriptListener( NULL )
,m_rFormModel( _rModel )
,m_bDisposed( false )
{
@@ -856,23 +850,6 @@ namespace svxform
}
- oslInterlockedCount SAL_CALL FormScriptingEnvironment::acquire()
- {
- return osl_atomic_increment( &m_refCount );
- }
-
-
- oslInterlockedCount SAL_CALL FormScriptingEnvironment::release()
- {
- if ( 0 == osl_atomic_decrement( &m_refCount ) )
- {
- delete this;
- return 0;
- }
- return m_refCount;
- }
-
-
IFormScriptingEnvironment::~IFormScriptingEnvironment()
{
}
diff --git a/svx/source/inc/fmscriptingenv.hxx b/svx/source/inc/fmscriptingenv.hxx
index 8d86f25..9e9e7db 100644
--- a/svx/source/inc/fmscriptingenv.hxx
+++ b/svx/source/inc/fmscriptingenv.hxx
@@ -22,6 +22,7 @@
#include <com/sun/star/script/XEventAttacherManager.hpp>
#include <rtl/ref.hxx>
+#include <salhelper/simplereferenceobject.hxx>
class FmFormModel;
@@ -35,7 +36,7 @@ namespace svxform
/** describes the interface implemented by a component which handles scripting requirements
in a form/control environment.
*/
- class SAL_NO_VTABLE IFormScriptingEnvironment : public ::rtl::IReference
+ class SAL_NO_VTABLE IFormScriptingEnvironment : public ::salhelper::SimpleReferenceObject
{
public:
/** registers an XEventAttacherManager whose events should be monitored and handled
commit 482f97926e1090c50ef05eed6badf311a7aa02f9
Author: Noel Grandin <noel at peralex.com>
Date: Mon Jul 7 11:26:58 2014 +0200
use SimpleReferenceObject in svtools module
to replace hand-rolled version
Change-Id: I7a1048ff1ea335c3934fe7e91a09489a4d7aeb96
diff --git a/accessibility/source/helper/acc_factory.cxx b/accessibility/source/helper/acc_factory.cxx
index ed4d2da..495d93d 100644
--- a/accessibility/source/helper/acc_factory.cxx
+++ b/accessibility/source/helper/acc_factory.cxx
@@ -87,16 +87,9 @@ inline bool hasFloatingChild(Window *pWindow)
class AccessibleFactory :public ::toolkit::IAccessibleFactory
,public ::svt::IAccessibleFactory
{
-private:
- oslInterlockedCount m_refCount;
-
public:
AccessibleFactory();
- // IReference
- virtual oslInterlockedCount SAL_CALL acquire() SAL_OVERRIDE;
- virtual oslInterlockedCount SAL_CALL release() SAL_OVERRIDE;
-
// ::toolkit::IAccessibleFactory
virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext >
createAccessibleContext( VCLXButton* _pXWindow ) SAL_OVERRIDE;
@@ -228,7 +221,6 @@ protected:
};
AccessibleFactory::AccessibleFactory()
- :m_refCount( 0 )
{
}
@@ -236,22 +228,6 @@ AccessibleFactory::~AccessibleFactory()
{
}
-oslInterlockedCount SAL_CALL AccessibleFactory::acquire()
-{
- return osl_atomic_increment( &m_refCount );
-}
-
-oslInterlockedCount SAL_CALL AccessibleFactory::release()
-{
- if ( 0 == osl_atomic_decrement( &m_refCount ) )
- {
- delete this;
- return 0;
- }
-
- return m_refCount;
-}
-
Reference< XAccessible > AccessibleFactory::createAccessible( Menu* _pMenu, sal_Bool _bIsMenuBar )
{
OAccessibleMenuBaseComponent* pAccessible;
diff --git a/include/svtools/accessiblefactory.hxx b/include/svtools/accessiblefactory.hxx
index b13dabd..21ba910 100644
--- a/include/svtools/accessiblefactory.hxx
+++ b/include/svtools/accessiblefactory.hxx
@@ -26,6 +26,7 @@
#include <com/sun/star/uno/Reference.hxx>
#include <rtl/ref.hxx>
+#include <salhelper/simplereferenceobject.hxx>
namespace com { namespace sun { namespace star {
namespace accessibility {
@@ -70,7 +71,7 @@ namespace svt
//= IAccessibleFactory
- class IAccessibleFactory : public ::rtl::IReference
+ class IAccessibleFactory : public virtual ::salhelper::SimpleReferenceObject
{
public:
virtual IAccessibleTabListBox*
@@ -172,7 +173,7 @@ namespace svt
) = 0;
protected:
- ~IAccessibleFactory() {}
+ virtual ~IAccessibleFactory() {}
};
diff --git a/include/svtools/toolpanel/decklayouter.hxx b/include/svtools/toolpanel/decklayouter.hxx
index 11345e7..e5b9e931 100644
--- a/include/svtools/toolpanel/decklayouter.hxx
+++ b/include/svtools/toolpanel/decklayouter.hxx
@@ -23,6 +23,7 @@
#include <com/sun/star/uno/Reference.hxx>
#include <rtl/ref.hxx>
+#include <salhelper/simplereferenceobject.hxx>
#include <boost/optional.hpp>
@@ -40,7 +41,7 @@ namespace svt
//= IDeckLayouter
- class IDeckLayouter : public ::rtl::IReference
+ class IDeckLayouter : public salhelper::SimpleReferenceObject
{
public:
/** re-arranges the elements of the tool deck, taking into account the
diff --git a/include/svtools/toolpanel/drawerlayouter.hxx b/include/svtools/toolpanel/drawerlayouter.hxx
index 4ee46ae..2cef5d7 100644
--- a/include/svtools/toolpanel/drawerlayouter.hxx
+++ b/include/svtools/toolpanel/drawerlayouter.hxx
@@ -21,7 +21,6 @@
#define INCLUDED_SVTOOLS_TOOLPANEL_DRAWERLAYOUTER_HXX
#include <svtools/svtdllapi.h>
-#include <svtools/toolpanel/refbase.hxx>
#include <svtools/toolpanel/toolpaneldeck.hxx>
#include <svtools/toolpanel/decklayouter.hxx>
@@ -41,8 +40,7 @@ namespace svt
/** a class which implements a tool panel selector in the form of the classical drawers
*/
- class SVT_DLLPUBLIC DrawerDeckLayouter :public RefBase
- ,public IDeckLayouter
+ class SVT_DLLPUBLIC DrawerDeckLayouter :public IDeckLayouter
,public IToolPanelDeckListener
{
public:
@@ -52,9 +50,6 @@ namespace svt
);
virtual ~DrawerDeckLayouter();
- // IReference
- DECLARE_IREFERENCE()
-
// IDeckLayouter
virtual Rectangle Layout( const Rectangle& i_rDeckPlayground ) SAL_OVERRIDE;
virtual void Destroy() SAL_OVERRIDE;
diff --git a/include/svtools/toolpanel/refbase.hxx b/include/svtools/toolpanel/refbase.hxx
deleted file mode 100644
index 15fda18..0000000
--- a/include/svtools/toolpanel/refbase.hxx
+++ /dev/null
@@ -1,75 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#ifndef INCLUDED_SVTOOLS_TOOLPANEL_REFBASE_HXX
-#define INCLUDED_SVTOOLS_TOOLPANEL_REFBASE_HXX
-
-#include <svtools/svtdllapi.h>
-
-#include <rtl/ref.hxx>
-
-
-namespace svt
-{
-
-
-
- //= RefBase
-
- class SVT_DLLPUBLIC RefBase : public ::rtl::IReference
- {
- protected:
- RefBase()
- :m_refCount( 0 )
- {
- }
-
- virtual ~RefBase()
- {
- }
-
- virtual oslInterlockedCount SAL_CALL acquire() SAL_OVERRIDE;
- virtual oslInterlockedCount SAL_CALL release() SAL_OVERRIDE;
-
- private:
- oslInterlockedCount m_refCount;
- };
-
-#define DECLARE_IREFERENCE() \
- virtual oslInterlockedCount SAL_CALL acquire() SAL_OVERRIDE; \
- virtual oslInterlockedCount SAL_CALL release() SAL_OVERRIDE;
-
-
-#define IMPLEMENT_IREFERENCE( classname ) \
- oslInterlockedCount classname::acquire() \
- { \
- return RefBase::acquire(); \
- } \
- oslInterlockedCount classname::release() \
- { \
- return RefBase::release(); \
- }
-
-
-} // namespace svt
-
-
-#endif // INCLUDED_SVTOOLS_TOOLPANEL_REFBASE_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svtools/toolpanel/tablayouter.hxx b/include/svtools/toolpanel/tablayouter.hxx
index 17b5c4f..db89736 100644
--- a/include/svtools/toolpanel/tablayouter.hxx
+++ b/include/svtools/toolpanel/tablayouter.hxx
@@ -24,7 +24,7 @@
#include <svtools/toolpanel/decklayouter.hxx>
#include <svtools/toolpanel/tabalignment.hxx>
#include <svtools/toolpanel/tabitemcontent.hxx>
-#include <svtools/toolpanel/refbase.hxx>
+#include <salhelper/simplereferenceobject.hxx>
#include <memory>
@@ -44,8 +44,7 @@ namespace svt
//= TabDeckLayouter
- class SVT_DLLPUBLIC TabDeckLayouter :public RefBase
- ,public IDeckLayouter
+ class SVT_DLLPUBLIC TabDeckLayouter :public IDeckLayouter
,public ::boost::noncopyable
{
public:
@@ -83,9 +82,6 @@ namespace svt
const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& i_rParentAccessible
) SAL_OVERRIDE;
- // IReference
- DECLARE_IREFERENCE()
-
private:
::std::auto_ptr< TabDeckLayouter_Data > m_pData;
};
diff --git a/include/svtools/toolpanel/toolpanel.hxx b/include/svtools/toolpanel/toolpanel.hxx
index 7fea988..27084d8 100644
--- a/include/svtools/toolpanel/toolpanel.hxx
+++ b/include/svtools/toolpanel/toolpanel.hxx
@@ -21,8 +21,9 @@
#define INCLUDED_SVTOOLS_TOOLPANEL_TOOLPANEL_HXX
#include <svtools/svtdllapi.h>
-#include <svtools/toolpanel/refbase.hxx>
+#include <salhelper/simplereferenceobject.hxx>
+#include <rtl/ref.hxx>
#include <rtl/ustring.hxx>
#include <vcl/image.hxx>
@@ -44,7 +45,7 @@ namespace svt
/** abstract interface for a single tool panel
*/
- class SVT_DLLPUBLIC IToolPanel : public ::rtl::IReference
+ class SVT_DLLPUBLIC IToolPanel : public salhelper::SimpleReferenceObject
{
public:
/// retrieves the display name of the panel
@@ -118,15 +119,11 @@ namespace svt
but still being abstract
*/
class SVT_DLLPUBLIC ToolPanelBase :public IToolPanel
- ,public RefBase
,public ::boost::noncopyable
{
protected:
ToolPanelBase();
virtual ~ToolPanelBase();
-
- public:
- DECLARE_IREFERENCE()
};
diff --git a/include/toolkit/helper/accessiblefactory.hxx b/include/toolkit/helper/accessiblefactory.hxx
index bcd3dce..e56eda2 100644
--- a/include/toolkit/helper/accessiblefactory.hxx
+++ b/include/toolkit/helper/accessiblefactory.hxx
@@ -58,7 +58,7 @@ namespace toolkit
//= IAccessibleFactory
- class IAccessibleFactory : public salhelper::SimpleReferenceObject
+ class IAccessibleFactory : public virtual salhelper::SimpleReferenceObject
{
public:
/** creates an accessible context for a button window
diff --git a/sfx2/Library_sfx.mk b/sfx2/Library_sfx.mk
index 9ff7a37..249cdd8 100644
--- a/sfx2/Library_sfx.mk
+++ b/sfx2/Library_sfx.mk
@@ -62,6 +62,7 @@ $(eval $(call gb_Library_use_libraries,sfx,\
i18nlangtag \
i18nutil \
sal \
+ salhelper \
sax \
sb \
sot \
diff --git a/svtools/Library_svt.mk b/svtools/Library_svt.mk
index 192f14a..ea5e953 100644
--- a/svtools/Library_svt.mk
+++ b/svtools/Library_svt.mk
@@ -216,7 +216,6 @@ $(eval $(call gb_Library_add_exception_objects,svt,\
svtools/source/toolpanel/paneldecklisteners \
svtools/source/toolpanel/paneltabbar \
svtools/source/toolpanel/paneltabbarpeer \
- svtools/source/toolpanel/refbase \
svtools/source/toolpanel/tabbargeometry \
svtools/source/toolpanel/tablayouter \
svtools/source/toolpanel/toolpanel \
diff --git a/svtools/source/misc/svtaccessiblefactory.cxx b/svtools/source/misc/svtaccessiblefactory.cxx
index 4704e4f..02f9dfb 100644
--- a/svtools/source/misc/svtaccessiblefactory.cxx
+++ b/svtools/source/misc/svtaccessiblefactory.cxx
@@ -52,14 +52,7 @@ namespace svt
protected:
virtual ~AccessibleDummyFactory();
- private:
- oslInterlockedCount m_refCount;
-
public:
- // IReference
- virtual oslInterlockedCount SAL_CALL acquire() SAL_OVERRIDE;
- virtual oslInterlockedCount SAL_CALL release() SAL_OVERRIDE;
-
// IAccessibleFactory
virtual IAccessibleTabListBox*
createAccessibleTabListBox(
@@ -205,7 +198,6 @@ namespace svt
AccessibleDummyFactory::AccessibleDummyFactory()
- : m_refCount(0)
{
}
@@ -214,22 +206,6 @@ namespace svt
{
}
-
- oslInterlockedCount SAL_CALL AccessibleDummyFactory::acquire()
- {
- return osl_atomic_increment( &m_refCount );
- }
-
-
- oslInterlockedCount SAL_CALL AccessibleDummyFactory::release()
- {
- if ( 0 == osl_atomic_decrement( &m_refCount ) )
- {
- delete this;
- return 0;
- }
- return m_refCount;
- }
}
diff --git a/svtools/source/table/defaultinputhandler.cxx b/svtools/source/table/defaultinputhandler.cxx
index ff006aa..292121e 100644
--- a/svtools/source/table/defaultinputhandler.cxx
+++ b/svtools/source/table/defaultinputhandler.cxx
@@ -32,7 +32,7 @@ namespace svt { namespace table
{
- typedef ::rtl::Reference< IMouseFunction > PMouseFunction;
+ typedef ::rtl::Reference< MouseFunction > PMouseFunction;
typedef ::std::vector< PMouseFunction > MouseFunctions;
struct DefaultInputHandler_Impl
{
@@ -61,7 +61,7 @@ namespace svt { namespace table
namespace
{
bool lcl_delegateMouseEvent( DefaultInputHandler_Impl& i_impl, ITableControl& i_control, const MouseEvent& i_event,
- FunctionResult ( IMouseFunction::*i_handlerMethod )( ITableControl&, const MouseEvent& ) )
+ FunctionResult ( MouseFunction::*i_handlerMethod )( ITableControl&, const MouseEvent& ) )
{
if ( i_impl.pActiveFunction.is() )
{
@@ -118,19 +118,19 @@ namespace svt { namespace table
bool DefaultInputHandler::MouseMove( ITableControl& i_tableControl, const MouseEvent& i_event )
{
- return lcl_delegateMouseEvent( *m_pImpl, i_tableControl, i_event, &IMouseFunction::handleMouseMove );
+ return lcl_delegateMouseEvent( *m_pImpl, i_tableControl, i_event, &MouseFunction::handleMouseMove );
}
bool DefaultInputHandler::MouseButtonDown( ITableControl& i_tableControl, const MouseEvent& i_event )
{
- return lcl_delegateMouseEvent( *m_pImpl, i_tableControl, i_event, &IMouseFunction::handleMouseDown );
+ return lcl_delegateMouseEvent( *m_pImpl, i_tableControl, i_event, &MouseFunction::handleMouseDown );
}
bool DefaultInputHandler::MouseButtonUp( ITableControl& i_tableControl, const MouseEvent& i_event )
{
- return lcl_delegateMouseEvent( *m_pImpl, i_tableControl, i_event, &IMouseFunction::handleMouseUp );
+ return lcl_delegateMouseEvent( *m_pImpl, i_tableControl, i_event, &MouseFunction::handleMouseUp );
}
diff --git a/svtools/source/table/mousefunction.cxx b/svtools/source/table/mousefunction.cxx
index f921435..dcd55b0 100644
--- a/svtools/source/table/mousefunction.cxx
+++ b/svtools/source/table/mousefunction.cxx
@@ -30,27 +30,6 @@ namespace svt { namespace table
- //= MouseFunction
-
-
- oslInterlockedCount MouseFunction::acquire()
- {
- return osl_atomic_increment( &m_refCount );
- }
-
-
- oslInterlockedCount MouseFunction::release()
- {
- oslInterlockedCount newCount = osl_atomic_decrement( &m_refCount );
- if ( newCount == 0 )
- {
- delete this;
- return 0;
- }
- return newCount;
- }
-
-
//= ColumnResize
diff --git a/svtools/source/table/mousefunction.hxx b/svtools/source/table/mousefunction.hxx
index 71f7aa0..6256259 100644
--- a/svtools/source/table/mousefunction.hxx
+++ b/svtools/source/table/mousefunction.hxx
@@ -23,6 +23,7 @@
#include <svtools/table/tabletypes.hxx>
#include <rtl/ref.hxx>
+#include <salhelper/simplereferenceobject.hxx>
#include <boost/noncopyable.hpp>
@@ -48,40 +49,18 @@ namespace svt { namespace table
};
- //= IMouseFunction
+ //= MouseFunction
- class IMouseFunction : public ::rtl::IReference, public ::boost::noncopyable
+ class MouseFunction : public ::salhelper::SimpleReferenceObject, public ::boost::noncopyable
{
public:
+ MouseFunction() {}
virtual FunctionResult handleMouseMove( ITableControl& i_tableControl, MouseEvent const & i_event ) = 0;
virtual FunctionResult handleMouseDown( ITableControl& i_tableControl, MouseEvent const & i_event ) = 0;
virtual FunctionResult handleMouseUp( ITableControl& i_tableControl, MouseEvent const & i_event ) = 0;
protected:
- virtual ~IMouseFunction() { }
- };
-
-
- //= MouseFunction
-
- class MouseFunction : public IMouseFunction
- {
- public:
- MouseFunction()
- :m_refCount( 0 )
- {
- }
- protected:
- virtual ~MouseFunction()
- {
- }
-
- public:
- virtual oslInterlockedCount SAL_CALL acquire() SAL_OVERRIDE;
- virtual oslInterlockedCount SAL_CALL release() SAL_OVERRIDE;
-
- private:
- oslInterlockedCount m_refCount;
+ virtual ~MouseFunction() { }
};
@@ -96,7 +75,7 @@ namespace svt { namespace table
}
public:
- // IMouseFunction
+ // MouseFunction
virtual FunctionResult handleMouseMove( ITableControl& i_tableControl, MouseEvent const & i_event ) SAL_OVERRIDE;
virtual FunctionResult handleMouseDown( ITableControl& i_tableControl, MouseEvent const & i_event ) SAL_OVERRIDE;
virtual FunctionResult handleMouseUp( ITableControl& i_tableControl, MouseEvent const & i_event ) SAL_OVERRIDE;
@@ -117,7 +96,7 @@ namespace svt { namespace table
}
public:
- // IMouseFunction
+ // MouseFunction
virtual FunctionResult handleMouseMove( ITableControl& i_tableControl, MouseEvent const & i_event ) SAL_OVERRIDE;
virtual FunctionResult handleMouseDown( ITableControl& i_tableControl, MouseEvent const & i_event ) SAL_OVERRIDE;
virtual FunctionResult handleMouseUp( ITableControl& i_tableControl, MouseEvent const & i_event ) SAL_OVERRIDE;
@@ -138,7 +117,7 @@ namespace svt { namespace table
}
public:
- // IMouseFunction
+ // MouseFunction
virtual FunctionResult handleMouseMove( ITableControl& i_tableControl, MouseEvent const & i_event ) SAL_OVERRIDE;
virtual FunctionResult handleMouseDown( ITableControl& i_tableControl, MouseEvent const & i_event ) SAL_OVERRIDE;
virtual FunctionResult handleMouseUp( ITableControl& i_tableControl, MouseEvent const & i_event ) SAL_OVERRIDE;
diff --git a/svtools/source/toolpanel/drawerlayouter.cxx b/svtools/source/toolpanel/drawerlayouter.cxx
index 565d858..97ff395 100644
--- a/svtools/source/toolpanel/drawerlayouter.cxx
+++ b/svtools/source/toolpanel/drawerlayouter.cxx
@@ -57,9 +57,6 @@ namespace svt
}
- IMPLEMENT_IREFERENCE( DrawerDeckLayouter )
-
-
Rectangle DrawerDeckLayouter::Layout( const Rectangle& i_rDeckPlayground )
{
const size_t nPanelCount( m_rPanelDeck.GetPanelCount() );
diff --git a/svtools/source/toolpanel/dummypanel.cxx b/svtools/source/toolpanel/dummypanel.cxx
index 1b40bf0..95dffda 100644
--- a/svtools/source/toolpanel/dummypanel.cxx
+++ b/svtools/source/toolpanel/dummypanel.cxx
@@ -42,9 +42,6 @@ namespace svt
}
- IMPLEMENT_IREFERENCE( DummyPanel )
-
-
void DummyPanel::Activate( Window& )
{
}
diff --git a/svtools/source/toolpanel/dummypanel.hxx b/svtools/source/toolpanel/dummypanel.hxx
index 0632786e..f4a884a 100644
--- a/svtools/source/toolpanel/dummypanel.hxx
+++ b/svtools/source/toolpanel/dummypanel.hxx
@@ -21,7 +21,7 @@
#define INCLUDED_SVTOOLS_SOURCE_TOOLPANEL_DUMMYPANEL_HXX
#include <svtools/toolpanel/toolpanel.hxx>
-#include <svtools/toolpanel/refbase.hxx>
+#include <salhelper/simplereferenceobject.hxx>
namespace svt
@@ -32,8 +32,7 @@ namespace svt
//= DummyPanel
/// is a dummy implementation of the IToolPanel interface
- class DummyPanel :public RefBase
- ,public IToolPanel
+ class DummyPanel :public IToolPanel
{
public:
DummyPanel();
@@ -52,8 +51,6 @@ namespace svt
CreatePanelAccessible(
const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& i_rParentAccessible
) SAL_OVERRIDE;
-
- DECLARE_IREFERENCE()
};
diff --git a/svtools/source/toolpanel/refbase.cxx b/svtools/source/toolpanel/refbase.cxx
deleted file mode 100644
index 4ff9969..0000000
--- a/svtools/source/toolpanel/refbase.cxx
+++ /dev/null
@@ -1,50 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-
-#include <svtools/toolpanel/refbase.hxx>
-
-
-namespace svt
-{
-
-
-
- //= RefBase
-
-
- oslInterlockedCount SAL_CALL RefBase::acquire()
- {
- return osl_atomic_increment( &m_refCount );
- }
-
-
- oslInterlockedCount SAL_CALL RefBase::release()
- {
- oslInterlockedCount newCount = osl_atomic_decrement( &m_refCount );
- if ( 0 == newCount )
- delete this;
- return newCount;
- }
-
-
-} // namespace svt
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/toolpanel/tablayouter.cxx b/svtools/source/toolpanel/tablayouter.cxx
index 518b088..0f82dd4 100644
--- a/svtools/source/toolpanel/tablayouter.cxx
+++ b/svtools/source/toolpanel/tablayouter.cxx
@@ -92,9 +92,6 @@ namespace svt
}
- IMPLEMENT_IREFERENCE( TabDeckLayouter )
-
-
TabItemContent TabDeckLayouter::GetTabItemContent() const
{
if ( lcl_checkDisposed( *m_pData ) )
diff --git a/svtools/source/toolpanel/toolpanel.cxx b/svtools/source/toolpanel/toolpanel.cxx
index b0e65c8..5918565 100644
--- a/svtools/source/toolpanel/toolpanel.cxx
+++ b/svtools/source/toolpanel/toolpanel.cxx
@@ -38,10 +38,6 @@ namespace svt
{
}
-
- IMPLEMENT_IREFERENCE( ToolPanelBase )
-
-
} // namespace svt
More information about the Libreoffice-commits
mailing list