summaryrefslogtreecommitdiff
path: root/fpicker
diff options
context:
space:
mode:
authorMathias Bauer <mba@openoffice.org>2009-10-26 17:41:29 +0100
committerMathias Bauer <mba@openoffice.org>2009-10-26 17:41:29 +0100
commit98c81b0f6cbeb3322bd325390f0a9ec068956f2e (patch)
treeb8071b3ef1fe046b46fc3d4fdd569412a30bf962 /fpicker
parenta822b5571761174e94563f53c8e55abf79c9f0b2 (diff)
parentc18e25b533b12d73ae8bc58564f9eda45c26e3b1 (diff)
merge commit for m62
Diffstat (limited to 'fpicker')
-rw-r--r--fpicker/source/win32/filepicker/VistaFilePickerImpl.cxx41
1 files changed, 21 insertions, 20 deletions
diff --git a/fpicker/source/win32/filepicker/VistaFilePickerImpl.cxx b/fpicker/source/win32/filepicker/VistaFilePickerImpl.cxx
index 58041b3fe628..ed2d5041ad67 100644
--- a/fpicker/source/win32/filepicker/VistaFilePickerImpl.cxx
+++ b/fpicker/source/win32/filepicker/VistaFilePickerImpl.cxx
@@ -872,30 +872,31 @@ void VistaFilePickerImpl::impl_sta_ShowDialogModal(const RequestRef& rRequest)
{
if (m_sFilename.getLength())
{
- ::rtl::OUString aFileURL(m_sDirectory);
- sal_Int32 nIndex = aFileURL.lastIndexOf('/');
- if (nIndex != aFileURL.getLength()-1)
- aFileURL += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/"));
- aFileURL += m_sFilename;
-
+ ::rtl::OUString aFileURL(m_sDirectory);
+ sal_Int32 nIndex = aFileURL.lastIndexOf('/');
+ if (nIndex != aFileURL.getLength()-1)
+ aFileURL += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/"));
+ aFileURL += m_sFilename;
+
TFileDialogCustomize iCustom = impl_getCustomizeInterface();
BOOL bValue = FALSE;
HRESULT hResult = iCustom->GetCheckButtonState( css::ui::dialogs::ExtendedFilePickerElementIds::CHECKBOX_AUTOEXTENSION, &bValue);
if ( bValue )
{
- ::rtl::OUString aExt;
- UINT nFileType;
- hResult = iDialog->GetFileTypeIndex(&nFileType);
+ ::rtl::OUString aExt;
+ UINT nFileType;
+ hResult = iDialog->GetFileTypeIndex(&nFileType);
if ( SUCCEEDED(hResult) )
- {
+ {
+ ::sal_Int32 nRealIndex = (nFileType-1); // COM dialog base on 1 ... filter container on 0 .-)
::std::vector< COMDLG_FILTERSPEC > lFilters = lcl_buildFilterList(m_lFilters);
- LPCWSTR lpFilterExt = lFilters[nFileType].pszSpec;
+ LPCWSTR lpFilterExt = lFilters[nRealIndex].pszSpec;
lpFilterExt = wcsrchr( lpFilterExt, '.' );
if ( lpFilterExt )
aFileURL += reinterpret_cast<const sal_Unicode*>(lpFilterExt);
- }
+ }
}
// Check existence of file. Set folder only for this special case
@@ -904,15 +905,15 @@ void VistaFilePickerImpl::impl_sta_ShowDialogModal(const RequestRef& rRequest)
WIN32_FIND_DATA aFindFileData;
HANDLE hFind = FindFirstFile( reinterpret_cast<LPCWSTR>(aSystemPath.getStr()), &aFindFileData );
- if (hFind != INVALID_HANDLE_VALUE)
- iDialog->SetFolder(pFolder);
- else
- hResult = iDialog->AddPlace(pFolder, FDAP_TOP);
-
+ if (hFind != INVALID_HANDLE_VALUE)
+ iDialog->SetFolder(pFolder);
+ else
+ hResult = iDialog->AddPlace(pFolder, FDAP_TOP);
+
FindClose( hFind );
- }
- else
- hResult = iDialog->AddPlace(pFolder, FDAP_TOP);
+ }
+ else
+ hResult = iDialog->AddPlace(pFolder, FDAP_TOP);
}
}