diff options
author | Andras Timar <atimar@suse.com> | 2012-11-11 18:24:14 +0100 |
---|---|---|
committer | Andras Timar <atimar@suse.com> | 2012-11-11 18:24:14 +0100 |
commit | 06ec1c089519ef3249464aa09eadf03a8db93a39 (patch) | |
tree | 85b2eb6d8ba6ca95e18e1ff82151224cb14106f6 /desktop | |
parent | 8e0d67bed54633d555a4601a5d79e2d5ba7ab2bb (diff) | |
parent | 3f899eae02eaad0b967de749fe09b869ba93ad6d (diff) |
Merge branch 'master' into feature/killsdf
Conflicts:
Repository.mk
RepositoryFixes.mk
connectivity/prj/build.lst
extensions/prj/build.lst
filter/prj/build.lst
fpicker/prj/build.lst
l10ntools/StaticLibrary_transex.mk
saxon/build.xml
shell/prj/build.lst
solenv/gbuild/AllLangResTarget.mk
solenv/gbuild/Configuration.mk
solenv/gbuild/UI.mk
ucb/source/ucp/webdav/webdavcontent.cxx
Diffstat (limited to 'desktop')
19 files changed, 136 insertions, 164 deletions
diff --git a/desktop/scripts/soffice.sh b/desktop/scripts/soffice.sh index 7727206c2a2b..9afcfdf4fcf0 100755 --- a/desktop/scripts/soffice.sh +++ b/desktop/scripts/soffice.sh @@ -155,7 +155,7 @@ fi # valgrind --log-file=valgrind.log does not work well with --trace-children=yes if [ -n "$VALGRINDCHECK" -a -z "$VALGRIND" ] ; then echo "redirecting the standard and the error output to valgrind.log" - exec &>valgrind.log + exec > valgrind.log 2>&1 fi # oosplash does the rest: forcing pages in, javaldx etc. are diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index cff9f8ed65e6..400da64ad8fc 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -43,6 +43,7 @@ #include "migration.hxx" #include <svtools/javacontext.hxx> +#include <com/sun/star/frame/AutoRecovery.hpp> #include <com/sun/star/frame/GlobalEventBroadcaster.hpp> #include <com/sun/star/frame/XSessionManagerListener.hpp> #include <com/sun/star/frame/XSynchronousDispatch.hpp> @@ -65,7 +66,7 @@ #include <com/sun/star/configuration/InstallationIncompleteException.hpp> #include <com/sun/star/configuration/backend/BackendSetupException.hpp> #include <com/sun/star/configuration/backend/BackendAccessException.hpp> -#include <com/sun/star/task/XJobExecutor.hpp> +#include <com/sun/star/task/JobExecutor.hpp> #include <com/sun/star/task/XRestartManager.hpp> #include <com/sun/star/document/XEventListener.hpp> #include <com/sun/star/frame/UICommandDescription.hpp> @@ -2357,11 +2358,8 @@ void Desktop::OpenClients() { try { - Reference< XDispatch > xRecovery( - ::comphelper::getProcessServiceFactory()->createInstance( OUString("com.sun.star.frame.AutoRecovery") ), - ::com::sun::star::uno::UNO_QUERY_THROW ); - - Reference< css::util::XURLTransformer > xParser( css::util::URLTransformer::create(::comphelper::getProcessComponentContext()) ); + Reference< XDispatch > xRecovery = css::frame::AutoRecovery::create( ::comphelper::getProcessComponentContext() ); + Reference< css::util::XURLTransformer > xParser = css::util::URLTransformer::create( ::comphelper::getProcessComponentContext() ); css::util::URL aCmd; aCmd.Complete = ::rtl::OUString("vnd.sun.star.autorecovery:/disableRecovery"); @@ -2895,9 +2893,8 @@ void Desktop::DoFirstRunInitializations() { try { - Reference< XJobExecutor > xExecutor( ::comphelper::getProcessServiceFactory()->createInstance( ::rtl::OUString("com.sun.star.task.JobExecutor") ), UNO_QUERY ); - if( xExecutor.is() ) - xExecutor->trigger( ::rtl::OUString("onFirstRunInitialization") ); + Reference< XJobExecutor > xExecutor = JobExecutor::create( ::comphelper::getProcessComponentContext() ); + xExecutor->trigger( ::rtl::OUString("onFirstRunInitialization") ); } catch(const ::com::sun::star::uno::Exception&) { diff --git a/desktop/source/app/main.c b/desktop/source/app/main.c index c18fabd158d2..e358a38662d8 100644 --- a/desktop/source/app/main.c +++ b/desktop/source/app/main.c @@ -21,22 +21,38 @@ #include "sofficemain.h" -SAL_IMPLEMENT_MAIN() { - return soffice_main(); -} - #ifdef DBG_UTIL #ifdef __gnu_linux__ #include <stdio.h> #include <stdlib.h> +static int g_Exiting = 0; + /* HACK: detect calls to xmlCleanupParser, which causes hard to debug crashes */ __attribute__ ((visibility("default"))) void xmlCleanupParser(void) { - fprintf(stderr, "\n*** ERROR: DO NOT call xmlCleanupParser()\n\n"); - abort(); + /* there are libraries that register xmlCleanupParser as an atexit handler, + which is not entirely sound (another atexit handler could want to + use libxml), but not enough of a problem to complain. + (example found by llunak: KDE's Strigi library) */ + if (!g_Exiting) + { + fprintf(stderr, "\n*** ERROR: DO NOT call xmlCleanupParser()\n\n"); + abort(); + } } #endif #endif +SAL_IMPLEMENT_MAIN() { + int ret = soffice_main(); +#ifdef DBG_UTIL +#ifdef __gnu_linux__ + g_Exiting = 1; +#endif +#endif + return ret; +} + + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/desktop/source/deployment/dp_persmap.cxx b/desktop/source/deployment/dp_persmap.cxx index fb7aecad00ba..047ad5331e6c 100644 --- a/desktop/source/deployment/dp_persmap.cxx +++ b/desktop/source/deployment/dp_persmap.cxx @@ -122,6 +122,14 @@ bool PersistentMap::has( OString const & key ) const return get( 0, key ); } +// for 3 functions here MSVC gives C4702 "unreachable code" if optimization +// is enabled and return is there and C4715 "not all control paths return +// a value" if optimization disabled and no return... +#ifdef _MSC_VER +#pragma warning( push ) +#pragma warning( disable: 4702 ) +#endif + //______________________________________________________________________________ bool PersistentMap::get( OString * value, OString const & key ) const { @@ -144,9 +152,7 @@ bool PersistentMap::get( OString * value, OString const & key ) const catch (DbException & exc) { throw_rtexc( exc.get_errno(), exc.what() ); } -#ifndef _MSC_VER return false; // avoiding warning -#endif } //______________________________________________________________________________ @@ -194,9 +200,7 @@ bool PersistentMap::erase( OString const & key, bool flush_immediately ) catch (DbException & exc) { throw_rtexc( exc.get_errno(), exc.what() ); } -#ifndef _MSC_VER return false; // avoiding warning -#endif } //______________________________________________________________________________ @@ -235,11 +239,13 @@ t_string2string_map PersistentMap::getEntries() const catch (DbException & exc) { throw_rtexc( exc.get_errno(), exc.what() ); } -#ifndef _MSC_VER return t_string2string_map(); // avoiding warning -#endif } +#ifdef _MSC_VER +#pragma warning( pop ) +#endif + } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/desktop/source/deployment/gui/dp_gui_service.cxx b/desktop/source/deployment/gui/dp_gui_service.cxx index 71c6ccd74ff4..6f067b9ba829 100644 --- a/desktop/source/deployment/gui/dp_gui_service.cxx +++ b/desktop/source/deployment/gui/dp_gui_service.cxx @@ -33,6 +33,7 @@ #include "cppuhelper/implbase2.hxx" #include "cppuhelper/implementationentry.hxx" #include "unotools/configmgr.hxx" +#include "comphelper/processfactory.hxx" #include "comphelper/servicedecl.hxx" #include "comphelper/unwrapargs.hxx" #include <i18npool/mslangid.hxx> @@ -66,6 +67,7 @@ public: // Application virtual int Main(); + virtual void DeInit(); }; //______________________________________________________________________________ @@ -84,6 +86,15 @@ int MyApp::Main() return EXIT_SUCCESS; } +void MyApp::DeInit() +{ + css::uno::Reference< css::uno::XComponentContext > context( + comphelper::getProcessComponentContext()); + dp_misc::disposeBridges(context); + css::uno::Reference< css::lang::XComponent >( + context, css::uno::UNO_QUERY_THROW)->dispose(); + comphelper::setProcessServiceFactory(0); +} namespace { @@ -233,9 +244,7 @@ void ServiceImpl::startExecuteModal( if (! bOfficePipePresent) { OSL_ASSERT( ! bAppUp ); app.reset( new MyApp ); - if (! InitVCL( Reference<lang::XMultiServiceFactory>( - m_xComponentContext->getServiceManager(), - UNO_QUERY_THROW ) )) + if (! InitVCL() ) throw RuntimeException( OUSTR("Cannot initialize VCL!"), static_cast<OWeakObject *>(this) ); AllSettings as = app->GetSettings(); diff --git a/desktop/source/deployment/gui/dp_gui_updatedialog.cxx b/desktop/source/deployment/gui/dp_gui_updatedialog.cxx index 0b6a8df76fde..129663a28dec 100644 --- a/desktop/source/deployment/gui/dp_gui_updatedialog.cxx +++ b/desktop/source/deployment/gui/dp_gui_updatedialog.cxx @@ -42,7 +42,7 @@ #include "com/sun/star/awt/WindowAttribute.hpp" #include "com/sun/star/awt/WindowClass.hpp" #include "com/sun/star/awt/WindowDescriptor.hpp" -#include "com/sun/star/awt/XToolkit.hpp" +#include "com/sun/star/awt/Toolkit.hpp" #include "com/sun/star/awt/XWindow.hpp" #include "com/sun/star/awt/XWindowPeer.hpp" #include "com/sun/star/beans/NamedValue.hpp" @@ -554,17 +554,9 @@ UpdateDialog::UpdateDialog( m_xExtensionManager = deployment::ExtensionManager::get( context ); - uno::Reference< awt::XToolkit > toolkit; + uno::Reference< awt::XToolkit2 > toolkit; try { - toolkit = uno::Reference< awt::XToolkit >( - (uno::Reference< lang::XMultiComponentFactory >( - m_context->getServiceManager(), - uno::UNO_QUERY_THROW)-> - createInstanceWithContext( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.Toolkit")), - m_context)), - uno::UNO_QUERY_THROW); + toolkit = awt::Toolkit::create(m_context); } catch (const uno::RuntimeException &) { throw; } catch (const uno::Exception & e) { @@ -662,7 +654,7 @@ void UpdateDialog::CheckListBox::KeyInput(KeyEvent const & event) { //------------------------------------------------------------------------------ void UpdateDialog::CheckListBox::handlePopupMenu( const Point &rPos ) { - SvListEntry *pData = GetEntry( rPos ); + SvTreeListEntry *pData = GetEntry( rPos ); if ( pData ) { diff --git a/desktop/source/deployment/inc/dp_misc.h b/desktop/source/deployment/inc/dp_misc.h index 248b81f69805..cf17cb529578 100644 --- a/desktop/source/deployment/inc/dp_misc.h +++ b/desktop/source/deployment/inc/dp_misc.h @@ -159,6 +159,14 @@ void syncRepositories( ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XCommandEnvironment> const & xCmdEnv); +/** workaround: for some reason the bridge threads which communicate with the + uno.exe process are not released on time +*/ +DESKTOP_DEPLOYMENTMISC_DLLPUBLIC +void disposeBridges( + com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > + const & ctx); + } #endif diff --git a/desktop/source/deployment/manager/dp_extensionmanager.cxx b/desktop/source/deployment/manager/dp_extensionmanager.cxx index de78275bb205..4ba55848494d 100644 --- a/desktop/source/deployment/manager/dp_extensionmanager.cxx +++ b/desktop/source/deployment/manager/dp_extensionmanager.cxx @@ -655,8 +655,22 @@ Reference<deploy::XPackage> ExtensionManager::addExtension( //would remove the first one. ::osl::MutexGuard addGuard(m_addMutex); - Reference<deploy::XPackage> xTmpExtension = - getTempExtension(url, xAbortChannel, xCmdEnv); + Reference<deploy::XPackageManager> xTmpRepository(getTmpRepository()); + // make sure xTmpRepository is alive as long as xTmpExtension is; as + // the "tmp" manager is only held weakly by m_xPackageManagerFactory, it + // could otherwise be disposed early, which would in turn dispose + // xTmpExtension's PackageRegistryBackend behind its back + Reference<deploy::XPackage> xTmpExtension( + xTmpRepository->addPackage( + url, uno::Sequence<beans::NamedValue>(), OUString(), xAbortChannel, + new TmpRepositoryCommandEnv())); + if (!xTmpExtension.is()) { + throw deploy::DeploymentException( + ("Extension Manager: Failed to create temporary XPackage for url: " + + url), + static_cast<OWeakObject*>(this), uno::Any()); + } + //Make sure the extension is removed from the tmp repository in case //of an exception ExtensionRemoveGuard tmpExtensionRemoveGuard(xTmpExtension, getTmpRepository()); @@ -1404,25 +1418,6 @@ void ExtensionManager::checkUpdate( static_cast<OWeakObject *>(this), request ); } -Reference<deploy::XPackage> ExtensionManager::getTempExtension( - OUString const & url, - Reference<task::XAbortChannel> const & xAbortChannel, - Reference<ucb::XCommandEnvironment> const & /*xCmdEnv*/) - -{ - Reference<ucb::XCommandEnvironment> tmpCmdEnvA(new TmpRepositoryCommandEnv()); - Reference<deploy::XPackage> xTmpPackage = getTmpRepository()->addPackage( - url, uno::Sequence<beans::NamedValue>(),OUString(), xAbortChannel, tmpCmdEnvA); - if (!xTmpPackage.is()) - { - throw deploy::DeploymentException( - OUSTR("Extension Manager: Failed to create temporary XPackage for url: ") + url, - static_cast<OWeakObject*>(this), uno::Any()); - - } - return xTmpPackage; -} - uno::Sequence<Reference<deploy::XPackage> > SAL_CALL ExtensionManager::getExtensionsWithUnacceptedLicenses( OUString const & repository, diff --git a/desktop/source/deployment/manager/dp_extensionmanager.hxx b/desktop/source/deployment/manager/dp_extensionmanager.hxx index c8d8b300da60..584f01ce07c1 100644 --- a/desktop/source/deployment/manager/dp_extensionmanager.hxx +++ b/desktop/source/deployment/manager/dp_extensionmanager.hxx @@ -280,11 +280,6 @@ private: css::uno::Reference<css::deployment::XPackage> const & oldExtension, css::uno::Reference<css::ucb::XCommandEnvironment> const & xCmdEnv); - css::uno::Reference<css::deployment::XPackage> getTempExtension( - ::rtl::OUString const & url, - css::uno::Reference<css::task::XAbortChannel> const & xAbortChannel, - css::uno::Reference<css::ucb::XCommandEnvironment> const & xCmdEnv); - void addExtensionsToMap( id2extensions & mapExt, css::uno::Sequence<css::uno::Reference<css::deployment::XPackage> > const & seqExt, diff --git a/desktop/source/deployment/manager/dp_manager.cxx b/desktop/source/deployment/manager/dp_manager.cxx index 894999efe105..bedc5013933c 100644 --- a/desktop/source/deployment/manager/dp_manager.cxx +++ b/desktop/source/deployment/manager/dp_manager.cxx @@ -436,15 +436,12 @@ Reference<deployment::XPackageManager> PackageManagerImpl::create( catch (const RuntimeException &) { throw; } - catch (const Exception &) { + catch (const Exception & e) { Any exc( ::cppu::getCaughtException() ); - ::rtl::OUStringBuffer buf; - buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("[context=\"") ); - buf.append( context ); - buf.appendAscii( RTL_CONSTASCII_STRINGPARAM( - "\"] caught unexpected exception!") ); throw lang::WrappedTargetRuntimeException( - buf.makeStringAndClear(), Reference<XInterface>(), exc ); + ("[context=\"" + context + "\"] caught unexpected " + + exc.getValueType().getTypeName() + ": " + e.Message), + Reference<XInterface>(), exc ); } } diff --git a/desktop/source/deployment/misc/dp_misc.cxx b/desktop/source/deployment/misc/dp_misc.cxx index 31cb38c2f4ed..55d372431ef9 100644 --- a/desktop/source/deployment/misc/dp_misc.cxx +++ b/desktop/source/deployment/misc/dp_misc.cxx @@ -41,6 +41,7 @@ #include "osl/mutex.hxx" #include "com/sun/star/ucb/CommandAbortedException.hpp" #include "com/sun/star/task/XInteractionHandler.hpp" +#include "com/sun/star/bridge/BridgeFactory.hpp" #include "com/sun/star/bridge/UnoUrlResolver.hpp" #include "com/sun/star/bridge/XUnoUrlResolver.hpp" #include "com/sun/star/deployment/ExtensionManager.hpp" @@ -586,7 +587,28 @@ void syncRepositories( } } +void disposeBridges(Reference<css::uno::XComponentContext> const & ctx) +{ + if (!ctx.is()) + return; + Reference<css::bridge::XBridgeFactory2> bridgeFac( css::bridge::BridgeFactory::create(ctx) ); + + const Sequence< Reference<css::bridge::XBridge> >seqBridges = bridgeFac->getExistingBridges(); + for (sal_Int32 i = 0; i < seqBridges.getLength(); i++) + { + Reference<css::lang::XComponent> comp(seqBridges[i], UNO_QUERY); + if (comp.is()) + { + try { + comp->dispose(); + } + catch ( const css::lang::DisposedException& ) + { + } + } + } +} } diff --git a/desktop/source/deployment/registry/dp_backend.cxx b/desktop/source/deployment/registry/dp_backend.cxx index 57703d5d3986..ad6c2a83263c 100644 --- a/desktop/source/deployment/registry/dp_backend.cxx +++ b/desktop/source/deployment/registry/dp_backend.cxx @@ -26,6 +26,9 @@ * ************************************************************************/ +#include "sal/config.h" + +#include <cassert> #include "dp_backend.h" #include "dp_ucb.h" @@ -85,6 +88,7 @@ PackageRegistryBackend::PackageRegistryBackend( m_eContext( CONTEXT_UNKNOWN ), m_readOnly( false ) { + assert(xContext.is()); boost::optional<OUString> cachePath; boost::optional<bool> readOnly; comphelper::unwrapArgs( args, m_context, cachePath, readOnly ); diff --git a/desktop/source/deployment/registry/package/dp_package.cxx b/desktop/source/deployment/registry/package/dp_package.cxx index cd1fd3066c42..d41ed12d2511 100644 --- a/desktop/source/deployment/registry/package/dp_package.cxx +++ b/desktop/source/deployment/registry/package/dp_package.cxx @@ -61,8 +61,8 @@ #include "com/sun/star/ucb/UnsupportedCommandException.hpp" #include "com/sun/star/sdbc/XResultSet.hpp" #include "com/sun/star/sdbc/XRow.hpp" -#include "com/sun/star/packages/manifest/XManifestReader.hpp" -#include "com/sun/star/packages/manifest/XManifestWriter.hpp" +#include "com/sun/star/packages/manifest/ManifestReader.hpp" +#include "com/sun/star/packages/manifest/ManifestWriter.hpp" #include "com/sun/star/deployment/DependencyException.hpp" #include "com/sun/star/deployment/LicenseException.hpp" #include "com/sun/star/deployment/PlatformException.hpp" @@ -1185,10 +1185,8 @@ void BackendImpl::PackageImpl::exportTo( // write into pipe: Reference<XComponentContext> xContext( getMyBackend()->getComponentContext() ); - Reference<packages::manifest::XManifestWriter> xManifestWriter( - xContext->getServiceManager()->createInstanceWithContext( - OUSTR("com.sun.star.packages.manifest.ManifestWriter"), - xContext ), UNO_QUERY_THROW ); + Reference<packages::manifest::XManifestWriter> xManifestWriter = + packages::manifest::ManifestWriter::create( xContext ); Reference<io::XOutputStream> xPipe( io::Pipe::create(xContext), UNO_QUERY_THROW ); xManifestWriter->writeManifestSequence( xPipe, comphelper::containerToSequence(manifest) ); @@ -1445,10 +1443,8 @@ void BackendImpl::PackageImpl::scanBundle( const Reference<XComponentContext> xContext( getMyBackend()->getComponentContext() ); - Reference<packages::manifest::XManifestReader> xManifestReader( - xContext->getServiceManager()->createInstanceWithContext( - OUSTR("com.sun.star.packages.manifest.ManifestReader"), - xContext ), UNO_QUERY_THROW ); + Reference<packages::manifest::XManifestReader> xManifestReader = + packages::manifest::ManifestReader::create( xContext ); const Sequence< Sequence<beans::PropertyValue> > manifestSeq( xManifestReader->readManifestSequence( manifestContent.openStream() ) ); const OUString packageRootURL( getURL() ); diff --git a/desktop/source/pkgchk/unopkg/unopkg_app.cxx b/desktop/source/pkgchk/unopkg/unopkg_app.cxx index c3387f0ec0a5..db3f65895383 100644 --- a/desktop/source/pkgchk/unopkg/unopkg_app.cxx +++ b/desktop/source/pkgchk/unopkg/unopkg_app.cxx @@ -48,11 +48,9 @@ #include "com/sun/star/deployment/ui/PackageManagerDialog.hpp" #include "com/sun/star/ui/dialogs/XExecutableDialog.hpp" -#include "com/sun/star/lang/DisposedException.hpp" #include "boost/scoped_array.hpp" #include "com/sun/star/ui/dialogs/XDialogClosedListener.hpp" #include "com/sun/star/bridge/BridgeFactory.hpp" -#include "com/sun/star/bridge/XBridgeFactory.hpp" #include <stdio.h> #include <vector> @@ -190,36 +188,9 @@ Reference<deployment::XPackage> findPackage( } // anon namespace - -//workaround for some reason the bridge threads which communicate with the uno.exe -//process are not releases on time -void disposeBridges(Reference<css::uno::XComponentContext> ctx) -{ - if (!ctx.is()) - return; - - Reference<css::bridge::XBridgeFactory2> bridgeFac( css::bridge::BridgeFactory::create(ctx) ); - - const Sequence< Reference<css::bridge::XBridge> >seqBridges = bridgeFac->getExistingBridges(); - for (sal_Int32 i = 0; i < seqBridges.getLength(); i++) - { - Reference<css::lang::XComponent> comp(seqBridges[i], UNO_QUERY); - if (comp.is()) - { - try { - comp->dispose(); - } - catch ( const css::lang::DisposedException& ) - { - } - } - } -} - extern "C" DESKTOP_DLLPUBLIC int unopkg_main() { tools::extendApplicationEnvironment(); - DisposeGuard disposeGuard; bool bNoOtherErrorMsg = false; OUString subCommand; bool option_shared = false; @@ -371,8 +342,7 @@ extern "C" DESKTOP_DLLPUBLIC int unopkg_main() } xComponentContext = getUNO( - disposeGuard, option_verbose, option_shared, subcmd_gui, - xLocalComponentContext ); + option_verbose, option_shared, subcmd_gui, xLocalComponentContext ); Reference<deployment::XExtensionManager> xExtensionManager( deployment::ExtensionManager::get( xComponentContext ) ); @@ -575,6 +545,7 @@ extern "C" DESKTOP_DLLPUBLIC int unopkg_main() xDialog->startExecuteModal(xListener); dialogEnded.wait(); + return 0; } else { @@ -591,7 +562,7 @@ extern "C" DESKTOP_DLLPUBLIC int unopkg_main() if (option_verbose) dp_misc::writeConsole(OUSTR("\n" APP_NAME " done.\n")); //Force to release all bridges which connect us to the child processes - disposeBridges(xLocalComponentContext); + dp_misc::disposeBridges(xLocalComponentContext); return 0; } catch (const ucb::CommandFailedException &e) @@ -640,7 +611,7 @@ extern "C" DESKTOP_DLLPUBLIC int unopkg_main() } if (!bNoOtherErrorMsg) dp_misc::writeConsoleError("\n" APP_NAME " failed.\n"); - disposeBridges(xLocalComponentContext); + dp_misc::disposeBridges(xLocalComponentContext); return 1; } diff --git a/desktop/source/pkgchk/unopkg/unopkg_misc.cxx b/desktop/source/pkgchk/unopkg/unopkg_misc.cxx index a034828646be..7a6c899c6ed2 100644 --- a/desktop/source/pkgchk/unopkg/unopkg_misc.cxx +++ b/desktop/source/pkgchk/unopkg/unopkg_misc.cxx @@ -368,16 +368,11 @@ void printf_packages( namespace { //------------------------------------------------------------------------------ -Reference<XComponentContext> bootstrapStandAlone( - DisposeGuard & disposeGuard, bool /*verbose */) +Reference<XComponentContext> bootstrapStandAlone() { Reference<XComponentContext> xContext = ::cppu::defaultBootstrap_InitialComponentContext(); - // assure disposing of local component context: - disposeGuard.reset( - Reference<lang::XComponent>( xContext, UNO_QUERY ) ); - Reference<lang::XMultiServiceFactory> xServiceManager( xContext->getServiceManager(), UNO_QUERY_THROW ); // set global process service factory used by unotools config helpers @@ -462,7 +457,7 @@ OUString getLockFilePath() } //============================================================================== Reference<XComponentContext> getUNO( - DisposeGuard & disposeGuard, bool verbose, bool shared, bool bGui, + bool verbose, bool shared, bool bGui, Reference<XComponentContext> & out_localContext) { // do not create any user data (for the root user) in --shared mode: @@ -474,8 +469,7 @@ Reference<XComponentContext> getUNO( // hold lock during process runtime: static ::desktop::Lockfile s_lockfile( false /* no IPC server */ ); - Reference<XComponentContext> xComponentContext( - bootstrapStandAlone( disposeGuard, verbose ) ); + Reference<XComponentContext> xComponentContext( bootstrapStandAlone() ); out_localContext = xComponentContext; if (::dp_misc::office_is_running()) { xComponentContext.set( @@ -496,9 +490,7 @@ Reference<XComponentContext> getUNO( { //We show a message box or print to the console that there //is another instance already running - if ( ! InitVCL( Reference<lang::XMultiServiceFactory>( - xComponentContext->getServiceManager(), - UNO_QUERY_THROW ) )) + if ( ! InitVCL() ) throw RuntimeException( OUSTR("Cannot initialize VCL!"), NULL ); { diff --git a/desktop/source/pkgchk/unopkg/unopkg_shared.h b/desktop/source/pkgchk/unopkg/unopkg_shared.h index c8cdc3c51a78..adc6e8b66d87 100644 --- a/desktop/source/pkgchk/unopkg/unopkg_shared.h +++ b/desktop/source/pkgchk/unopkg/unopkg_shared.h @@ -28,7 +28,6 @@ #include "dp_misc.h" #include "com/sun/star/uno/Exception.hpp" -#include "com/sun/star/lang/XComponent.hpp" #include "com/sun/star/uno/XComponentContext.hpp" #include "com/sun/star/ucb/XCommandEnvironment.hpp" #include "com/sun/star/deployment/XPackage.hpp" @@ -121,25 +120,6 @@ bool isBootstrapVariable(sal_uInt32 * pIndex); //############################################################################## //============================================================================== -class DisposeGuard -{ - css::uno::Reference<css::lang::XComponent> m_xComp; - -public: - inline ~DisposeGuard() - { - if (m_xComp.is()) - m_xComp->dispose(); - } - - inline void reset( - css::uno::Reference<css::lang::XComponent> const & xComp ) - { - m_xComp = xComp; - } -}; - -//============================================================================== css::uno::Reference<css::ucb::XCommandEnvironment> createCmdEnv( css::uno::Reference<css::uno::XComponentContext> const & xContext, ::rtl::OUString const & logFile, @@ -158,7 +138,7 @@ void printf_packages( //============================================================================== css::uno::Reference<css::uno::XComponentContext> getUNO( - DisposeGuard & disposeGuard, bool verbose, bool shared, bool bGui, + bool verbose, bool shared, bool bGui, css::uno::Reference<css::uno::XComponentContext> & out_LocalComponentContext); } diff --git a/desktop/source/splash/splash.cxx b/desktop/source/splash/splash.cxx index 1f816cd14b2f..2321293f3a11 100644 --- a/desktop/source/splash/splash.cxx +++ b/desktop/source/splash/splash.cxx @@ -63,13 +63,6 @@ class SplashScreen , public IntroWindow { private: - struct FullScreenProgressRatioValue - { - double _fXRelPos; - double _fYRelPos; - double _fRelWidth; - double _fRelHeight; - }; enum BitmapMode { BM_FULLSCREEN, BM_DEFAULTMODE }; DECL_LINK( AppEventListenerHdl, VclWindowEvent * ); @@ -89,7 +82,6 @@ private: bool _bNativeProgress; OUString _sAppName; OUString _sProgressText; - std::vector< FullScreenProgressRatioValue > _sFullScreenProgressRatioValues; sal_Int32 _iMax; sal_Int32 _iProgress; diff --git a/desktop/test/deployment/active/active_native.cxx b/desktop/test/deployment/active/active_native.cxx index 9845fd511168..493728d44c3a 100644 --- a/desktop/test/deployment/active/active_native.cxx +++ b/desktop/test/deployment/active/active_native.cxx @@ -31,6 +31,7 @@ #include "boost/noncopyable.hpp" #include "com/sun/star/awt/MessageBoxButtons.hpp" #include "com/sun/star/awt/Rectangle.hpp" +#include "com/sun/star/awt/Toolkit.hpp" #include "com/sun/star/awt/XMessageBox.hpp" #include "com/sun/star/awt/XMessageBoxFactory.hpp" #include "com/sun/star/awt/XWindowPeer.hpp" @@ -235,13 +236,12 @@ void Dispatch::dispatch( css::uno::Sequence< css::beans::PropertyValue > const &) throw (css::uno::RuntimeException) { - css::uno::Reference< css::lang::XMultiComponentFactory > smgr( - context_->getServiceManager(), css::uno::UNO_SET_THROW); + css::uno::Reference< css::lang::XMultiComponentFactory > smgr( context_->getServiceManager(), css::uno::UNO_SET_THROW); + css::uno::Reference< css::awt::XToolkit > toolkit( css::awt::Toolkit::create(context_), css::uno::UNO_SET_THROW); + css::uno::Reference< css::awt::XMessageBox > box( css::uno::Reference< css::awt::XMessageBoxFactory >( - smgr->createInstanceWithContext( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "com.sun.star.awt.Toolkit")), context_), + toolkit, css::uno::UNO_QUERY_THROW)->createMessageBox( css::uno::Reference< css::awt::XWindowPeer >( css::uno::Reference< css::frame::XFrame >( diff --git a/desktop/test/deployment/passive/passive_native.cxx b/desktop/test/deployment/passive/passive_native.cxx index 0da885d5a31d..5e409f6cb30d 100644 --- a/desktop/test/deployment/passive/passive_native.cxx +++ b/desktop/test/deployment/passive/passive_native.cxx @@ -32,6 +32,7 @@ #include "com/sun/star/awt/MessageBoxButtons.hpp" #include "com/sun/star/awt/Rectangle.hpp" #include "com/sun/star/awt/XMessageBox.hpp" +#include "com/sun/star/awt/Toolkit.hpp" #include "com/sun/star/awt/XMessageBoxFactory.hpp" #include "com/sun/star/awt/XWindowPeer.hpp" #include "com/sun/star/beans/PropertyValue.hpp" @@ -233,13 +234,12 @@ void Dispatch::dispatch( css::uno::Sequence< css::beans::PropertyValue > const &) throw (css::uno::RuntimeException) { - css::uno::Reference< css::lang::XMultiComponentFactory > smgr( - context_->getServiceManager(), css::uno::UNO_SET_THROW); + css::uno::Reference< css::lang::XMultiComponentFactory > smgr(context_->getServiceManager(), css::uno::UNO_SET_THROW); + css::uno::Reference< css::awt::XToolkit > toolkit( css::awt::Toolkit::create(context_), css::uno::UNO_SET_THROW); + css::uno::Reference< css::awt::XMessageBox > box( css::uno::Reference< css::awt::XMessageBoxFactory >( - smgr->createInstanceWithContext( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "com.sun.star.awt.Toolkit")), context_), + toolkit, css::uno::UNO_QUERY_THROW)->createMessageBox( css::uno::Reference< css::awt::XWindowPeer >( css::uno::Reference< css::frame::XFrame >( |