comphelper/source/property/propertycontainer.cxx               |    7 --
 connectivity/source/drivers/ado/ADatabaseMetaDataResultSet.cxx |    7 --
 connectivity/source/drivers/ado/APreparedStatement.cxx         |   30 
----------
 connectivity/source/drivers/ado/AResultSet.cxx                 |    7 --
 connectivity/source/drivers/ado/AStatement.cxx                 |    7 --
 connectivity/source/inc/ado/APreparedStatement.hxx             |   17 +----
 include/comphelper/propertycontainer.hxx                       |    2 
 7 files changed, 14 insertions(+), 63 deletions(-)

New commits:
commit 8fdef548702ef240980b52e4076af36122534fed
Author:     Mike Kaganski <mike.kagan...@collabora.com>
AuthorDate: Sat Dec 7 02:38:08 2024 +0500
Commit:     Mike Kaganski <mike.kagan...@collabora.com>
CommitDate: Sat Dec 7 21:55:58 2024 +0100

    Simplify OPropertyContainer::getBaseTypes
    
    Change-Id: I438d510e05329163dabdc8ed42d3a97d49e19ef9
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178055
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com>

diff --git a/comphelper/source/property/propertycontainer.cxx 
b/comphelper/source/property/propertycontainer.cxx
index ad24c5f30aa7..0c17feb50234 100644
--- a/comphelper/source/property/propertycontainer.cxx
+++ b/comphelper/source/property/propertycontainer.cxx
@@ -42,12 +42,7 @@ OPropertyContainer::~OPropertyContainer()
 Sequence< Type > OPropertyContainer::getBaseTypes()
 {
     // just the types from our one and only base class
-    ::cppu::OTypeCollection aTypes(
-        cppu::UnoType<XPropertySet>::get(),
-        cppu::UnoType<XFastPropertySet>::get(),
-        cppu::UnoType<XMultiPropertySet>::get()
-    );
-    return aTypes.getTypes();
+    return cppu::OPropertySetHelper::getTypes();
 }
 
 sal_Bool OPropertyContainer::convertFastPropertyValue(
diff --git a/include/comphelper/propertycontainer.hxx 
b/include/comphelper/propertycontainer.hxx
index 2c64b2cdfedf..0c663e7bacab 100644
--- a/include/comphelper/propertycontainer.hxx
+++ b/include/comphelper/propertycontainer.hxx
@@ -53,7 +53,7 @@ protected:
     /// for scripting : the types of the interfaces supported by this class
     ///
     /// @throws css::uno::RuntimeException
-    static css::uno::Sequence< css::uno::Type > getBaseTypes();
+    css::uno::Sequence< css::uno::Type > getBaseTypes();
 
 // OPropertySetHelper overridables
     virtual sal_Bool SAL_CALL convertFastPropertyValue(
commit 831700824d6c6c86ee798fec4617307aedded7df
Author:     Mike Kaganski <mike.kagan...@collabora.com>
AuthorDate: Sat Dec 7 02:01:07 2024 +0500
Commit:     Mike Kaganski <mike.kagan...@collabora.com>
CommitDate: Sat Dec 7 21:55:52 2024 +0100

    Simplify getTypes implementations
    
    Change-Id: Ia0f7e8497f628b17a108a4dd8ffebc60745b7d6a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178054
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com>

diff --git a/connectivity/source/drivers/ado/ADatabaseMetaDataResultSet.cxx 
b/connectivity/source/drivers/ado/ADatabaseMetaDataResultSet.cxx
index 0e5c082d7fdf..5c96b394da0f 100644
--- a/connectivity/source/drivers/ado/ADatabaseMetaDataResultSet.cxx
+++ b/connectivity/source/drivers/ado/ADatabaseMetaDataResultSet.cxx
@@ -99,11 +99,8 @@ Any SAL_CALL ODatabaseMetaDataResultSet::queryInterface( 
const Type & rType )
 
 css::uno::Sequence< css::uno::Type > SAL_CALL 
ODatabaseMetaDataResultSet::getTypes(  )
 {
-    ::cppu::OTypeCollection aTypes( 
cppu::UnoType<css::beans::XMultiPropertySet>::get(),
-                                    
cppu::UnoType<css::beans::XFastPropertySet>::get(),
-                                    
cppu::UnoType<css::beans::XPropertySet>::get());
-
-    return 
::comphelper::concatSequences(aTypes.getTypes(),ODatabaseMetaDataResultSet_BASE::getTypes());
+    return comphelper::concatSequences(cppu::OPropertySetHelper::getTypes(),
+                                       
ODatabaseMetaDataResultSet_BASE::getTypes());
 }
 
 void ODatabaseMetaDataResultSet::checkRecordSet()
diff --git a/connectivity/source/drivers/ado/AResultSet.cxx 
b/connectivity/source/drivers/ado/AResultSet.cxx
index f1357449d471..ae1013c1c177 100644
--- a/connectivity/source/drivers/ado/AResultSet.cxx
+++ b/connectivity/source/drivers/ado/AResultSet.cxx
@@ -132,11 +132,8 @@ Any SAL_CALL OResultSet::queryInterface( const Type & 
rType )
 
 css::uno::Sequence< css::uno::Type > SAL_CALL OResultSet::getTypes(  )
 {
-    ::cppu::OTypeCollection aTypes( 
cppu::UnoType<css::beans::XMultiPropertySet>::get(),
-                                    
cppu::UnoType<css::beans::XFastPropertySet>::get(),
-                                    
cppu::UnoType<css::beans::XPropertySet>::get());
-
-    return 
::comphelper::concatSequences(aTypes.getTypes(),OResultSet_BASE::getTypes());
+    return comphelper::concatSequences(cppu::OPropertySetHelper::getTypes(),
+                                       OResultSet_BASE::getTypes());
 }
 
 sal_Int32 SAL_CALL OResultSet::findColumn( const OUString& columnName )
diff --git a/connectivity/source/drivers/ado/AStatement.cxx 
b/connectivity/source/drivers/ado/AStatement.cxx
index 935e361f8000..0764a4b335a5 100644
--- a/connectivity/source/drivers/ado/AStatement.cxx
+++ b/connectivity/source/drivers/ado/AStatement.cxx
@@ -120,11 +120,8 @@ Any SAL_CALL OStatement_Base::queryInterface( const Type & 
rType )
 
 css::uno::Sequence< css::uno::Type > SAL_CALL OStatement_Base::getTypes(  )
 {
-    ::cppu::OTypeCollection aTypes( 
cppu::UnoType<css::beans::XMultiPropertySet>::get(),
-                                    
cppu::UnoType<css::beans::XFastPropertySet>::get(),
-                                    
cppu::UnoType<css::beans::XPropertySet>::get());
-
-    return 
::comphelper::concatSequences(aTypes.getTypes(),OStatement_BASE::getTypes());
+    return comphelper::concatSequences(cppu::OPropertySetHelper::getTypes(),
+                                       OStatement_BASE::getTypes());
 }
 
 
commit 75f5c610de6161284dc7db0550d7875c18fbf27f
Author:     Mike Kaganski <mike.kagan...@collabora.com>
AuthorDate: Sat Dec 7 01:55:39 2024 +0500
Commit:     Mike Kaganski <mike.kagan...@collabora.com>
CommitDate: Sat Dec 7 21:55:46 2024 +0100

    Simplify OPreparedStatement
    
    Change-Id: I1c36ec85d1acafc5c6ef33ea250ac6027d604da7
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178053
    Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com>
    Tested-by: Jenkins

diff --git a/connectivity/source/drivers/ado/APreparedStatement.cxx 
b/connectivity/source/drivers/ado/APreparedStatement.cxx
index 6be6cfefd993..d7c82d184fdb 100644
--- a/connectivity/source/drivers/ado/APreparedStatement.cxx
+++ b/connectivity/source/drivers/ado/APreparedStatement.cxx
@@ -55,7 +55,7 @@ using namespace com::sun::star::util;
 
IMPLEMENT_SERVICE_INFO(OPreparedStatement,"com.sun.star.sdbcx.APreparedStatement","com.sun.star.sdbc.PreparedStatement");
 
 OPreparedStatement::OPreparedStatement( OConnection* _pConnection, const 
OUString& sql)
-    : OStatement_Base( _pConnection )
+    : OPreparedStatement_BASE(_pConnection)
 {
     osl_atomic_increment( &m_refCount );
 
@@ -92,24 +92,6 @@ OPreparedStatement::~OPreparedStatement()
     }
 }
 
-Any SAL_CALL OPreparedStatement::queryInterface( const Type & rType )
-{
-    Any aRet = OStatement_Base::queryInterface(rType);
-    return aRet.hasValue() ? aRet : ::cppu::queryInterface( rType,
-                                        static_cast< 
XPreparedStatement*>(this),
-                                        static_cast< XParameters*>(this),
-                                        static_cast< 
XResultSetMetaDataSupplier*>(this));
-}
-
-css::uno::Sequence< css::uno::Type > SAL_CALL OPreparedStatement::getTypes(  )
-{
-    ::cppu::OTypeCollection aTypes( cppu::UnoType<XPreparedStatement>::get(),
-                                    cppu::UnoType<XParameters>::get(),
-                                    
cppu::UnoType<XResultSetMetaDataSupplier>::get());
-
-    return 
::comphelper::concatSequences(aTypes.getTypes(),OStatement_Base::getTypes());
-}
-
 Reference< XResultSetMetaData > SAL_CALL OPreparedStatement::getMetaData(  )
 {
     if(!m_xMetaData.is() && m_RecordSet.IsValid())
@@ -421,16 +403,6 @@ void SAL_CALL OPreparedStatement::clearParameters(  )
     }
 }
 
