summaryrefslogtreecommitdiff
path: root/extensions
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2012-09-27 13:43:06 +0200
committerStephan Bergmann <sbergman@redhat.com>2012-09-27 15:03:32 +0200
commita00c4e02acd1b7a3ab126941166aa2d12c7eb3fc (patch)
tree124a0877db6e0921b9a1237261106b63d94c1c9f /extensions
parent9c00e38b431b57c3760f6c0aa774424b3239eeda (diff)
Improvements on previous commit
* Made XDatabaseContext inherit XDatabaseRegistrations non-optionally, adapted call-sites to just use XDatabaseContext w/o querying. (The previous commit had inadvertantly effectively removed support for XDatabaseRegistrations from the ODatabaseContext implementation, as an optional UNO super-interface does not lead to a super-class in the corresponding C++ class hierarchy, but making the super-interface non-optional fixes that anyway.) * Adapted some more call-sites to just use XDatabaseContext w/o querying. * Added @since tag. * Replaced new uses of comphelper::ComponentContext::getUNOContext with comphelper::getComponentContext (see 03a9f139bd9ea1a4f9096fc982e6b326def58532 "ComponentContext::getUnoContext -> getComponentContext simplification;" I intend to get rid of comphelper/componentcontext.hxx much sooner than of comphelper/processfactory.hxx). Change-Id: I68d09f2dbe651629f79ed21cd40cdb6d6b32c624
Diffstat (limited to 'extensions')
-rw-r--r--extensions/source/abpilot/datasourcehandling.cxx14
-rw-r--r--extensions/source/dbpilots/commonpagesdbp.hxx4
-rw-r--r--extensions/source/dbpilots/controlwizard.cxx7
-rw-r--r--extensions/source/dbpilots/wizardcontext.hxx3
4 files changed, 13 insertions, 15 deletions
diff --git a/extensions/source/abpilot/datasourcehandling.cxx b/extensions/source/abpilot/datasourcehandling.cxx
index c91b480f53a1..c37139b48e46 100644
--- a/extensions/source/abpilot/datasourcehandling.cxx
+++ b/extensions/source/abpilot/datasourcehandling.cxx
@@ -49,7 +49,7 @@
#include <com/sun/star/uno/XNamingService.hpp>
#include <comphelper/interaction.hxx>
-#include <comphelper/componentcontext.hxx>
+#include <comphelper/processfactory.hxx>
#include <tools/debug.hxx>
#include <tools/diagnose_ex.h>
#include <unotools/confignode.hxx>
@@ -127,7 +127,7 @@ namespace abp
{
// create the new data source
Reference< XPropertySet > xNewDataSource;
- lcl_implCreateAndInsert( comphelper::ComponentContext(_rxORB).getUNOContext(), _rName, xNewDataSource );
+ lcl_implCreateAndInsert( comphelper::getComponentContext(_rxORB), _rName, xNewDataSource );
//.............................................................
// set the URL property
@@ -157,11 +157,9 @@ namespace abp
OSL_ENSURE( !_sURL.isEmpty(), "lcl_registerDataSource: invalid URL!" );
try
{
-
- ::comphelper::ComponentContext aContext( _rxORB );
- Reference< XDatabaseRegistrations > xRegistrations(
- aContext.createComponent( "com.sun.star.sdb.DatabaseContext" ), UNO_QUERY_THROW );
-
+ Reference< XDatabaseContext > xRegistrations(
+ DatabaseContext::create(
+ comphelper::getComponentContext(_rxORB)));
if ( xRegistrations->hasRegisteredDatabase( _sName ) )
xRegistrations->changeDatabaseLocation( _sName, _sURL );
else
@@ -201,7 +199,7 @@ namespace abp
{
// create the UNO context
m_pImpl->xContext = Reference<XNameAccess>(
- lcl_getDataSourceContext( comphelper::ComponentContext(_rxORB).getUNOContext() ),
+ lcl_getDataSourceContext( comphelper::getComponentContext(_rxORB) ),
UNO_QUERY_THROW);
if (m_pImpl->xContext.is())
diff --git a/extensions/source/dbpilots/commonpagesdbp.hxx b/extensions/source/dbpilots/commonpagesdbp.hxx
index 07038717bbcb..3d00eba2076c 100644
--- a/extensions/source/dbpilots/commonpagesdbp.hxx
+++ b/extensions/source/dbpilots/commonpagesdbp.hxx
@@ -23,7 +23,7 @@
#include "controlwizard.hxx"
#include <vcl/fixed.hxx>
#include <vcl/lstbox.hxx>
-#include <com/sun/star/container/XNameAccess.hpp>
+#include <com/sun/star/sdb/XDatabaseContext.hpp>
//.........................................................................
namespace dbp
@@ -44,7 +44,7 @@ namespace dbp
FixedText m_aTableLabel;
ListBox m_aTable;
- ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >
+ ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XDatabaseContext >
m_xDSContext;
public:
diff --git a/extensions/source/dbpilots/controlwizard.cxx b/extensions/source/dbpilots/controlwizard.cxx
index ba216b3d4451..47c6bb55ed48 100644
--- a/extensions/source/dbpilots/controlwizard.cxx
+++ b/extensions/source/dbpilots/controlwizard.cxx
@@ -42,7 +42,7 @@
#include <com/sun/star/sdb/CommandType.hpp>
#include <com/sun/star/sdbc/SQLWarning.hpp>
#include <com/sun/star/sdb/SQLContext.hpp>
-#include <comphelper/componentcontext.hxx>
+#include <comphelper/processfactory.hxx>
#include <comphelper/types.hxx>
#include <connectivity/dbtools.hxx>
#include <vcl/msgbox.hxx>
@@ -446,9 +446,8 @@ namespace dbp
{
DBG_ASSERT(xORB.is(), "OControlWizard::implGetDSContext: invalid service factory!");
- m_aContext.xDatasourceContext = Reference<XNameAccess>(
- DatabaseContext::create(comphelper::ComponentContext(xORB).getUNOContext()),
- UNO_QUERY_THROW);
+ m_aContext.xDatasourceContext =
+ DatabaseContext::create(comphelper::getComponentContext(xORB));
}
catch(const Exception&)
{
diff --git a/extensions/source/dbpilots/wizardcontext.hxx b/extensions/source/dbpilots/wizardcontext.hxx
index 2e5bb4240f9a..6b77c7877571 100644
--- a/extensions/source/dbpilots/wizardcontext.hxx
+++ b/extensions/source/dbpilots/wizardcontext.hxx
@@ -22,6 +22,7 @@
#include <com/sun/star/container/XNameAccess.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/sdb/XDatabaseContext.hpp>
#include <com/sun/star/sdbc/XRowSet.hpp>
#include <com/sun/star/uno/Sequence.hxx>
#include <com/sun/star/drawing/XDrawPage.hpp>
@@ -40,7 +41,7 @@ namespace dbp
struct OControlWizardContext
{
// the global data source context
- ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >
+ ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XDatabaseContext >
xDatasourceContext;
// the control mode