summaryrefslogtreecommitdiff
path: root/connectivity/source/commontools
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-07-13 16:45:58 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-07-14 09:03:30 +0200
commit27ae032f793ecae63ff231339cb18c4b2ec64206 (patch)
treec0e3f19fb4995110bb98599cb2f5918ecb566d91 /connectivity/source/commontools
parent9c8aa11ee7ddbae34afcce2cbfc4d521122a527b (diff)
connectivity/dbtools: create instances with uno constructors
See tdf#74608 for motivation. Change-Id: I281475b9fe5eff0d462f575e8434b9511b292e85 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98688 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'connectivity/source/commontools')
-rw-r--r--connectivity/source/commontools/FDatabaseMetaDataResultSet.cxx47
-rw-r--r--connectivity/source/commontools/ParameterSubstitution.cxx23
2 files changed, 13 insertions, 57 deletions
diff --git a/connectivity/source/commontools/FDatabaseMetaDataResultSet.cxx b/connectivity/source/commontools/FDatabaseMetaDataResultSet.cxx
index 7bc060ad174c..969a1f1e1f4f 100644
--- a/connectivity/source/commontools/FDatabaseMetaDataResultSet.cxx
+++ b/connectivity/source/commontools/FDatabaseMetaDataResultSet.cxx
@@ -833,19 +833,9 @@ void SAL_CALL ODatabaseMetaDataResultSet::initialize( const Sequence< Any >& _aA
// XServiceInfo
- OUString ODatabaseMetaDataResultSet::getImplementationName_Static( )
- {
- return "org.openoffice.comp.helper.DatabaseMetaDataResultSet";
- }
-
- Sequence< OUString > ODatabaseMetaDataResultSet::getSupportedServiceNames_Static( )
- {
- return Sequence<OUString>{ "com.sun.star.sdbc.ResultSet" };
- }
-
OUString SAL_CALL ODatabaseMetaDataResultSet::getImplementationName( )
{
- return getImplementationName_Static();
+ return "org.openoffice.comp.helper.DatabaseMetaDataResultSet";
}
sal_Bool SAL_CALL ODatabaseMetaDataResultSet::supportsService( const OUString& _rServiceName )
@@ -855,39 +845,14 @@ void SAL_CALL ODatabaseMetaDataResultSet::initialize( const Sequence< Any >& _aA
Sequence< OUString > SAL_CALL ODatabaseMetaDataResultSet::getSupportedServiceNames( )
{
- return getSupportedServiceNames_Static();
- }
-
- namespace connectivity
- {
- /// @throws Exception
- static Reference< XInterface > ODatabaseMetaDataResultSet_CreateInstance(const Reference< XComponentContext >& )
- {
- return *(new ODatabaseMetaDataResultSet());
- }
+ return Sequence<OUString>{ "com.sun.star.sdbc.ResultSet" };
}
-
-namespace
-{
- cppu::ImplementationEntry const entries[] = {
- { &ODatabaseMetaDataResultSet_CreateInstance, &ODatabaseMetaDataResultSet::getImplementationName_Static, &ODatabaseMetaDataResultSet::getSupportedServiceNames_Static,
- &cppu::createSingleComponentFactory, nullptr, 0 },
- { &ParameterSubstitution::create, &ParameterSubstitution::getImplementationName_Static, &ParameterSubstitution::getSupportedServiceNames_Static,
- &cppu::createSingleComponentFactory, nullptr, 0 },
- { nullptr, nullptr, nullptr, nullptr, nullptr, 0 }
- };
-}
-
-extern "C"
-{
-
-
-SAL_DLLPUBLIC_EXPORT void* dbtools_component_getFactory(const char* implName, void* serviceManager, void* registryKey)
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
+connectivity_dbtools_ODatabaseMetaDataResultSet_get_implementation(
+ css::uno::XComponentContext* , css::uno::Sequence<css::uno::Any> const&)
{
- return cppu::component_getFactoryHelper(implName, serviceManager, registryKey, entries);
-}
-
+ return cppu::acquire(new ODatabaseMetaDataResultSet());
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/connectivity/source/commontools/ParameterSubstitution.cxx b/connectivity/source/commontools/ParameterSubstitution.cxx
index 9adf63a93a73..3a58fed70b09 100644
--- a/connectivity/source/commontools/ParameterSubstitution.cxx
+++ b/connectivity/source/commontools/ParameterSubstitution.cxx
@@ -40,14 +40,9 @@ namespace connectivity
m_xConnection = xConnection;
}
- OUString ParameterSubstitution::getImplementationName_Static( )
- {
- return "org.openoffice.comp.helper.ParameterSubstitution";
- }
-
OUString SAL_CALL ParameterSubstitution::getImplementationName( )
{
- return getImplementationName_Static();
+ return "org.openoffice.comp.helper.ParameterSubstitution";
}
sal_Bool SAL_CALL ParameterSubstitution::supportsService( const OUString& _rServiceName )
@@ -57,20 +52,10 @@ namespace connectivity
Sequence< OUString > SAL_CALL ParameterSubstitution::getSupportedServiceNames( )
{
- return getSupportedServiceNames_Static();
- }
-
- Sequence< OUString > ParameterSubstitution::getSupportedServiceNames_Static( )
- {
return { "com.sun.star.sdb.ParameterSubstitution" };
}
- Reference< XInterface > ParameterSubstitution::create(const Reference< XComponentContext >& _xContext)
- {
- return *(new ParameterSubstitution(_xContext));
- }
-
OUString SAL_CALL ParameterSubstitution::substituteVariables( const OUString& _sText, sal_Bool /*bSubstRequired*/ )
{
OUString sRet = _sText;
@@ -110,5 +95,11 @@ namespace connectivity
} // connectivity
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
+connectivity_dbtools_ParameterSubstitution_get_implementation(
+ css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any> const&)
+{
+ return cppu::acquire(new connectivity::ParameterSubstitution(context));
+}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */