diff options
Diffstat (limited to 'connectivity/source/inc/ado')
36 files changed, 118 insertions, 297 deletions
diff --git a/connectivity/source/inc/ado/ACallableStatement.hxx b/connectivity/source/inc/ado/ACallableStatement.hxx index 3114242558ac..e58617b3b00e 100644 --- a/connectivity/source/inc/ado/ACallableStatement.hxx +++ b/connectivity/source/inc/ado/ACallableStatement.hxx @@ -17,8 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_CONNECTIVITY_SOURCE_INC_ADO_ACALLABLESTATEMENT_HXX -#define INCLUDED_CONNECTIVITY_SOURCE_INC_ADO_ACALLABLESTATEMENT_HXX +#pragma once #include <ado/APreparedStatement.hxx> #include <com/sun/star/sdbc/XRow.hpp> @@ -43,8 +42,8 @@ namespace connectivity::ado OCallableStatement( OConnection* _pConnection, const OUString& sql ); virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override; - virtual void SAL_CALL acquire() throw() override; - virtual void SAL_CALL release() throw() override; + virtual void SAL_CALL acquire() noexcept override; + virtual void SAL_CALL release() noexcept override; // XRow virtual sal_Bool SAL_CALL wasNull( ) override; @@ -72,7 +71,6 @@ namespace connectivity::ado virtual void SAL_CALL registerNumericOutParameter( sal_Int32 parameterIndex, sal_Int32 sqlType, sal_Int32 scale ) override; }; } -#endif // _CONNECTIVITY_OCallableStatement_HXX_ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/connectivity/source/inc/ado/ACatalog.hxx b/connectivity/source/inc/ado/ACatalog.hxx index 9afe9e41cfb9..fd09e9ad3c40 100644 --- a/connectivity/source/inc/ado/ACatalog.hxx +++ b/connectivity/source/inc/ado/ACatalog.hxx @@ -16,8 +16,7 @@ * 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_INC_ADO_ACATALOG_HXX -#define INCLUDED_CONNECTIVITY_SOURCE_INC_ADO_ACATALOG_HXX +#pragma once #include <sdbcx/VCatalog.hxx> #include <ado/Awrapadox.hxx> @@ -46,6 +45,5 @@ namespace connectivity::ado WpADOCatalog getCatalog() const { return m_aCatalog; } }; } -#endif // INCLUDED_CONNECTIVITY_SOURCE_INC_ADO_ACATALOG_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/connectivity/source/inc/ado/AColumn.hxx b/connectivity/source/inc/ado/AColumn.hxx index 84344ece755e..f297964820dc 100644 --- a/connectivity/source/inc/ado/AColumn.hxx +++ b/connectivity/source/inc/ado/AColumn.hxx @@ -17,8 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_CONNECTIVITY_SOURCE_INC_ADO_ACOLUMN_HXX -#define INCLUDED_CONNECTIVITY_SOURCE_INC_ADO_ACOLUMN_HXX +#pragma once #include <connectivity/sdbcx/VColumn.hxx> #include <ado/Awrapadox.hxx> @@ -45,13 +44,9 @@ namespace connectivity::ado OAdoColumn(bool _bCase,OConnection* _pConnection); // ODescriptor virtual void construct() override; - // css::lang::XUnoTunnel - virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override; - static css::uno::Sequence< sal_Int8 > getUnoTunnelId(); WpADOColumn getColumnImpl() const; }; } -#endif // INCLUDED_CONNECTIVITY_SOURCE_INC_ADO_ACOLUMN_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/connectivity/source/inc/ado/AColumns.hxx b/connectivity/source/inc/ado/AColumns.hxx index f9773ba48460..25decfa6877f 100644 --- a/connectivity/source/inc/ado/AColumns.hxx +++ b/connectivity/source/inc/ado/AColumns.hxx @@ -17,8 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_CONNECTIVITY_SOURCE_INC_ADO_ACOLUMNS_HXX -#define INCLUDED_CONNECTIVITY_SOURCE_INC_ADO_ACOLUMNS_HXX +#pragma once #include <connectivity/sdbcx/VCollection.hxx> #include <com/sun/star/sdbc/XDatabaseMetaData.hpp> @@ -53,6 +52,5 @@ namespace connectivity::ado }; } -#endif // INCLUDED_CONNECTIVITY_SOURCE_INC_ADO_ACOLUMNS_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/connectivity/source/inc/ado/AConnection.hxx b/connectivity/source/inc/ado/AConnection.hxx index 29f552946a89..c2c82100363d 100644 --- a/connectivity/source/inc/ado/AConnection.hxx +++ b/connectivity/source/inc/ado/AConnection.hxx @@ -16,13 +16,13 @@ * 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_INC_ADO_ACONNECTION_HXX -#define INCLUDED_CONNECTIVITY_SOURCE_INC_ADO_ACONNECTION_HXX +#pragma once #include <com/sun/star/sdbc/SQLWarning.hpp> #include <com/sun/star/sdbcx/XTablesSupplier.hpp> #include <com/sun/star/beans/PropertyValue.hpp> #include <map> +#include <string_view> #include <connectivity/CommonTools.hxx> #include <OTypeInfo.hxx> #include <TConnection.hxx> @@ -57,7 +57,7 @@ namespace connectivity::ado css::uno::WeakReference< css::sdbcx::XTablesSupplier> m_xCatalog; ODriver* m_pDriver; private: - WpADOConnection* m_pAdoConnection; + WpADOConnection m_aAdoConnection; OCatalog* m_pCatalog; sal_Int32 m_nEngineType; bool m_bClosed; @@ -72,7 +72,7 @@ namespace connectivity::ado OConnection(ODriver* _pDriver); // OConnection(const SQLHANDLE _pConnectionHandle); ~OConnection() override; - void construct(const OUString& url,const css::uno::Sequence< css::beans::PropertyValue >& info); + void construct(std::u16string_view url,const css::uno::Sequence< css::beans::PropertyValue >& info); //XUnoTunnel virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override; @@ -107,7 +107,7 @@ namespace connectivity::ado virtual css::uno::Any SAL_CALL getWarnings( ) override; virtual void SAL_CALL clearWarnings( ) override; - WpADOConnection* getConnection() { return m_pAdoConnection; } + WpADOConnection& getConnection() { return m_aAdoConnection; } void setCatalog(const css::uno::WeakReference< css::sdbcx::XTablesSupplier>& _xCat) { m_xCatalog = _xCat; } void setCatalog(OCatalog* _pCatalog) { m_pCatalog = _pCatalog; } @@ -130,6 +130,5 @@ namespace connectivity::ado bool& _brForceToType); }; } -#endif // INCLUDED_CONNECTIVITY_SOURCE_INC_ADO_ACONNECTION_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/connectivity/source/inc/ado/ADatabaseMetaData.hxx b/connectivity/source/inc/ado/ADatabaseMetaData.hxx index af59ab2429e1..1661ca44181c 100644 --- a/connectivity/source/inc/ado/ADatabaseMetaData.hxx +++ b/connectivity/source/inc/ado/ADatabaseMetaData.hxx @@ -17,8 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_CONNECTIVITY_SOURCE_INC_ADO_ADATABASEMETADATA_HXX -#define INCLUDED_CONNECTIVITY_SOURCE_INC_ADO_ADATABASEMETADATA_HXX +#pragma once #include <TDatabaseMetaDataBase.hxx> #include <map> @@ -41,7 +40,7 @@ namespace connectivity::ado }; std::map<sal_uInt32,LiteralInfo> m_aLiteralInfo; - WpADOConnection* m_pADOConnection; + WpADOConnection& m_rADOConnection; OConnection* m_pConnection; void fillLiterals(); @@ -218,7 +217,5 @@ namespace connectivity::ado }; } -#endif // INCLUDED_CONNECTIVITY_SOURCE_INC_ADO_ADATABASEMETADATA_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/connectivity/source/inc/ado/ADatabaseMetaDataResultSet.hxx b/connectivity/source/inc/ado/ADatabaseMetaDataResultSet.hxx index a13ae359a5cc..dce6971658d3 100644 --- a/connectivity/source/inc/ado/ADatabaseMetaDataResultSet.hxx +++ b/connectivity/source/inc/ado/ADatabaseMetaDataResultSet.hxx @@ -17,8 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_CONNECTIVITY_SOURCE_INC_ADO_ADATABASEMETADATARESULTSET_HXX -#define INCLUDED_CONNECTIVITY_SOURCE_INC_ADO_ADATABASEMETADATARESULTSET_HXX +#pragma once #include <com/sun/star/sdbc/XResultSet.hpp> #include <com/sun/star/sdbc/XRow.hpp> @@ -132,8 +131,8 @@ namespace connectivity::ado virtual void SAL_CALL disposing() override; // XInterface virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override; - virtual void SAL_CALL acquire() throw() override; - virtual void SAL_CALL release() throw() override; + virtual void SAL_CALL acquire() noexcept override; + virtual void SAL_CALL release() noexcept override; //XTypeProvider virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override; // XPropertySet @@ -222,6 +221,5 @@ namespace connectivity::ado } } -#endif // INCLUDED_CONNECTIVITY_SOURCE_INC_ADO_ADATABASEMETADATARESULTSET_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/connectivity/source/inc/ado/ADatabaseMetaDataResultSetMetaData.hxx b/connectivity/source/inc/ado/ADatabaseMetaDataResultSetMetaData.hxx index 59750edfd400..abac49ba1d9b 100644 --- a/connectivity/source/inc/ado/ADatabaseMetaDataResultSetMetaData.hxx +++ b/connectivity/source/inc/ado/ADatabaseMetaDataResultSetMetaData.hxx @@ -17,8 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_CONNECTIVITY_SOURCE_INC_ADO_ADATABASEMETADATARESULTSETMETADATA_HXX -#define INCLUDED_CONNECTIVITY_SOURCE_INC_ADO_ADATABASEMETADATARESULTSETMETADATA_HXX +#pragma once #include <com/sun/star/sdbc/XResultSetMetaData.hpp> #include <cppuhelper/implbase.hxx> @@ -73,7 +72,7 @@ namespace connectivity::ado ~ODatabaseMetaDataResultSetMetaData() override; /// Avoid ambiguous cast error from the compiler. - operator css::uno::Reference< css::sdbc::XResultSetMetaData > () throw() + operator css::uno::Reference< css::sdbc::XResultSetMetaData > () noexcept { return this; } virtual sal_Int32 SAL_CALL getColumnCount( ) override; @@ -99,6 +98,5 @@ namespace connectivity::ado virtual OUString SAL_CALL getColumnServiceName( sal_Int32 column ) override; }; } -#endif // _CONNECTIVITY_ADO_ADATABASEMETARESULTSETMETADATA_HXX_ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/connectivity/source/inc/ado/ADriver.hxx b/connectivity/source/inc/ado/ADriver.hxx index a428ed1636ca..8542e03f6d60 100644 --- a/connectivity/source/inc/ado/ADriver.hxx +++ b/connectivity/source/inc/ado/ADriver.hxx @@ -17,8 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_CONNECTIVITY_SOURCE_INC_ADO_ADRIVER_HXX -#define INCLUDED_CONNECTIVITY_SOURCE_INC_ADO_ADRIVER_HXX +#pragma once #include <com/sun/star/sdbc/XDriver.hpp> #include <com/sun/star/sdbcx/XDataDefinitionSupplier.hpp> @@ -76,7 +75,6 @@ namespace connectivity::ado }; } -#endif // INCLUDED_CONNECTIVITY_SOURCE_INC_ADO_ADRIVER_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/connectivity/source/inc/ado/AGroup.hxx b/connectivity/source/inc/ado/AGroup.hxx index 73b526006647..00207a5fa23a 100644 --- a/connectivity/source/inc/ado/AGroup.hxx +++ b/connectivity/source/inc/ado/AGroup.hxx @@ -17,8 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_CONNECTIVITY_SOURCE_INC_ADO_AGROUP_HXX -#define INCLUDED_CONNECTIVITY_SOURCE_INC_ADO_AGROUP_HXX +#pragma once #include <sdbcx/VGroup.hxx> #include <ado/Awrapadox.hxx> @@ -46,10 +45,6 @@ namespace connectivity::ado OAdoGroup(OCatalog* _pParent,bool _bCase, ADOGroup* _pGroup=nullptr); OAdoGroup(OCatalog* _pParent,bool _bCase, const OUString& Name); - // css::lang::XUnoTunnel - virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override; - static css::uno::Sequence< sal_Int8 > getUnoTunnelId(); - // XAuthorizable virtual sal_Int32 SAL_CALL getPrivileges( const OUString& objName, sal_Int32 objType ) override; virtual sal_Int32 SAL_CALL getGrantablePrivileges( const OUString& objName, sal_Int32 objType ) override; @@ -59,6 +54,5 @@ namespace connectivity::ado WpADOGroup getImpl() const { return m_aGroup; } }; } -#endif // INCLUDED_CONNECTIVITY_SOURCE_INC_ADO_AGROUP_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/connectivity/source/inc/ado/AGroups.hxx b/connectivity/source/inc/ado/AGroups.hxx index 91c38dc64b1b..85817cec84d0 100644 --- a/connectivity/source/inc/ado/AGroups.hxx +++ b/connectivity/source/inc/ado/AGroups.hxx @@ -17,8 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_CONNECTIVITY_SOURCE_INC_ADO_AGROUPS_HXX -#define INCLUDED_CONNECTIVITY_SOURCE_INC_ADO_AGROUPS_HXX +#pragma once #include <connectivity/sdbcx/VCollection.hxx> #include <ado/Awrapadox.hxx> @@ -49,6 +48,4 @@ namespace connectivity::ado }; } -#endif // INCLUDED_CONNECTIVITY_SOURCE_INC_ADO_AGROUPS_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/connectivity/source/inc/ado/AIndex.hxx b/connectivity/source/inc/ado/AIndex.hxx index 41a839619b78..98c3a77d1ceb 100644 --- a/connectivity/source/inc/ado/AIndex.hxx +++ b/connectivity/source/inc/ado/AIndex.hxx @@ -17,8 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_CONNECTIVITY_SOURCE_INC_ADO_AINDEX_HXX -#define INCLUDED_CONNECTIVITY_SOURCE_INC_ADO_AINDEX_HXX +#pragma once #include <sdbcx/VIndex.hxx> #include <com/sun/star/sdbc/XDatabaseMetaData.hpp> @@ -39,13 +38,9 @@ namespace connectivity::ado public: OAdoIndex(bool _bCase, OConnection* _pConnection,ADOIndex* _pIndex); OAdoIndex(bool _bCase, OConnection* _pConnection); - // css::lang::XUnoTunnel - virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override; - static css::uno::Sequence< sal_Int8 > getUnoTunnelId(); WpADOIndex getImpl() const { return m_aIndex;} }; } -#endif // INCLUDED_CONNECTIVITY_SOURCE_INC_ADO_AINDEX_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/connectivity/source/inc/ado/AIndexes.hxx b/connectivity/source/inc/ado/AIndexes.hxx index 065c8a0b1843..48c2d1abee83 100644 --- a/connectivity/source/inc/ado/AIndexes.hxx +++ b/connectivity/source/inc/ado/AIndexes.hxx @@ -16,8 +16,7 @@ * 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_INC_ADO_AINDEXES_HXX -#define INCLUDED_CONNECTIVITY_SOURCE_INC_ADO_AINDEXES_HXX +#pragma once #include <connectivity/sdbcx/VCollection.hxx> #include <com/sun/star/sdbc/XDatabaseMetaData.hpp> @@ -51,6 +50,4 @@ namespace connectivity::ado }; } -#endif // INCLUDED_CONNECTIVITY_SOURCE_INC_ADO_AINDEXES_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/connectivity/source/inc/ado/AKey.hxx b/connectivity/source/inc/ado/AKey.hxx index ffb1eebe4216..5ec3fa972b12 100644 --- a/connectivity/source/inc/ado/AKey.hxx +++ b/connectivity/source/inc/ado/AKey.hxx @@ -17,8 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_CONNECTIVITY_SOURCE_INC_ADO_AKEY_HXX -#define INCLUDED_CONNECTIVITY_SOURCE_INC_ADO_AKEY_HXX +#pragma once #include <sdbcx/VKey.hxx> #include <com/sun/star/sdbc/XDatabaseMetaData.hpp> @@ -42,10 +41,6 @@ namespace connectivity::ado OAdoKey(bool _bCase,OConnection* _pConnection,ADOKey* _pKey); OAdoKey(bool _bCase,OConnection* _pConnection); - // css::lang::XUnoTunnel - virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override; - static css::uno::Sequence< sal_Int8 > getUnoTunnelId(); - WpADOKey getImpl() const { return m_aKey;} // map the update/delete rules static RuleEnum Map2Rule(sal_Int32 _eNum); @@ -56,6 +51,5 @@ namespace connectivity::ado static KeyTypeEnum Map2KeyRule(sal_Int32 _eNum); }; } -#endif // INCLUDED_CONNECTIVITY_SOURCE_INC_ADO_AKEY_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/connectivity/source/inc/ado/AKeys.hxx b/connectivity/source/inc/ado/AKeys.hxx index 6de3d5a2055a..45e127e29bf7 100644 --- a/connectivity/source/inc/ado/AKeys.hxx +++ b/connectivity/source/inc/ado/AKeys.hxx @@ -17,8 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_CONNECTIVITY_SOURCE_INC_ADO_AKEYS_HXX -#define INCLUDED_CONNECTIVITY_SOURCE_INC_ADO_AKEYS_HXX +#pragma once #include <connectivity/sdbcx/VCollection.hxx> #include <ado/Awrapadox.hxx> @@ -51,6 +50,4 @@ namespace connectivity::ado }; } -#endif // INCLUDED_CONNECTIVITY_SOURCE_INC_ADO_AKEYS_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/connectivity/source/inc/ado/APreparedStatement.hxx b/connectivity/source/inc/ado/APreparedStatement.hxx index 214f277c16bf..2ce394dbdefb 100644 --- a/connectivity/source/inc/ado/APreparedStatement.hxx +++ b/connectivity/source/inc/ado/APreparedStatement.hxx @@ -17,8 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_CONNECTIVITY_SOURCE_INC_ADO_APREPAREDSTATEMENT_HXX -#define INCLUDED_CONNECTIVITY_SOURCE_INC_ADO_APREPAREDSTATEMENT_HXX +#pragma once #include <ado/AStatement.hxx> #include <com/sun/star/sdbc/XPreparedStatement.hpp> @@ -63,8 +62,8 @@ namespace connectivity // a Constructor, that is needed for when Returning the Object is needed: OPreparedStatement( OConnection* _pConnection, const OUString& sql); - virtual void SAL_CALL acquire() throw() override; - virtual void SAL_CALL release() throw() override; + virtual void SAL_CALL acquire() noexcept override; + virtual void SAL_CALL release() noexcept override; virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override; //XTypeProvider virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override; @@ -110,6 +109,5 @@ namespace connectivity }; } } -#endif // INCLUDED_CONNECTIVITY_SOURCE_INC_ADO_APREPAREDSTATEMENT_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/connectivity/source/inc/ado/AResultSet.hxx b/connectivity/source/inc/ado/AResultSet.hxx index 101835f26019..58de2baeb539 100644 --- a/connectivity/source/inc/ado/AResultSet.hxx +++ b/connectivity/source/inc/ado/AResultSet.hxx @@ -17,8 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_CONNECTIVITY_SOURCE_INC_ADO_ARESULTSET_HXX -#define INCLUDED_CONNECTIVITY_SOURCE_INC_ADO_ARESULTSET_HXX +#pragma once #include <com/sun/star/sdbc/XResultSet.hpp> #include <com/sun/star/sdbc/XRow.hpp> @@ -135,8 +134,8 @@ namespace connectivity::ado virtual void SAL_CALL disposing() override; // XInterface virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override; - virtual void SAL_CALL acquire() throw() override; - virtual void SAL_CALL release() throw() override; + virtual void SAL_CALL acquire() noexcept override; + virtual void SAL_CALL release() noexcept override; //XTypeProvider virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override; // XPropertySet @@ -230,7 +229,6 @@ namespace connectivity::ado }; } -#endif // INCLUDED_CONNECTIVITY_SOURCE_INC_ADO_ARESULTSET_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/connectivity/source/inc/ado/AResultSetMetaData.hxx b/connectivity/source/inc/ado/AResultSetMetaData.hxx index 6389efc04a70..1eeb22656245 100644 --- a/connectivity/source/inc/ado/AResultSetMetaData.hxx +++ b/connectivity/source/inc/ado/AResultSetMetaData.hxx @@ -17,8 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_CONNECTIVITY_SOURCE_INC_ADO_ARESULTSETMETADATA_HXX -#define INCLUDED_CONNECTIVITY_SOURCE_INC_ADO_ARESULTSETMETADATA_HXX +#pragma once #include <com/sun/star/sdbc/XResultSetMetaData.hpp> #include <cppuhelper/implbase.hxx> @@ -76,6 +75,5 @@ namespace connectivity::ado virtual OUString SAL_CALL getColumnServiceName( sal_Int32 column ) override; }; } -#endif // INCLUDED_CONNECTIVITY_SOURCE_INC_ADO_ARESULTSETMETADATA_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/connectivity/source/inc/ado/AStatement.hxx b/connectivity/source/inc/ado/AStatement.hxx index a85992d01f03..625339917591 100644 --- a/connectivity/source/inc/ado/AStatement.hxx +++ b/connectivity/source/inc/ado/AStatement.hxx @@ -17,8 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_CONNECTIVITY_SOURCE_INC_ADO_ASTATEMENT_HXX -#define INCLUDED_CONNECTIVITY_SOURCE_INC_ADO_ASTATEMENT_HXX +#pragma once #include <com/sun/star/sdbc/XStatement.hpp> #include <com/sun/star/sdbc/XWarningsSupplier.hpp> @@ -168,8 +167,8 @@ namespace connectivity::ado // OComponentHelper virtual void SAL_CALL disposing() override; // XInterface - virtual void SAL_CALL acquire() throw() override; - virtual void SAL_CALL release() throw() override; + virtual void SAL_CALL acquire() noexcept override; + virtual void SAL_CALL release() noexcept override; virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override; //XTypeProvider virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override; @@ -205,8 +204,8 @@ namespace connectivity::ado DECLARE_SERVICE_INFO(); - virtual void SAL_CALL acquire() throw() override; - virtual void SAL_CALL release() throw() override; + virtual void SAL_CALL acquire() noexcept override; + virtual void SAL_CALL release() noexcept override; virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override; // XBatchExecution virtual void SAL_CALL addBatch( const OUString& sql ) override; @@ -214,6 +213,5 @@ namespace connectivity::ado virtual css::uno::Sequence< sal_Int32 > SAL_CALL executeBatch( ) override; }; } -#endif // INCLUDED_CONNECTIVITY_SOURCE_INC_ADO_ASTATEMENT_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/connectivity/source/inc/ado/ATable.hxx b/connectivity/source/inc/ado/ATable.hxx index dd0949dd2c3d..827485a6b480 100644 --- a/connectivity/source/inc/ado/ATable.hxx +++ b/connectivity/source/inc/ado/ATable.hxx @@ -17,8 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_CONNECTIVITY_SOURCE_INC_ADO_ATABLE_HXX -#define INCLUDED_CONNECTIVITY_SOURCE_INC_ADO_ATABLE_HXX +#pragma once #include <connectivity/sdbcx/VTable.hxx> #include <ado/Awrapadox.hxx> @@ -54,9 +53,6 @@ namespace connectivity::ado virtual OUString SAL_CALL getName() override; OUString getSchema() const { return m_SchemaName; } virtual css::uno::Reference< css::sdbc::XDatabaseMetaData> getMetaData() const override; - // css::lang::XUnoTunnel - virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override; - static css::uno::Sequence< sal_Int8 > getUnoTunnelId(); // XRename virtual void SAL_CALL rename( const OUString& newName ) override; @@ -69,6 +65,5 @@ namespace connectivity::ado OCatalog* getCatalog() const { return m_pCatalog; } }; } -#endif // INCLUDED_CONNECTIVITY_SOURCE_INC_ADO_ATABLE_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/connectivity/source/inc/ado/ATables.hxx b/connectivity/source/inc/ado/ATables.hxx index 2ca881051ff6..4fff5b97956e 100644 --- a/connectivity/source/inc/ado/ATables.hxx +++ b/connectivity/source/inc/ado/ATables.hxx @@ -16,8 +16,7 @@ * 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_INC_ADO_ATABLES_HXX -#define INCLUDED_CONNECTIVITY_SOURCE_INC_ADO_ATABLES_HXX +#pragma once #include <connectivity/sdbcx/VCollection.hxx> #include <ado/Awrapadox.hxx> @@ -49,6 +48,5 @@ namespace connectivity::ado void appendNew(const OUString& _rsNewTable); }; } -#endif // INCLUDED_CONNECTIVITY_SOURCE_INC_ADO_ATABLES_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/connectivity/source/inc/ado/AUser.hxx b/connectivity/source/inc/ado/AUser.hxx index 1368ed46d922..8d0c0f7321b6 100644 --- a/connectivity/source/inc/ado/AUser.hxx +++ b/connectivity/source/inc/ado/AUser.hxx @@ -17,8 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_CONNECTIVITY_SOURCE_INC_ADO_AUSER_HXX -#define INCLUDED_CONNECTIVITY_SOURCE_INC_ADO_AUSER_HXX +#pragma once #include <sdbcx/VUser.hxx> #include <ado/Awrapadox.hxx> @@ -49,9 +48,6 @@ namespace connectivity::ado OAdoUser(OCatalog* _pParent,bool _bCase, ADOUser* _pUser=nullptr); OAdoUser(OCatalog* _pParent,bool _bCase, const OUString& Name); - // css::lang::XUnoTunnel - virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override; - static css::uno::Sequence< sal_Int8 > getUnoTunnelId(); // XUser virtual void SAL_CALL changePassword( const OUString& objPassword, const OUString& newPassword ) override; // XAuthorizable @@ -83,6 +79,5 @@ namespace connectivity::ado OUString getPassword() const { return m_Password;} }; } -#endif // INCLUDED_CONNECTIVITY_SOURCE_INC_ADO_AUSER_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/connectivity/source/inc/ado/AUsers.hxx b/connectivity/source/inc/ado/AUsers.hxx index 17979351ef0a..1ec0bd5ad8f7 100644 --- a/connectivity/source/inc/ado/AUsers.hxx +++ b/connectivity/source/inc/ado/AUsers.hxx @@ -17,8 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_CONNECTIVITY_SOURCE_INC_ADO_AUSERS_HXX -#define INCLUDED_CONNECTIVITY_SOURCE_INC_ADO_AUSERS_HXX +#pragma once #include <connectivity/sdbcx/VCollection.hxx> #include <ado/Awrapadox.hxx> @@ -51,6 +50,4 @@ namespace connectivity::ado }; } -#endif // INCLUDED_CONNECTIVITY_SOURCE_INC_ADO_AUSERS_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/connectivity/source/inc/ado/AView.hxx b/connectivity/source/inc/ado/AView.hxx index 8aabc1053ba8..db81c4e70bb5 100644 --- a/connectivity/source/inc/ado/AView.hxx +++ b/connectivity/source/inc/ado/AView.hxx @@ -17,8 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_CONNECTIVITY_SOURCE_INC_ADO_AVIEW_HXX -#define INCLUDED_CONNECTIVITY_SOURCE_INC_ADO_AVIEW_HXX +#pragma once #include <connectivity/sdbcx/VView.hxx> #include <ado/Awrapadox.hxx> @@ -41,14 +40,8 @@ namespace connectivity::ado public: OAdoView(bool _bCase, ADOView* _pView=nullptr); - // css::lang::XUnoTunnel - virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override; - static css::uno::Sequence< sal_Int8 > getUnoTunnelId(); - WpADOView getImpl() const { return m_aView;} }; } -#endif // INCLUDED_CONNECTIVITY_SOURCE_INC_ADO_AVIEW_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/connectivity/source/inc/ado/AViews.hxx b/connectivity/source/inc/ado/AViews.hxx index be90d1463f08..ef0c692fdfc3 100644 --- a/connectivity/source/inc/ado/AViews.hxx +++ b/connectivity/source/inc/ado/AViews.hxx @@ -17,8 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_CONNECTIVITY_SOURCE_INC_ADO_AVIEWS_HXX -#define INCLUDED_CONNECTIVITY_SOURCE_INC_ADO_AVIEWS_HXX +#pragma once #include <connectivity/sdbcx/VCollection.hxx> #include <ado/Awrapadox.hxx> @@ -48,6 +47,5 @@ namespace connectivity::ado } }; } -#endif // INCLUDED_CONNECTIVITY_SOURCE_INC_ADO_AVIEWS_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/connectivity/source/inc/ado/Aolevariant.hxx b/connectivity/source/inc/ado/Aolevariant.hxx index d44287d7440c..ba0653156a94 100644 --- a/connectivity/source/inc/ado/Aolevariant.hxx +++ b/connectivity/source/inc/ado/Aolevariant.hxx @@ -16,8 +16,7 @@ * 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_INC_ADO_AOLEVARIANT_HXX -#define INCLUDED_CONNECTIVITY_SOURCE_INC_ADO_AOLEVARIANT_HXX +#pragma once #include <sal/types.h> #include <rtl/ustring.hxx> @@ -34,27 +33,6 @@ namespace com::sun::star::util namespace connectivity::ado { - class OLEString - { - BSTR m_sStr; - public: - OLEString(); - OLEString(const BSTR& _sBStr); - OLEString(std::u16string_view _sBStr); - OLEString(const OLEString& _rRh) - { - OLEString::operator=(_rRh); - } - ~OLEString(); - OLEString& operator=(std::u16string_view _rSrc); - OLEString& operator=(const BSTR& _rSrc); - OLEString& operator=(const OLEString& _rSrc); - OUString asOUString() const; - BSTR asBSTR() const; - BSTR* getAddress(); - sal_Int32 length() const; - }; - class OLEVariant : public ::tagVARIANT { public: @@ -142,6 +120,4 @@ namespace connectivity::ado }; } -#endif // INCLUDED_CONNECTIVITY_SOURCE_INC_ADO_AOLEVARIANT_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/connectivity/source/inc/ado/Aolewrap.hxx b/connectivity/source/inc/ado/Aolewrap.hxx index 3fb6b0713040..9d402fcf21b1 100644 --- a/connectivity/source/inc/ado/Aolewrap.hxx +++ b/connectivity/source/inc/ado/Aolewrap.hxx @@ -16,11 +16,12 @@ * 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_INC_ADO_AOLEWRAP_HXX -#define INCLUDED_CONNECTIVITY_SOURCE_INC_ADO_AOLEWRAP_HXX +#pragma once #include <osl/diagnose.h> #include <osl/thread.h> +#include <systools/win32/comtools.hxx> + #include <map> #include <vector> @@ -32,101 +33,59 @@ namespace rtl } namespace connectivity::ado { - class WpBase - { - protected: - IDispatch* pIUnknown; - - void setIDispatch(IDispatch* _pIUnknown); - public: - WpBase(); - WpBase(IDispatch* pInt); - //inline - WpBase& operator=(const WpBase& rhs); - WpBase& operator=(IDispatch* rhs); - WpBase(const WpBase& aWrapper); - virtual ~WpBase(); - void clear(); - - - bool IsValid() const; - operator IDispatch*(); - - }; - // Template class WpOLEBase<class T> // ================================== // // Objects of this class contain a pointer to an interface of the type T. - // The ctors and operator= make sure, that AddRef() and Release() are being - // called adhering to COM conventions. - // An object can also hold no pointer (null pointer), calling IsValid() then - // returns false. - // - // In order to do efficient pass-by-value, this class (as all derived classes) - // is a thin wrapper class, avoiding virtual methods and inlining. - template<class T> class WpOLEBase : public WpBase + template<class T> class WpOLEBase { protected: - T* pInterface; + sal::systools::COMReference<T> pInterface; public: - WpOLEBase(T* pInt = nullptr) : WpBase(pInt),pInterface(pInt){} + WpOLEBase(T* pInt = nullptr) : pInterface(pInt){} + WpOLEBase(const WpOLEBase<T>& aWrapper) + : pInterface( aWrapper.pInterface ) + { + } //inline WpOLEBase<T>& operator=(const WpOLEBase<T>& rhs) { - WpBase::operator=(rhs); pInterface = rhs.pInterface; return *this; }; - WpOLEBase<T>& operator=(T* rhs) - { - WpBase::operator=(rhs); - pInterface = rhs.pInterface; - return *this; - } - - WpOLEBase(const WpOLEBase<T>& aWrapper) - : WpBase( aWrapper ) - , pInterface( aWrapper.pInterface ) - { - } - - operator T*() const { return pInterface; } - void setWithOutAddRef(T* _pInterface) - { - pInterface = _pInterface; - WpBase::setIDispatch(_pInterface); - } + operator T*() const { return pInterface.get(); } + T** operator&() { return &pInterface; } + bool IsValid() const { return pInterface.is(); } + void set(T* p) { pInterface = p; } + void clear() { pInterface.clear(); } }; - // Template class WpOLECollection<class Ts, class T, class WrapT> + // Template class WpOLECollection<class Ts, class WrapT> // =============================================================== // // This class (derived from WpOLEBase<Ts>), abstracts away the properties // common to DAO collections: // // They are accessed via an interface Ts (e.g. DAOFields) and can return - // Items of the Type T (actually: with the interface T, e.g. DAOField) - // via get_Item (here GetItem). + // Items of the type wrapped by WrapT (actually: with the interface, e.g. + // DAOField) via get_Item (here GetItem). // - // This wrapper class does not expose an interface T, however, - // it exposes an object of the class WrapT. This must allow a construction - // by T, preferably it is derived from WpOLEBase<T>. + // This wrapper class exposes an object of the class WrapT. - template<class Ts, class T, class WrapT> class WpOLECollection : public WpOLEBase<Ts> + template<class Ts, class WrapT> class WpOLECollection : public WpOLEBase<Ts> { public: using WpOLEBase<Ts>::pInterface; using WpOLEBase<Ts>::IsValid; // Ctors, operator= // They only call the superclass - WpOLECollection(Ts* pInt=nullptr):WpOLEBase<Ts>(pInt){} + WpOLECollection() = default; WpOLECollection(const WpOLECollection& rhs) : WpOLEBase<Ts>(rhs) {} WpOLECollection& operator=(const WpOLECollection& rhs) {WpOLEBase<Ts>::operator=(rhs); return *this;}; @@ -143,35 +102,28 @@ namespace connectivity::ado WrapT GetItem(sal_Int32 index) const { OSL_ENSURE(index >= 0 && index<GetItemCount(),"Wrong index for field!"); - T* pT = NULL; - WrapT aRet(NULL); - if(SUCCEEDED(pInterface->get_Item(OLEVariant(index), &pT))) - aRet.setWithOutAddRef(pT); + WrapT aRet; + pInterface->get_Item(OLEVariant(index), &aRet); return aRet; } WrapT GetItem(const OLEVariant& index) const { - T* pT = NULL; - WrapT aRet(NULL); - if(SUCCEEDED(pInterface->get_Item(index, &pT))) - aRet.setWithOutAddRef(pT); + WrapT aRet; + pInterface->get_Item(index, &aRet); return aRet; } WrapT GetItem(const OUString& sStr) const { - WrapT aRet(NULL); - T* pT = NULL; - if (FAILED(pInterface->get_Item(OLEVariant(sStr), &pT))) + WrapT aRet; + if (FAILED(pInterface->get_Item(OLEVariant(sStr), &aRet))) { #if OSL_DEBUG_LEVEL > 0 OString sTemp("Unknown Item: " + OString(sStr.getStr(),sStr.getLength(),osl_getThreadTextEncoding())); OSL_FAIL(sTemp.getStr()); #endif } - else - aRet.setWithOutAddRef(pT); return aRet; } void fillElementNames(::std::vector< OUString>& _rVector) @@ -191,23 +143,23 @@ namespace connectivity::ado } }; - template<class Ts, class T, class WrapT> class WpOLEAppendCollection: - public WpOLECollection<Ts,T,WrapT> + template<class Ts, class WrapT> class WpOLEAppendCollection: + public WpOLECollection<Ts,WrapT> { public: // Ctors, operator= // They only call the superclass using WpOLEBase<Ts>::pInterface; - WpOLEAppendCollection(Ts* pInt=nullptr):WpOLECollection<Ts,T,WrapT>(pInt){} - WpOLEAppendCollection(const WpOLEAppendCollection& rhs) : WpOLECollection<Ts, T, WrapT>(rhs) {} + WpOLEAppendCollection() = default; + WpOLEAppendCollection(const WpOLEAppendCollection& rhs) : WpOLECollection<Ts, WrapT>(rhs) {} WpOLEAppendCollection& operator=(const WpOLEAppendCollection& rhs) {WpOLEBase<Ts>::operator=(rhs); return *this;}; bool Append(const WrapT& aWrapT) { - return SUCCEEDED(pInterface->Append(OLEVariant(static_cast<T*>(aWrapT)))); + return SUCCEEDED(pInterface->Append(OLEVariant(aWrapT))); }; bool Delete(const OUString& sName) @@ -219,6 +171,4 @@ namespace connectivity::ado }; } -#endif // INCLUDED_CONNECTIVITY_SOURCE_INC_ADO_AOLEWRAP_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/connectivity/source/inc/ado/Awrapado.hxx b/connectivity/source/inc/ado/Awrapado.hxx index 4e52d13847cb..507b85522674 100644 --- a/connectivity/source/inc/ado/Awrapado.hxx +++ b/connectivity/source/inc/ado/Awrapado.hxx @@ -16,8 +16,7 @@ * 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_INC_ADO_AWRAPADO_HXX -#define INCLUDED_CONNECTIVITY_SOURCE_INC_ADO_AWRAPADO_HXX +#pragma once #include <sal/config.h> @@ -43,16 +42,15 @@ namespace connectivity::ado class WpADOError; class WpADOProperty; - typedef WpOLEAppendCollection< ADOFields, ADOField, WpADOField> WpADOFields; - typedef WpOLECollection< ADOProperties, ADOProperty, WpADOProperty> WpADOProperties; + typedef WpOLEAppendCollection< ADOFields, WpADOField> WpADOFields; + typedef WpOLECollection< ADOProperties, WpADOProperty> WpADOProperties; class WpADOConnection : public WpOLEBase<ADOConnection> { - friend class WpADOCommand; public: - WpADOConnection(ADOConnection* pInt) : WpOLEBase<ADOConnection>(pInt){} + WpADOConnection() = default; WpADOConnection(const WpADOConnection& rhs) : WpOLEBase<ADOConnection>(rhs) {} @@ -108,7 +106,7 @@ namespace connectivity::ado ADORecordset* getIndexInfo( const css::uno::Any& catalog, const OUString& schema, std::u16string_view table, bool unique, bool approximate ); ADORecordset* getTablePrivileges( const css::uno::Any& catalog, const OUString& schemaPattern, - const OUString& tableNamePattern ); + std::u16string_view tableNamePattern ); ADORecordset* getCrossReference( const css::uno::Any& primaryCatalog, const OUString& primarySchema, std::u16string_view primaryTable, @@ -117,18 +115,18 @@ namespace connectivity::ado std::u16string_view foreignTable); ADORecordset* getProcedures( const css::uno::Any& catalog, const OUString& schemaPattern, - const OUString& procedureNamePattern ); + std::u16string_view procedureNamePattern ); ADORecordset* getProcedureColumns( const css::uno::Any& catalog, const OUString& schemaPattern, - const OUString& procedureNamePattern, - const OUString& columnNamePattern ); + std::u16string_view procedureNamePattern, + std::u16string_view columnNamePattern ); ADORecordset* getTables( const css::uno::Any& catalog, const OUString& schemaPattern, - const OUString& tableNamePattern, + std::u16string_view tableNamePattern, const css::uno::Sequence< OUString >& types ); ADORecordset* getColumns( const css::uno::Any& catalog, const OUString& schemaPattern, - const OUString& tableNamePattern, + std::u16string_view tableNamePattern, std::u16string_view columnNamePattern ); ADORecordset* getColumnPrivileges( const css::uno::Any& catalog, const OUString& schemaPattern, @@ -141,11 +139,9 @@ namespace connectivity::ado class WpADOCommand : public WpOLEBase<ADOCommand> { public: - WpADOCommand(){} + WpADOCommand() = default; // Ctors, operator= // They only call the superclass - WpADOCommand(ADOCommand* pInt) : WpOLEBase<ADOCommand>(pInt){} - WpADOCommand(const WpADOCommand& rhs) : WpOLEBase<ADOCommand>(rhs) {} WpADOCommand& operator=(const WpADOCommand& rhs) @@ -153,7 +149,7 @@ namespace connectivity::ado WpOLEBase<ADOCommand>::operator=(rhs); return *this;} - bool putref_ActiveConnection( WpADOConnection *pCon); + bool putref_ActiveConnection(const WpADOConnection& rCon); void put_ActiveConnection(/* [in] */ const OLEVariant& vConn); void Create(); @@ -182,7 +178,7 @@ namespace connectivity::ado // Ctors, operator= // They only call the superclass - WpADOError(ADOError* pInt):WpOLEBase<ADOError>(pInt){} + WpADOError() = default; WpADOError(const WpADOError& rhs) : WpOLEBase<ADOError>(rhs) {} @@ -205,7 +201,7 @@ namespace connectivity::ado // Ctors, operator= // They only call the superclass - WpADOField(ADOField* pInt=nullptr):WpOLEBase<ADOField>(pInt){} + WpADOField() = default; WpADOField(const WpADOField& rhs) : WpOLEBase<ADOField>(rhs) {} WpADOField& operator=(const WpADOField& rhs) @@ -251,7 +247,7 @@ namespace connectivity::ado public: // Ctors, operator= // They only call the superclass - WpADOProperty(ADOProperty* pInt=nullptr):WpOLEBase<ADOProperty>(pInt){} + WpADOProperty() = default; WpADOProperty(const WpADOProperty& rhs) : WpOLEBase<ADOProperty>(rhs) {} WpADOProperty& operator=(const WpADOProperty& rhs) {WpOLEBase<ADOProperty>::operator=(rhs); return *this;} @@ -273,7 +269,7 @@ namespace connectivity::ado public: // Ctors, operator= // They only call the superclass - WpADORecordset(ADORecordset* pInt=nullptr):WpOLEBase<ADORecordset>(pInt){} + WpADORecordset() = default; WpADORecordset(const WpADORecordset& rhs) : WpOLEBase<ADORecordset>() {operator=(rhs);} WpADORecordset& operator=(const WpADORecordset& rhs) { @@ -333,7 +329,7 @@ namespace connectivity::ado public: // Ctors, operator= // They only call the superclass - WpADOParameter(ADOParameter* pInt):WpOLEBase<ADOParameter>(pInt){} + WpADOParameter() = default; WpADOParameter(const WpADOParameter& rhs):WpOLEBase<ADOParameter>(rhs){} WpADOParameter& operator=(const WpADOParameter& rhs) {WpOLEBase<ADOParameter>::operator=(rhs); return *this;} @@ -373,6 +369,4 @@ namespace connectivity::ado }; } -#endif // INCLUDED_CONNECTIVITY_SOURCE_INC_ADO_AWRAPADO_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/connectivity/source/inc/ado/Awrapadox.hxx b/connectivity/source/inc/ado/Awrapadox.hxx index 6bda5b4878d8..ba91422a1d09 100644 --- a/connectivity/source/inc/ado/Awrapadox.hxx +++ b/connectivity/source/inc/ado/Awrapadox.hxx @@ -89,7 +89,7 @@ namespace connectivity::ado class WpADOGroup : public WpOLEBase<ADOGroup> { public: - WpADOGroup(ADOGroup* pInt=nullptr) : WpOLEBase<ADOGroup>(pInt){} + WpADOGroup() = default; WpADOGroup(const WpADOGroup& rhs) : WpOLEBase<ADOGroup>(rhs) {} WpADOGroup& operator=(const WpADOGroup& rhs) @@ -113,7 +113,7 @@ namespace connectivity::ado class WpADOUser : public WpOLEBase<_ADOUser> { public: - WpADOUser(_ADOUser* pInt=nullptr) : WpOLEBase<_ADOUser>(pInt){} + WpADOUser() = default; WpADOUser(const WpADOUser& rhs) : WpOLEBase<_ADOUser>(rhs) {} WpADOUser& operator=(const WpADOUser& rhs) diff --git a/connectivity/source/inc/ado/WrapCatalog.hxx b/connectivity/source/inc/ado/WrapCatalog.hxx index 34834236b7dc..0bcff441c23a 100644 --- a/connectivity/source/inc/ado/WrapCatalog.hxx +++ b/connectivity/source/inc/ado/WrapCatalog.hxx @@ -16,8 +16,7 @@ * 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_INC_ADO_WRAPCATALOG_HXX -#define INCLUDED_CONNECTIVITY_SOURCE_INC_ADO_WRAPCATALOG_HXX +#pragma once #include <sal/config.h> @@ -48,6 +47,4 @@ namespace connectivity::ado }; } -#endif // INCLUDED_CONNECTIVITY_SOURCE_INC_ADO_WRAPCATALOG_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/connectivity/source/inc/ado/WrapColumn.hxx b/connectivity/source/inc/ado/WrapColumn.hxx index 096dcd326154..f1b73585fba9 100644 --- a/connectivity/source/inc/ado/WrapColumn.hxx +++ b/connectivity/source/inc/ado/WrapColumn.hxx @@ -16,8 +16,7 @@ * 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_INC_ADO_WRAPCOLUMN_HXX -#define INCLUDED_CONNECTIVITY_SOURCE_INC_ADO_WRAPCOLUMN_HXX +#pragma once #include <sal/config.h> @@ -32,7 +31,7 @@ namespace connectivity::ado class WpADOColumn : public WpOLEBase<_ADOColumn> { public: - WpADOColumn(_ADOColumn* pInt=nullptr) : WpOLEBase<_ADOColumn>(pInt){} + WpADOColumn() = default; WpADOColumn(const WpADOColumn& rhs) : WpOLEBase<_ADOColumn>(rhs) {} void Create(); @@ -60,6 +59,4 @@ namespace connectivity::ado }; } -#endif // INCLUDED_CONNECTIVITY_SOURCE_INC_ADO_WRAPCOLUMN_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/connectivity/source/inc/ado/WrapIndex.hxx b/connectivity/source/inc/ado/WrapIndex.hxx index f4318c45873f..4444bb340ae5 100644 --- a/connectivity/source/inc/ado/WrapIndex.hxx +++ b/connectivity/source/inc/ado/WrapIndex.hxx @@ -16,8 +16,7 @@ * 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_INC_ADO_WRAPINDEX_HXX -#define INCLUDED_CONNECTIVITY_SOURCE_INC_ADO_WRAPINDEX_HXX +#pragma once #include <sal/config.h> @@ -30,7 +29,7 @@ namespace connectivity::ado class WpADOIndex : public WpOLEBase<_ADOIndex> { public: - WpADOIndex(_ADOIndex* pInt=nullptr) : WpOLEBase<_ADOIndex>(pInt){} + WpADOIndex() = default; WpADOIndex(const WpADOIndex& rhs) : WpOLEBase<_ADOIndex>(rhs) {} WpADOIndex& operator=(const WpADOIndex& rhs) @@ -50,6 +49,4 @@ namespace connectivity::ado }; } -#endif // INCLUDED_CONNECTIVITY_SOURCE_INC_ADO_WRAPINDEX_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/connectivity/source/inc/ado/WrapKey.hxx b/connectivity/source/inc/ado/WrapKey.hxx index 49969c41bb61..1f984445b8ae 100644 --- a/connectivity/source/inc/ado/WrapKey.hxx +++ b/connectivity/source/inc/ado/WrapKey.hxx @@ -16,8 +16,7 @@ * 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_INC_ADO_WRAPKEY_HXX -#define INCLUDED_CONNECTIVITY_SOURCE_INC_ADO_WRAPKEY_HXX +#pragma once #include <sal/config.h> @@ -30,7 +29,7 @@ namespace connectivity::ado class WpADOKey : public WpOLEBase<ADOKey> { public: - WpADOKey(ADOKey* pInt=nullptr) : WpOLEBase<ADOKey>(pInt){} + WpADOKey() = default; WpADOKey(const WpADOKey& rhs) : WpOLEBase<ADOKey>(rhs) {} WpADOKey& operator=(const WpADOKey& rhs) @@ -52,6 +51,4 @@ namespace connectivity::ado }; } -#endif // INCLUDED_CONNECTIVITY_SOURCE_INC_ADO_WRAPKEY_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/connectivity/source/inc/ado/WrapTable.hxx b/connectivity/source/inc/ado/WrapTable.hxx index 4119bfb58e3b..dc06dbc03a8e 100644 --- a/connectivity/source/inc/ado/WrapTable.hxx +++ b/connectivity/source/inc/ado/WrapTable.hxx @@ -16,8 +16,7 @@ * 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_INC_ADO_WRAPTABLE_HXX -#define INCLUDED_CONNECTIVITY_SOURCE_INC_ADO_WRAPTABLE_HXX +#pragma once #include <sal/config.h> @@ -32,7 +31,7 @@ namespace connectivity::ado class WpADOTable : public WpOLEBase<_ADOTable> { public: - WpADOTable(_ADOTable* pInt=nullptr) : WpOLEBase<_ADOTable>(pInt){} + WpADOTable() = default; WpADOTable(const WpADOTable& rhs) : WpOLEBase<_ADOTable>(rhs) {} WpADOTable& operator=(const WpADOTable& rhs) @@ -52,9 +51,7 @@ namespace connectivity::ado }; - typedef WpOLEAppendCollection<ADOTables, _ADOTable, WpADOTable> WpADOTables; + typedef WpOLEAppendCollection<ADOTables, WpADOTable> WpADOTables; } -#endif // INCLUDED_CONNECTIVITY_SOURCE_INC_ADO_WRAPTABLE_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/connectivity/source/inc/ado/WrapTypeDefs.hxx b/connectivity/source/inc/ado/WrapTypeDefs.hxx index 991d0018e5d8..91bea8453480 100644 --- a/connectivity/source/inc/ado/WrapTypeDefs.hxx +++ b/connectivity/source/inc/ado/WrapTypeDefs.hxx @@ -16,8 +16,7 @@ * 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_INC_ADO_WRAPTYPEDEFS_HXX -#define INCLUDED_CONNECTIVITY_SOURCE_INC_ADO_WRAPTYPEDEFS_HXX +#pragma once namespace connectivity::ado @@ -30,15 +29,13 @@ namespace connectivity::ado class WpADOView; class WpADOUser; - typedef WpOLEAppendCollection<ADOTables, _ADOTable, WpADOTable> WpADOTables; - typedef WpOLEAppendCollection<ADOKeys, ADOKey, WpADOKey> WpADOKeys; - typedef WpOLEAppendCollection<ADOIndexes, _ADOIndex, WpADOIndex> WpADOIndexes; - typedef WpOLEAppendCollection<ADOColumns, _ADOColumn, WpADOColumn> WpADOColumns; - typedef WpOLEAppendCollection<ADOGroups, ADOGroup, WpADOGroup> WpADOGroups; - typedef WpOLEAppendCollection<ADOViews, ADOView, WpADOView> WpADOViews; - typedef WpOLEAppendCollection<ADOUsers, _ADOUser, WpADOUser> WpADOUsers; + typedef WpOLEAppendCollection<ADOTables, WpADOTable> WpADOTables; + typedef WpOLEAppendCollection<ADOKeys, WpADOKey> WpADOKeys; + typedef WpOLEAppendCollection<ADOIndexes, WpADOIndex> WpADOIndexes; + typedef WpOLEAppendCollection<ADOColumns, WpADOColumn> WpADOColumns; + typedef WpOLEAppendCollection<ADOGroups, WpADOGroup> WpADOGroups; + typedef WpOLEAppendCollection<ADOViews, WpADOView> WpADOViews; + typedef WpOLEAppendCollection<ADOUsers, WpADOUser> WpADOUsers; } -#endif // INCLUDED_CONNECTIVITY_SOURCE_INC_ADO_WRAPTYPEDEFS_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/connectivity/source/inc/ado/adoimp.hxx b/connectivity/source/inc/ado/adoimp.hxx index 5394aac3e4a0..60c6fd313d77 100644 --- a/connectivity/source/inc/ado/adoimp.hxx +++ b/connectivity/source/inc/ado/adoimp.hxx @@ -16,8 +16,7 @@ * 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_INC_ADO_ADOIMP_HXX -#define INCLUDED_CONNECTIVITY_SOURCE_INC_ADO_ADOIMP_HXX +#pragma once #include <com/sun/star/sdbc/SQLException.hpp> @@ -25,16 +24,17 @@ struct ADOConnection; +namespace sal::systools { class BStr; }; + namespace connectivity::ado { class WpADOField; - class OLEString; class ADOS { public: // Also here: Free BSTR with SysFreeString()! - static OLEString& GetKeyStr(); + static sal::systools::BStr& GetKeyStr(); static const CLSID CLSID_ADOCATALOG_25; static const IID IID_ADOCATALOG_25; @@ -96,10 +96,8 @@ namespace connectivity::ado if(aProp.IsValid()) \ aVar = aProp.GetValue(); \ else \ - ADOS::ThrowException(*m_pADOConnection,*this); - + ADOS::ThrowException(m_rADOConnection,*this); -#endif // INCLUDED_CONNECTIVITY_SOURCE_INC_ADO_ADOIMP_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |