[Libreoffice-commits] core.git: 2 commits - compilerplugins/clang dbaccess/source

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Tue Oct 22 06:14:24 UTC 2019


 compilerplugins/clang/virtualdead.unusedparams.results |   12 ------------
 dbaccess/source/core/api/CacheSet.cxx                  |   15 ---------------
 dbaccess/source/core/api/CacheSet.hxx                  |    3 ---
 dbaccess/source/core/api/KeySet.cxx                    |   17 +----------------
 dbaccess/source/core/api/KeySet.hxx                    |    5 -----
 dbaccess/source/core/api/RowSetCache.cxx               |   16 ++++++++--------
 dbaccess/source/core/api/querycontainer.cxx            |    2 +-
 dbaccess/source/core/api/tablecontainer.cxx            |    2 +-
 dbaccess/source/core/dataaccess/documentcontainer.cxx  |    4 ++--
 dbaccess/source/core/inc/containerapprove.hxx          |    7 +------
 dbaccess/source/core/inc/objectnameapproval.hxx        |    2 +-
 dbaccess/source/core/misc/objectnameapproval.cxx       |    2 +-
 12 files changed, 16 insertions(+), 71 deletions(-)

New commits:
commit db90e072fa0d0fe6514361cc50273aaa47563478
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Fri Oct 18 15:53:57 2019 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Tue Oct 22 08:13:45 2019 +0200

    loplugin:virtualdead unused params in OCacheSet
    
    these methods do nothing except forward to their similar named variants,
    so just remove them
    
    Change-Id: I28d31bbe2c1e39fe5a9c2d7eaa9e14006213ab27
    Reviewed-on: https://gerrit.libreoffice.org/81247
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/compilerplugins/clang/virtualdead.unusedparams.results b/compilerplugins/clang/virtualdead.unusedparams.results
index 99806442c261..fda3eaf9f698 100644
--- a/compilerplugins/clang/virtualdead.unusedparams.results
+++ b/compilerplugins/clang/virtualdead.unusedparams.results
@@ -37,15 +37,6 @@ chart2/source/controller/dialogs/ChangingResource.hxx:30
 chart2/source/controller/dialogs/ChartTypeDialogController.hxx:105
     void chart::ChartTypeDialogController::fillExtraControls(const class chart::ChartTypeParameter &,const class com::sun::star::uno::Reference<class com::sun::star::chart2::XChartDocument> &,const class com::sun::star::uno::Reference<class com::sun::star::beans::XPropertySet> &,)const
     011
-dbaccess/source/core/api/CacheSet.hxx:174
-    _Bool dbaccess::OCacheSet::previous_checked(_Bool,)
-    0
-dbaccess/source/core/api/CacheSet.hxx:175
-    _Bool dbaccess::OCacheSet::absolute_checked(int,_Bool,)
-    10
-dbaccess/source/core/api/CacheSet.hxx:176
-    _Bool dbaccess::OCacheSet::last_checked(_Bool,)
-    0
 desktop/source/deployment/registry/inc/dp_backend.h:84
     void dp_registry::backend::Package::processPackage_(class osl::ResettableGuard<class osl::Mutex> &,_Bool,_Bool,const class rtl::Reference<class dp_misc::AbortChannel> &,const class com::sun::star::uno::Reference<class com::sun::star::ucb::XCommandEnvironment> &,)
     01111
diff --git a/dbaccess/source/core/api/CacheSet.cxx b/dbaccess/source/core/api/CacheSet.cxx
index 62020e68d4db..59a9669e4db3 100644
--- a/dbaccess/source/core/api/CacheSet.cxx
+++ b/dbaccess/source/core/api/CacheSet.cxx
@@ -540,21 +540,6 @@ bool OCacheSet::previous(  )
     return m_xDriverSet->previous();
 }
 
