[Libreoffice-commits] core.git: dbaccess/source dbaccess/util
Matúš Kukan
matus.kukan at gmail.com
Thu Dec 3 12:17:23 PST 2015
dbaccess/source/core/dataaccess/datasource.cxx | 42 +++++--------------------
dbaccess/source/core/dataaccess/datasource.hxx | 6 ---
dbaccess/source/core/inc/services.hxx | 1
dbaccess/source/core/misc/services.cxx | 1
dbaccess/util/dba.component | 3 +
5 files changed, 11 insertions(+), 42 deletions(-)
New commits:
commit 81fa5340191baf8687f9c82f1f414f5afc86b529
Author: Matúš Kukan <matus.kukan at gmail.com>
Date: Fri Nov 20 21:12:27 2015 +0100
tdf#74608 dbaccess: Constructor feature for ODatabaseSource
Change-Id: I9ab9c0eaf463c93caf116c98e47564562af0af5d
diff --git a/dbaccess/source/core/dataaccess/datasource.cxx b/dbaccess/source/core/dataaccess/datasource.cxx
index 73bf3c8..00e9d3f 100644
--- a/dbaccess/source/core/dataaccess/datasource.cxx
+++ b/dbaccess/source/core/dataaccess/datasource.cxx
@@ -18,8 +18,6 @@
*/
#include "datasource.hxx"
-#include "module_dba.hxx"
-#include "services.hxx"
#include "userinformation.hxx"
#include "commandcontainer.hxx"
#include "dbastrings.hrc"
@@ -472,17 +470,6 @@ namespace
};
}
-} // namespace dbaccess
-
-// ODatabaseContext
-
-extern "C" void SAL_CALL createRegistryInfo_ODatabaseSource()
-{
- static ::dba::OAutoRegistration< ::dbaccess::ODatabaseSource > aAutoRegistration;
-}
-
-namespace dbaccess
-{
ODatabaseSource::ODatabaseSource(const ::rtl::Reference<ODatabaseModelImpl>& _pImpl)
:ModelDependentComponent( _pImpl )
@@ -560,31 +547,12 @@ void SAL_CALL ODatabaseSource::disposing( const css::lang::EventObject& Source )
// XServiceInfo
OUString ODatabaseSource::getImplementationName( ) throw(RuntimeException, std::exception)
{
- return getImplementationName_static();
-}
-
-OUString ODatabaseSource::getImplementationName_static( ) throw(RuntimeException)
-{
return OUString("com.sun.star.comp.dba.ODatabaseSource");
}
Sequence< OUString > ODatabaseSource::getSupportedServiceNames( ) throw (RuntimeException, std::exception)
{
- return getSupportedServiceNames_static();
-}
-
-Reference< XInterface > ODatabaseSource::Create( const Reference< XComponentContext >& _rxContext )
-{
- Reference< XDatabaseContext > xDBContext( DatabaseContext::create(_rxContext) );
- return xDBContext->createInstance();
-}
-
-Sequence< OUString > ODatabaseSource::getSupportedServiceNames_static( ) throw (RuntimeException)
-{
- Sequence< OUString > aSNS( 2 );
- aSNS[0] = SERVICE_SDB_DATASOURCE;
- aSNS[1] = "com.sun.star.sdb.DocumentDataSource";
- return aSNS;
+ return { SERVICE_SDB_DATASOURCE, "com.sun.star.sdb.DocumentDataSource" };
}
sal_Bool ODatabaseSource::supportsService( const OUString& _rServiceName ) throw (RuntimeException, std::exception)
@@ -1355,4 +1323,12 @@ Reference< XInterface > ODatabaseSource::getThis() const
} // namespace dbaccess
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* SAL_CALL
+com_sun_star_comp_dba_ODatabaseSource(css::uno::XComponentContext* context,
+ css::uno::Sequence<css::uno::Any> const &)
+{
+ css::uno::Reference< XDatabaseContext > xDBContext( DatabaseContext::create(context) );
+ return cppu::acquire(static_cast<OWeakObject*>(xDBContext->createInstance().get()));
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/dbaccess/source/core/dataaccess/datasource.hxx b/dbaccess/source/core/dataaccess/datasource.hxx
index 3c4caf2..446b846 100644
--- a/dbaccess/source/core/dataaccess/datasource.hxx
+++ b/dbaccess/source/core/dataaccess/datasource.hxx
@@ -129,12 +129,6 @@ public:
virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw(css::uno::RuntimeException, std::exception) override;
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) throw(css::uno::RuntimeException, std::exception) override;
-// css::lang::XServiceInfo - static methods
- static css::uno::Sequence< OUString > getSupportedServiceNames_static() throw( css::uno::RuntimeException );
- static OUString getImplementationName_static() throw( css::uno::RuntimeException );
- static css::uno::Reference< css::uno::XInterface >
- SAL_CALL Create(const css::uno::Reference< css::uno::XComponentContext >&);
-
// OComponentHelper
virtual void SAL_CALL disposing() override;
diff --git a/dbaccess/source/core/inc/services.hxx b/dbaccess/source/core/inc/services.hxx
index d93b505..1919ff8 100644
--- a/dbaccess/source/core/inc/services.hxx
+++ b/dbaccess/source/core/inc/services.hxx
@@ -28,7 +28,6 @@ extern "C" void SAL_CALL createRegistryInfo_DataAccessDescriptorFactory();
extern "C" void SAL_CALL createRegistryInfo_OCommandDefinition();
extern "C" void SAL_CALL createRegistryInfo_OComponentDefinition();
extern "C" void SAL_CALL createRegistryInfo_ODatabaseDocument();
-extern "C" void SAL_CALL createRegistryInfo_ODatabaseSource();
#endif
diff --git a/dbaccess/source/core/misc/services.cxx b/dbaccess/source/core/misc/services.cxx
index a3b8143..2118576 100644
--- a/dbaccess/source/core/misc/services.cxx
+++ b/dbaccess/source/core/misc/services.cxx
@@ -61,7 +61,6 @@ extern "C" void SAL_CALL createRegistryInfo_DBA()
createRegistryInfo_OCommandDefinition();
createRegistryInfo_OComponentDefinition();
createRegistryInfo_ODatabaseDocument();
- createRegistryInfo_ODatabaseSource();
createRegistryInfo_DataAccessDescriptorFactory();
bInit = true;
}
diff --git a/dbaccess/util/dba.component b/dbaccess/util/dba.component
index 8c85a8d..4448f72 100644
--- a/dbaccess/util/dba.component
+++ b/dbaccess/util/dba.component
@@ -39,7 +39,8 @@
<service name="com.sun.star.document.OfficeDocument"/>
<service name="com.sun.star.sdb.OfficeDatabaseDocument"/>
</implementation>
- <implementation name="com.sun.star.comp.dba.ODatabaseSource">
+ <implementation name="com.sun.star.comp.dba.ODatabaseSource"
+ constructor="com_sun_star_comp_dba_ODatabaseSource">
<service name="com.sun.star.sdb.DataSource"/>
<service name="com.sun.star.sdb.DocumentDataSource"/>
</implementation>
More information about the Libreoffice-commits
mailing list