diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2012-09-14 18:08:57 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2012-09-14 18:24:49 +0200 |
commit | 9ac86f484b0c278aafbce685ed19d3ea005ee8f8 (patch) | |
tree | cf2fe16d76992bcbd1bd89a8693c5f4996cd55f2 /test | |
parent | fdo#46808, Adapt ucb::UniversalContentBroker UNO service to new style (diff) | |
download | core-9ac86f484b0c278aafbce685ed19d3ea005ee8f8.tar.gz core-9ac86f484b0c278aafbce685ed19d3ea005ee8f8.zip |
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 'test')
-rw-r--r-- | test/Library_subsequenttest.mk | 1 | ||||
-rw-r--r-- | test/Library_test.mk | 1 | ||||
-rw-r--r-- | test/source/bootstrapfixture.cxx | 32 |
3 files changed, 15 insertions, 19 deletions
diff --git a/test/Library_subsequenttest.mk b/test/Library_subsequenttest.mk index b829dd46d7c5..ead6af3adad1 100644 --- a/test/Library_subsequenttest.mk +++ b/test/Library_subsequenttest.mk @@ -42,7 +42,6 @@ $(eval $(call gb_Library_use_libraries,subsequenttest,\ test \ tl \ utl \ - ucbhelper \ unotest \ vcl \ $(gb_STDLIBS) \ diff --git a/test/Library_test.mk b/test/Library_test.mk index 48ca6b01262b..cea736feffa1 100644 --- a/test/Library_test.mk +++ b/test/Library_test.mk @@ -48,7 +48,6 @@ $(eval $(call gb_Library_use_libraries,test,\ svt \ tl \ utl \ - ucbhelper \ unotest \ vcl \ $(gb_STDLIBS) \ diff --git a/test/source/bootstrapfixture.cxx b/test/source/bootstrapfixture.cxx index b560913699be..2b68451d1ae6 100644 --- a/test/source/bootstrapfixture.cxx +++ b/test/source/bootstrapfixture.cxx @@ -31,13 +31,14 @@ #include <rtl/strbuf.hxx> #include <rtl/bootstrap.hxx> #include <cppuhelper/bootstrap.hxx> -#include <ucbhelper/contentbroker.hxx> #include <comphelper/processfactory.hxx> #include <i18npool/mslangid.hxx> #include <com/sun/star/lang/Locale.hpp> #include <com/sun/star/lang/XComponent.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> +#include <com/sun/star/ucb/XContentProvider.hpp> +#include <com/sun/star/ucb/XUniversalContentBroker.hpp> #include <vcl/svapp.hxx> #include <tools/resmgr.hxx> @@ -77,21 +78,6 @@ void test::BootstrapFixture::setUp() lang::Locale aLocale(aLang, aCountry, OUString()); ResMgr::SetDefaultLocale( aLocale ); - if (m_bNeedUCB) - { - // initialise UCB-Broker - uno::Sequence<uno::Any> aUcbInitSequence(2); - aUcbInitSequence[0] <<= OUString("Local"); - aUcbInitSequence[1] <<= OUString("Office"); - bool bInitUcb = ucbhelper::ContentBroker::initialize(m_xSFactory, aUcbInitSequence); - CPPUNIT_ASSERT_MESSAGE("Should be able to initialize UCB", bInitUcb); - - uno::Reference<ucb::XContentProviderManager> xUcb = - ucbhelper::ContentBroker::get()->getContentProviderManagerInterface(); - uno::Reference<ucb::XContentProvider> xFileProvider(m_xSFactory->createInstance("com.sun.star.ucb.FileContentProvider"), uno::UNO_QUERY); - xUcb->registerContentProvider(xFileProvider, "file", sal_True); - } - SvtSysLocaleOptions aLocalOptions; OUString aLangISO = MsLangId::convertLanguageToIsoString( LANGUAGE_ENGLISH_US ); aLocalOptions.SetLocaleConfigString( aLangISO ); @@ -106,11 +92,23 @@ void test::BootstrapFixture::setUp() // Make GraphicConverter work, normally done in desktop::Desktop::Main() Application::SetFilterHdl( LINK( this, test::BootstrapFixture, ImplInitFilterHdl ) ); + + if (m_bNeedUCB) + { + // initialise unconfigured UCB: + uno::Reference<ucb::XUniversalContentBroker> xUcb(m_xSFactory->createInstance("com.sun.star.ucb.UniversalContentBroker"), uno::UNO_QUERY_THROW); + uno::Reference<ucb::XContentProvider> xFileProvider(m_xSFactory->createInstance("com.sun.star.ucb.FileContentProvider"), uno::UNO_QUERY_THROW); + xUcb->registerContentProvider(xFileProvider, "file", sal_True); + uno::Reference<ucb::XContentProvider> xTdocProvider(m_xSFactory->createInstance("com.sun.star.ucb.TransientDocumentsContentProvider"), uno::UNO_QUERY); + if (xTdocProvider.is()) + { + xUcb->registerContentProvider(xTdocProvider, "vnd.sun.star.tdoc", sal_True); + } + } } void test::BootstrapFixture::tearDown() { - ucbhelper::ContentBroker::deinitialize(); test::BootstrapFixtureBase::tearDown(); } |