-bool OCacheSet::last_checked( bool /*i_bFetchRow*/)
-{
-    return last();
-}
-
-bool OCacheSet::previous_checked( bool /*i_bFetchRow*/ )
-{
-    return previous();
-}
-
-bool OCacheSet::absolute_checked( sal_Int32 row,bool /*i_bFetchRow*/ )
-{
-    return absolute(row);
-}
-
 void OCacheSet::refreshRow(  )
 {
     m_xDriverSet->refreshRow();
diff --git a/dbaccess/source/core/api/CacheSet.hxx b/dbaccess/source/core/api/CacheSet.hxx
index 0fc0e5777a6e..efdd843250b4 100644
--- a/dbaccess/source/core/api/CacheSet.hxx
+++ b/dbaccess/source/core/api/CacheSet.hxx
@@ -171,9 +171,6 @@ namespace dbaccess
         virtual bool columnValuesUpdated(ORowSetValueVector::Vector& o_aCachedRow,const ORowSetValueVector::Vector& i_aRow);
         virtual bool updateColumnValues(const ORowSetValueVector::Vector& io_aCachedRow,ORowSetValueVector::Vector& io_aRow,const std::vector<sal_Int32>& i_aChangedColumns);
         virtual void fillMissingValues(ORowSetValueVector::Vector& io_aRow) const;
-        virtual bool previous_checked( bool i_bFetchRow );
-        virtual bool absolute_checked( sal_Int32 row,bool i_bFetchRow );
-        virtual bool last_checked( bool i_bFetchRow);
     };
 }
 #endif // INCLUDED_DBACCESS_SOURCE_CORE_API_CACHESET_HXX
diff --git a/dbaccess/source/core/api/KeySet.cxx b/dbaccess/source/core/api/KeySet.cxx
index 137f1e3b4104..f83ac766237d 100644
--- a/dbaccess/source/core/api/KeySet.cxx
+++ b/dbaccess/source/core/api/KeySet.cxx
@@ -1040,11 +1040,6 @@ bool OKeySet::first()
 
 bool OKeySet::last(  )
 {
-    return last_checked(true);
-}
-
-bool OKeySet::last_checked( bool /* i_bFetchRow */ )
-{
     m_bInserted = m_bUpdated = m_bDeleted = false;
     bool bFetchedRow = fillAllRows();
 
@@ -1067,11 +1062,6 @@ sal_Int32 OKeySet::getRow(  )
 
 bool OKeySet::absolute( sal_Int32 row )
 {
-    return absolute_checked(row,true);
-}
-
-bool OKeySet::absolute_checked( sal_Int32 row, bool /* i_bFetchRow */ )
-{
     m_bInserted = m_bUpdated = m_bDeleted = false;
     OSL_ENSURE(row,"absolute(0) isn't allowed!");
     bool bFetchedRow = false;
@@ -1127,7 +1117,7 @@ bool OKeySet::absolute_checked( sal_Int32 row, bool /* i_bFetchRow */ )
     return m_aKeyIter != m_aKeyMap.end() && m_aKeyIter != m_aKeyMap.begin();
 }
 
-bool OKeySet::previous_checked( bool /* i_bFetchRow */ )
+bool OKeySet::previous()
 {
     m_bInserted = m_bUpdated = m_bDeleted = false;
     if(m_aKeyIter != m_aKeyMap.begin())
@@ -1138,11 +1128,6 @@ bool OKeySet::previous_checked( bool /* i_bFetchRow */ )
     return m_aKeyIter != m_aKeyMap.begin();
 }
 
-bool OKeySet::previous(  )
-{
-    return previous_checked(true);
-}
-
 bool OKeySet::doTryRefetch_throw()
 {
     ensureStatement( );
diff --git a/dbaccess/source/core/api/KeySet.hxx b/dbaccess/source/core/api/KeySet.hxx
index 0bd8a681beaa..cdf2e5a6946d 100644
--- a/dbaccess/source/core/api/KeySet.hxx
+++ b/dbaccess/source/core/api/KeySet.hxx
@@ -215,11 +215,6 @@ namespace dbaccess
         virtual void updateRow(const ORowSetRow& _rInsertRow,const ORowSetRow& _rOriginalRow,const connectivity::OSQLTable& _xTable   ) override;
         virtual void deleteRow(const ORowSetRow& _rInsertRow,const connectivity::OSQLTable& _xTable   ) override;
         virtual void insertRow( const ORowSetRow& _rInsertRow,const connectivity::OSQLTable& _xTable ) override;
-
-
-        virtual bool previous_checked( bool i_bFetchRow ) override;
-        virtual bool absolute_checked( sal_Int32 row,bool i_bFetchRow ) override;
-        virtual bool last_checked( bool i_bFetchRow) override;
     };
 }
 #endif // INCLUDED_DBACCESS_SOURCE_CORE_API_KEYSET_HXX
