[Libreoffice-commits] core.git: 2 commits - extensions/source include/connectivity
Noel Grandin
noel at peralex.com
Sun Jul 20 23:01:42 PDT 2014
extensions/source/propctrlr/composeduiupdate.cxx | 4 --
include/connectivity/CommonTools.hxx | 32 ++++-------------------
2 files changed, 7 insertions(+), 29 deletions(-)
New commits:
commit 43a37822dc82abd16e0d99b5bbe21ac469c04ddd
Author: Noel Grandin <noel at peralex.com>
Date: Fri Jul 18 16:21:04 2014 +0200
convert ORefVector to use salhelp::SimpleReferenceObject
instead of hand-rolled code
Change-Id: I56e991c70334cb201a460ea8679be70808451a86
diff --git a/include/connectivity/CommonTools.hxx b/include/connectivity/CommonTools.hxx
index d099905..1ef5908 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,21 +64,19 @@ 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)
{
if ( &_rRH != this )
@@ -90,25 +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 d694339bc87b1e8966bc536b042723a96b93e408
Author: Noel Grandin <noel at peralex.com>
Date: Fri Jul 18 15:01:33 2014 +0200
remove unused field
Change-Id: I4d58650f96191c0c58c0cd1233d7a7f670de3324
diff --git a/extensions/source/propctrlr/composeduiupdate.cxx b/extensions/source/propctrlr/composeduiupdate.cxx
index c4cf96a..bcff8de 100644
--- a/extensions/source/propctrlr/composeduiupdate.cxx
+++ b/extensions/source/propctrlr/composeduiupdate.cxx
@@ -82,7 +82,6 @@ namespace pcr
{
private:
::osl::Mutex m_aMutex;
- oslInterlockedCount m_refCount;
bool m_bDisposed;
ComposedPropertyUIUpdate&
m_rMaster;
@@ -187,8 +186,7 @@ namespace pcr
CachedInspectorUI::CachedInspectorUI( ComposedPropertyUIUpdate& _rMaster, FNotifySingleUIChange _pUIChangeNotification )
- :m_refCount( 0 )
- ,m_bDisposed( false )
+ :m_bDisposed( false )
,m_rMaster( _rMaster )
,m_pUIChangeNotification( _pUIChangeNotification )
{
More information about the Libreoffice-commits
mailing list