From 194bdbde25dd70988c94ff5e1af43b530d47d94b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C3=BA=C5=A1=20Kukan?= Date: Wed, 8 Jan 2014 09:08:08 +0100 Subject: [PATCH] Revert "make FilePicker::createWithMode not crash" This reverts commit 58ea27124af27bfac21a796b0d13d72354bd0dd3. It's probably better to fix it another way. --- include/vcl/svapp.hxx | 6 +++--- svtools/source/uno/fpicker.cxx | 14 +++++--------- vcl/source/app/svapp.cxx | 12 ++---------- 3 files changed, 10 insertions(+), 22 deletions(-) diff --git a/include/vcl/svapp.hxx b/include/vcl/svapp.hxx index 57814e0d8cb7..1620efa9f806 100644 --- a/include/vcl/svapp.hxx +++ b/include/vcl/svapp.hxx @@ -389,9 +389,9 @@ public: /** Create a platform specific file picker, if one is available, otherwise return an empty reference */ - static css::uno::Reference - createFilePicker(const css::uno::Sequence& rArguments, - const css::uno::Reference& rServiceManager); + static com::sun::star::uno::Reference< com::sun::star::ui::dialogs::XFilePicker2 > + createFilePicker( const com::sun::star::uno::Reference< + com::sun::star::uno::XComponentContext >& rServiceManager ); /** Create a platform specific folder picker, if one is available, otherwise return an empty reference diff --git a/svtools/source/uno/fpicker.cxx b/svtools/source/uno/fpicker.cxx index 1034bafa3bdb..a9d06ad6d5c7 100644 --- a/svtools/source/uno/fpicker.cxx +++ b/svtools/source/uno/fpicker.cxx @@ -57,22 +57,19 @@ extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL com_sun_star_comp_svt_FilePicker_get_implementation( css::uno::XComponentContext *context, uno_Sequence * arguments) { - assert(arguments != 0 && (arguments->nElements == 0 || arguments->nElements == 1)); - css::uno::Sequence aArgs(reinterpret_cast(arguments->elements), - arguments->nElements); + assert(arguments != 0 && arguments->nElements == 0); (void) arguments; Reference< css::uno::XInterface > xResult; Reference< css::lang::XMultiComponentFactory > xFactory (context->getServiceManager()); if (xFactory.is() && SvtMiscOptions().UseSystemFileDialog()) { - xResult = Reference(Application::createFilePicker(aArgs, context)); + xResult = Reference< css::uno::XInterface >( Application::createFilePicker( context ) ); if (!xResult.is()) { try { - xResult = xFactory->createInstanceWithArgumentsAndContext( + xResult = xFactory->createInstanceWithContext ( FilePicker_getSystemPickerServiceName(), - aArgs, context); } catch (css::uno::Exception const &) @@ -86,9 +83,8 @@ com_sun_star_comp_svt_FilePicker_get_implementation( if (!xResult.is() && xFactory.is()) { // Always fall back to OfficeFilePicker. - xResult = xFactory->createInstanceWithArgumentsAndContext( - "com.sun.star.ui.dialogs.OfficeFilePicker", - aArgs, + xResult = xFactory->createInstanceWithContext ( + OUString( "com.sun.star.ui.dialogs.OfficeFilePicker"), context); } if (xResult.is()) diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx index 945229c24b67..5e573d065c90 100644 --- a/vcl/source/app/svapp.cxx +++ b/vcl/source/app/svapp.cxx @@ -62,7 +62,6 @@ #include "com/sun/star/uno/Reference.h" #include "com/sun/star/awt/XToolkit.hpp" #include "com/sun/star/uno/XNamingService.hpp" -#include "com/sun/star/lang/XInitialization.hpp" #include "com/sun/star/lang/XMultiServiceFactory.hpp" #include "comphelper/solarmutex.hxx" #include "osl/process.h" @@ -1648,17 +1647,10 @@ bool Application::hasNativeFileSelection() } Reference< ui::dialogs::XFilePicker2 > -Application::createFilePicker(const uno::Sequence& rArguments, - const Reference< uno::XComponentContext >& xSM) +Application::createFilePicker( const Reference< uno::XComponentContext >& xSM ) { ImplSVData* pSVData = ImplGetSVData(); - Reference< ui::dialogs::XFilePicker2 > xRet(pSVData->mpDefInst->createFilePicker(xSM)); - if (xRet.is() && rArguments.getLength()) - { - uno::Reference xInit(xRet, uno::UNO_QUERY_THROW); - xInit->initialize(rArguments); - } - return xRet; + return pSVData->mpDefInst->createFilePicker( xSM ); } Reference< ui::dialogs::XFolderPicker2 >