Kaydet (Commit) eb89c6f7 authored tarafından Matúš Kukan's avatar Matúš Kukan

Do not initialize FilePicker with empty argument.

This is tricky.
In constructor, we don't know if we were called by service manager's
createInstanceWithArgumentsAndContext or just createInstanceWithContext,
so we don't know if initialize should be called.
Let's assume that nobody would use createInstanceWithArgumentsAndContext
with empty argument. Then the behaviour should be the same as before.

FolderPicker does not seem to be called with arguments.

Change-Id: If33dc20fe1b2b10b092ff35fa0b258137c8e94b2
üst 3cb4aa94
......@@ -94,7 +94,7 @@ com_sun_star_comp_svt_FilePicker_get_implementation(
svt::addFilePicker (xResult);
}
css::uno::Reference< css::lang::XInitialization > xx(xResult, css::uno::UNO_QUERY);
if (xx.is())
if (xx.is() && arguments->nElements)
{
css::uno::Sequence<css::uno::Any> aArgs(
reinterpret_cast<css::uno::Any *>(arguments->elements),
......@@ -126,7 +126,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
com_sun_star_comp_svt_FolderPicker_get_implementation(
css::uno::XComponentContext *context, uno_Sequence * arguments)
{
assert(arguments != 0);
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())
......@@ -158,14 +158,6 @@ com_sun_star_comp_svt_FolderPicker_get_implementation(
// Add to FolderPicker history.
svt::addFolderPicker (xResult);
}
css::uno::Reference< css::lang::XInitialization > xx(xResult, css::uno::UNO_QUERY);
if (xx.is())
{
css::uno::Sequence<css::uno::Any> aArgs(
reinterpret_cast<css::uno::Any *>(arguments->elements),
arguments->nElements);
xx->initialize(aArgs);
}
xResult->acquire();
return xResult.get();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment