diff options
author | Aurimas FiĊĦeras <aurimas@members.fsf.org> | 2014-07-21 10:43:42 +0300 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2014-07-22 11:45:29 +0200 |
commit | 2115f27d792d83bffc2212ce7f50b03b5677ec71 (patch) | |
tree | 4cf9199a0f0c8c46cc3cb5090c0fb650d14bd983 /fpicker | |
parent | a2be3fd31184ff0ba73f1603f762ab78bb206405 (diff) |
fdo#74295 win32 fpicker: correctly set the default file name
Revert "Cleaning: remove use of old edt1 from dlg.h (Windows)"
This reverts commit e9fd9c25269abe171e5f693a8c70b33ab5a01c85.
Reviewed-on: https://gerrit.libreoffice.org/10429
Reviewed-on: https://gerrit.libreoffice.org/10430
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
(cherry picked from commit a37d99eb176d0a302f92af287cc0d19ba2663bbc)
(cherry picked from commit bb4ffcdf9a3682f13f0145055f81921a764c36f3)
Signed-off-by: Andras Timar <andras.timar@collabora.com>
(cherry picked from commit 6466d0fec06e095bc596593357846802a24bb4af)
Signed-off-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'fpicker')
-rw-r--r-- | fpicker/source/win32/filepicker/WinFileOpenImpl.cxx | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/fpicker/source/win32/filepicker/WinFileOpenImpl.cxx b/fpicker/source/win32/filepicker/WinFileOpenImpl.cxx index ee2760b5c878..66e6caae8185 100644 --- a/fpicker/source/win32/filepicker/WinFileOpenImpl.cxx +++ b/fpicker/source/win32/filepicker/WinFileOpenImpl.cxx @@ -584,7 +584,7 @@ void SAL_CALL CWinFileOpenImpl::InitControlLabel(HWND hWnd) // Our approach is to align all static text controls with the // static text control "File name" of the FileOpen dialog, // all checkboxes and all list/comboboxes will be left aligned with -// the standard combobox cmb13 (defined in MS platform sdk dlgs.h) +// the standard combobox edt1/cmb13 (defined in MS platform sdk dlgs.h) // and all push buttons will be left aligned with the standard // "OK" button //----------------------------------------------------------------- @@ -689,6 +689,8 @@ void CWinFileOpenImpl::EnlargeStdControlLabels() const HWND hFilterBoxLabel = GetDlgItem(m_hwndFileOpenDlg, stc2); HWND hFileNameBoxLabel = GetDlgItem(m_hwndFileOpenDlg, stc3); HWND hFileNameBox = GetDlgItem(m_hwndFileOpenDlg, cmb13); + if (!hFileNameBox) + hFileNameBox = GetDlgItem(m_hwndFileOpenDlg, edt1); // since Win2k it is cmb13 or edt1 HWND hFilterBox = GetDlgItem(m_hwndFileOpenDlg, cmb1); HWND hOkButton = GetDlgItem(m_hwndFileOpenDlg, IDOK); @@ -983,12 +985,15 @@ void SAL_CALL CWinFileOpenImpl::InitialSetDefaultName() // open dialog (reason: see above setDefaultName) if (m_bInitialSelChanged && m_defaultName.getLength()) { - // from W2k there is a combobox instead + // under W2k by default there is a combobox instead // of an edit field for the file name edit field - // So the control id of this box is cmb13 and not - // edt1 as before - HWND hwndEdt1 = GetDlgItem(m_hwndFileOpenDlg, cmb13); - SetWindowText(hwndEdt1, reinterpret_cast<LPCTSTR>(m_defaultName.getStr())); + // the control id of this box is cmb13 and not + // edt1 as before. + // However, edt1 is still possible. See fdo#74295 + HWND hFileNameBox = GetDlgItem(m_hwndFileOpenDlg, cmb13); + if (!hFileNameBox) + hFileNameBox = GetDlgItem(m_hwndFileOpenDlg, edt1); + SetWindowText(hFileNameBox, reinterpret_cast<LPCTSTR>(m_defaultName.getStr())); } m_bInitialSelChanged = sal_False; |