summaryrefslogtreecommitdiff
path: root/dbaccess
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2012-09-14 18:08:57 +0200
committerStephan Bergmann <sbergman@redhat.com>2012-09-14 18:24:49 +0200
commit9ac86f484b0c278aafbce685ed19d3ea005ee8f8 (patch)
treecf2fe16d76992bcbd1bd89a8693c5f4996cd55f2 /dbaccess
parent2e284203da7f9882842111265f5f68ea0a145065 (diff)
Improvement on previous commit, UCB clean up
* As UCB is only ever initialized with "Local"/"Office", remove this configuration vector completely. The "create" ctor creates an instance internally initialized with those "Local"/"Office" keys. Special (test) code can still instantiate an uninitialized one via plain createInstance. And for backwards compatilibity process startup still ensures to create an initialized instance early, in case there is still code out there (in extensions) that later calls plain createInstance and expects to get the already-initialized (single) instance. * XInitialization is an "implementation detail" of the UniversalContentBroker service, do not expose in XUniversalContentBroker. * ucbhelper/configurationkeys.hxx is no longer needed and is removed. * ucbhelper/contentbroker.hxx is an empty wrapper and is removed; however, that requires ucbhelper::Content constructors to take explicit XComponentContext arguments now. * The only remaining code in ucbhelper/source/client/contentbroker.cxx is Android-only InitUCBHelper. Is that relevant still? Change-Id: I3f7bddd0456bffbcd13590c66d9011915c760f28
Diffstat (limited to 'dbaccess')
-rw-r--r--dbaccess/source/core/dataaccess/databasecontext.cxx2
-rw-r--r--dbaccess/source/ext/macromigration/macromigrationdialog.cxx24
-rw-r--r--dbaccess/source/filter/xml/dbloader2.cxx1
-rw-r--r--dbaccess/source/ui/dlg/ConnectionHelper.cxx4
-rw-r--r--dbaccess/source/ui/dlg/dbfindex.cxx5
-rw-r--r--dbaccess/source/ui/misc/UITools.cxx4
6 files changed, 20 insertions, 20 deletions
diff --git a/dbaccess/source/core/dataaccess/databasecontext.cxx b/dbaccess/source/core/dataaccess/databasecontext.cxx
index 63df72b72d83..bb37110ae416 100644
--- a/dbaccess/source/core/dataaccess/databasecontext.cxx
+++ b/dbaccess/source/core/dataaccess/databasecontext.cxx
@@ -319,7 +319,7 @@ Reference< XInterface > ODatabaseContext::loadObjectFromURL(const ::rtl::OUStrin
try
{
- ::ucbhelper::Content aContent( _sURL, NULL );
+ ::ucbhelper::Content aContent( _sURL, NULL, comphelper::getProcessComponentContext() );
if ( !aContent.isDocument() )
throw InteractiveIOException(
_sURL, *this, InteractionClassification_ERROR, IOErrorCode_NO_FILE
diff --git a/dbaccess/source/ext/macromigration/macromigrationdialog.cxx b/dbaccess/source/ext/macromigration/macromigrationdialog.cxx
index bd759075ff59..c4826fe4628c 100644
--- a/dbaccess/source/ext/macromigration/macromigrationdialog.cxx
+++ b/dbaccess/source/ext/macromigration/macromigrationdialog.cxx
@@ -34,8 +34,8 @@
#include <com/sun/star/util/XCloseable.hpp>
#include <com/sun/star/frame/XComponentLoader.hpp>
#include <com/sun/star/util/XModifiable.hpp>
+#include <com/sun/star/ucb/UniversalContentBroker.hpp>
#include <com/sun/star/ucb/XContent.hpp>
-#include <com/sun/star/ucb/XContentProvider.hpp>
#include <comphelper/namedvaluecollection.hxx>
#include <cppuhelper/exc_hlp.hxx>
@@ -44,7 +44,6 @@
#include <svl/filenotation.hxx>
#include <tools/diagnose_ex.h>
#include <ucbhelper/content.hxx>
-#include <ucbhelper/contentbroker.hxx>
#include <vcl/msgbox.hxx>
#include <list>
@@ -63,6 +62,7 @@ namespace dbmm
/** === begin UNO using === **/
using ::com::sun::star::uno::Reference;
+ using ::com::sun::star::uno::XComponentContext;
using ::com::sun::star::uno::XInterface;
using ::com::sun::star::uno::UNO_QUERY;
using ::com::sun::star::uno::UNO_QUERY_THROW;
@@ -88,17 +88,17 @@ namespace dbmm
using ::com::sun::star::lang::EventObject;
using ::com::sun::star::frame::XComponentLoader;
using ::com::sun::star::util::XModifiable;
+ using ::com::sun::star::ucb::UniversalContentBroker;
using ::com::sun::star::ucb::XCommandEnvironment;
using ::com::sun::star::ucb::XContent;
using ::com::sun::star::ucb::XContentIdentifier;
- using ::com::sun::star::ucb::XContentProvider;
/** === end UNO using === **/
//====================================================================
//= helper
//====================================================================
//--------------------------------------------------------------------
- static void lcl_getControllers_throw( const Reference< XModel2 >& _rxDocument,
+ static void lcl_getControllers_throw(const Reference< XModel2 >& _rxDocument,
::std::list< Reference< XController2 > >& _out_rControllers )
{
_out_rControllers.clear();
@@ -396,7 +396,9 @@ namespace dbmm
//--------------------------------------------------------------------
namespace
{
- bool lcl_equalURLs_nothrow( const ::rtl::OUString& _lhs, const ::rtl::OUString _rhs )
+ bool lcl_equalURLs_nothrow(
+ const Reference< XComponentContext >& context,
+ const ::rtl::OUString& _lhs, const ::rtl::OUString _rhs )
{
// the cheap situation: the URLs are equal
if ( _lhs == _rhs )
@@ -405,18 +407,14 @@ namespace dbmm
bool bEqual = true;
try
{
- ::ucbhelper::Content aContentLHS = ::ucbhelper::Content( _lhs, Reference< XCommandEnvironment >() );
- ::ucbhelper::Content aContentRHS = ::ucbhelper::Content( _rhs, Reference< XCommandEnvironment >() );
+ ::ucbhelper::Content aContentLHS = ::ucbhelper::Content( _lhs, Reference< XCommandEnvironment >(), context );
+ ::ucbhelper::Content aContentRHS = ::ucbhelper::Content( _rhs, Reference< XCommandEnvironment >(), context );
Reference< XContent > xContentLHS( aContentLHS.get(), UNO_SET_THROW );
Reference< XContent > xContentRHS( aContentRHS.get(), UNO_SET_THROW );
Reference< XContentIdentifier > xID1( xContentLHS->getIdentifier(), UNO_SET_THROW );
Reference< XContentIdentifier > xID2( xContentRHS->getIdentifier(), UNO_SET_THROW );
- ::ucbhelper::ContentBroker* pBroker = ::ucbhelper::ContentBroker::get();
- Reference< XContentProvider > xProvider(
- pBroker ? pBroker->getContentProviderInterface() : Reference< XContentProvider >(), UNO_SET_THROW );
-
- bEqual = ( 0 == xProvider->compareContentIds( xID1, xID2 ) );
+ bEqual = UniversalContentBroker::create(context)->compareContentIds( xID1, xID2 ) == 0;
}
catch( const Exception& )
{
@@ -440,7 +438,7 @@ namespace dbmm
try
{
// check that the backup location isn't the same as the document itself
- if ( lcl_equalURLs_nothrow( sBackupLocation, m_pData->xDocumentModel->getURL() ) )
+ if ( lcl_equalURLs_nothrow( m_pData->aContext.getUNOContext(), sBackupLocation, m_pData->xDocumentModel->getURL() ) )
{
ErrorBox aErrorBox( const_cast< MacroMigrationDialog* >( this ), MacroMigrationResId( ERR_INVALID_BACKUP_LOCATION ) );
aErrorBox.Execute();
diff --git a/dbaccess/source/filter/xml/dbloader2.cxx b/dbaccess/source/filter/xml/dbloader2.cxx
index f3ebf33738ca..bad3711e4ceb 100644
--- a/dbaccess/source/filter/xml/dbloader2.cxx
+++ b/dbaccess/source/filter/xml/dbloader2.cxx
@@ -67,7 +67,6 @@
#include <tools/diagnose_ex.h>
#include <ucbhelper/commandenvironment.hxx>
#include <ucbhelper/content.hxx>
-#include <ucbhelper/contentbroker.hxx>
#include <vcl/msgbox.hxx>
#include <vcl/svapp.hxx>
diff --git a/dbaccess/source/ui/dlg/ConnectionHelper.cxx b/dbaccess/source/ui/dlg/ConnectionHelper.cxx
index 4bf7ce20b638..26b32f24a33a 100644
--- a/dbaccess/source/ui/dlg/ConnectionHelper.cxx
+++ b/dbaccess/source/ui/dlg/ConnectionHelper.cxx
@@ -530,7 +530,7 @@ DBG_NAME(OConnectionHelper)
Reference< XCommandEnvironment > xCmdEnv = new ::ucbhelper::CommandEnvironment( xInteractionHandler, Reference< XProgressHandler >() );
try
{
- aCheckExistence = ::ucbhelper::Content(_rURL, xCmdEnv );
+ aCheckExistence = ::ucbhelper::Content(_rURL, xCmdEnv, comphelper::getProcessComponentContext());
bExists = bIsFile? aCheckExistence.isDocument(): aCheckExistence.isFolder();
eExists = bExists? PATH_EXIST: PATH_NOT_EXIST;
}
@@ -596,7 +596,7 @@ DBG_NAME(OConnectionHelper)
{
// the parent content
Reference< XCommandEnvironment > xEmptyEnv;
- ::ucbhelper::Content aParent(aParser.GetMainURL(INetURLObject::NO_DECODE), xEmptyEnv);
+ ::ucbhelper::Content aParent(aParser.GetMainURL(INetURLObject::NO_DECODE), xEmptyEnv, comphelper::getProcessComponentContext());
::rtl::OUString sContentType;
if ( INET_PROT_FILE == eProtocol )
diff --git a/dbaccess/source/ui/dlg/dbfindex.cxx b/dbaccess/source/ui/dlg/dbfindex.cxx
index 9dd99164ef6f..8e5dce8294cd 100644
--- a/dbaccess/source/ui/dlg/dbfindex.cxx
+++ b/dbaccess/source/ui/dlg/dbfindex.cxx
@@ -18,6 +18,7 @@
*/
#include "dbfindex.hxx"
+#include <comphelper/processfactory.hxx>
#include <tools/config.hxx>
#include <sfx2/app.hxx>
#include "moduledbu.hxx"
@@ -298,7 +299,7 @@ void ODbaseIndexDialog::Init()
sal_Bool bFolder=sal_True;
try
{
- aFile = ::ucbhelper::Content(m_aDSN,Reference< ::com::sun::star::ucb::XCommandEnvironment >());
+ aFile = ::ucbhelper::Content(m_aDSN,Reference< ::com::sun::star::ucb::XCommandEnvironment >(), comphelper::getProcessComponentContext());
bFolder = aFile.isFolder();
}
catch(Exception&)
@@ -489,7 +490,7 @@ void OTableInfo::WriteInfFile( const String& rDSN ) const
{
try
{
- ::ucbhelper::Content aContent(aURL.GetURLNoPass(),Reference<XCommandEnvironment>());
+ ::ucbhelper::Content aContent(aURL.GetURLNoPass(),Reference<XCommandEnvironment>(), comphelper::getProcessComponentContext());
aContent.executeCommand( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("delete")),makeAny( sal_Bool( sal_True ) ) );
}
catch (const Exception& e )
diff --git a/dbaccess/source/ui/misc/UITools.cxx b/dbaccess/source/ui/misc/UITools.cxx
index 6f61a4bbf7af..578e6e054113 100644
--- a/dbaccess/source/ui/misc/UITools.cxx
+++ b/dbaccess/source/ui/misc/UITools.cxx
@@ -68,6 +68,7 @@
#include "dlgattr.hrc"
#include "TypeInfo.hxx"
#include "FieldDescriptions.hxx"
+#include <comphelper/processfactory.hxx>
#include <comphelper/stl_types.hxx>
#include <comphelper/componentcontext.hxx>
@@ -1228,7 +1229,8 @@ namespace
try
{
::ucbhelper::Content aCnt( INetURLObject( _rURL ).GetMainURL( INetURLObject::NO_DECODE ),
- Reference< ::com::sun::star::ucb::XCommandEnvironment > () );
+ Reference< ::com::sun::star::ucb::XCommandEnvironment >(),
+ comphelper::getProcessComponentContext() );
if ( ( aCnt.getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AnchorName")) ) >>= sAnchor ) )
{