summaryrefslogtreecommitdiff
path: root/fpicker
diff options
context:
space:
mode:
authorOliver Bolte <obo@openoffice.org>2009-03-05 12:59:42 +0000
committerOliver Bolte <obo@openoffice.org>2009-03-05 12:59:42 +0000
commitff4cbc080657259f22844d872e02722a804513bb (patch)
treedc42e5b4e90e540244a4480f449e14b44555d357 /fpicker
parent60f04aebe63d2fb9b5f72ad681c444bd5c987214 (diff)
CWS-TOOLING: integrate CWS jl117_DEV300
2009-02-18 16:23:55 +0100 kso r268240 : #i98983# - auto extension fix. 2009-02-16 15:33:04 +0100 jl r267821 : #i99249# conflict resolution error, unopkg hangs 2009-02-13 15:19:16 +0100 jl r267723 : #i99068# regression: extension description from manifest.xml was not displayed
Diffstat (limited to 'fpicker')
-rw-r--r--fpicker/source/win32/filepicker/VistaFilePickerImpl.cxx24
1 files changed, 17 insertions, 7 deletions
diff --git a/fpicker/source/win32/filepicker/VistaFilePickerImpl.cxx b/fpicker/source/win32/filepicker/VistaFilePickerImpl.cxx
index 4ea9dedf7d14..853f54bed322 100644
--- a/fpicker/source/win32/filepicker/VistaFilePickerImpl.cxx
+++ b/fpicker/source/win32/filepicker/VistaFilePickerImpl.cxx
@@ -668,6 +668,22 @@ void VistaFilePickerImpl::impl_sta_SetDefaultName(const RequestRef& rRequest)
{
::rtl::OUString sFilename = rRequest->getArgumentOrDefault(PROP_FILENAME, ::rtl::OUString());
TFileDialog iDialog = impl_getBaseDialogInterface();
+
+ TFileDialogCustomize iCustom = impl_getCustomizeInterface();
+ if ( ! iCustom.is())
+ return;
+
+ // if we have the autoextension check box set, remove (or change ???) the extension of the filename
+ // so that the autoextension mechanism can do its job
+ BOOL bValue = FALSE;
+ HRESULT hResult = iCustom->GetCheckButtonState( css::ui::dialogs::ExtendedFilePickerElementIds::CHECKBOX_AUTOEXTENSION, &bValue);
+ if ( bValue )
+ {
+ sal_Int32 nSepPos = sFilename.lastIndexOf( '.' );
+ if ( -1 != nSepPos )
+ sFilename = sFilename.copy(0, nSepPos);
+ }
+
iDialog->SetFileName ( reinterpret_cast<LPCTSTR>(sFilename.getStr()));
m_sFilename = sFilename;
}
@@ -682,17 +698,11 @@ void VistaFilePickerImpl::impl_sta_setFiltersOnDialog()
::rtl::OUString sCurrentFilter = m_lFilters.getCurrentFilter();
sal_Int32 nCurrentFilter = m_lFilters.getFilterPos(sCurrentFilter);
TFileDialog iDialog = impl_getBaseDialogInterface();
- TFileDialogCustomize iCustomize;
+ TFileDialogCustomize iCustomize = impl_getCustomizeInterface();
aLock.clear();
// <- SYNCHRONIZED
-#ifdef __MINGW32__
- iDialog->QueryInterface(IID_IFileDialog, (void **)(&iCustomize));
-#else
- iDialog.query(&iCustomize);
-#endif
-
COMDLG_FILTERSPEC *pFilt = &lFilters[0];
iDialog->SetFileTypes(lFilters.size(), pFilt/*&lFilters[0]*/);
iDialog->SetFileTypeIndex(nCurrentFilter + 1);