diff options
author | Noel Grandin <noel@peralex.com> | 2015-05-26 10:25:09 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2015-05-29 06:46:40 +0000 |
commit | 6c1cabe677f5eb24b465dd6e316c8c66df64bb29 (patch) | |
tree | 511a164130e1c4fdc9be4e7c54d32fd4eac9eb78 | |
parent | ef2e135cfb8f107a154aaab9b54f2dfca0edf6a0 (diff) |
loplugin:unnecessarysuperclass, merge IWarningsContainer..
..into WarningsContainer
Change-Id: I682528a4eb1b1298faf12b2d498db65f94800cd5
Reviewed-on: https://gerrit.libreoffice.org/15905
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
-rw-r--r-- | connectivity/source/commontools/warningscontainer.cxx | 5 | ||||
-rw-r--r-- | dbaccess/source/core/api/FilteredContainer.cxx | 2 | ||||
-rw-r--r-- | dbaccess/source/core/api/query.hxx | 10 | ||||
-rw-r--r-- | dbaccess/source/core/api/querycontainer.cxx | 4 | ||||
-rw-r--r-- | dbaccess/source/core/api/tablecontainer.cxx | 2 | ||||
-rw-r--r-- | dbaccess/source/core/api/viewcontainer.cxx | 2 | ||||
-rw-r--r-- | dbaccess/source/core/inc/FilteredContainer.hxx | 6 | ||||
-rw-r--r-- | dbaccess/source/core/inc/querycontainer.hxx | 8 | ||||
-rw-r--r-- | dbaccess/source/core/inc/tablecontainer.hxx | 2 | ||||
-rw-r--r-- | dbaccess/source/core/inc/viewcontainer.hxx | 4 | ||||
-rw-r--r-- | include/connectivity/warningscontainer.hxx | 46 |
11 files changed, 32 insertions, 59 deletions
diff --git a/connectivity/source/commontools/warningscontainer.cxx b/connectivity/source/commontools/warningscontainer.cxx index 4afe81aeaef8..5d355323eb34 100644 --- a/connectivity/source/commontools/warningscontainer.cxx +++ b/connectivity/source/commontools/warningscontainer.cxx @@ -55,11 +55,6 @@ namespace dbtools } - WarningsContainer::~WarningsContainer() - { - } - - void WarningsContainer::appendWarning(const SQLException& _rWarning) { lcl_concatWarnings( m_aOwnWarnings, makeAny( _rWarning ) ); diff --git a/dbaccess/source/core/api/FilteredContainer.cxx b/dbaccess/source/core/api/FilteredContainer.cxx index 3fa7078257e9..4002ce9845fd 100644 --- a/dbaccess/source/core/api/FilteredContainer.cxx +++ b/dbaccess/source/core/api/FilteredContainer.cxx @@ -239,7 +239,7 @@ sal_Int32 createWildCardVector(Sequence< OUString >& _rTableFilter, ::std::vecto const Reference< XConnection >& _xCon, bool _bCase, IRefreshListener* _pRefreshListener, - ::dbtools::IWarningsContainer* _pWarningsContainer + ::dbtools::WarningsContainer* _pWarningsContainer ,oslInterlockedCount& _nInAppend) :OCollection(_rParent,_bCase,_rMutex,::std::vector< OUString>()) ,m_bConstructed(false) diff --git a/dbaccess/source/core/api/query.hxx b/dbaccess/source/core/api/query.hxx index ecaa325b043a..baf50c20b206 100644 --- a/dbaccess/source/core/api/query.hxx +++ b/dbaccess/source/core/api/query.hxx @@ -32,7 +32,7 @@ namespace dbtools { - class IWarningsContainer; + class WarningsContainer; } namespace dbaccess @@ -64,8 +64,8 @@ protected: ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > m_xConnection; ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > m_xCommandPropInfo; ::rtl::Reference< OContainerMediator > m_pColumnMediator; - ::dbtools::IWarningsContainer* m_pWarnings; - bool m_bCaseSensitiv : 1; // assume case sensitivity of the column names ? + ::dbtools::WarningsContainer* m_pWarnings; + bool m_bCaseSensitiv : 1; // assume case sensitivity of the column names ? // possible actions on our "aggregate" enum AGGREGATE_ACTION { NONE, SETTING_PROPERTIES, FLUSHING }; @@ -131,8 +131,8 @@ public: public: // the caller is responsible for the lifetime! - void setWarningsContainer( ::dbtools::IWarningsContainer* _pWarnings ) { m_pWarnings = _pWarnings; } - ::dbtools::IWarningsContainer* getWarningsContainer( ) const { return m_pWarnings; } + void setWarningsContainer( ::dbtools::WarningsContainer* _pWarnings ) { m_pWarnings = _pWarnings; } + ::dbtools::WarningsContainer* getWarningsContainer( ) const { return m_pWarnings; } // XRename virtual void SAL_CALL rename( const OUString& newName ) throw (::com::sun::star::sdbc::SQLException, ::com::sun::star::container::ElementExistException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; diff --git a/dbaccess/source/core/api/querycontainer.cxx b/dbaccess/source/core/api/querycontainer.cxx index 59ad63ed2f6a..b9dd5c157510 100644 --- a/dbaccess/source/core/api/querycontainer.cxx +++ b/dbaccess/source/core/api/querycontainer.cxx @@ -64,7 +64,7 @@ OQueryContainer::OQueryContainer( const Reference< XNameContainer >& _rxCommandDefinitions , const Reference< XConnection >& _rxConn , const Reference< XComponentContext >& _rxORB, - ::dbtools::IWarningsContainer* _pWarnings) + ::dbtools::WarningsContainer* _pWarnings) :ODefinitionContainer(_rxORB,NULL,TContentPtr(new ODefinitionContainer_Impl)) ,m_pWarnings( _pWarnings ) ,m_xCommandDefinitions(_rxCommandDefinitions) @@ -99,7 +99,7 @@ rtl::Reference<OQueryContainer> OQueryContainer::create( const Reference< XNameContainer >& _rxCommandDefinitions , const Reference< XConnection >& _rxConn , const Reference< XComponentContext >& _rxORB, - ::dbtools::IWarningsContainer* _pWarnings) + ::dbtools::WarningsContainer* _pWarnings) { rtl::Reference<OQueryContainer> c( new OQueryContainer( diff --git a/dbaccess/source/core/api/tablecontainer.cxx b/dbaccess/source/core/api/tablecontainer.cxx index 8af70e9c46c1..a10f5be74a32 100644 --- a/dbaccess/source/core/api/tablecontainer.cxx +++ b/dbaccess/source/core/api/tablecontainer.cxx @@ -101,7 +101,7 @@ OTableContainer::OTableContainer(::cppu::OWeakObject& _rParent, bool _bCase, const Reference< XNameContainer >& _xTableDefinitions, IRefreshListener* _pRefreshListener, - ::dbtools::IWarningsContainer* _pWarningsContainer + ::dbtools::WarningsContainer* _pWarningsContainer ,oslInterlockedCount& _nInAppend) :OFilteredContainer(_rParent,_rMutex,_xCon,_bCase,_pRefreshListener,_pWarningsContainer,_nInAppend) ,m_xTableDefinitions(_xTableDefinitions) diff --git a/dbaccess/source/core/api/viewcontainer.cxx b/dbaccess/source/core/api/viewcontainer.cxx index 7725bdf82dc6..5bf449facebd 100644 --- a/dbaccess/source/core/api/viewcontainer.cxx +++ b/dbaccess/source/core/api/viewcontainer.cxx @@ -63,7 +63,7 @@ OViewContainer::OViewContainer(::cppu::OWeakObject& _rParent ,const Reference< XConnection >& _xCon ,bool _bCase ,IRefreshListener* _pRefreshListener - ,::dbtools::IWarningsContainer* _pWarningsContainer + ,::dbtools::WarningsContainer* _pWarningsContainer ,oslInterlockedCount& _nInAppend) :OFilteredContainer(_rParent,_rMutex,_xCon,_bCase,_pRefreshListener,_pWarningsContainer,_nInAppend) ,m_bInElementRemoved(false) diff --git a/dbaccess/source/core/inc/FilteredContainer.hxx b/dbaccess/source/core/inc/FilteredContainer.hxx index 908ea6a588d0..6d3616029342 100644 --- a/dbaccess/source/core/inc/FilteredContainer.hxx +++ b/dbaccess/source/core/inc/FilteredContainer.hxx @@ -26,7 +26,7 @@ namespace dbtools { - class IWarningsContainer; + class WarningsContainer; } namespace dbaccess @@ -39,7 +39,7 @@ namespace dbaccess mutable bool m_bConstructed; // late ctor called protected: - ::dbtools::IWarningsContainer* m_pWarningsContainer; + ::dbtools::WarningsContainer* m_pWarningsContainer; IRefreshListener* m_pRefreshListener; oslInterlockedCount& m_nInAppend; @@ -104,7 +104,7 @@ namespace dbaccess const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _xCon, bool _bCase, IRefreshListener* _pRefreshListener, - ::dbtools::IWarningsContainer* _pWarningsContainer, + ::dbtools::WarningsContainer* _pWarningsContainer, oslInterlockedCount& _nInAppend ); diff --git a/dbaccess/source/core/inc/querycontainer.hxx b/dbaccess/source/core/inc/querycontainer.hxx index ea786ff72691..70cdef5c7561 100644 --- a/dbaccess/source/core/inc/querycontainer.hxx +++ b/dbaccess/source/core/inc/querycontainer.hxx @@ -45,7 +45,7 @@ namespace dbtools { - class IWarningsContainer; + class WarningsContainer; } namespace dbaccess @@ -63,7 +63,7 @@ namespace dbaccess , public OQueryContainer_Base { private: - ::dbtools::IWarningsContainer* m_pWarnings; + ::dbtools::WarningsContainer* m_pWarnings; ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > m_xCommandDefinitions; ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > @@ -107,7 +107,7 @@ namespace dbaccess const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& _rxCommandDefinitions, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConn, const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxORB, - ::dbtools::IWarningsContainer* _pWarnings + ::dbtools::WarningsContainer* _pWarnings ); void init(); @@ -117,7 +117,7 @@ namespace dbaccess const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& _rxCommandDefinitions, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConn, const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxORB, - ::dbtools::IWarningsContainer* _pWarnings + ::dbtools::WarningsContainer* _pWarnings ); DECLARE_XINTERFACE( ) diff --git a/dbaccess/source/core/inc/tablecontainer.hxx b/dbaccess/source/core/inc/tablecontainer.hxx index b2c023f6e822..54f57bb9b3af 100644 --- a/dbaccess/source/core/inc/tablecontainer.hxx +++ b/dbaccess/source/core/inc/tablecontainer.hxx @@ -91,7 +91,7 @@ namespace dbaccess bool _bCase, const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& _xTableDefinitions, IRefreshListener* _pRefreshListener, - ::dbtools::IWarningsContainer* _pWarningsContainer, + ::dbtools::WarningsContainer* _pWarningsContainer, oslInterlockedCount& _nInAppend ); diff --git a/dbaccess/source/core/inc/viewcontainer.hxx b/dbaccess/source/core/inc/viewcontainer.hxx index 5d15c31f4e81..e28ede644c7e 100644 --- a/dbaccess/source/core/inc/viewcontainer.hxx +++ b/dbaccess/source/core/inc/viewcontainer.hxx @@ -37,7 +37,7 @@ namespace dbtools { - class IWarningsContainer; + class WarningsContainer; } namespace dbaccess @@ -63,7 +63,7 @@ namespace dbaccess const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _xCon, bool _bCase, IRefreshListener* _pRefreshListener, - ::dbtools::IWarningsContainer* _pWarningsContainer, + ::dbtools::WarningsContainer* _pWarningsContainer, oslInterlockedCount& _nInAppend ); diff --git a/include/connectivity/warningscontainer.hxx b/include/connectivity/warningscontainer.hxx index 4d652b2ba3a6..978c9892ed95 100644 --- a/include/connectivity/warningscontainer.hxx +++ b/include/connectivity/warningscontainer.hxx @@ -29,42 +29,21 @@ namespace dbtools { - - - //= IWarningsContainer - - class SAL_NO_VTABLE IWarningsContainer - { - public: - virtual void appendWarning(const ::com::sun::star::sdbc::SQLException& _rWarning) = 0; - virtual void appendWarning(const ::com::sun::star::sdbc::SQLWarning& _rWarning) = 0; - virtual void appendWarning(const ::com::sun::star::sdb::SQLContext& _rContext) = 0; - - protected: - ~IWarningsContainer() {} - }; - - - //= WarningsContainer - /** helper class for implementing XWarningsSupplier, which mixes own warnings with warnings obtained from an external instance */ - class OOO_DLLPUBLIC_DBTOOLS WarningsContainer : public IWarningsContainer + class OOO_DLLPUBLIC_DBTOOLS WarningsContainer { private: - ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XWarningsSupplier > m_xExternalWarnings; - ::com::sun::star::uno::Any m_aOwnWarnings; + css::uno::Reference< css::sdbc::XWarningsSupplier > m_xExternalWarnings; + css::uno::Any m_aOwnWarnings; public: - WarningsContainer() { } - WarningsContainer( const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XWarningsSupplier >& _rxExternalWarnings ) - :m_xExternalWarnings( _rxExternalWarnings ) - { - } - virtual ~WarningsContainer(); + WarningsContainer() {} + WarningsContainer( const css::uno::Reference< css::sdbc::XWarningsSupplier >& _rxExternalWarnings ) + :m_xExternalWarnings( _rxExternalWarnings ) {} - void setExternalWarnings( const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XWarningsSupplier >& _rxExternalWarnings ) + void setExternalWarnings( const css::uno::Reference< css::sdbc::XWarningsSupplier >& _rxExternalWarnings ) { m_xExternalWarnings = _rxExternalWarnings; } @@ -81,15 +60,14 @@ namespace dbtools void appendWarning( const OUString& _rWarning, const sal_Char* _pAsciiSQLState, - const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxContext ); + const css::uno::Reference< css::uno::XInterface >& _rxContext ); - // IWarningsContainer - virtual void appendWarning(const ::com::sun::star::sdbc::SQLException& _rWarning) SAL_OVERRIDE; - virtual void appendWarning(const ::com::sun::star::sdbc::SQLWarning& _rWarning) SAL_OVERRIDE; - virtual void appendWarning(const ::com::sun::star::sdb::SQLContext& _rContext) SAL_OVERRIDE; + void appendWarning(const css::sdbc::SQLException& _rWarning); + void appendWarning(const css::sdbc::SQLWarning& _rWarning); + void appendWarning(const css::sdb::SQLContext& _rContext); // XWarningsSupplier equivalents - ::com::sun::star::uno::Any SAL_CALL getWarnings( ) const; + css::uno::Any SAL_CALL getWarnings( ) const; void SAL_CALL clearWarnings( ); }; |