-void SAL_CALL OPreparedStatement::acquire() noexcept
-{
-    OStatement_Base::acquire();
-}
-
-void SAL_CALL OPreparedStatement::release() noexcept
-{
-    OStatement_Base::release();
-}
-
 void OPreparedStatement::replaceParameterNodeName(OSQLParseNode const * _pNode,
                                                   const OUString& 
_sDefaultName,
                                                   sal_Int32& _rParameterCount)
diff --git a/connectivity/source/inc/ado/APreparedStatement.hxx 
b/connectivity/source/inc/ado/APreparedStatement.hxx
index 2ce394dbdefb..8227252b685c 100644
--- a/connectivity/source/inc/ado/APreparedStatement.hxx
+++ b/connectivity/source/inc/ado/APreparedStatement.hxx
@@ -34,13 +34,12 @@ namespace connectivity
     class OSQLParseNode;
     namespace ado
     {
+    using OPreparedStatement_BASE
+        = cppu::ImplInheritanceHelper<OStatement_Base, 
css::sdbc::XPreparedStatement,
+                                      css::sdbc::XParameters, 
css::sdbc::XResultSetMetaDataSupplier,
+                                      css::lang::XServiceInfo>;
 
-        class OPreparedStatement :  public  OStatement_Base,
-                                    public  css::sdbc::XPreparedStatement,
-                                    public  css::sdbc::XParameters,
-                                    public  
css::sdbc::XResultSetMetaDataSupplier,
-                                    public  css::lang::XServiceInfo
-
+        class OPreparedStatement : public OPreparedStatement_BASE
         {
             /// @throws css::sdbc::SQLException
             /// @throws css::uno::RuntimeException
@@ -62,12 +61,6 @@ 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() 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;
-
             // XPreparedStatement
             virtual css::uno::Reference< css::sdbc::XResultSet > SAL_CALL 
executeQuery(  ) override;
             using OStatement_Base::executeQuery;

Reply via email to