Kaydet (Commit) 970f5189 authored tarafından Matúš Kukan's avatar Matúš Kukan

tdf#74608 dbaccess: Constructor feature for OComponentDefinition

Change-Id: I150cdaa46a0d86e1a4b6598ac580a10b2e8f071f
üst 5738a6fb
...@@ -20,34 +20,22 @@ ...@@ -20,34 +20,22 @@
#include "ComponentDefinition.hxx" #include "ComponentDefinition.hxx"
#include "apitools.hxx" #include "apitools.hxx"
#include "dbastrings.hrc" #include "dbastrings.hrc"
#include "module_dba.hxx"
#include "services.hxx"
#include <boost/noncopyable.hpp> #include <boost/noncopyable.hpp>
#include <tools/debug.hxx> #include <tools/debug.hxx>
#include <osl/diagnose.h> #include <osl/diagnose.h>
#include <comphelper/sequence.hxx> #include <comphelper/sequence.hxx>
#include <com/sun/star/lang/DisposedException.hpp>
#include <com/sun/star/beans/PropertyAttribute.hpp> #include <com/sun/star/beans/PropertyAttribute.hpp>
#include <comphelper/property.hxx> #include <comphelper/property.hxx>
#include "definitioncolumn.hxx" #include "definitioncolumn.hxx"
#include <cppuhelper/implbase.hxx>
using namespace ::com::sun::star::uno; using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::sdbc; using namespace ::com::sun::star::sdbc;
using namespace ::com::sun::star::lang; using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::beans; using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::container; using namespace ::com::sun::star::container;
using namespace ::osl;
using namespace ::comphelper;
using namespace ::cppu; using namespace ::cppu;
extern "C" void SAL_CALL createRegistryInfo_OComponentDefinition()
{
static ::dba::OAutoRegistration< ::dbaccess::OComponentDefinition > aAutoRegistration;
}
namespace dbaccess namespace dbaccess
{ {
...@@ -159,33 +147,14 @@ css::uno::Sequence<sal_Int8> OComponentDefinition::getImplementationId() ...@@ -159,33 +147,14 @@ css::uno::Sequence<sal_Int8> OComponentDefinition::getImplementationId()
IMPLEMENT_GETTYPES3(OComponentDefinition,ODataSettings,OContentHelper,OComponentDefinition_BASE); IMPLEMENT_GETTYPES3(OComponentDefinition,ODataSettings,OContentHelper,OComponentDefinition_BASE);
IMPLEMENT_FORWARD_XINTERFACE3( OComponentDefinition,OContentHelper,ODataSettings,OComponentDefinition_BASE) IMPLEMENT_FORWARD_XINTERFACE3( OComponentDefinition,OContentHelper,ODataSettings,OComponentDefinition_BASE)
OUString OComponentDefinition::getImplementationName_static( ) throw(RuntimeException) OUString SAL_CALL OComponentDefinition::getImplementationName() throw(RuntimeException, std::exception)
{ {
return OUString("com.sun.star.comp.dba.OComponentDefinition"); return OUString("com.sun.star.comp.dba.OComponentDefinition");
} }
OUString SAL_CALL OComponentDefinition::getImplementationName( ) throw(RuntimeException, std::exception) Sequence< OUString > SAL_CALL OComponentDefinition::getSupportedServiceNames() throw(RuntimeException, std::exception)
{ {
return getImplementationName_static(); return { "com.sun.star.sdb.TableDefinition", "com.sun.star.ucb.Content" };
}
Sequence< OUString > OComponentDefinition::getSupportedServiceNames_static( ) throw(RuntimeException)
{
Sequence< OUString > aServices(2);
aServices[0] = "com.sun.star.sdb.TableDefinition";
aServices[1] = "com.sun.star.ucb.Content";
return aServices;
}
Sequence< OUString > SAL_CALL OComponentDefinition::getSupportedServiceNames( ) throw(RuntimeException, std::exception)
{
return getSupportedServiceNames_static();
}
Reference< XInterface > OComponentDefinition::Create( const Reference< XComponentContext >& _rxContext )
{
return *(new OComponentDefinition( _rxContext, nullptr, TContentPtr( new OComponentDefinition_Impl ) ) );
} }
void SAL_CALL OComponentDefinition::disposing() void SAL_CALL OComponentDefinition::disposing()
...@@ -300,4 +269,12 @@ void OComponentDefinition::columnAppended( const Reference< XPropertySet >& _rxS ...@@ -300,4 +269,12 @@ void OComponentDefinition::columnAppended( const Reference< XPropertySet >& _rxS
} // namespace dbaccess } // namespace dbaccess
extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* SAL_CALL
com_sun_star_comp_dba_OComponentDefinition(css::uno::XComponentContext* context,
css::uno::Sequence<css::uno::Any> const &)
{
return cppu::acquire(new dbaccess::OComponentDefinition(
context, nullptr, dbaccess::TContentPtr(new dbaccess::OComponentDefinition_Impl)));
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -85,8 +85,6 @@ class OComponentDefinition :public OContentHelper ...@@ -85,8 +85,6 @@ class OComponentDefinition :public OContentHelper
,public OComponentDefinition_BASE ,public OComponentDefinition_BASE
,public ::comphelper::OPropertyArrayUsageHelper< OComponentDefinition > ,public ::comphelper::OPropertyArrayUsageHelper< OComponentDefinition >
{ {
OComponentDefinition();
protected: protected:
css::uno::Reference< OColumns > m_xColumns; css::uno::Reference< OColumns > m_xColumns;
rtl::Reference<OColumnPropertyListener> m_xColumnPropertyListener; rtl::Reference<OColumnPropertyListener> m_xColumnPropertyListener;
...@@ -95,15 +93,14 @@ protected: ...@@ -95,15 +93,14 @@ protected:
virtual ~OComponentDefinition(); virtual ~OComponentDefinition();
virtual void SAL_CALL disposing() override; virtual void SAL_CALL disposing() override;
protected:
OComponentDefinition(const css::uno::Reference< css::uno::XComponentContext >&
,const css::uno::Reference< css::uno::XInterface >& _xParentContainer
,const TContentPtr& _pImpl
,bool _bTable = true);
const OComponentDefinition_Impl& getDefinition() const { return dynamic_cast< const OComponentDefinition_Impl& >( *m_pImpl.get() ); } const OComponentDefinition_Impl& getDefinition() const { return dynamic_cast< const OComponentDefinition_Impl& >( *m_pImpl.get() ); }
OComponentDefinition_Impl& getDefinition() { return dynamic_cast< OComponentDefinition_Impl& >( *m_pImpl.get() ); } OComponentDefinition_Impl& getDefinition() { return dynamic_cast< OComponentDefinition_Impl& >( *m_pImpl.get() ); }
public: public:
OComponentDefinition(
const css::uno::Reference< css::uno::XComponentContext >&,
const css::uno::Reference< css::uno::XInterface >& _xParentContainer,
const TContentPtr& _pImpl,
bool _bTable = true);
OComponentDefinition( OComponentDefinition(
const css::uno::Reference< css::uno::XInterface >& _rxContainer const css::uno::Reference< css::uno::XInterface >& _rxContainer
...@@ -125,11 +122,6 @@ public: ...@@ -125,11 +122,6 @@ public:
virtual OUString SAL_CALL getImplementationName( ) throw(css::uno::RuntimeException, std::exception) override; virtual OUString SAL_CALL getImplementationName( ) throw(css::uno::RuntimeException, std::exception) override;
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) throw(css::uno::RuntimeException, std::exception) override; virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) throw(css::uno::RuntimeException, std::exception) override;
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 >&);
// XInitialization // XInitialization
virtual void SAL_CALL initialize( css::uno::Sequence< css::uno::Any > const & rArguments) throw (css::uno::Exception, std::exception) override; virtual void SAL_CALL initialize( css::uno::Sequence< css::uno::Any > const & rArguments) throw (css::uno::Exception, std::exception) override;
......
...@@ -25,7 +25,6 @@ ...@@ -25,7 +25,6 @@
#include <sal/types.h> #include <sal/types.h>
extern "C" void SAL_CALL createRegistryInfo_DataAccessDescriptorFactory(); extern "C" void SAL_CALL createRegistryInfo_DataAccessDescriptorFactory();
extern "C" void SAL_CALL createRegistryInfo_OComponentDefinition();
extern "C" void SAL_CALL createRegistryInfo_ODatabaseDocument(); extern "C" void SAL_CALL createRegistryInfo_ODatabaseDocument();
#endif #endif
......
...@@ -58,7 +58,6 @@ extern "C" void SAL_CALL createRegistryInfo_DBA() ...@@ -58,7 +58,6 @@ extern "C" void SAL_CALL createRegistryInfo_DBA()
static bool bInit = false; static bool bInit = false;
if (!bInit) if (!bInit)
{ {
createRegistryInfo_OComponentDefinition();
createRegistryInfo_ODatabaseDocument(); createRegistryInfo_ODatabaseDocument();
createRegistryInfo_DataAccessDescriptorFactory(); createRegistryInfo_DataAccessDescriptorFactory();
bInit = true; bInit = true;
......
...@@ -30,7 +30,8 @@ ...@@ -30,7 +30,8 @@
<service name="com.sun.star.sdb.CommandDefinition"/> <service name="com.sun.star.sdb.CommandDefinition"/>
<service name="com.sun.star.sdb.QueryDefinition"/> <service name="com.sun.star.sdb.QueryDefinition"/>
</implementation> </implementation>
<implementation name="com.sun.star.comp.dba.OComponentDefinition"> <implementation name="com.sun.star.comp.dba.OComponentDefinition"
constructor="com_sun_star_comp_dba_OComponentDefinition">
<service name="com.sun.star.sdb.TableDefinition"/> <service name="com.sun.star.sdb.TableDefinition"/>
</implementation> </implementation>
<implementation name="com.sun.star.comp.dba.ODatabaseContext"> <implementation name="com.sun.star.comp.dba.ODatabaseContext">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment