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

These implementations could inherit from XInitialization too.

Change-Id: I70493afcec837411b0f3c6d5165564d2cc0996db
üst 194bdbde
...@@ -20,7 +20,8 @@ ...@@ -20,7 +20,8 @@
#include "sal/types.h" #include "sal/types.h"
#include "rtl/ustring.hxx" #include "rtl/ustring.hxx"
#include "com/sun/star/lang/XMultiComponentFactory.hpp" #include <com/sun/star/lang/XInitialization.hpp>
#include <com/sun/star/lang/XMultiComponentFactory.hpp>
#include "svtools/miscopt.hxx" #include "svtools/miscopt.hxx"
#include "svl/pickerhistoryaccess.hxx" #include "svl/pickerhistoryaccess.hxx"
...@@ -57,7 +58,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL ...@@ -57,7 +58,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
com_sun_star_comp_svt_FilePicker_get_implementation( com_sun_star_comp_svt_FilePicker_get_implementation(
css::uno::XComponentContext *context, uno_Sequence * arguments) css::uno::XComponentContext *context, uno_Sequence * arguments)
{ {
assert(arguments != 0 && arguments->nElements == 0); (void) arguments; assert(arguments != 0);
Reference< css::uno::XInterface > xResult; Reference< css::uno::XInterface > xResult;
Reference< css::lang::XMultiComponentFactory > xFactory (context->getServiceManager()); Reference< css::lang::XMultiComponentFactory > xFactory (context->getServiceManager());
if (xFactory.is() && SvtMiscOptions().UseSystemFileDialog()) if (xFactory.is() && SvtMiscOptions().UseSystemFileDialog())
...@@ -92,6 +93,14 @@ com_sun_star_comp_svt_FilePicker_get_implementation( ...@@ -92,6 +93,14 @@ com_sun_star_comp_svt_FilePicker_get_implementation(
// Add to FilePicker history. // Add to FilePicker history.
svt::addFilePicker (xResult); svt::addFilePicker (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(); xResult->acquire();
return xResult.get(); return xResult.get();
} }
...@@ -117,7 +126,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL ...@@ -117,7 +126,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
com_sun_star_comp_svt_FolderPicker_get_implementation( com_sun_star_comp_svt_FolderPicker_get_implementation(
css::uno::XComponentContext *context, uno_Sequence * arguments) css::uno::XComponentContext *context, uno_Sequence * arguments)
{ {
assert(arguments != 0 && arguments->nElements == 0); (void) arguments; assert(arguments != 0);
Reference< css::uno::XInterface > xResult; Reference< css::uno::XInterface > xResult;
Reference< css::lang::XMultiComponentFactory > xFactory (context->getServiceManager()); Reference< css::lang::XMultiComponentFactory > xFactory (context->getServiceManager());
if (xFactory.is() && SvtMiscOptions().UseSystemFileDialog()) if (xFactory.is() && SvtMiscOptions().UseSystemFileDialog())
...@@ -149,6 +158,14 @@ com_sun_star_comp_svt_FolderPicker_get_implementation( ...@@ -149,6 +158,14 @@ com_sun_star_comp_svt_FolderPicker_get_implementation(
// Add to FolderPicker history. // Add to FolderPicker history.
svt::addFolderPicker (xResult); 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(); xResult->acquire();
return xResult.get(); 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