dbaccess/source/core/inc/objectnameapproval.hxx | 6 +++--- dbaccess/source/core/misc/objectnameapproval.cxx | 18 ++++-------------- 2 files changed, 7 insertions(+), 17 deletions(-)
New commits: commit f69971ac3a0aa25e6302d9e6f81fa757612085cb Author: Noel Grandin <noelgran...@gmail.com> AuthorDate: Sun Sep 4 14:58:49 2022 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Mon Sep 5 08:56:25 2022 +0200 ObjectNameApproval doesn't need a pimpl it is already module private Change-Id: Ic597fa86ee83a5d22d88c29befc3d54ea6eaecf8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139364 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/dbaccess/source/core/inc/objectnameapproval.hxx b/dbaccess/source/core/inc/objectnameapproval.hxx index ddd538c79edb..e503c347ea4e 100644 --- a/dbaccess/source/core/inc/objectnameapproval.hxx +++ b/dbaccess/source/core/inc/objectnameapproval.hxx @@ -21,14 +21,13 @@ #include <memory> #include "containerapprove.hxx" - +#include <cppuhelper/weakref.hxx> #include <com/sun/star/sdbc/XConnection.hpp> namespace dbaccess { // ObjectNameApproval - struct ObjectNameApproval_Impl; /** implementation of the IContainerApprove interface which approves elements for insertion into a query or tables container. @@ -40,7 +39,8 @@ namespace dbaccess */ class ObjectNameApproval : public IContainerApprove { - std::unique_ptr< ObjectNameApproval_Impl > m_pImpl; + css::uno::WeakReference< css::sdbc::XConnection > mxConnection; + sal_Int32 mnCommandType; public: enum ObjectType diff --git a/dbaccess/source/core/misc/objectnameapproval.cxx b/dbaccess/source/core/misc/objectnameapproval.cxx index 3ec15caaa4fd..5b7faa6ada9b 100644 --- a/dbaccess/source/core/misc/objectnameapproval.cxx +++ b/dbaccess/source/core/misc/objectnameapproval.cxx @@ -23,8 +23,6 @@ #include <com/sun/star/sdb/tools/XConnectionTools.hpp> #include <com/sun/star/sdb/CommandType.hpp> -#include <cppuhelper/weakref.hxx> - namespace dbaccess { @@ -39,19 +37,11 @@ namespace dbaccess namespace CommandType = com::sun::star::sdb::CommandType; - // ObjectNameApproval_Impl - struct ObjectNameApproval_Impl - { - WeakReference< XConnection > aConnection; - sal_Int32 nCommandType; - }; - // ObjectNameApproval ObjectNameApproval::ObjectNameApproval( const Reference< XConnection >& _rxConnection, ObjectType _eType ) - :m_pImpl( new ObjectNameApproval_Impl ) { - m_pImpl->aConnection = _rxConnection; - m_pImpl->nCommandType = _eType == TypeQuery ? CommandType::QUERY : CommandType::TABLE; + mxConnection = _rxConnection; + mnCommandType = _eType == TypeQuery ? CommandType::QUERY : CommandType::TABLE; } ObjectNameApproval::~ObjectNameApproval() @@ -60,13 +50,13 @@ namespace dbaccess void ObjectNameApproval::approveElement( const OUString& _rName ) { - Reference< XConnection > xConnection( m_pImpl->aConnection ); + Reference< XConnection > xConnection( mxConnection ); if ( !xConnection.is() ) throw DisposedException(); Reference< XConnectionTools > xConnectionTools( xConnection, UNO_QUERY_THROW ); Reference< XObjectNames > xObjectNames( xConnectionTools->getObjectNames(), css::uno::UNO_SET_THROW ); - xObjectNames->checkNameForCreate( m_pImpl->nCommandType, _rName ); + xObjectNames->checkNameForCreate( mnCommandType, _rName ); } } // namespace dbaccess