[Libreoffice-commits] core.git: fpicker/source

Aurimas Fišeras aurimas at members.fsf.org
Mon Jul 21 14:08:35 PDT 2014


 fpicker/source/win32/filepicker/WinFileOpenImpl.cxx |   19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)

New commits:
commit bb4ffcdf9a3682f13f0145055f81921a764c36f3
Author: Aurimas Fišeras <aurimas at members.fsf.org>
Date:   Mon Jul 21 11:11:22 2014 +0300

    win32 fpicker: correctly set the default file name
    
    Correctly set the default file name in win2k+
    See fdo#74295 for more details.
    
    Change-Id: I30117a8e1e50b157fee96f4777b0c3f11630165c
    Reviewed-on: https://gerrit.libreoffice.org/10430
    Reviewed-by: Andras Timar <andras.timar at collabora.com>
    Tested-by: Andras Timar <andras.timar at collabora.com>

diff --git a/fpicker/source/win32/filepicker/WinFileOpenImpl.cxx b/fpicker/source/win32/filepicker/WinFileOpenImpl.cxx
index 1305bb1..d852249 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 edt1 (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
 
@@ -690,7 +690,7 @@ void CWinFileOpenImpl::EnlargeStdControlLabels() const
     HWND hFileNameBoxLabel = GetDlgItem(m_hwndFileOpenDlg, stc3);
     HWND hFileNameBox = GetDlgItem(m_hwndFileOpenDlg, cmb13);
     if (!hFileNameBox)
-        hFileNameBox = GetDlgItem(m_hwndFileOpenDlg, edt1); // under Win98 it is edt1 instead of cmb13
+        hFileNameBox = GetDlgItem(m_hwndFileOpenDlg, edt1); // since Win2k it is cmb13 or edt1
 
     HWND hFilterBox = GetDlgItem(m_hwndFileOpenDlg, cmb1);
     HWND hOkButton = GetDlgItem(m_hwndFileOpenDlg, IDOK);
@@ -985,16 +985,15 @@ void SAL_CALL CWinFileOpenImpl::InitialSetDefaultName()
     // open dialog (reason: see above setDefaultName)
     if (m_bInitialSelChanged && m_defaultName.getLength())
     {
-        sal_Int32 edt1Id = edt1;
-
-        // under W2k the there is a combobox instead
+        // under W2k by default there is a combobox instead
         // of an edit field for the file name edit field
         // the control id of this box is cmb13 and not
-        // edt1 as before so we must use this id
-        edt1Id = cmb13;
-
-        HWND hwndEdt1 = GetDlgItem(m_hwndFileOpenDlg, edt1Id);
-        SetWindowText(hwndEdt1, reinterpret_cast<LPCTSTR>(m_defaultName.getStr()));
+        // 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;


More information about the Libreoffice-commits mailing list