diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-03-27 09:25:00 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-03-27 09:25:28 +0100 |
commit | a15ec82edebf14baa41a888ead7da8e0556ab0bb (patch) | |
tree | 296e55c104be00b78befa63bed70b1281ea9125b /fpicker/source/win32/filepicker/VistaFilePicker.cxx | |
parent | 41cd0ccc68b5bb43bfe28f0ece0b1fbc25a7adf3 (diff) |
Resolves: tdf#106729 ensure VistaFilePicker init before access
Change-Id: I238599cf5ed464c4bb99a894ac47126fbc32796d
Diffstat (limited to 'fpicker/source/win32/filepicker/VistaFilePicker.cxx')
-rw-r--r-- | fpicker/source/win32/filepicker/VistaFilePicker.cxx | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/fpicker/source/win32/filepicker/VistaFilePicker.cxx b/fpicker/source/win32/filepicker/VistaFilePicker.cxx index ad50716c604f..d2508c50e690 100644 --- a/fpicker/source/win32/filepicker/VistaFilePicker.cxx +++ b/fpicker/source/win32/filepicker/VistaFilePicker.cxx @@ -106,6 +106,8 @@ void SAL_CALL VistaFilePicker::disposing(const css::lang::EventObject& /*aEvent* void SAL_CALL VistaFilePicker::setMultiSelectionMode(sal_Bool bMode) { + ensureInit(); + RequestRef rRequest(new Request()); rRequest->setRequest (VistaFilePickerImpl::E_SET_MULTISELECTION_MODE); rRequest->setArgument(PROP_MULTISELECTION_MODE, bMode); @@ -115,6 +117,8 @@ void SAL_CALL VistaFilePicker::setMultiSelectionMode(sal_Bool bMode) void SAL_CALL VistaFilePicker::setTitle(const OUString& sTitle) { + ensureInit(); + RequestRef rRequest(new Request()); rRequest->setRequest (VistaFilePickerImpl::E_SET_TITLE); rRequest->setArgument(PROP_TITLE, sTitle); @@ -165,6 +169,8 @@ void SAL_CALL VistaFilePicker::appendFilterGroup(const OUString& void SAL_CALL VistaFilePicker::setDefaultName(const OUString& sName ) { + ensureInit(); + RequestRef rRequest(new Request()); rRequest->setRequest (VistaFilePickerImpl::E_SET_DEFAULT_NAME); rRequest->setArgument(PROP_FILENAME, sName); @@ -174,6 +180,8 @@ void SAL_CALL VistaFilePicker::setDefaultName(const OUString& sName ) void SAL_CALL VistaFilePicker::setDisplayDirectory(const OUString& sDirectory) { + ensureInit(); + bool bChanged = officecfg::Office::Common::Path::Info::WorkPathChanged::get( comphelper::getComponentContext(m_xSMGR)); if (bChanged ) @@ -196,6 +204,8 @@ void SAL_CALL VistaFilePicker::setDisplayDirectory(const OUString& sDirectory) OUString SAL_CALL VistaFilePicker::getDisplayDirectory() { + ensureInit(); + RequestRef rRequest(new Request()); rRequest->setRequest (VistaFilePickerImpl::E_GET_DIRECTORY); m_aAsyncExecute.triggerRequestThreadAware(rRequest, AsyncRequests::BLOCKED); @@ -228,7 +238,7 @@ css::uno::Sequence< OUString > SAL_CALL VistaFilePicker::getSelectedFiles() return lFiles; } -::sal_Int16 SAL_CALL VistaFilePicker::execute() +void VistaFilePicker::ensureInit() { bool bInitialized(false); { @@ -243,6 +253,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); |