summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatúš Kukan <matus.kukan@collabora.com>2014-01-08 09:12:17 +0100
committerMatúš Kukan <matus.kukan@collabora.com>2014-01-08 15:01:33 +0100
commitdf002e39f7518036ae1c1d2afec7a525ef902327 (patch)
tree7995a89223ef1171f6b51cbb3b0853c208fe9604
parent194bdbde25dd70988c94ff5e1af43b530d47d94b (diff)
These implementations could inherit from XInitialization too.
Change-Id: I70493afcec837411b0f3c6d5165564d2cc0996db
-rw-r--r--svtools/source/uno/fpicker.cxx23
1 files changed, 20 insertions, 3 deletions
diff --git a/svtools/source/uno/fpicker.cxx b/svtools/source/uno/fpicker.cxx
index a9d06ad6d5c7..7a4b769403b6 100644
--- a/svtools/source/uno/fpicker.cxx
+++ b/svtools/source/uno/fpicker.cxx
@@ -20,7 +20,8 @@
#include "sal/types.h"
#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 "svl/pickerhistoryaccess.hxx"
@@ -57,7 +58,7 @@ 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); (void) arguments;
+ assert(arguments != 0);
Reference< css::uno::XInterface > xResult;
Reference< css::lang::XMultiComponentFactory > xFactory (context->getServiceManager());
if (xFactory.is() && SvtMiscOptions().UseSystemFileDialog())
@@ -92,6 +93,14 @@ com_sun_star_comp_svt_FilePicker_get_implementation(
// Add to FilePicker history.
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();
return xResult.get();
}
@@ -117,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 && arguments->nElements == 0); (void) arguments;
+ assert(arguments != 0);
Reference< css::uno::XInterface > xResult;
Reference< css::lang::XMultiComponentFactory > xFactory (context->getServiceManager());
if (xFactory.is() && SvtMiscOptions().UseSystemFileDialog())
@@ -149,6 +158,14 @@ 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();
}