summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrank Schönheit <fs@openoffice.org>2001-07-27 07:42:15 +0000
committerFrank Schönheit <fs@openoffice.org>2001-07-27 07:42:15 +0000
commit1147f346707741f11225efe14ac35dd3154ee6c7 (patch)
tree73ae41cb6f79626f7df892549b861521da089aee
parent21b42b7f73108cc2e86be9f694bbf57970d3cb6a (diff)
#88530# be a XSingleServiceFactory to ease the creation of data sources
-rw-r--r--dbaccess/source/core/dataaccess/databasecontext.cxx17
-rw-r--r--dbaccess/source/core/dataaccess/databasecontext.hxx18
2 files changed, 28 insertions, 7 deletions
diff --git a/dbaccess/source/core/dataaccess/databasecontext.cxx b/dbaccess/source/core/dataaccess/databasecontext.cxx
index afa4ac8a1a14..d011f0614551 100644
--- a/dbaccess/source/core/dataaccess/databasecontext.cxx
+++ b/dbaccess/source/core/dataaccess/databasecontext.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: databasecontext.cxx,v $
*
- * $Revision: 1.19 $
+ * $Revision: 1.20 $
*
- * last change: $Author: oj $ $Date: 2001-07-26 09:15:31 $
+ * last change: $Author: fs $ $Date: 2001-07-27 08:42:15 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -237,6 +237,18 @@ Sequence< sal_Int8 > ODatabaseContext::getUnoTunnelImplementationId() throw (Run
}
//--------------------------------------------------------------------------
+Reference< XInterface > SAL_CALL ODatabaseContext::createInstance( ) throw (Exception, RuntimeException)
+{
+ return *(new ODatabaseSource(m_xServiceManager));
+}
+
+//--------------------------------------------------------------------------
+Reference< XInterface > SAL_CALL ODatabaseContext::createInstanceWithArguments( const Sequence< Any >& _rArguments ) throw (Exception, RuntimeException)
+{
+ return createInstance();
+}
+
+//--------------------------------------------------------------------------
sal_Int64 SAL_CALL ODatabaseContext::getSomething(const Sequence<sal_Int8>& _rIdentifier) throw( RuntimeException )
{
if (_rIdentifier.getLength() == 16 && 0 == rtl_compareMemory(getImplementationId().getConstArray(), _rIdentifier.getConstArray(), 16 ) )
@@ -381,6 +393,7 @@ void ODatabaseContext::registerObject(const rtl::OUString& _rName, const Referen
if (m_aRootNode.hasByName(_rName))
throw ElementExistException();
+
OConfigurationNode aObjectNode;
// here we have to check if the datasource should only be renamed
::utl::OConfigurationNode aTreeNode = pObjectImpl->getRenameNode();
diff --git a/dbaccess/source/core/dataaccess/databasecontext.hxx b/dbaccess/source/core/dataaccess/databasecontext.hxx
index b02943ff6ed0..1dbef61d34c8 100644
--- a/dbaccess/source/core/dataaccess/databasecontext.hxx
+++ b/dbaccess/source/core/dataaccess/databasecontext.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: databasecontext.hxx,v $
*
- * $Revision: 1.7 $
+ * $Revision: 1.8 $
*
- * last change: $Author: fs $ $Date: 2001-06-18 11:49:05 $
+ * last change: $Author: fs $ $Date: 2001-07-27 08:42:15 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -86,8 +86,8 @@
#ifndef _COM_SUN_STAR_LANG_XUNOTUNNEL_HPP_
#include <com/sun/star/lang/XUnoTunnel.hpp>
#endif
-#ifndef _CPPUHELPER_COMPBASE7_HXX_
-#include <cppuhelper/compbase7.hxx>
+#ifndef _CPPUHELPER_COMPBASE8_HXX_
+#include <cppuhelper/compbase8.hxx>
#endif
#ifndef _COMPHELPER_STLTYPES_HXX_
#include <comphelper/stl_types.hxx>
@@ -107,6 +107,9 @@
#ifndef _UNOTOOLS_CONFIGNODE_HXX_
#include <unotools/confignode.hxx>
#endif
+#ifndef _COM_SUN_STAR_LANG_XSINGLESERVICEFACTORY_HPP_
+#include <com/sun/star/lang/XSingleServiceFactory.hpp>
+#endif
// needed for registration
namespace com { namespace sun { namespace star {
@@ -128,13 +131,14 @@ namespace dbaccess
::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >
ODatabaseContext_CreateInstance(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >&);
-typedef ::cppu::WeakComponentImplHelper7 < ::com::sun::star::lang::XServiceInfo
+typedef ::cppu::WeakComponentImplHelper8 < ::com::sun::star::lang::XServiceInfo
, ::com::sun::star::container::XEnumerationAccess
, ::com::sun::star::container::XNameAccess
, ::com::sun::star::uno::XNamingService
, ::com::sun::star::lang::XEventListener
, ::com::sun::star::lang::XUnoTunnel
, ::com::sun::star::container::XContainer
+ , ::com::sun::star::lang::XSingleServiceFactory
> DatabaseAccessContext_Base;
class ODatabaseContext
@@ -167,6 +171,10 @@ public:
// OComponentHelper
virtual void SAL_CALL disposing(void);
+// ::com::sun::star::lang::XSingleServiceFactory
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL createInstance( ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL createInstanceWithArguments( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& _rArguments ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
+
// ::com::sun::star::lang::XUnoTunnel
virtual sal_Int64 SAL_CALL getSomething(const ::com::sun::star::uno::Sequence<sal_Int8>& _rIdentifier) throw( ::com::sun::star::uno::RuntimeException );
static ::com::sun::star::uno::Sequence< sal_Int8 > getUnoTunnelImplementationId() throw (::com::sun::star::uno::RuntimeException);