Revert "make FilePicker::createWithMode not crash"

This reverts commit 58ea27124a.
It's probably better to fix it another way.
This commit is contained in:
Matúš Kukan 2014-01-08 09:08:08 +01:00
parent daa654fb44
commit 194bdbde25
3 changed files with 10 additions and 22 deletions

View file

@ -389,9 +389,9 @@ public:
/** Create a platform specific file picker, if one is available,
otherwise return an empty reference
*/
static css::uno::Reference<css::ui::dialogs::XFilePicker2>
createFilePicker(const css::uno::Sequence<css::uno::Any>& rArguments,
const css::uno::Reference<css::uno::XComponentContext>& 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

View file

@ -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<css::uno::Any> aArgs(reinterpret_cast<css::uno::Any *>(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<css::uno::XInterface>(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())

View file

@ -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<uno::Any>& 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<lang::XInitialization> xInit(xRet, uno::UNO_QUERY_THROW);
xInit->initialize(rArguments);
}
return xRet;
return pSVData->mpDefInst->createFilePicker( xSM );
}
Reference< ui::dialogs::XFolderPicker2 >