diff options
author | Noel Grandin <noel@peralex.com> | 2014-07-09 09:20:52 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2014-07-10 11:04:12 +0200 |
commit | 183e062e9f22d51e59054396ebb75e2148b067d7 (patch) | |
tree | e668edd447541ffd37b6cf5e660de634c75e83a8 /connectivity | |
parent | ea8f32b61a51b6d9cef72bbd5ac701bef2975a39 (diff) |
use SimpleReferenceObject in connectivity module
to replace hand-rolled version
Change-Id: Ib415a6e78733277cbc1c0777d7263b65f404e6a4
Diffstat (limited to 'connectivity')
-rw-r--r-- | connectivity/Library_dbtools.mk | 1 | ||||
-rw-r--r-- | connectivity/source/simpledbt/charset_s.cxx | 12 | ||||
-rw-r--r-- | connectivity/source/simpledbt/charset_s.hxx | 9 | ||||
-rw-r--r-- | connectivity/source/simpledbt/dbtfactory.cxx | 12 | ||||
-rw-r--r-- | connectivity/source/simpledbt/dbtfactory.hxx | 9 | ||||
-rw-r--r-- | connectivity/source/simpledbt/parsenode_s.cxx | 13 | ||||
-rw-r--r-- | connectivity/source/simpledbt/parsenode_s.hxx | 9 | ||||
-rw-r--r-- | connectivity/source/simpledbt/parser_s.cxx | 12 | ||||
-rw-r--r-- | connectivity/source/simpledbt/parser_s.hxx | 9 | ||||
-rw-r--r-- | connectivity/source/simpledbt/refbase.cxx | 55 | ||||
-rw-r--r-- | connectivity/source/simpledbt/refbase.hxx | 54 | ||||
-rw-r--r-- | connectivity/source/simpledbt/staticdbtools_s.cxx | 12 | ||||
-rw-r--r-- | connectivity/source/simpledbt/staticdbtools_s.hxx | 7 |
13 files changed, 5 insertions, 209 deletions
diff --git a/connectivity/Library_dbtools.mk b/connectivity/Library_dbtools.mk index 167cb6946390..7170dc008e49 100644 --- a/connectivity/Library_dbtools.mk +++ b/connectivity/Library_dbtools.mk @@ -52,7 +52,6 @@ endif #connectivity/source/commontools/RowFunctionParser.cxx disable optimization? $(eval $(call gb_Library_add_exception_objects,dbtools,\ - connectivity/source/simpledbt/refbase \ )) $(eval $(call gb_Library_add_grammars,dbtools,\ diff --git a/connectivity/source/simpledbt/charset_s.cxx b/connectivity/source/simpledbt/charset_s.cxx index ea00094a79e8..2843b674e6f9 100644 --- a/connectivity/source/simpledbt/charset_s.cxx +++ b/connectivity/source/simpledbt/charset_s.cxx @@ -30,18 +30,6 @@ namespace connectivity //= ODataAccessCharSet - oslInterlockedCount SAL_CALL ODataAccessCharSet::acquire() - { - return ORefBase::acquire(); - } - - - oslInterlockedCount SAL_CALL ODataAccessCharSet::release() - { - return ORefBase::release(); - } - - sal_Int32 ODataAccessCharSet::getSupportedTextEncodings( ::std::vector< rtl_TextEncoding >& _rEncs ) const { _rEncs.clear(); diff --git a/connectivity/source/simpledbt/charset_s.hxx b/connectivity/source/simpledbt/charset_s.hxx index 80c09d8f258c..25aa2bfc7630 100644 --- a/connectivity/source/simpledbt/charset_s.hxx +++ b/connectivity/source/simpledbt/charset_s.hxx @@ -21,7 +21,6 @@ #define INCLUDED_CONNECTIVITY_SOURCE_SIMPLEDBT_CHARSET_S_HXX #include <connectivity/virtualdbtools.hxx> -#include "refbase.hxx" #include <connectivity/dbcharset.hxx> @@ -32,9 +31,7 @@ namespace connectivity //= ODataAccessCharSet - class ODataAccessCharSet - :public simple::IDataAccessCharSet - ,public ORefBase + class ODataAccessCharSet : public simple::IDataAccessCharSet { protected: ::dbtools::OCharsetMap m_aCharsetInfo; @@ -46,10 +43,6 @@ namespace connectivity sal_Int32 getSupportedTextEncodings( ::std::vector< rtl_TextEncoding >& /* [out] */ _rEncs ) const SAL_OVERRIDE; - - // disambiguate IReference - virtual oslInterlockedCount SAL_CALL acquire() SAL_OVERRIDE; - virtual oslInterlockedCount SAL_CALL release() SAL_OVERRIDE; }; diff --git a/connectivity/source/simpledbt/dbtfactory.cxx b/connectivity/source/simpledbt/dbtfactory.cxx index 5211b763ff37..dfd553574b4e 100644 --- a/connectivity/source/simpledbt/dbtfactory.cxx +++ b/connectivity/source/simpledbt/dbtfactory.cxx @@ -55,18 +55,6 @@ namespace connectivity } - oslInterlockedCount SAL_CALL ODataAccessToolsFactory::acquire() - { - return ORefBase::acquire(); - } - - - oslInterlockedCount SAL_CALL ODataAccessToolsFactory::release() - { - return ORefBase::release(); - } - - ::rtl::Reference< simple::IDataAccessTypeConversion > ODataAccessToolsFactory::getTypeConversionHelper() { return m_xTypeConversionHelper; diff --git a/connectivity/source/simpledbt/dbtfactory.hxx b/connectivity/source/simpledbt/dbtfactory.hxx index f4722b7dd95a..4ba0fe5fc4ee 100644 --- a/connectivity/source/simpledbt/dbtfactory.hxx +++ b/connectivity/source/simpledbt/dbtfactory.hxx @@ -21,7 +21,6 @@ #define INCLUDED_CONNECTIVITY_SOURCE_SIMPLEDBT_DBTFACTORY_HXX #include <connectivity/virtualdbtools.hxx> -#include "refbase.hxx" namespace connectivity @@ -31,9 +30,7 @@ namespace connectivity //= ODataAccessToolsFactory - class ODataAccessToolsFactory - :public simple::IDataAccessToolsFactory - ,public ORefBase + class ODataAccessToolsFactory : public simple::IDataAccessToolsFactory { protected: ::rtl::Reference< simple::IDataAccessTypeConversion > m_xTypeConversionHelper; @@ -41,6 +38,7 @@ namespace connectivity public: ODataAccessToolsFactory(); + virtual ~ODataAccessToolsFactory() {} // IDataAccessToolsFactory virtual ::rtl::Reference< simple::ISQLParser > createSQLParser( @@ -60,9 +58,6 @@ namespace connectivity const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxColumn ) SAL_OVERRIDE; - // IReference - virtual oslInterlockedCount SAL_CALL acquire() SAL_OVERRIDE; - virtual oslInterlockedCount SAL_CALL release() SAL_OVERRIDE; }; diff --git a/connectivity/source/simpledbt/parsenode_s.cxx b/connectivity/source/simpledbt/parsenode_s.cxx index fc30c5fcf147..07e1402797f9 100644 --- a/connectivity/source/simpledbt/parsenode_s.cxx +++ b/connectivity/source/simpledbt/parsenode_s.cxx @@ -50,19 +50,6 @@ namespace connectivity delete m_pFullNode; } - - oslInterlockedCount SAL_CALL OSimpleParseNode::acquire() - { - return ORefBase::acquire(); - } - - - oslInterlockedCount SAL_CALL OSimpleParseNode::release() - { - return ORefBase::release(); - } - - void OSimpleParseNode::parseNodeToStr(OUString& _rString, const Reference< XConnection >& _rxConnection,const IParseContext* _pContext) const { m_pFullNode->parseNodeToStr( _rString, _rxConnection, _pContext ); diff --git a/connectivity/source/simpledbt/parsenode_s.hxx b/connectivity/source/simpledbt/parsenode_s.hxx index 6e5387d5a09f..42e47be228c5 100644 --- a/connectivity/source/simpledbt/parsenode_s.hxx +++ b/connectivity/source/simpledbt/parsenode_s.hxx @@ -21,7 +21,6 @@ #define INCLUDED_CONNECTIVITY_SOURCE_SIMPLEDBT_PARSENODE_S_HXX #include <connectivity/virtualdbtools.hxx> -#include "refbase.hxx" namespace connectivity @@ -32,9 +31,7 @@ namespace connectivity //= OSimpleParseNode - class OSimpleParseNode - :public simple::ISQLParseNode - ,public ORefBase + class OSimpleParseNode : public simple::ISQLParseNode { protected: const OSQLParseNode* m_pFullNode; @@ -59,10 +56,6 @@ namespace connectivity const sal_Char _cDecSeparator, const IParseContext* _pContext ) const SAL_OVERRIDE; - - // disambiguate IReference - virtual oslInterlockedCount SAL_CALL acquire() SAL_OVERRIDE; - virtual oslInterlockedCount SAL_CALL release() SAL_OVERRIDE; }; diff --git a/connectivity/source/simpledbt/parser_s.cxx b/connectivity/source/simpledbt/parser_s.cxx index e514abbcf485..eddae295e7cb 100644 --- a/connectivity/source/simpledbt/parser_s.cxx +++ b/connectivity/source/simpledbt/parser_s.cxx @@ -41,18 +41,6 @@ namespace connectivity } - oslInterlockedCount SAL_CALL OSimpleSQLParser::acquire() - { - return ORefBase::acquire(); - } - - - oslInterlockedCount SAL_CALL OSimpleSQLParser::release() - { - return ORefBase::release(); - } - - const IParseContext& OSimpleSQLParser::getContext() const { return m_aFullParser.getContext(); diff --git a/connectivity/source/simpledbt/parser_s.hxx b/connectivity/source/simpledbt/parser_s.hxx index 50994fe8ca46..359ab25c6366 100644 --- a/connectivity/source/simpledbt/parser_s.hxx +++ b/connectivity/source/simpledbt/parser_s.hxx @@ -21,7 +21,6 @@ #define INCLUDED_CONNECTIVITY_SOURCE_SIMPLEDBT_PARSER_S_HXX #include <connectivity/virtualdbtools.hxx> -#include "refbase.hxx" #include <connectivity/sqlparse.hxx> @@ -32,9 +31,7 @@ namespace connectivity //= OSimpleSQLParser - class OSimpleSQLParser - :public simple::ISQLParser - ,public ORefBase + class OSimpleSQLParser : public simple::ISQLParser { protected: OSQLParser m_aFullParser; @@ -51,10 +48,6 @@ namespace connectivity ) const SAL_OVERRIDE; virtual const IParseContext& getContext() const SAL_OVERRIDE; - - // disambiguate IReference - virtual oslInterlockedCount SAL_CALL acquire() SAL_OVERRIDE; - virtual oslInterlockedCount SAL_CALL release() SAL_OVERRIDE; }; diff --git a/connectivity/source/simpledbt/refbase.cxx b/connectivity/source/simpledbt/refbase.cxx deleted file mode 100644 index 6c86bc329f05..000000000000 --- a/connectivity/source/simpledbt/refbase.cxx +++ /dev/null @@ -1,55 +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 "refbase.hxx" - - -namespace connectivity -{ - - - - //= ORefBase - - - ORefBase::~ORefBase() - { - } - - - oslInterlockedCount SAL_CALL ORefBase::acquire() - { - return osl_atomic_increment(&m_refCount); - } - - - oslInterlockedCount SAL_CALL ORefBase::release() - { - oslInterlockedCount nNewRefCount = osl_atomic_decrement(&m_refCount); - if (0 == nNewRefCount) - delete this; - - return nNewRefCount; - } - - -} // namespace connectivity - - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/connectivity/source/simpledbt/refbase.hxx b/connectivity/source/simpledbt/refbase.hxx deleted file mode 100644 index 19c72c639a41..000000000000 --- a/connectivity/source/simpledbt/refbase.hxx +++ /dev/null @@ -1,54 +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_CONNECTIVITY_SOURCE_SIMPLEDBT_REFBASE_HXX -#define INCLUDED_CONNECTIVITY_SOURCE_SIMPLEDBT_REFBASE_HXX - -#include <rtl/ref.hxx> - - -namespace connectivity -{ - - - - //= ORefBase - - /// base class for all objects implementing the ::rtl::IReference interface - class ORefBase : public ::rtl::IReference - { - protected: - oslInterlockedCount m_refCount; - - protected: - ORefBase() : m_refCount(0) { } - virtual ~ORefBase(); - - virtual oslInterlockedCount SAL_CALL acquire() SAL_OVERRIDE; - virtual oslInterlockedCount SAL_CALL release() SAL_OVERRIDE; - }; - - -} // namespace connectivity - - -#endif // INCLUDED_CONNECTIVITY_SOURCE_SIMPLEDBT_REFBASE_HXX - - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/connectivity/source/simpledbt/staticdbtools_s.cxx b/connectivity/source/simpledbt/staticdbtools_s.cxx index ce63c340033f..56c8401ca6be 100644 --- a/connectivity/source/simpledbt/staticdbtools_s.cxx +++ b/connectivity/source/simpledbt/staticdbtools_s.cxx @@ -71,18 +71,6 @@ namespace connectivity } - oslInterlockedCount SAL_CALL ODataAccessStaticTools::acquire() - { - return ORefBase::acquire(); - } - - - oslInterlockedCount SAL_CALL ODataAccessStaticTools::release() - { - return ORefBase::release(); - } - - Reference< XConnection> ODataAccessStaticTools::getConnection_withFeedback(const OUString& _rDataSourceName, const OUString& _rUser, const OUString& _rPwd, const Reference< XComponentContext>& _rxContext) const { diff --git a/connectivity/source/simpledbt/staticdbtools_s.hxx b/connectivity/source/simpledbt/staticdbtools_s.hxx index 949713117221..7ad25ae9481b 100644 --- a/connectivity/source/simpledbt/staticdbtools_s.hxx +++ b/connectivity/source/simpledbt/staticdbtools_s.hxx @@ -21,7 +21,6 @@ #define INCLUDED_CONNECTIVITY_SOURCE_SIMPLEDBT_STATICDBTOOLS_S_HXX #include <connectivity/virtualdbtools.hxx> -#include "refbase.hxx" namespace connectivity @@ -34,7 +33,6 @@ namespace connectivity class ODataAccessStaticTools :public simple::IDataAccessTypeConversion ,public simple::IDataAccessTools - ,public ORefBase { public: ODataAccessStaticTools(); @@ -181,11 +179,6 @@ namespace connectivity const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxComponent, ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxActualConnection ) SAL_OVERRIDE; - - // disambiguate IReference - - virtual oslInterlockedCount SAL_CALL acquire() SAL_OVERRIDE; - virtual oslInterlockedCount SAL_CALL release() SAL_OVERRIDE; }; |