diff options
author | sb <sb@openoffice.org> | 2009-07-22 15:13:36 +0200 |
---|---|---|
committer | sb <sb@openoffice.org> | 2009-07-22 15:13:36 +0200 |
commit | d25e6f716f7c7806de8c5de76847929dfdfc118e (patch) | |
tree | d1d786d08c8ec4fb482edd21a8d34f96e640ee1d /fpicker | |
parent | 7ea0bb9d6168b3d5071e3d8187828dadea201ea6 (diff) | |
parent | c55ad3a6e59271fa6d730d3dd3100f5cb516d9ba (diff) |
merged in DEV300_m53
Diffstat (limited to 'fpicker')
4 files changed, 26 insertions, 2 deletions
diff --git a/fpicker/source/aqua/AquaFilePickerDelegate.mm b/fpicker/source/aqua/AquaFilePickerDelegate.mm index 2bece2d90eb8..7a557495191b 100644 --- a/fpicker/source/aqua/AquaFilePickerDelegate.mm +++ b/fpicker/source/aqua/AquaFilePickerDelegate.mm @@ -59,8 +59,10 @@ - (MacOSBOOL)panel:(id)sender shouldShowFilename:(NSString *)filename { - if (filterHelper == NULL) + if( filterHelper == NULL ) return true; + if( filename == nil ) + return false; return filterHelper->filenameMatchesFilter(filename); } 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); } |