summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2012-09-14 18:23:35 +0200
committerStephan Bergmann <sbergman@redhat.com>2012-09-14 18:23:35 +0200
commitce8df700973de1c20c7ab388671129a3945cdaf3 (patch)
tree2a121094638fd36f674a658161e230fa2422e2ba
parent-Werror=shadow (diff)
downloadbinfilter-ce8df700973de1c20c7ab388671129a3945cdaf3.tar.gz
binfilter-ce8df700973de1c20c7ab388671129a3945cdaf3.zip
Improvement on previous commit, UCB clean up, binfilter redux
...of core commit c46a972279af60c01e20e54a9f1b78eaff6a7386 Change-Id: I6291e49f334e8217042d632610aaa66409e83dd0
-rw-r--r--binfilter/bf_sc/source/core/data/sc_globalx.cxx4
-rw-r--r--binfilter/bf_sfx2/source/appl/sfx2_appinit.cxx1
-rw-r--r--binfilter/bf_sfx2/source/doc/sfx2_docfile.cxx7
-rw-r--r--binfilter/bf_sfx2/source/doc/sfx2_objstor.cxx4
-rw-r--r--binfilter/bf_so3/source/copied/staticbaseurl.cxx4
-rw-r--r--binfilter/bf_so3/source/persist/transuno.cxx48
-rw-r--r--binfilter/bf_svtools/source/filter.vcl/filter/svt_filter.cxx6
-rw-r--r--binfilter/bf_svtools/source/misc/svt_urihelper.cxx1
-rw-r--r--binfilter/bf_svtools/source/misc1/svt_fstathelper.cxx7
-rw-r--r--binfilter/bf_sw/source/core/unocore/sw_swunohelper.cxx3
10 files changed, 24 insertions, 61 deletions
diff --git a/binfilter/bf_sc/source/core/data/sc_globalx.cxx b/binfilter/bf_sc/source/core/data/sc_globalx.cxx
index b5bce64b2..3409adb6f 100644
--- a/binfilter/bf_sc/source/core/data/sc_globalx.cxx
+++ b/binfilter/bf_sc/source/core/data/sc_globalx.cxx
@@ -21,8 +21,8 @@
#include "callform.hxx"
#include "global.hxx"
+#include <comphelper/processfactory.hxx>
#include <tools/urlobj.hxx>
-#include <ucbhelper/contentbroker.hxx>
#include <ucbhelper/content.hxx>
#include <unotools/localfilehelper.hxx>
@@ -71,7 +71,7 @@ namespace binfilter {
/*N*/ try
/*N*/ {
/*N*/ ::ucbhelper::Content aCnt( aObj.GetMainURL(INetURLObject::NO_DECODE),
-/*N*/ Reference< XCommandEnvironment > () );
+/*N*/ Reference< XCommandEnvironment > (), comphelper::getProcessComponentContext() );
/*N*/ Reference< sdbc::XResultSet > xResultSet;
/*N*/ Sequence< ::rtl::OUString > aProps;
/*N*/ try
diff --git a/binfilter/bf_sfx2/source/appl/sfx2_appinit.cxx b/binfilter/bf_sfx2/source/appl/sfx2_appinit.cxx
index 469788685..ff1b54baa 100644
--- a/binfilter/bf_sfx2/source/appl/sfx2_appinit.cxx
+++ b/binfilter/bf_sfx2/source/appl/sfx2_appinit.cxx
@@ -39,7 +39,6 @@
#include <comphelper/processfactory.hxx>
#include <rtl/ustrbuf.hxx>
#include <osl/security.hxx>
-#include <ucbhelper/configurationkeys.hxx>
#include <bf_svtools/pathoptions.hxx>
#include <bf_svtools/historyoptions.hxx>
#include <bf_svtools/moduleoptions.hxx>
diff --git a/binfilter/bf_sfx2/source/doc/sfx2_docfile.cxx b/binfilter/bf_sfx2/source/doc/sfx2_docfile.cxx
index 4fea36682..dcdeca193 100644
--- a/binfilter/bf_sfx2/source/doc/sfx2_docfile.cxx
+++ b/binfilter/bf_sfx2/source/doc/sfx2_docfile.cxx
@@ -84,7 +84,6 @@ using namespace ::com::sun::star::io;
#include <bf_svtools/pathoptions.hxx>
#include <bf_svtools/asynclink.hxx>
#include <bf_svtools/inettype.hxx>
-#include <ucbhelper/contentbroker.hxx>
#include <ucbhelper/commandenvironment.hxx>
#include <unotools/localfilehelper.hxx>
#include <unotools/ucbstreamhelper.hxx>
@@ -448,7 +447,7 @@ void SAL_CALL SfxMediumHandler_Impl::handle(
/*N*/ {
/*N*/ try
/*N*/ {
-/*?*/ pImp->aContent = ::ucbhelper::Content( xContent, xEnv );
+/*?*/ pImp->aContent = ::ucbhelper::Content( xContent, xEnv, comphelper::getProcessComponentContext() );
/*N*/ }
/*N*/ catch ( Exception& )
/*N*/ {
@@ -462,7 +461,7 @@ void SAL_CALL SfxMediumHandler_Impl::handle(
/*N*/ else if ( aLogicName.Len() )
/*N*/ aURL = GetURLObject().GetMainURL( INetURLObject::NO_DECODE );
/*N*/ if ( !aURL.isEmpty() )
-/*N*/ ::ucbhelper::Content::create( aURL, xEnv, pImp->aContent );
+/*N*/ ::ucbhelper::Content::create( aURL, xEnv, comphelper::getProcessComponentContext(), pImp->aContent );
/*N*/ }
/*N*/ }
/*N*/
@@ -945,7 +944,7 @@ void SAL_CALL SfxMediumHandler_Impl::handle(
/*N*/
/*N*/ INetURLObject aSource( pImp->pTempFile->GetURL() );
/*N*/ ::ucbhelper::Content aTempCont;
-/*N*/ if( ::ucbhelper::Content::create( aSource.GetMainURL( INetURLObject::NO_DECODE ), xEnv, aTempCont ) )
+/*N*/ if( ::ucbhelper::Content::create( aSource.GetMainURL( INetURLObject::NO_DECODE ), xEnv, comphelper::getProcessComponentContext(), aTempCont ) )
/*N*/ {
/*N*/ try
/*N*/ {
diff --git a/binfilter/bf_sfx2/source/doc/sfx2_objstor.cxx b/binfilter/bf_sfx2/source/doc/sfx2_objstor.cxx
index f68ea4187..c51c90641 100644
--- a/binfilter/bf_sfx2/source/doc/sfx2_objstor.cxx
+++ b/binfilter/bf_sfx2/source/doc/sfx2_objstor.cxx
@@ -435,7 +435,7 @@ sal_False Das Objekt konnte nicht geladen werden
{
try
{
- ::ucbhelper::Content aContent( pMedium->GetName(), ::com::sun::star::uno::Reference < XCommandEnvironment >() );
+ ::ucbhelper::Content aContent( pMedium->GetName(), ::com::sun::star::uno::Reference < XCommandEnvironment >(), comphelper::getProcessComponentContext() );
::com::sun::star::uno::Reference < XPropertySetInfo > xProps = aContent.getProperties();
if ( xProps.is() )
{
@@ -769,7 +769,7 @@ sal_Bool SfxObjectShell::SaveTo_Impl
try
{
- ::ucbhelper::Content aContent( rMedium.GetName(), ::com::sun::star::uno::Reference < XCommandEnvironment >() );
+ ::ucbhelper::Content aContent( rMedium.GetName(), ::com::sun::star::uno::Reference < XCommandEnvironment >(), comphelper::getProcessComponentContext() );
::com::sun::star::uno::Reference < XPropertySetInfo > xProps = aContent.getProperties();
if ( xProps.is() )
{
diff --git a/binfilter/bf_so3/source/copied/staticbaseurl.cxx b/binfilter/bf_so3/source/copied/staticbaseurl.cxx
index 3a6386dcb..7cbb4ac02 100644
--- a/binfilter/bf_so3/source/copied/staticbaseurl.cxx
+++ b/binfilter/bf_so3/source/copied/staticbaseurl.cxx
@@ -25,6 +25,7 @@
#include "com/sun/star/uno/Any.hxx"
#include "com/sun/star/uno/Exception.hpp"
#include "com/sun/star/uno/Reference.hxx"
+#include "comphelper/processfactory.hxx"
#include "rtl/instance.hxx"
#include "rtl/textenc.h"
#include "rtl/ustring.h"
@@ -47,7 +48,8 @@ com::sun::star::uno::Any GetCasePreservedURL(INetURLObject const & aObj) {
ucbhelper::Content aCnt(
aObj.GetMainURL(INetURLObject::NO_DECODE),
com::sun::star::uno::Reference<
- com::sun::star::ucb::XCommandEnvironment >());
+ com::sun::star::ucb::XCommandEnvironment >(),
+ comphelper::getProcessComponentContext());
return aCnt.executeCommand(
rtl::OUString(
RTL_CONSTASCII_USTRINGPARAM("getCasePreservingURL")),
diff --git a/binfilter/bf_so3/source/persist/transuno.cxx b/binfilter/bf_so3/source/persist/transuno.cxx
index e518169af..292ff2679 100644
--- a/binfilter/bf_so3/source/persist/transuno.cxx
+++ b/binfilter/bf_so3/source/persist/transuno.cxx
@@ -27,13 +27,9 @@
#include <com/sun/star/beans/PropertyValue.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-
+#include <com/sun/star/ucb/UniversalContentBroker.hpp>
#include <com/sun/star/ucb/XContent.hpp>
-#include <com/sun/star/ucb/XContentIdentifier.hpp>
-#include <com/sun/star/ucb/XContentIdentifierFactory.hpp>
-#include <com/sun/star/ucb/XContentProvider.hpp>
-#include <com/sun/star/ucb/XContentProviderManager.hpp>
+#include <com/sun/star/ucb/XUniversalContentBroker.hpp>
#include <comphelper/processfactory.hxx>
@@ -51,16 +47,6 @@ using namespace com::sun::star::sdbc;
namespace binfilter {
typedef com::sun::star::lang::XMultiServiceFactory factory_type;
-typedef com::sun::star::uno::XInterface interface_type;
-
-
-/*
- * S2U.
- */
-inline rtl::OUString S2U (const sal_Char *ascii)
-{
- return rtl::OUString::createFromAscii (ascii);
-}
/*========================================================================
*
@@ -83,33 +69,9 @@ SvBindingTransport_Impl::getProcessServiceFactory (void)
com::sun::star::uno::Reference<XContent>
SvBindingTransport_Impl::createContent (const rtl::OUString &rUrl)
{
- com::sun::star::uno::Reference<factory_type>
- xFactory (getProcessServiceFactory(), com::sun::star::uno::UNO_QUERY);
- if (!xFactory.is())
- return com::sun::star::uno::Reference<XContent>();
-
- com::sun::star::uno::Reference<interface_type>
- xBroker (xFactory->createInstance (
- S2U ("com.sun.star.ucb.UniversalContentBroker")));
- if (!xBroker.is())
- return com::sun::star::uno::Reference<XContent>();
-
- com::sun::star::uno::Reference<XContentProvider>
- xProvider (xBroker, com::sun::star::uno::UNO_QUERY);
- if (!xProvider.is())
- return com::sun::star::uno::Reference<XContent>();
-
- com::sun::star::uno::Reference<XContentIdentifierFactory>
- xIdentProv (xProvider, com::sun::star::uno::UNO_QUERY);
- if (!xIdentProv.is())
- return com::sun::star::uno::Reference<XContent>();
-
- com::sun::star::uno::Reference<XContentIdentifier>
- xIdent (xIdentProv->createContentIdentifier (rUrl));
- if (!xIdent.is())
- return com::sun::star::uno::Reference<XContent>();
-
- return xProvider->queryContent (xIdent);
+ com::sun::star::uno::Reference<XUniversalContentBroker>
+ xBroker (UniversalContentBroker::create(comphelper::getProcessComponentContext()));
+ return xBroker->queryContent (xBroker->createContentIdentifier (rUrl));
}
/*
diff --git a/binfilter/bf_svtools/source/filter.vcl/filter/svt_filter.cxx b/binfilter/bf_svtools/source/filter.vcl/filter/svt_filter.cxx
index eaaaa3f94..71dd76469 100644
--- a/binfilter/bf_svtools/source/filter.vcl/filter/svt_filter.cxx
+++ b/binfilter/bf_svtools/source/filter.vcl/filter/svt_filter.cxx
@@ -134,7 +134,8 @@ BOOL ImplDirEntryHelper::Exists( const INetURLObject& rObj )
{
::rtl::OUString aTitle;
::ucbhelper::Content aCnt( rObj.GetMainURL( INetURLObject::NO_DECODE ),
- ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XCommandEnvironment >() );
+ ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XCommandEnvironment >(),
+ comphelper::getProcessComponentContext() );
bExists = aCnt.isDocument();
}
@@ -160,7 +161,8 @@ void ImplDirEntryHelper::Kill( const String& rMainUrl )
try
{
::ucbhelper::Content aCnt( rMainUrl,
- ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XCommandEnvironment >() );
+ ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XCommandEnvironment >(),
+ comphelper::getProcessComponentContext() );
aCnt.executeCommand( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "delete" )),
::com::sun::star::uno::makeAny( sal_Bool( sal_True ) ) );
diff --git a/binfilter/bf_svtools/source/misc/svt_urihelper.cxx b/binfilter/bf_svtools/source/misc/svt_urihelper.cxx
index 38c586c25..df9165028 100644
--- a/binfilter/bf_svtools/source/misc/svt_urihelper.cxx
+++ b/binfilter/bf_svtools/source/misc/svt_urihelper.cxx
@@ -51,7 +51,6 @@
#include "sal/types.h"
#include <tools/debug.hxx>
#include <tools/inetmime.hxx>
-#include <ucbhelper/contentbroker.hxx>
#include <unotools/charclass.hxx>
#include "rtl/instance.hxx"
diff --git a/binfilter/bf_svtools/source/misc1/svt_fstathelper.cxx b/binfilter/bf_svtools/source/misc1/svt_fstathelper.cxx
index 971045453..effb15278 100644
--- a/binfilter/bf_svtools/source/misc1/svt_fstathelper.cxx
+++ b/binfilter/bf_svtools/source/misc1/svt_fstathelper.cxx
@@ -17,6 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <comphelper/processfactory.hxx>
#include <tools/date.hxx>
#include <tools/time.hxx>
#include <bf_tools/string.hxx>
@@ -41,7 +42,8 @@ sal_Bool GetModifiedDateTimeOfFile( const UniString& rURL,
try
{
::ucbhelper::Content aTestContent( rURL,
- uno::Reference< XCommandEnvironment > ());
+ uno::Reference< XCommandEnvironment > (),
+ comphelper::getProcessComponentContext());
uno::Any aAny = aTestContent.getPropertyValue(
OUString( RTL_CONSTASCII_USTRINGPARAM( "DateModified" )) );
if( aAny.hasValue() )
@@ -68,7 +70,8 @@ sal_Bool IsDocument( const UniString& rURL )
try
{
::ucbhelper::Content aTestContent( rURL,
- uno::Reference< XCommandEnvironment > ());
+ uno::Reference< XCommandEnvironment > (),
+ comphelper::getProcessComponentContext());
bExist = aTestContent.isDocument();
}
catch(...)
diff --git a/binfilter/bf_sw/source/core/unocore/sw_swunohelper.cxx b/binfilter/bf_sw/source/core/unocore/sw_swunohelper.cxx
index a02cde5bf..ae136c057 100644
--- a/binfilter/bf_sw/source/core/unocore/sw_swunohelper.cxx
+++ b/binfilter/bf_sw/source/core/unocore/sw_swunohelper.cxx
@@ -40,9 +40,6 @@
#include <tools/urlobj.hxx>
#include <tools/datetime.hxx>
#include <tools/debug.hxx>
-#include <ucbhelper/contentidentifier.hxx>
-#include <ucbhelper/contentbroker.hxx>
-#include <ucbhelper/content.hxx>
#include <bf_svtools/svstdarr.hxx>
#include <swunohelper.hxx>