summaryrefslogtreecommitdiff
path: root/fpicker
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 /fpicker
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 'fpicker')
-rw-r--r--fpicker/source/office/fpsmartcontent.cxx2
-rw-r--r--fpicker/source/office/iodlg.cxx20
2 files changed, 8 insertions, 14 deletions
diff --git a/fpicker/source/office/fpsmartcontent.cxx b/fpicker/source/office/fpsmartcontent.cxx
index 56bb084a5afe..5de4395ed362 100644
--- a/fpicker/source/office/fpsmartcontent.cxx
+++ b/fpicker/source/office/fpsmartcontent.cxx
@@ -150,7 +150,7 @@ namespace svt
{
try
{
- m_pContent = new ::ucbhelper::Content( _rURL, m_xCmdEnv );
+ m_pContent = new ::ucbhelper::Content( _rURL, m_xCmdEnv, comphelper::getProcessComponentContext() );
m_eState = UNKNOWN;
// from now on, the state is unknown -> we cannot know for sure if the content
// is really valid (some UCP's only tell this when asking for properties, not upon
diff --git a/fpicker/source/office/iodlg.cxx b/fpicker/source/office/iodlg.cxx
index 7b6ebe1cad24..46e2b708f506 100644
--- a/fpicker/source/office/iodlg.cxx
+++ b/fpicker/source/office/iodlg.cxx
@@ -30,7 +30,6 @@
#include <vcl/svapp.hxx>
#include <vcl/timer.hxx>
#include <unotools/ucbhelper.hxx>
-#include <ucbhelper/contentbroker.hxx>
#include "svtools/ehdl.hxx"
#include "svl/urihelper.hxx"
#include "unotools/pathoptions.hxx"
@@ -52,7 +51,7 @@
#include "svtools/QueryFolderName.hxx"
#include <rtl/ustring.hxx>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/ucb/XContentProviderManager.hpp>
+#include <com/sun/star/ucb/UniversalContentBroker.hpp>
#include <com/sun/star/ui/dialogs/CommonFilePickerElementIds.hpp>
#include <com/sun/star/ui/dialogs/ExtendedFilePickerElementIds.hpp>
#include <com/sun/star/ui/dialogs/ControlActions.hpp>
@@ -273,17 +272,11 @@ namespace
//=================================================================
try
{
- // get the content provider manager
- ::ucbhelper::ContentBroker* pBroker = ::ucbhelper::ContentBroker::get();
- Reference< XContentProviderManager > xProviderManager;
- if ( pBroker )
- xProviderManager = pBroker->getContentProviderManagerInterface();
-
- //=================================================================
// get the provider for the current scheme
- Reference< XContentProvider > xProvider;
- if ( xProviderManager.is() )
- xProvider = xProviderManager->queryContentProvider( _rForURL );
+ Reference< XContentProvider > xProvider(
+ UniversalContentBroker::create(
+ comphelper::getProcessComponentContext() )->
+ queryContentProvider( _rForURL ) );
DBG_ASSERT( xProvider.is(), "lcl_getHomeDirectory: could not find a (valid) content provider for the current URL!" );
Reference< XPropertySet > xProviderProps( xProvider, UNO_QUERY );
@@ -2072,7 +2065,8 @@ short SvtFileDialog::PrepareExecute()
INetURLObject aStdDir( GetStandardDir() );
::ucbhelper::Content aCnt( rtl::OUString( aStdDir.GetMainURL(
INetURLObject::NO_DECODE ) ),
- Reference< XCommandEnvironment >() );
+ Reference< XCommandEnvironment >(),
+ comphelper::getProcessComponentContext() );
Sequence< rtl::OUString > aProps(2);
aProps[0] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "IsVolume" ));
aProps[1] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "IsRemoveable" ));