[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - fpicker/source
Caolán McNamara
caolanm at redhat.com
Mon Mar 27 09:48:10 UTC 2017
fpicker/source/win32/filepicker/VistaFilePicker.cxx | 19 +++++++++++++++++--
fpicker/source/win32/filepicker/VistaFilePicker.hxx | 2 ++
2 files changed, 19 insertions(+), 2 deletions(-)
New commits:
commit 51433f10b67685ad64dc77c848c689706f2afdd8
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon Mar 27 09:25:00 2017 +0100
Resolves: tdf#106729 ensure VistaFilePicker init before access
(cherry picked from commit a15ec82edebf14baa41a888ead7da8e0556ab0bb)
Change-Id: I238599cf5ed464c4bb99a894ac47126fbc32796d
Reviewed-on: https://gerrit.libreoffice.org/35746
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Adolfo Jayme Barrientos <fitojb at ubuntu.com>
diff --git a/fpicker/source/win32/filepicker/VistaFilePicker.cxx b/fpicker/source/win32/filepicker/VistaFilePicker.cxx
index 2efdad5af545..238dad83d44d 100644
--- a/fpicker/source/win32/filepicker/VistaFilePicker.cxx
+++ b/fpicker/source/win32/filepicker/VistaFilePicker.cxx
@@ -121,6 +121,8 @@ void SAL_CALL VistaFilePicker::disposing(const css::lang::EventObject& /*aEvent*
void SAL_CALL VistaFilePicker::setMultiSelectionMode(sal_Bool bMode)
throw(css::uno::RuntimeException)
{
+ ensureInit();
+
RequestRef rRequest(new Request());
rRequest->setRequest (VistaFilePickerImpl::E_SET_MULTISELECTION_MODE);
rRequest->setArgument(PROP_MULTISELECTION_MODE, bMode);
@@ -132,6 +134,8 @@ void SAL_CALL VistaFilePicker::setMultiSelectionMode(sal_Bool bMode)
void SAL_CALL VistaFilePicker::setTitle(const OUString& sTitle)
throw(css::uno::RuntimeException)
{
+ ensureInit();
+
RequestRef rRequest(new Request());
rRequest->setRequest (VistaFilePickerImpl::E_SET_TITLE);
rRequest->setArgument(PROP_TITLE, sTitle);
@@ -195,6 +199,8 @@ void SAL_CALL VistaFilePicker::appendFilterGroup(const OUString&
void SAL_CALL VistaFilePicker::setDefaultName(const OUString& sName )
throw(css::uno::RuntimeException)
{
+ ensureInit();
+
RequestRef rRequest(new Request());
rRequest->setRequest (VistaFilePickerImpl::E_SET_DEFAULT_NAME);
rRequest->setArgument(PROP_FILENAME, sName);
@@ -207,6 +213,8 @@ void SAL_CALL VistaFilePicker::setDisplayDirectory(const OUString& sDirectory)
throw (css::lang::IllegalArgumentException,
css::uno::RuntimeException )
{
+ ensureInit();
+
bool bChanged = officecfg::Office::Common::Path::Info::WorkPathChanged::get(
comphelper::getComponentContext(m_xSMGR));
if (bChanged )
@@ -231,6 +239,8 @@ void SAL_CALL VistaFilePicker::setDisplayDirectory(const OUString& sDirectory)
OUString SAL_CALL VistaFilePicker::getDisplayDirectory()
throw(css::uno::RuntimeException)
{
+ ensureInit();
+
RequestRef rRequest(new Request());
rRequest->setRequest (VistaFilePickerImpl::E_GET_DIRECTORY);
m_aAsyncExecute.triggerRequestThreadAware(rRequest, AsyncRequests::BLOCKED);
@@ -268,8 +278,7 @@ css::uno::Sequence< OUString > SAL_CALL VistaFilePicker::getSelectedFiles()
}
-::sal_Int16 SAL_CALL VistaFilePicker::execute()
- throw(css::uno::RuntimeException)
+void VistaFilePicker::ensureInit()
{
bool bInitialized(false);
{
@@ -284,6 +293,12 @@ css::uno::Sequence< OUString > SAL_CALL VistaFilePicker::getSelectedFiles()
aInitArguments[0] <<= nTemplateDescription;
initialize(aInitArguments);
}
+}
+
+::sal_Int16 SAL_CALL VistaFilePicker::execute()
+ throw(css::uno::RuntimeException)
+{
+ ensureInit();
RequestRef rRequest(new Request());
rRequest->setRequest (VistaFilePickerImpl::E_SHOW_DIALOG_MODAL);
diff --git a/fpicker/source/win32/filepicker/VistaFilePicker.hxx b/fpicker/source/win32/filepicker/VistaFilePicker.hxx
index b14eb124dc69..2118fbd9d058 100644
--- a/fpicker/source/win32/filepicker/VistaFilePicker.hxx
+++ b/fpicker/source/win32/filepicker/VistaFilePicker.hxx
@@ -249,6 +249,8 @@ public:
using WeakComponentImplHelperBase::disposing;
+ void ensureInit();
+
private:
More information about the Libreoffice-commits
mailing list