diff options
author | Andrzej J.R. Hunt <andrzej@ahunt.org> | 2013-07-17 08:55:24 +0200 |
---|---|---|
committer | Andrzej J.R. Hunt <andrzej@ahunt.org> | 2013-07-17 08:57:12 +0200 |
commit | 09fb28de3b29c426afa4c37e36268e883aa55923 (patch) | |
tree | 9661110b1c076717ad14f1cab42b5d3d4ecde589 /connectivity | |
parent | 0d7facdf06728bb1dfeb13ecca199184638c2c3b (diff) |
Remove duplication from FSubComponent.
Change-Id: I453eb35ec82cfa632616626385a80d6e0d5cebbc
Diffstat (limited to 'connectivity')
5 files changed, 7 insertions, 66 deletions
diff --git a/connectivity/source/drivers/firebird/FConnection.hxx b/connectivity/source/drivers/firebird/FConnection.hxx index 67771f9094c7..c25390fa3418 100644 --- a/connectivity/source/drivers/firebird/FConnection.hxx +++ b/connectivity/source/drivers/firebird/FConnection.hxx @@ -66,14 +66,13 @@ namespace connectivity ::com::sun::star::sdbc::XWarningsSupplier, ::com::sun::star::lang::XServiceInfo, ::com::sun::star::document::XDocumentEventListener - > OMetaConnection_BASE; + > OConnection_BASE; class OStatement_Base; class FirebirdDriver; class ODatabaseMetaData; - typedef OMetaConnection_BASE OConnection_BASE; // implements basics and text encoding typedef ::std::vector< ::connectivity::OTypeInfo> TTypeInfoVector; typedef std::vector< ::com::sun::star::uno::WeakReferenceHelper > OWeakRefArray; diff --git a/connectivity/source/drivers/firebird/FPreparedStatement.cxx b/connectivity/source/drivers/firebird/FPreparedStatement.cxx index 8d8a06a36d15..9901064ed864 100644 --- a/connectivity/source/drivers/firebird/FPreparedStatement.cxx +++ b/connectivity/source/drivers/firebird/FPreparedStatement.cxx @@ -42,7 +42,9 @@ #include <cppuhelper/typeprovider.hxx> #include <com/sun/star/lang/DisposedException.hpp> #include "propertyids.hxx" +#include <comphelper/sequence.hxx> +using namespace ::comphelper; using namespace connectivity::firebird; using namespace com::sun::star::uno; using namespace com::sun::star::lang; diff --git a/connectivity/source/drivers/firebird/FResultSet.cxx b/connectivity/source/drivers/firebird/FResultSet.cxx index 4af469856dd6..deef30ac64ad 100644 --- a/connectivity/source/drivers/firebird/FResultSet.cxx +++ b/connectivity/source/drivers/firebird/FResultSet.cxx @@ -42,7 +42,9 @@ #include <cppuhelper/typeprovider.hxx> #include <com/sun/star/lang/DisposedException.hpp> #include "propertyids.hxx" +#include <comphelper/sequence.hxx> +using namespace ::comphelper; using namespace connectivity::firebird; using namespace cppu; using namespace com::sun::star::uno; diff --git a/connectivity/source/drivers/firebird/FStatement.cxx b/connectivity/source/drivers/firebird/FStatement.cxx index 2646330bb7e8..d3257264fdba 100644 --- a/connectivity/source/drivers/firebird/FStatement.cxx +++ b/connectivity/source/drivers/firebird/FStatement.cxx @@ -47,7 +47,9 @@ #include "propertyids.hxx" #include <ibase.h> +#include <comphelper/sequence.hxx> +using namespace ::comphelper; using namespace connectivity::firebird; //------------------------------------------------------------------------------ using namespace com::sun::star::uno; diff --git a/connectivity/source/drivers/firebird/FSubComponent.hxx b/connectivity/source/drivers/firebird/FSubComponent.hxx index 2d98bc064ea1..426a33ec7f8f 100644 --- a/connectivity/source/drivers/firebird/FSubComponent.hxx +++ b/connectivity/source/drivers/firebird/FSubComponent.hxx @@ -71,41 +71,6 @@ namespace connectivity ::com::sun::star::lang::XComponent* _pObject); 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> @@ -182,41 +147,12 @@ namespace connectivity return s_pProps; } - - class OBase_Mutex { public: ::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; - } |