diff --git a/dbaccess/source/core/api/RowSetCache.cxx b/dbaccess/source/core/api/RowSetCache.cxx
index a3a1de4df10a..2f71f9e4bc5d 100644
--- a/dbaccess/source/core/api/RowSetCache.cxx
+++ b/dbaccess/source/core/api/RowSetCache.cxx
@@ -705,7 +705,7 @@ void ORowSetCache::afterLast(  )
 
         if(!m_bRowCountFinal)
         {
-            m_xCacheSet->last_checked(false);
+            m_xCacheSet->last();
             m_bRowCountFinal = true;
             m_nRowCount = m_xCacheSet->getRow();// + 1 removed
         }
@@ -757,7 +757,7 @@ bool ORowSetCache::fillMatrix(sal_Int32& _nNewStartPos, sal_Int32 &_nNewEndPos)
 
             if(!m_bRowCountFinal)
             {
-                if(m_xCacheSet->previous_checked(false)) // because we stand after the last row
+                if(m_xCacheSet->previous()) // because we stand after the last row
                     m_nRowCount = m_xCacheSet->getRow(); // here we have the row count
                 if(!m_nRowCount)
                     m_nRowCount = i-1; // it can be that getRow return zero
@@ -798,7 +798,7 @@ bool ORowSetCache::fillMatrix(sal_Int32& _nNewStartPos, sal_Int32 &_nNewEndPos)
     {
         if(!m_xCacheSet->next())
         {
-            if(m_xCacheSet->previous_checked(false)) // because we stand after the last row
+            if(m_xCacheSet->previous()) // because we stand after the last row
                 m_nRowCount = m_xCacheSet->getRow(); // here we have the row count
             m_bRowCountFinal = true;
         }
@@ -836,7 +836,7 @@ void ORowSetCache::moveWindow()
                 // but only when we don't know it already
                 if ( !m_bRowCountFinal )
                 {
-                    bOk = m_xCacheSet->absolute_checked( m_nPosition + 1,false );
+                    bOk = m_xCacheSet->absolute( m_nPosition + 1 );
                     if ( bOk )
                         m_nRowCount = std::max(sal_Int32(m_nPosition+1),m_nRowCount);
                 }
@@ -844,7 +844,7 @@ void ORowSetCache::moveWindow()
             if(!bOk && !m_bRowCountFinal)
             {
                 // because we stand after the last row
-                m_nRowCount = m_xCacheSet->previous_checked(false) ? m_xCacheSet->getRow() : 0;
+                m_nRowCount = m_xCacheSet->previous() ? m_xCacheSet->getRow() : 0;
                 m_bRowCountFinal = true;
             }
         }
@@ -1000,7 +1000,7 @@ void ORowSetCache::moveWindow()
                     bOk = m_xCacheSet->next();
                 if(!bOk)
                 {
-                    m_xCacheSet->previous_checked(false); // because we stand after the last row
+                    m_xCacheSet->previous(); // because we stand after the last row
                     m_nRowCount      = nPos; // here we have the row count
                     OSL_ENSURE(nPos == m_xCacheSet->getRow(),"nPos is not valid!");
                     m_bRowCountFinal = true;
@@ -1027,7 +1027,7 @@ void ORowSetCache::moveWindow()
 
                 if ( !m_bRowCountFinal )
                 {
-                    m_xCacheSet->previous_checked(false);                   // because we stand after the last row
+                    m_xCacheSet->previous();                   // because we stand after the last row
                     m_nRowCount      = std::max(m_nRowCount, nPos);    // here we have the row count
                     OSL_ENSURE(nPos == m_xCacheSet->getRow(),"nPos isn't valid!");
                     m_bRowCountFinal = true;
@@ -1040,7 +1040,7 @@ void ORowSetCache::moveWindow()
                 aIter = m_pMatrix->begin();
 
                 nPos    = m_nStartPos + 1;
-                bCheck  = m_xCacheSet->absolute_checked(nPos, true);
+                bCheck  = m_xCacheSet->absolute(nPos);
                 for(; !aIter->is() && bCheck;++aIter, ++nPos)
                 {
                     OSL_ENSURE(aIter != m_pMatrix->end(),"Invalid iterator");
commit 964ffdc0687c14f9a90105dab4ffdf5eb09b6231
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Fri Oct 18 15:47:38 2019 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Tue Oct 22 08:13:38 2019 +0200

    loplugin:virtualdead unused param in IContainerApprove
    
    Change-Id: I59edede149d02085125ee946994b6088c3152e7b
    Reviewed-on: https://gerrit.libreoffice.org/81246
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/compilerplugins/clang/virtualdead.unusedparams.results b/compilerplugins/clang/virtualdead.unusedparams.results
index ef67c180b642..99806442c261 100644
--- a/compilerplugins/clang/virtualdead.unusedparams.results
+++ b/compilerplugins/clang/virtualdead.unusedparams.results
@@ -46,9 +46,6 @@ dbaccess/source/core/api/CacheSet.hxx:175
 dbaccess/source/core/api/CacheSet.hxx:176
     _Bool dbaccess::OCacheSet::last_checked(_Bool,)
     0
-dbaccess/source/core/inc/containerapprove.hxx:53
-    void dbaccess::IContainerApprove::approveElement(const class rtl::OUString &,const class com::sun::star::uno::Reference<class com::sun::star::uno::XInterface> &,)
-    10
 desktop/source/deployment/registry/inc/dp_backend.h:84
     void dp_registry::backend::Package::processPackage_(class osl::ResettableGuard<class osl::Mutex> &,_Bool,_Bool,const class rtl::Reference<class dp_misc::AbortChannel> &,const class com::sun::star::uno::Reference<class com::sun::star::ucb::XCommandEnvironment> &,)
     01111
diff --git a/dbaccess/source/core/api/querycontainer.cxx b/dbaccess/source/core/api/querycontainer.cxx
index 0acba89f5c9e..2fbf6b551689 100644
--- a/dbaccess/source/core/api/querycontainer.cxx
+++ b/dbaccess/source/core/api/querycontainer.cxx
@@ -291,7 +291,7 @@ Reference< XVeto > SAL_CALL OQueryContainer::approveInsertElement( const Contain
     Reference< XVeto > xReturn;
     try
     {
-        getElementApproval()->approveElement( sName, xElement.get() );
+        getElementApproval()->approveElement( sName );
     }
     catch( const Exception& )
     {
diff --git a/dbaccess/source/core/api/tablecontainer.cxx b/dbaccess/source/core/api/tablecontainer.cxx
index f0adf088281f..3637e6b3bed1 100644
--- a/dbaccess/source/core/api/tablecontainer.cxx
+++ b/dbaccess/source/core/api/tablecontainer.cxx
@@ -268,7 +268,7 @@ ObjectType OTableContainer::appendObject( const OUString& _rForName, const Refer
 
     Reference< XConnection > xConnection( m_xConnection.get(), UNO_QUERY );
     PContainerApprove pApprove( new ObjectNameApproval( xConnection, ObjectNameApproval::TypeTable ) );
-    pApprove->approveElement( aName, descriptor );
+    pApprove->approveElement( aName );
 
     {
         EnsureReset aReset(m_nInAppend);
diff --git a/dbaccess/source/core/dataaccess/documentcontainer.cxx b/dbaccess/source/core/dataaccess/documentcontainer.cxx
index cad8369ba479..c30f15000323 100644
--- a/dbaccess/source/core/dataaccess/documentcontainer.cxx
+++ b/dbaccess/source/core/dataaccess/documentcontainer.cxx
@@ -65,10 +65,10 @@ class LocalNameApproval : public IContainerApprove
     ::connectivity::SQLError    m_aErrors;
 
 public:
-    void approveElement( const OUString& _rName, const Reference< XInterface >& _rxElement ) override;
+    void approveElement( const OUString& _rName ) override;
 };
 
-void LocalNameApproval::approveElement( const OUString& _rName, const Reference< XInterface >& /*_rxElement*/ )
+void LocalNameApproval::approveElement( const OUString& _rName )
 {
     if ( _rName.indexOf( '/' ) != -1 )
         throw IllegalArgumentException(
diff --git a/dbaccess/source/core/inc/containerapprove.hxx b/dbaccess/source/core/inc/containerapprove.hxx
index 47da745bdc89..5c0582904381 100644
--- a/dbaccess/source/core/inc/containerapprove.hxx
+++ b/dbaccess/source/core/inc/containerapprove.hxx
@@ -44,16 +44,11 @@ namespace dbaccess
         /** approves a given element for insertion into the container
             @param  _rName
                 specifies the name under which the element is going to be inserted
-            @param  _rxElement
-                specifies the element which is going to be inserted
             @throws Exception
                 if the name or the object are invalid, or not eligible for insertion
                 into the container
         */
-        virtual void   approveElement(
-            const OUString& _rName,
-            const css::uno::Reference< css::uno::XInterface >& _rxElement
-        ) = 0;
+        virtual void   approveElement( const OUString& _rName ) = 0;
     };
 
     typedef std::shared_ptr< IContainerApprove >    PContainerApprove;
diff --git a/dbaccess/source/core/inc/objectnameapproval.hxx b/dbaccess/source/core/inc/objectnameapproval.hxx
index b99933281168..6e0ce4577b03 100644
--- a/dbaccess/source/core/inc/objectnameapproval.hxx
+++ b/dbaccess/source/core/inc/objectnameapproval.hxx
@@ -67,7 +67,7 @@ namespace dbaccess
         virtual ~ObjectNameApproval() override;
 
         // IContainerApprove
-        virtual void approveElement( const OUString& _rName, const css::uno::Reference< css::uno::XInterface >& _rxElement ) override;
+        virtual void approveElement( const OUString& _rName ) override;
 
     };
 
diff --git a/dbaccess/source/core/misc/objectnameapproval.cxx b/dbaccess/source/core/misc/objectnameapproval.cxx
index f1a51b1e3fa2..71e13ec413a1 100644
--- a/dbaccess/source/core/misc/objectnameapproval.cxx
+++ b/dbaccess/source/core/misc/objectnameapproval.cxx
@@ -59,7 +59,7 @@ namespace dbaccess
     {
     }
 
-    void ObjectNameApproval::approveElement( const OUString& _rName, const Reference< XInterface >& /*_rxElement*/ )
+    void ObjectNameApproval::approveElement( const OUString& _rName )
     {
         Reference< XConnection > xConnection( m_pImpl->aConnection );
         if ( !xConnection.is() )


More information about the Libreoffice-commits mailing list