kbrown / rpms / libreoffice

Forked from rpms/libreoffice 2 years ago
Clone

Blame SOURCES/0048-fdo-74295-win32-fpicker-correctly-set-the-default-fi.patch

f085be
From 1a72abae4863c5f60c96b5fda2dcad8f46551fbd Mon Sep 17 00:00:00 2001
f085be
From: =?UTF-8?q?Aurimas=20Fi=C5=A1eras?= <aurimas@members.fsf.org>
f085be
Date: Mon, 21 Jul 2014 10:43:42 +0300
f085be
Subject: [PATCH 048/137] fdo#74295 win32 fpicker: correctly set the default
f085be
 file name
f085be
f085be
Revert "Cleaning: remove use of old edt1 from dlg.h (Windows)"
f085be
This reverts commit e9fd9c25269abe171e5f693a8c70b33ab5a01c85.
f085be
f085be
Reviewed-on: https://gerrit.libreoffice.org/10429
f085be
Reviewed-on: https://gerrit.libreoffice.org/10430
f085be
Reviewed-by: Andras Timar <andras.timar@collabora.com>
f085be
Tested-by: Andras Timar <andras.timar@collabora.com>
f085be
(cherry picked from commit a37d99eb176d0a302f92af287cc0d19ba2663bbc)
f085be
(cherry picked from commit bb4ffcdf9a3682f13f0145055f81921a764c36f3)
f085be
Signed-off-by: Andras Timar <andras.timar@collabora.com>
f085be
(cherry picked from commit 6466d0fec06e095bc596593357846802a24bb4af)
f085be
Signed-off-by: Andras Timar <andras.timar@collabora.com>
f085be
---
f085be
 fpicker/source/win32/filepicker/WinFileOpenImpl.cxx | 17 +++++++++++------
f085be
 1 file changed, 11 insertions(+), 6 deletions(-)
f085be
f085be
diff --git a/fpicker/source/win32/filepicker/WinFileOpenImpl.cxx b/fpicker/source/win32/filepicker/WinFileOpenImpl.cxx
f085be
index ee2760b..66e6caa 100644
f085be
--- a/fpicker/source/win32/filepicker/WinFileOpenImpl.cxx
f085be
+++ b/fpicker/source/win32/filepicker/WinFileOpenImpl.cxx
f085be
@@ -584,7 +584,7 @@ void SAL_CALL CWinFileOpenImpl::InitControlLabel(HWND hWnd)
f085be
 // Our approach is to align all static text controls with the
f085be
 // static text control "File name" of the FileOpen dialog,
f085be
 // all checkboxes and all list/comboboxes will be left aligned with
f085be
-// the standard combobox cmb13 (defined in MS platform sdk dlgs.h)
f085be
+// the standard combobox edt1/cmb13 (defined in MS platform sdk dlgs.h)
f085be
 // and all push buttons will be left aligned with the standard
f085be
 // "OK" button
f085be
 //-----------------------------------------------------------------
f085be
@@ -689,6 +689,8 @@ void CWinFileOpenImpl::EnlargeStdControlLabels() const
f085be
     HWND hFilterBoxLabel = GetDlgItem(m_hwndFileOpenDlg, stc2);
f085be
     HWND hFileNameBoxLabel = GetDlgItem(m_hwndFileOpenDlg, stc3);
f085be
     HWND hFileNameBox = GetDlgItem(m_hwndFileOpenDlg, cmb13);
f085be
+    if (!hFileNameBox)
f085be
+        hFileNameBox = GetDlgItem(m_hwndFileOpenDlg, edt1); // since Win2k it is cmb13 or edt1
f085be
 
f085be
     HWND hFilterBox = GetDlgItem(m_hwndFileOpenDlg, cmb1);
f085be
     HWND hOkButton = GetDlgItem(m_hwndFileOpenDlg, IDOK);
f085be
@@ -983,12 +985,15 @@ void SAL_CALL CWinFileOpenImpl::InitialSetDefaultName()
f085be
     // open dialog (reason: see above setDefaultName)
f085be
     if (m_bInitialSelChanged && m_defaultName.getLength())
f085be
     {
f085be
-        // from W2k there is a combobox instead
f085be
+        // under W2k by default there is a combobox instead
f085be
         // of an edit field for the file name edit field
f085be
-        // So the control id of this box is cmb13 and not
f085be
-        // edt1 as before
f085be
-        HWND hwndEdt1 = GetDlgItem(m_hwndFileOpenDlg, cmb13);
f085be
-        SetWindowText(hwndEdt1, reinterpret_cast<LPCTSTR>(m_defaultName.getStr()));
f085be
+        // the control id of this box is cmb13 and not
f085be
+        // edt1 as before.
f085be
+        // However, edt1 is still possible. See fdo#74295
f085be
+        HWND hFileNameBox = GetDlgItem(m_hwndFileOpenDlg, cmb13);
f085be
+        if (!hFileNameBox)
f085be
+            hFileNameBox = GetDlgItem(m_hwndFileOpenDlg, edt1);
f085be
+        SetWindowText(hFileNameBox, reinterpret_cast<LPCTSTR>(m_defaultName.getStr()));
f085be
     }
f085be
 
f085be
     m_bInitialSelChanged = sal_False;
f085be
-- 
f085be
1.9.3
f085be