summaryrefslogtreecommitdiff
path: root/sw
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 /sw
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 'sw')
-rw-r--r--sw/source/core/unocore/swunohelper.cxx23
-rw-r--r--sw/source/filter/ww8/ww8par5.cxx8
-rw-r--r--sw/source/ui/misc/glossary.cxx3
3 files changed, 17 insertions, 17 deletions
diff --git a/sw/source/core/unocore/swunohelper.cxx b/sw/source/core/unocore/swunohelper.cxx
index 01fb1921efd0..6397eebc2830 100644
--- a/sw/source/core/unocore/swunohelper.cxx
+++ b/sw/source/core/unocore/swunohelper.cxx
@@ -28,8 +28,8 @@
#include <com/sun/star/uno/Sequence.h>
#include <com/sun/star/uno/Exception.hpp>
+#include <com/sun/star/ucb/UniversalContentBroker.hpp>
#include <com/sun/star/ucb/XContentIdentifier.hpp>
-#include <com/sun/star/ucb/XContentProvider.hpp>
#include <com/sun/star/ucb/XCommandEnvironment.hpp>
#include <com/sun/star/ucb/TransferInfo.hpp>
#include <com/sun/star/ucb/NameClash.hpp>
@@ -42,7 +42,6 @@
#include <tools/datetime.hxx>
#include <tools/string.hxx>
#include <ucbhelper/contentidentifier.hxx>
-#include <ucbhelper/contentbroker.hxx>
#include <ucbhelper/content.hxx>
#include <swunohelper.hxx>
@@ -71,7 +70,8 @@ sal_Bool UCB_DeleteFile( const String& rURL )
try
{
ucbhelper::Content aTempContent( rURL,
- ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XCommandEnvironment >());
+ ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XCommandEnvironment >(),
+ comphelper::getProcessComponentContext() );
aTempContent.executeCommand(
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("delete")),
::com::sun::star::uno::makeAny( sal_Bool( sal_True ) ) );
@@ -96,7 +96,8 @@ sal_Bool UCB_CopyFile( const String& rURL, const String& rNewURL, sal_Bool bCopy
String sMainURL( aURL.GetMainURL(INetURLObject::NO_DECODE) );
ucbhelper::Content aTempContent( sMainURL,
- ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XCommandEnvironment >());
+ ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XCommandEnvironment >(),
+ comphelper::getProcessComponentContext() );
::com::sun::star::uno::Any aAny;
::com::sun::star::ucb::TransferInfo aInfo;
@@ -136,10 +137,10 @@ sal_Bool UCB_IsCaseSensitiveFileName( const String& rURL )
ucbhelper::ContentIdentifier( xMSF,
aTempObj.GetMainURL( INetURLObject::NO_DECODE ));
- ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XContentProvider > xProv =
- ucbhelper::ContentBroker::get()->getContentProviderInterface();
+ ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XUniversalContentBroker > xUcb =
+ com::sun::star::ucb::UniversalContentBroker::create(comphelper::getProcessComponentContext());
- sal_Int32 nCompare = xProv->compareContentIds( xRef1, xRef2 );
+ sal_Int32 nCompare = xUcb->compareContentIds( xRef1, xRef2 );
bCaseSensitive = 0 != nCompare;
}
catch( ::com::sun::star::uno::Exception& )
@@ -155,7 +156,7 @@ sal_Bool UCB_IsReadOnlyFileName( const String& rURL )
sal_Bool bIsReadOnly = sal_False;
try
{
- ucbhelper::Content aCnt( rURL, ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XCommandEnvironment >());
+ ucbhelper::Content aCnt( rURL, ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XCommandEnvironment >(), comphelper::getProcessComponentContext() );
::com::sun::star::uno::Any aAny = aCnt.getPropertyValue(
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("IsReadOnly")));
if(aAny.hasValue())
@@ -173,7 +174,7 @@ sal_Bool UCB_IsFile( const String& rURL )
sal_Bool bExists = sal_False;
try
{
- ::ucbhelper::Content aContent( rURL, ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XCommandEnvironment >() );
+ ::ucbhelper::Content aContent( rURL, ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XCommandEnvironment >(), comphelper::getProcessComponentContext() );
bExists = aContent.isDocument();
}
catch (::com::sun::star::uno::Exception &)
@@ -187,7 +188,7 @@ sal_Bool UCB_IsDirectory( const String& rURL )
sal_Bool bExists = sal_False;
try
{
- ::ucbhelper::Content aContent( rURL, ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XCommandEnvironment >() );
+ ::ucbhelper::Content aContent( rURL, ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XCommandEnvironment >(), comphelper::getProcessComponentContext() );
bExists = aContent.isFolder();
}
catch (::com::sun::star::uno::Exception &)
@@ -209,7 +210,7 @@ bool UCB_GetFileListOfFolder( const String& rURL,
sal_Bool bOk = sal_False;
try
{
- ucbhelper::Content aCnt( rURL, ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XCommandEnvironment >());
+ ucbhelper::Content aCnt( rURL, ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XCommandEnvironment >(), comphelper::getProcessComponentContext() );
::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet > xResultSet;
sal_uInt16 nSeqSize = pDateTimeList ? 2 : 1;
diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx
index 67345a93475c..992549c9df48 100644
--- a/sw/source/filter/ww8/ww8par5.cxx
+++ b/sw/source/filter/ww8/ww8par5.cxx
@@ -32,7 +32,7 @@
#include <sal/types.h>
#include <tools/solar.h>
-
+#include <comphelper/processfactory.hxx>
#include <comphelper/storagehelper.hxx>
#include <comphelper/string.hxx>
#include <sot/storinfo.hxx>
@@ -48,8 +48,6 @@
#include <sfx2/linkmgr.hxx>
#include <ucbhelper/content.hxx>
-#include <ucbhelper/contentbroker.hxx>
-#include <ucbhelper/commandenvironment.hxx>
#include <com/sun/star/i18n/ScriptType.hpp>
#include <hintids.hxx>
@@ -2320,8 +2318,8 @@ bool CanUseRemoteLink(const String &rGrfName)
try
{
::ucbhelper::Content aCnt(rGrfName,
- uno::Reference<
- ucb::XCommandEnvironment >() );
+ uno::Reference< ucb::XCommandEnvironment >(),
+ comphelper::getProcessComponentContext() );
rtl::OUString aTitle;
aCnt.getPropertyValue("Title") >>= aTitle;
diff --git a/sw/source/ui/misc/glossary.cxx b/sw/source/ui/misc/glossary.cxx
index c123b95d16f8..7f011ecc194c 100644
--- a/sw/source/ui/misc/glossary.cxx
+++ b/sw/source/ui/misc/glossary.cxx
@@ -668,7 +668,8 @@ IMPL_LINK_NOARG(SwGlossaryDlg, BibHdl)
try
{
Content aTestContent( sPath,
- uno::Reference< XCommandEnvironment >());
+ uno::Reference< XCommandEnvironment >(),
+ comphelper::getProcessComponentContext() );
Any aAny = aTestContent.getPropertyValue( C2U("IsReadOnly") );
if(aAny.hasValue())
{