summaryrefslogtreecommitdiff
path: root/svx/source/svdraw
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 /svx/source/svdraw
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 'svx/source/svdraw')
-rw-r--r--svx/source/svdraw/svdoashp.cxx1
-rw-r--r--svx/source/svdraw/svdogrp.cxx2
-rw-r--r--svx/source/svdraw/svdomedia.cxx8
-rw-r--r--svx/source/svdraw/svdotxln.cxx35
4 files changed, 20 insertions, 26 deletions
diff --git a/svx/source/svdraw/svdoashp.cxx b/svx/source/svdraw/svdoashp.cxx
index 624a2a71cc0d..dab7b9feaf62 100644
--- a/svx/source/svdraw/svdoashp.cxx
+++ b/svx/source/svdraw/svdoashp.cxx
@@ -30,7 +30,6 @@
#include "svx/unoapi.hxx"
#include <svx/unoshape.hxx>
#include <ucbhelper/content.hxx>
-#include <ucbhelper/contentbroker.hxx>
#include <unotools/datetime.hxx>
#include <sfx2/lnkbase.hxx>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
diff --git a/svx/source/svdraw/svdogrp.cxx b/svx/source/svdraw/svdogrp.cxx
index d693d8b2035d..bf8552521be6 100644
--- a/svx/source/svdraw/svdogrp.cxx
+++ b/svx/source/svdraw/svdogrp.cxx
@@ -28,8 +28,6 @@
#include <sfx2/linkmgr.hxx>
-#include <ucbhelper/content.hxx>
-#include <ucbhelper/contentbroker.hxx>
#include <unotools/datetime.hxx>
#include <svx/svdogrp.hxx>
diff --git a/svx/source/svdraw/svdomedia.cxx b/svx/source/svdraw/svdomedia.cxx
index 875d263e033f..89ce42f4d540 100644
--- a/svx/source/svdraw/svdomedia.cxx
+++ b/svx/source/svdraw/svdomedia.cxx
@@ -36,7 +36,7 @@
#include <com/sun/star/embed/XStorage.hpp>
#include <ucbhelper/content.hxx>
-
+#include <comphelper/processfactory.hxx>
#include <comphelper/storagehelper.hxx>
#include <vcl/svapp.hxx>
@@ -290,7 +290,8 @@ uno::Reference<io::XInputStream> SdrMediaObj::GetInputStream()
return 0;
}
ucbhelper::Content tempFile(m_pImpl->m_pTempFile->m_TempFileURL,
- uno::Reference<ucb::XCommandEnvironment>());
+ uno::Reference<ucb::XCommandEnvironment>(),
+ comphelper::getProcessComponentContext());
return tempFile.openStream();
}
@@ -338,7 +339,8 @@ bool lcl_HandlePackageURL(
try
{
::ucbhelper::Content tempContent(tempFileURL,
- uno::Reference<ucb::XCommandEnvironment>());
+ uno::Reference<ucb::XCommandEnvironment>(),
+ comphelper::getProcessComponentContext());
tempContent.writeStream(xInStream, true); // copy stream to file
}
catch (uno::Exception const& e)
diff --git a/svx/source/svdraw/svdotxln.cxx b/svx/source/svdraw/svdotxln.cxx
index e8c8344bec84..ea7abe3ca95f 100644
--- a/svx/source/svdraw/svdotxln.cxx
+++ b/svx/source/svdraw/svdotxln.cxx
@@ -26,11 +26,12 @@
*
************************************************************************/
+#include "sal/config.h"
+#include <comphelper/processfactory.hxx>
#include <unotools/ucbstreamhelper.hxx>
#include <unotools/localfilehelper.hxx>
#include <ucbhelper/content.hxx>
-#include <ucbhelper/contentbroker.hxx>
#include <unotools/datetime.hxx>
#include <svx/svdotext.hxx>
#include "svx/svditext.hxx"
@@ -175,30 +176,24 @@ bool SdrTextObj::ReloadLinkedText( bool bForceLoad)
if( pData )
{
- ::ucbhelper::ContentBroker* pBroker = ::ucbhelper::ContentBroker::get();
DateTime aFileDT( DateTime::EMPTY );
- sal_Bool bExists = sal_False, bLoad = sal_False;
+ sal_Bool bExists = sal_True, bLoad = sal_False;
- if( pBroker )
+ try
{
- bExists = sal_True;
+ INetURLObject aURL( pData->aFileName );
+ DBG_ASSERT( aURL.GetProtocol() != INET_PROT_NOT_VALID, "invalid URL" );
- try
- {
- INetURLObject aURL( pData->aFileName );
- DBG_ASSERT( aURL.GetProtocol() != INET_PROT_NOT_VALID, "invalid URL" );
-
- ::ucbhelper::Content aCnt( aURL.GetMainURL( INetURLObject::NO_DECODE ), ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XCommandEnvironment >() );
- ::com::sun::star::uno::Any aAny( aCnt.getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DateModified" ) ) ) );
- ::com::sun::star::util::DateTime aDateTime;
+ ::ucbhelper::Content aCnt( aURL.GetMainURL( INetURLObject::NO_DECODE ), ::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( "DateModified" ) ) ) );
+ ::com::sun::star::util::DateTime aDateTime;
- aAny >>= aDateTime;
- ::utl::typeConvert( aDateTime, aFileDT );
- }
- catch( ... )
- {
- bExists = sal_False;
- }
+ aAny >>= aDateTime;
+ ::utl::typeConvert( aDateTime, aFileDT );
+ }
+ catch( ... )
+ {
+ bExists = sal_False;
}
if( bExists )