[PATCH] Cleaning: remove use of old edt1 from dlg.h (Windows)

Julien Nabet (via Code Review) gerrit at gerrit.libreoffice.org
Fri Jun 14 08:45:59 PDT 2013


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/4283

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/83/4283/1

Cleaning: remove use of old edt1 from dlg.h (Windows)

edt1 was used before cmb13 (used from Win2K version)
So use only cmb13 + tweaks associated comments
See http://nabble.documentfoundation.org/Cppcheck-reassignment-of-edt1Id-because-isWin2000-has-been-removed-fpicker-module-td4061342.html

Change-Id: I9d56726508a9fbf2607c9d18b7b33eca340f1b9f
---
M fpicker/source/win32/filepicker/WinFileOpenImpl.cxx
1 file changed, 5 insertions(+), 11 deletions(-)



diff --git a/fpicker/source/win32/filepicker/WinFileOpenImpl.cxx b/fpicker/source/win32/filepicker/WinFileOpenImpl.cxx
index f672916..ee2760b 100644
--- a/fpicker/source/win32/filepicker/WinFileOpenImpl.cxx
+++ b/fpicker/source/win32/filepicker/WinFileOpenImpl.cxx
@@ -584,7 +584,7 @@
 // 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 cmb13 (defined in MS platform sdk dlgs.h)
 // and all push buttons will be left aligned with the standard
 // "OK" button
 //-----------------------------------------------------------------
@@ -689,8 +689,6 @@
     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); // under Win98 it is edt1 instead of cmb13
 
     HWND hFilterBox = GetDlgItem(m_hwndFileOpenDlg, cmb1);
     HWND hOkButton = GetDlgItem(m_hwndFileOpenDlg, IDOK);
@@ -985,15 +983,11 @@
     // open dialog (reason: see above setDefaultName)
     if (m_bInitialSelChanged && m_defaultName.getLength())
     {
-        sal_Int32 edt1Id = edt1;
-
-        // under W2k the there is a combobox instead
+        // from W2k 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);
+        // 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()));
     }
 

-- 
To view, visit https://gerrit.libreoffice.org/4283
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9d56726508a9fbf2607c9d18b7b33eca340f1b9f
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Julien Nabet <serval2412 at yahoo.fr>



More information about the LibreOffice mailing list