Kaydet (Commit) 09fb28de authored tarafından Andrzej J.R. Hunt's avatar Andrzej J.R. Hunt

Remove duplication from FSubComponent.

Change-Id: I453eb35ec82cfa632616626385a80d6e0d5cebbc
üst 0d7facdf
...@@ -66,14 +66,13 @@ namespace connectivity ...@@ -66,14 +66,13 @@ namespace connectivity
::com::sun::star::sdbc::XWarningsSupplier, ::com::sun::star::sdbc::XWarningsSupplier,
::com::sun::star::lang::XServiceInfo, ::com::sun::star::lang::XServiceInfo,
::com::sun::star::document::XDocumentEventListener ::com::sun::star::document::XDocumentEventListener
> OMetaConnection_BASE; > OConnection_BASE;
class OStatement_Base; class OStatement_Base;
class FirebirdDriver; class FirebirdDriver;
class ODatabaseMetaData; class ODatabaseMetaData;
typedef OMetaConnection_BASE OConnection_BASE; // implements basics and text encoding
typedef ::std::vector< ::connectivity::OTypeInfo> TTypeInfoVector; typedef ::std::vector< ::connectivity::OTypeInfo> TTypeInfoVector;
typedef std::vector< ::com::sun::star::uno::WeakReferenceHelper > OWeakRefArray; typedef std::vector< ::com::sun::star::uno::WeakReferenceHelper > OWeakRefArray;
......
...@@ -42,7 +42,9 @@ ...@@ -42,7 +42,9 @@
#include <cppuhelper/typeprovider.hxx> #include <cppuhelper/typeprovider.hxx>
#include <com/sun/star/lang/DisposedException.hpp> #include <com/sun/star/lang/DisposedException.hpp>
#include "propertyids.hxx" #include "propertyids.hxx"
#include <comphelper/sequence.hxx>
using namespace ::comphelper;
using namespace connectivity::firebird; using namespace connectivity::firebird;
using namespace com::sun::star::uno; using namespace com::sun::star::uno;
using namespace com::sun::star::lang; using namespace com::sun::star::lang;
......
...@@ -42,7 +42,9 @@ ...@@ -42,7 +42,9 @@
#include <cppuhelper/typeprovider.hxx> #include <cppuhelper/typeprovider.hxx>
#include <com/sun/star/lang/DisposedException.hpp> #include <com/sun/star/lang/DisposedException.hpp>
#include "propertyids.hxx" #include "propertyids.hxx"
#include <comphelper/sequence.hxx>
using namespace ::comphelper;
using namespace connectivity::firebird; using namespace connectivity::firebird;
using namespace cppu; using namespace cppu;
using namespace com::sun::star::uno; using namespace com::sun::star::uno;
......
...@@ -47,7 +47,9 @@ ...@@ -47,7 +47,9 @@
#include "propertyids.hxx" #include "propertyids.hxx"
#include <ibase.h> #include <ibase.h>
#include <comphelper/sequence.hxx>
using namespace ::comphelper;
using namespace connectivity::firebird; using namespace connectivity::firebird;
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
using namespace com::sun::star::uno; using namespace com::sun::star::uno;
......
...@@ -71,41 +71,6 @@ namespace connectivity ...@@ -71,41 +71,6 @@ namespace connectivity
::com::sun::star::lang::XComponent* _pObject); ::com::sun::star::lang::XComponent* _pObject);
void checkDisposed(sal_Bool _bThrow) throw ( ::com::sun::star::lang::DisposedException ); void checkDisposed(sal_Bool _bThrow) throw ( ::com::sun::star::lang::DisposedException );
//************************************************************
// OSubComponent
//************************************************************
template <class SELF, class WEAK> class OSubComponent
{
protected:
// the parent must support the tunnel implementation
::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > m_xParent;
SELF* m_pDerivedImplementation;
public:
OSubComponent(
const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xParent,
SELF* _pDerivedImplementation)
:m_xParent(_xParent)
,m_pDerivedImplementation(_pDerivedImplementation)
{
}
protected:
void dispose_ChildImpl()
{
::osl::MutexGuard aGuard( m_pDerivedImplementation->rBHelper.rMutex );
m_xParent = NULL;
}
void relase_ChildImpl()
{
release(m_pDerivedImplementation->m_refCount,
m_pDerivedImplementation->rBHelper,
m_xParent,
m_pDerivedImplementation);
m_pDerivedImplementation->WEAK::release();
}
};
template <class TYPE> template <class TYPE>
...@@ -182,41 +147,12 @@ namespace connectivity ...@@ -182,41 +147,12 @@ namespace connectivity
return s_pProps; return s_pProps;
} }
class OBase_Mutex class OBase_Mutex
{ {
public: public:
::osl::Mutex m_aMutex; ::osl::Mutex m_aMutex;
}; };
namespace internal
{
template <class T>
void implCopySequence(const T* _pSource, T*& _pDest, sal_Int32 _nSourceLen)
{
for (sal_Int32 i=0; i<_nSourceLen; ++i, ++_pSource, ++_pDest)
*_pDest = *_pSource;
}
}
//-------------------------------------------------------------------------
/// concat two sequences
template <class T>
::com::sun::star::uno::Sequence<T> concatSequences(const ::com::sun::star::uno::Sequence<T>& _rLeft, const ::com::sun::star::uno::Sequence<T>& _rRight)
{
sal_Int32 nLeft(_rLeft.getLength()), nRight(_rRight.getLength());
const T* pLeft = _rLeft.getConstArray();
const T* pRight = _rRight.getConstArray();
sal_Int32 nReturnLen(nLeft + nRight);
::com::sun::star::uno::Sequence<T> aReturn(nReturnLen);
T* pReturn = aReturn.getArray();
internal::implCopySequence(pLeft, pReturn, nLeft);
internal::implCopySequence(pRight, pReturn, nRight);
return aReturn;
}
......
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