tdf#74608 dbaccess: Constructor feature for OComponentDefinition
Change-Id: I150cdaa46a0d86e1a4b6598ac580a10b2e8f071f
This commit is contained in:
@@ -20,34 +20,22 @@
|
||||
#include "ComponentDefinition.hxx"
|
||||
#include "apitools.hxx"
|
||||
#include "dbastrings.hrc"
|
||||
#include "module_dba.hxx"
|
||||
#include "services.hxx"
|
||||
|
||||
#include <boost/noncopyable.hpp>
|
||||
#include <tools/debug.hxx>
|
||||
#include <osl/diagnose.h>
|
||||
#include <comphelper/sequence.hxx>
|
||||
#include <com/sun/star/lang/DisposedException.hpp>
|
||||
#include <com/sun/star/beans/PropertyAttribute.hpp>
|
||||
#include <comphelper/property.hxx>
|
||||
#include "definitioncolumn.hxx"
|
||||
#include <cppuhelper/implbase.hxx>
|
||||
|
||||
using namespace ::com::sun::star::uno;
|
||||
using namespace ::com::sun::star::sdbc;
|
||||
using namespace ::com::sun::star::lang;
|
||||
|
||||
using namespace ::com::sun::star::beans;
|
||||
using namespace ::com::sun::star::container;
|
||||
using namespace ::osl;
|
||||
using namespace ::comphelper;
|
||||
using namespace ::cppu;
|
||||
|
||||
extern "C" void SAL_CALL createRegistryInfo_OComponentDefinition()
|
||||
{
|
||||
static ::dba::OAutoRegistration< ::dbaccess::OComponentDefinition > aAutoRegistration;
|
||||
}
|
||||
|
||||
namespace dbaccess
|
||||
{
|
||||
|
||||
@@ -159,33 +147,14 @@ css::uno::Sequence<sal_Int8> OComponentDefinition::getImplementationId()
|
||||
IMPLEMENT_GETTYPES3(OComponentDefinition,ODataSettings,OContentHelper,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");
|
||||
}
|
||||
|
||||
OUString SAL_CALL OComponentDefinition::getImplementationName( ) throw(RuntimeException, std::exception)
|
||||
Sequence< OUString > SAL_CALL OComponentDefinition::getSupportedServiceNames() throw(RuntimeException, std::exception)
|
||||
{
|
||||
return getImplementationName_static();
|
||||
}
|
||||
|
||||
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 ) ) );
|
||||
return { "com.sun.star.sdb.TableDefinition", "com.sun.star.ucb.Content" };
|
||||
}
|
||||
|
||||
void SAL_CALL OComponentDefinition::disposing()
|
||||
@@ -300,4 +269,12 @@ void OComponentDefinition::columnAppended( const Reference< XPropertySet >& _rxS
|
||||
|
||||
} // 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: */
|
||||
|
@@ -85,8 +85,6 @@ class OComponentDefinition :public OContentHelper
|
||||
,public OComponentDefinition_BASE
|
||||
,public ::comphelper::OPropertyArrayUsageHelper< OComponentDefinition >
|
||||
{
|
||||
OComponentDefinition();
|
||||
|
||||
protected:
|
||||
css::uno::Reference< OColumns > m_xColumns;
|
||||
rtl::Reference<OColumnPropertyListener> m_xColumnPropertyListener;
|
||||
@@ -95,15 +93,14 @@ protected:
|
||||
virtual ~OComponentDefinition();
|
||||
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() ); }
|
||||
OComponentDefinition_Impl& getDefinition() { return dynamic_cast< OComponentDefinition_Impl& >( *m_pImpl.get() ); }
|
||||
public:
|
||||
OComponentDefinition(
|
||||
const css::uno::Reference< css::uno::XComponentContext >&,
|
||||
const css::uno::Reference< css::uno::XInterface >& _xParentContainer,
|
||||
const TContentPtr& _pImpl,
|
||||
bool _bTable = true);
|
||||
|
||||
OComponentDefinition(
|
||||
const css::uno::Reference< css::uno::XInterface >& _rxContainer
|
||||
@@ -125,11 +122,6 @@ public:
|
||||
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;
|
||||
|
||||
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
|
||||
virtual void SAL_CALL initialize( css::uno::Sequence< css::uno::Any > const & rArguments) throw (css::uno::Exception, std::exception) override;
|
||||
|
||||
|
@@ -25,7 +25,6 @@
|
||||
#include <sal/types.h>
|
||||
|
||||
extern "C" void SAL_CALL createRegistryInfo_DataAccessDescriptorFactory();
|
||||
extern "C" void SAL_CALL createRegistryInfo_OComponentDefinition();
|
||||
extern "C" void SAL_CALL createRegistryInfo_ODatabaseDocument();
|
||||
|
||||
#endif
|
||||
|
@@ -58,7 +58,6 @@ extern "C" void SAL_CALL createRegistryInfo_DBA()
|
||||
static bool bInit = false;
|
||||
if (!bInit)
|
||||
{
|
||||
createRegistryInfo_OComponentDefinition();
|
||||
createRegistryInfo_ODatabaseDocument();
|
||||
createRegistryInfo_DataAccessDescriptorFactory();
|
||||
bInit = true;
|
||||
|
Reference in New Issue
Block a user