summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-03-27 09:25:00 +0100
committerAndras Timar <andras.timar@collabora.com>2017-03-27 10:38:22 +0200
commitffa13328287f57c25204adddee3a0d12c25ff959 (patch)
treedfce2d8acb5e8a145212ba9ff4cdf69c3a17d784
parentd6877736acfbd44417d79e8587739dfc92bf8123 (diff)
Resolves: tdf#106729 ensure VistaFilePicker init before access
(cherry picked from commit a15ec82edebf14baa41a888ead7da8e0556ab0bb) Change-Id: I238599cf5ed464c4bb99a894ac47126fbc32796d
-rw-r--r--fpicker/source/win32/filepicker/VistaFilePicker.cxx17
-rw-r--r--fpicker/source/win32/filepicker/VistaFilePicker.hxx2
2 files changed, 18 insertions, 1 deletions
diff --git a/fpicker/source/win32/filepicker/VistaFilePicker.cxx b/fpicker/source/win32/filepicker/VistaFilePicker.cxx
index 9e15e2dde1b3..f2565ca78164 100644
--- a/fpicker/source/win32/filepicker/VistaFilePicker.cxx
+++ b/fpicker/source/win32/filepicker/VistaFilePicker.cxx
@@ -134,6 +134,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);
@@ -145,6 +147,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);
@@ -208,6 +212,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);
@@ -220,6 +226,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 )
@@ -244,6 +252,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);
@@ -281,7 +291,7 @@ css::uno::Sequence< OUString > SAL_CALL VistaFilePicker::getSelectedFiles()
}
-::sal_Int16 SAL_CALL VistaFilePicker::execute()
+void VistaFilePicker::ensureInit()
throw(css::uno::RuntimeException)
{
bool bInitialized(false);
@@ -297,6 +307,11 @@ css::uno::Sequence< OUString > SAL_CALL VistaFilePicker::getSelectedFiles()
aInitArguments[0] <<= nTemplateDescription;
initialize(aInitArguments);
}
+}
+
+::sal_Int16 SAL_CALL VistaFilePicker::execute()
+{
+ 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 01b6da335893..88e5460e8948 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: