summaryrefslogtreecommitdiff
path: root/desktop/source/pkgchk
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 /desktop/source/pkgchk
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 'desktop/source/pkgchk')
-rw-r--r--desktop/source/pkgchk/unopkg/unopkg_misc.cxx14
-rw-r--r--desktop/source/pkgchk/unopkg/unopkg_shared.h14
2 files changed, 5 insertions, 23 deletions
diff --git a/desktop/source/pkgchk/unopkg/unopkg_misc.cxx b/desktop/source/pkgchk/unopkg/unopkg_misc.cxx
index 52b4ab884a1b..a034828646be 100644
--- a/desktop/source/pkgchk/unopkg/unopkg_misc.cxx
+++ b/desktop/source/pkgchk/unopkg/unopkg_misc.cxx
@@ -41,11 +41,10 @@
#include "osl/file.hxx"
#include "osl/thread.hxx"
#include "tools/getprocessworkingdir.hxx"
-#include "ucbhelper/contentbroker.hxx"
-#include "ucbhelper/configurationkeys.hxx"
#include "comphelper/processfactory.hxx"
#include "unotools/configmgr.hxx"
#include "com/sun/star/lang/XMultiServiceFactory.hpp"
+#include "com/sun/star/ucb/UniversalContentBroker.hpp"
#include "cppuhelper/bootstrap.hxx"
#include "comphelper/sequence.hxx"
#include <stdio.h>
@@ -384,15 +383,10 @@ Reference<XComponentContext> bootstrapStandAlone(
// set global process service factory used by unotools config helpers
::comphelper::setProcessServiceFactory( xServiceManager );
- // initialize the ucbhelper ucb,
- // because the package implementation uses it
- Sequence<Any> ucb_args( 2 );
- ucb_args[ 0 ] <<= OUSTR(UCB_CONFIGURATION_KEY1_LOCAL);
- ucb_args[ 1 ] <<= OUSTR(UCB_CONFIGURATION_KEY2_OFFICE);
- if (! ::ucbhelper::ContentBroker::initialize( xServiceManager, ucb_args ))
- throw RuntimeException( OUSTR("cannot initialize UCB!"), 0 );
+ // Initialize the UCB (for backwards compatibility, in case some code still
+ // uses plain createInstance w/o args directly to obtain an instance):
+ UniversalContentBroker::create( xContext );
- disposeGuard.setDeinitUCB();
return xContext;
}
diff --git a/desktop/source/pkgchk/unopkg/unopkg_shared.h b/desktop/source/pkgchk/unopkg/unopkg_shared.h
index 400e2835199e..c8cdc3c51a78 100644
--- a/desktop/source/pkgchk/unopkg/unopkg_shared.h
+++ b/desktop/source/pkgchk/unopkg/unopkg_shared.h
@@ -35,8 +35,6 @@
#include "tools/resmgr.hxx"
#include "rtl/ustring.hxx"
#include "unotools/configmgr.hxx"
-#include "ucbhelper/contentbroker.hxx"
-
#define APP_NAME "unopkg"
@@ -126,14 +124,10 @@ bool isBootstrapVariable(sal_uInt32 * pIndex);
class DisposeGuard
{
css::uno::Reference<css::lang::XComponent> m_xComp;
- bool m_bDeinitUCB;
+
public:
- DisposeGuard(): m_bDeinitUCB(false) {}
inline ~DisposeGuard()
{
- if (m_bDeinitUCB)
- ::ucbhelper::ContentBroker::deinitialize();
-
if (m_xComp.is())
m_xComp->dispose();
}
@@ -143,12 +137,6 @@ public:
{
m_xComp = xComp;
}
-
- inline void setDeinitUCB()
- {
- m_bDeinitUCB = true;
- }
-
};
//==============================================================================