[Libreoffice-commits] core.git: connectivity/source dbaccess/source include/connectivity

Noel Grandin noel at peralex.com
Thu May 28 23:47:00 PDT 2015


 connectivity/source/commontools/warningscontainer.cxx |    5 -
 dbaccess/source/core/api/FilteredContainer.cxx        |    2 
 dbaccess/source/core/api/query.hxx                    |   10 +--
 dbaccess/source/core/api/querycontainer.cxx           |    4 -
 dbaccess/source/core/api/tablecontainer.cxx           |    2 
 dbaccess/source/core/api/viewcontainer.cxx            |    2 
 dbaccess/source/core/inc/FilteredContainer.hxx        |    6 +-
 dbaccess/source/core/inc/querycontainer.hxx           |    8 +--
 dbaccess/source/core/inc/tablecontainer.hxx           |    2 
 dbaccess/source/core/inc/viewcontainer.hxx            |    4 -
 include/connectivity/warningscontainer.hxx            |   46 ++++--------------
 11 files changed, 32 insertions(+), 59 deletions(-)

New commits:
commit 6c1cabe677f5eb24b465dd6e316c8c66df64bb29
Author: Noel Grandin <noel at peralex.com>
Date:   Tue May 26 10:25:09 2015 +0200

    loplugin:unnecessarysuperclass, merge IWarningsContainer..
    
    ..into WarningsContainer
    
    Change-Id: I682528a4eb1b1298faf12b2d498db65f94800cd5
    Reviewed-on: https://gerrit.libreoffice.org/15905
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noelgrandin at gmail.com>

diff --git a/connectivity/source/commontools/warningscontainer.cxx b/connectivity/source/commontools/warningscontainer.cxx
index 4afe81a..5d35532 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 3fa7078..4002ce9 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 ecaa325..baf50c2 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 59ad63e..b9dd5c1 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 8af70e9..a10f5be 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 7725bdf..5bf449f 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 908ea6a..6d36160 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 ea786ff..70cdef5 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 b2c023f..54f57bb 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 5d15c31..e28ede6 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 4d652b2..978c989 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(  );
     };
 


More information about the Libreoffice-commits mailing list