diff options
Diffstat (limited to 'fpicker/source')
-rw-r--r-- | fpicker/source/win32/filepicker/VistaFilePicker.cxx | 20 | ||||
-rw-r--r-- | fpicker/source/win32/filepicker/VistaFilePicker.hxx | 2 | ||||
-rw-r--r-- | fpicker/source/win32/filepicker/asyncrequests.cxx | 2 |
3 files changed, 23 insertions, 1 deletions
diff --git a/fpicker/source/win32/filepicker/VistaFilePicker.cxx b/fpicker/source/win32/filepicker/VistaFilePicker.cxx index 1fe559c74282..eb26f23952d7 100644 --- a/fpicker/source/win32/filepicker/VistaFilePicker.cxx +++ b/fpicker/source/win32/filepicker/VistaFilePicker.cxx @@ -165,6 +165,7 @@ VistaFilePicker::VistaFilePicker(const css::uno::Reference< css::lang::XMultiSer , m_rDialog (new VistaFilePickerImpl()) , m_aAsyncExecute (m_rDialog ) , m_nFilePickerThreadId (0 ) + , m_bInitialized (false ) { } @@ -345,6 +346,20 @@ css::uno::Sequence< ::rtl::OUString > SAL_CALL VistaFilePicker::getSelectedFiles ::sal_Int16 SAL_CALL VistaFilePicker::execute() throw(css::uno::RuntimeException) { + bool bInitialized(false); + { + osl::MutexGuard aGuard(m_aMutex); + bInitialized = m_bInitialized; + } + + if ( !bInitialized ) + { + sal_Int16 nTemplateDescription = css::ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE; + css::uno::Sequence < css::uno::Any > aInitArguments(1); + aInitArguments[0] <<= nTemplateDescription; + initialize(aInitArguments); + } + RequestRef rRequest(new Request()); rRequest->setRequest (VistaFilePickerImpl::E_SHOW_DIALOG_MODAL); @@ -640,6 +655,11 @@ void SAL_CALL VistaFilePicker::initialize(const css::uno::Sequence< css::uno::An if ( ! m_aAsyncExecute.isRunning()) m_aAsyncExecute.create(); m_aAsyncExecute.triggerRequestThreadAware(rRequest, AsyncRequests::NON_BLOCKED); + + { + osl::MutexGuard aGuard(m_aMutex); + m_bInitialized = true; + } } //------------------------------------------------------------------------------------ diff --git a/fpicker/source/win32/filepicker/VistaFilePicker.hxx b/fpicker/source/win32/filepicker/VistaFilePicker.hxx index 825444cd52f9..4e3a73cb939f 100644 --- a/fpicker/source/win32/filepicker/VistaFilePicker.hxx +++ b/fpicker/source/win32/filepicker/VistaFilePicker.hxx @@ -305,6 +305,8 @@ public: //--------------------------------------------------------------------- oslThreadIdentifier m_nFilePickerThreadId; + + bool m_bInitialized; }; } // namespace vista diff --git a/fpicker/source/win32/filepicker/asyncrequests.cxx b/fpicker/source/win32/filepicker/asyncrequests.cxx index 4e277899e1cc..17352345eb2b 100644 --- a/fpicker/source/win32/filepicker/asyncrequests.cxx +++ b/fpicker/source/win32/filepicker/asyncrequests.cxx @@ -53,7 +53,7 @@ void lcl_sleep(::osl::Condition& aCondition , { TimeValue aTime; aTime.Seconds = (nMilliSeconds / 1000); - aTime.Nanosec = (nMilliSeconds % 1000); + aTime.Nanosec = (nMilliSeconds % 1000) * 1000000; aCondition.wait(&aTime); } |