[COMDLG32] Sync with Wine Staging 1.9.23. CORE-12409
authorAmine Khaldi <amine.khaldi@reactos.org>
Tue, 22 Nov 2016 12:15:51 +0000 (12:15 +0000)
committerAmine Khaldi <amine.khaldi@reactos.org>
Tue, 22 Nov 2016 12:15:51 +0000 (12:15 +0000)
svn path=/trunk/; revision=73337

reactos/dll/win32/comdlg32/colordlg.c
reactos/dll/win32/comdlg32/comdlg32_ros.diff
reactos/dll/win32/comdlg32/filedlg.c
reactos/dll/win32/comdlg32/fontdlg.c
reactos/media/doc/README.WINE

index 590e6a8..4ad3ca9 100644 (file)
@@ -661,15 +661,11 @@ static void CC_EditSetRGB( CCPRIV *infoPtr )
    int r = GetRValue(cr);
    int g = GetGValue(cr);
    int b = GetBValue(cr);
    int r = GetRValue(cr);
    int g = GetGValue(cr);
    int b = GetBValue(cr);
-   char buffer[10];
 
    infoPtr->updating = TRUE;
 
    infoPtr->updating = TRUE;
-   sprintf(buffer, "%d", r);
-   SetWindowTextA( GetDlgItem(infoPtr->hwndSelf, IDC_COLOR_EDIT_R), buffer);
-   sprintf(buffer, "%d", g);
-   SetWindowTextA( GetDlgItem(infoPtr->hwndSelf, IDC_COLOR_EDIT_G), buffer);
-   sprintf( buffer, "%d", b );
-   SetWindowTextA( GetDlgItem(infoPtr->hwndSelf, IDC_COLOR_EDIT_B), buffer);
+   SetDlgItemInt(infoPtr->hwndSelf, IDC_COLOR_EDIT_R, r, TRUE);
+   SetDlgItemInt(infoPtr->hwndSelf, IDC_COLOR_EDIT_G, g, TRUE);
+   SetDlgItemInt(infoPtr->hwndSelf, IDC_COLOR_EDIT_B, b, TRUE);
    infoPtr->updating = FALSE;
  }
 }
    infoPtr->updating = FALSE;
  }
 }
@@ -681,15 +677,10 @@ static void CC_EditSetHSL( CCPRIV *infoPtr )
 {
  if (IsWindowVisible( GetDlgItem(infoPtr->hwndSelf, IDC_COLOR_GRAPH) ))   /* if full size */
  {
 {
  if (IsWindowVisible( GetDlgItem(infoPtr->hwndSelf, IDC_COLOR_GRAPH) ))   /* if full size */
  {
-   char buffer[10];
-
    infoPtr->updating = TRUE;
    infoPtr->updating = TRUE;
-   sprintf(buffer, "%d", infoPtr->h);
-   SetWindowTextA( GetDlgItem(infoPtr->hwndSelf, IDC_COLOR_EDIT_H), buffer);
-   sprintf(buffer, "%d", infoPtr->s);
-   SetWindowTextA( GetDlgItem(infoPtr->hwndSelf, IDC_COLOR_EDIT_S), buffer);
-   sprintf(buffer, "%d", infoPtr->l);
-   SetWindowTextA( GetDlgItem(infoPtr->hwndSelf, IDC_COLOR_EDIT_L), buffer);
+   SetDlgItemInt(infoPtr->hwndSelf, IDC_COLOR_EDIT_H, infoPtr->h, TRUE);
+   SetDlgItemInt(infoPtr->hwndSelf, IDC_COLOR_EDIT_S, infoPtr->s, TRUE);
+   SetDlgItemInt(infoPtr->hwndSelf, IDC_COLOR_EDIT_L, infoPtr->l, TRUE);
    infoPtr->updating = FALSE;
  }
  CC_PaintLumBar(infoPtr);
    infoPtr->updating = FALSE;
  }
  CC_PaintLumBar(infoPtr);
index a3a3685..fb7d332 100644 (file)
@@ -1,7 +1,7 @@
 diff -pudN e:\wine\dlls\comdlg32/cdlg32.c e:\reactos\dll\win32\comdlg32/cdlg32.c\r
 diff -pudN e:\wine\dlls\comdlg32/cdlg32.c e:\reactos\dll\win32\comdlg32/cdlg32.c\r
---- e:\wine\dlls\comdlg32/cdlg32.c     2015-02-21 17:13:08.621542200 +0100\r
-+++ e:\reactos\dll\win32\comdlg32/cdlg32.c     2015-07-21 09:48:05.584922500 +0100\r
-@@ -174,6 +157,8 @@ DWORD WINAPI CommDlgExtendedError(void)\r
+--- e:\wine\dlls\comdlg32/cdlg32.c     2016-11-16 17:28:42 +0100\r
++++ e:\reactos\dll\win32\comdlg32/cdlg32.c     2015-08-27 22:02:19 +0100\r
+@@ -157,6 +157,8 @@ DWORD WINAPI CommDlgExtendedError(void)\r
          return 0; /* we never set an error, so there isn't one */\r
  }\r
  \r
          return 0; /* we never set an error, so there isn't one */\r
  }\r
  \r
@@ -10,7 +10,7 @@ diff -pudN e:\wine\dlls\comdlg32/cdlg32.c e:\reactos\dll\win32\comdlg32/cdlg32.c
  /*************************************************************************\r
   * Implement the CommDlg32 class factory\r
   *\r
  /*************************************************************************\r
   * Implement the CommDlg32 class factory\r
   *\r
-@@ -283,7 +268,11 @@ HRESULT WINAPI DllGetClassObject(REFCLSI\r
+@@ -266,7 +268,11 @@ HRESULT WINAPI DllGetClassObject(REFCLSI\r
   */\r
  HRESULT WINAPI DllRegisterServer(void)\r
  {\r
   */\r
  HRESULT WINAPI DllRegisterServer(void)\r
  {\r
@@ -22,7 +22,7 @@ diff -pudN e:\wine\dlls\comdlg32/cdlg32.c e:\reactos\dll\win32\comdlg32/cdlg32.c
  }\r
  \r
  /***********************************************************************\r
  }\r
  \r
  /***********************************************************************\r
-@@ -291,5 +280,11 @@ HRESULT WINAPI DllRegisterServer(void)\r
+@@ -274,5 +280,11 @@ HRESULT WINAPI DllRegisterServer(void)\r
   */\r
  HRESULT WINAPI DllUnregisterServer(void)\r
  {\r
   */\r
  HRESULT WINAPI DllUnregisterServer(void)\r
  {\r
@@ -34,27 +34,10 @@ diff -pudN e:\wine\dlls\comdlg32/cdlg32.c e:\reactos\dll\win32\comdlg32/cdlg32.c
  }\r
 +\r
 +#endif /* Win 7 */\r
  }\r
 +\r
 +#endif /* Win 7 */\r
-\r
-diff -pudN e:\wine\dlls\comdlg32/comdlg32.spec e:\reactos\dll\win32\comdlg32/comdlg32.spec\r
---- e:\wine\dlls\comdlg32/comdlg32.spec        2015-02-21 17:13:08.621542200 +0100\r
-+++ e:\reactos\dll\win32\comdlg32/comdlg32.spec        2012-02-15 22:32:22.456422900 +0100\r
-@@ -3,9 +3,9 @@\r
- @ stdcall ChooseFontA(ptr)\r
- @ stdcall ChooseFontW(ptr)\r
- @ stdcall CommDlgExtendedError()\r
--@ stdcall -private DllGetClassObject(ptr ptr ptr)\r
--@ stdcall -private DllRegisterServer()\r
--@ stdcall -private DllUnregisterServer()\r
-+;@ stdcall -private DllGetClassObject(ptr ptr ptr) ; Win 7\r
-+;@ stdcall -private DllRegisterServer() ; Win 7\r
-+;@ stdcall -private DllUnregisterServer() ; Win 7\r
- @ stdcall FindTextA(ptr)\r
- @ stdcall FindTextW(ptr)\r
- @ stdcall GetFileTitleA(str ptr long)\r
 diff -pudN e:\wine\dlls\comdlg32/itemdlg.c e:\reactos\dll\win32\comdlg32/itemdlg.c\r
 diff -pudN e:\wine\dlls\comdlg32/itemdlg.c e:\reactos\dll\win32\comdlg32/itemdlg.c\r
---- e:\wine\dlls\comdlg32/itemdlg.c    2015-04-05 20:44:56.807083800 +0100\r
-+++ e:\reactos\dll\win32\comdlg32/itemdlg.c    2015-07-21 09:56:34.329021000 +0100\r
-@@ -18,10 +18,13 @@\r
+--- e:\wine\dlls\comdlg32/itemdlg.c    2016-08-14 19:11:13 +0100\r
++++ e:\reactos\dll\win32\comdlg32/itemdlg.c    2016-08-15 16:16:18 +0100\r
+@@ -18,6 +18,8 @@\r
   * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA\r
   */\r
  \r
   * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA\r
   */\r
  \r
@@ -63,12 +46,7 @@ diff -pudN e:\wine\dlls\comdlg32/itemdlg.c e:\reactos\dll\win32\comdlg32/itemdlg
  #include <stdarg.h>\r
  \r
  #define COBJMACROS\r
  #include <stdarg.h>\r
  \r
  #define COBJMACROS\r
- #define NONAMELESSUNION\r
-+#define NONAMELESSSTRUCT\r
\r
- #include "windef.h"\r
- #include "winbase.h"\r
-@@ -3847,3 +3850,5 @@ HRESULT FileSaveDialog_Constructor(IUnkn\r
+@@ -4659,3 +4661,5 @@ HRESULT FileSaveDialog_Constructor(IUnkn\r
  {\r
      return FileDialog_constructor(pUnkOuter, riid, ppv, ITEMDLG_TYPE_SAVE);\r
  }\r
  {\r
      return FileDialog_constructor(pUnkOuter, riid, ppv, ITEMDLG_TYPE_SAVE);\r
  }\r
index 5baaf29..26e183e 100644 (file)
@@ -1550,10 +1550,16 @@ static LRESULT FILEDLG95_InitControls(HWND hwnd)
          result = GetFullPathNameW(fodInfos->filename, MAX_PATH, tmpBuf, &nameBit);
          if (result) {
 
          result = GetFullPathNameW(fodInfos->filename, MAX_PATH, tmpBuf, &nameBit);
          if (result) {
 
-            /* nameBit is always shorter than the original filename */
-            lstrcpyW(fodInfos->filename,nameBit);
+            /* nameBit is always shorter than the original filename. It may be NULL
+             * when the filename contains only a drive name instead of file name */
+            if (nameBit)
+            {
+                lstrcpyW(fodInfos->filename,nameBit);
+                *nameBit = 0x00;
+            }
+            else
+                *fodInfos->filename = '\0';
 
 
-            *nameBit = 0x00;
             MemFree(fodInfos->initdir);
             fodInfos->initdir = MemAlloc((lstrlenW(tmpBuf) + 1)*sizeof(WCHAR));
             lstrcpyW(fodInfos->initdir, tmpBuf);
             MemFree(fodInfos->initdir);
             fodInfos->initdir = MemAlloc((lstrlenW(tmpBuf) + 1)*sizeof(WCHAR));
             lstrcpyW(fodInfos->initdir, tmpBuf);
@@ -2526,6 +2532,7 @@ BOOL FILEDLG95_OnOpen(HWND hwnd)
                 && fodInfos->ofnInfos->Flags & OFN_EXPLORER)
             {
               SendCustomDlgNotificationMessage(hwnd, CDN_FOLDERCHANGE);
                 && fodInfos->ofnInfos->Flags & OFN_EXPLORER)
             {
               SendCustomDlgNotificationMessage(hwnd, CDN_FOLDERCHANGE);
+              SendMessageA(fodInfos->DlgInfos.hwndFileName, WM_SETTEXT, 0, (LPARAM)"");
             }
          }
          else if( nOpenAction == ONOPEN_SEARCH )
             }
          }
          else if( nOpenAction == ONOPEN_SEARCH )
@@ -2536,6 +2543,13 @@ BOOL FILEDLG95_OnOpen(HWND hwnd)
           COMDLG32_SHFree(pidlCurrent);
           if (filename_is_edit( fodInfos ))
               SendMessageW(fodInfos->DlgInfos.hwndFileName, EM_SETSEL, 0, -1);
           COMDLG32_SHFree(pidlCurrent);
           if (filename_is_edit( fodInfos ))
               SendMessageW(fodInfos->DlgInfos.hwndFileName, EM_SETSEL, 0, -1);
+          else
+          {
+              HWND hwnd;
+
+              hwnd = (HWND)SendMessageA(fodInfos->DlgInfos.hwndFileName, CBEM_GETEDITCONTROL, 0, 0);
+              SendMessageW(hwnd, EM_SETSEL, 0, -1);
+          }
         }
       }
       ret = FALSE;
         }
       }
       ret = FALSE;
index b1a9bc9..6cc8c89 100644 (file)
@@ -517,7 +517,6 @@ static INT AddFontStyle( const ENUMLOGFONTEXW *lpElfex, const NEWTEXTMETRICEXW *
 
 static void CFn_FitFontSize( HWND hDlg, int points)
 {
 
 static void CFn_FitFontSize( HWND hDlg, int points)
 {
-    WCHAR buffW[16];
     int i,n;
 
     /* look for fitting font size in combobox3 */
     int i,n;
 
     /* look for fitting font size in combobox3 */
@@ -536,8 +535,7 @@ static void CFn_FitFontSize( HWND hDlg, int points)
     }
 
     /* no default matching size, set text manually */
     }
 
     /* no default matching size, set text manually */
-    sprintfW(buffW, fontsizefmtW, points);
-    SetDlgItemTextW(hDlg, cmb3, buffW);
+    SetDlgItemInt(hDlg, cmb3, points, TRUE);
 }
 
 static BOOL CFn_FitFontStyle( HWND hDlg, LONG packedstyle )
 }
 
 static BOOL CFn_FitFontStyle( HWND hDlg, LONG packedstyle )
index ff67f1a..7b2a0c5 100644 (file)
@@ -55,7 +55,7 @@ reactos/dll/win32/cabinet             # Synced to WineStaging-1.9.23
 reactos/dll/win32/clusapi             # Synced to WineStaging-1.9.11
 reactos/dll/win32/comcat              # Synced to WineStaging-1.9.11
 reactos/dll/win32/comctl32            # Synced to WineStaging-1.9.23
 reactos/dll/win32/clusapi             # Synced to WineStaging-1.9.11
 reactos/dll/win32/comcat              # Synced to WineStaging-1.9.11
 reactos/dll/win32/comctl32            # Synced to WineStaging-1.9.23
-reactos/dll/win32/comdlg32            # Synced to WineStaging-1.9.16
+reactos/dll/win32/comdlg32            # Synced to WineStaging-1.9.23
 reactos/dll/win32/compstui            # Synced to WineStaging-1.9.11
 reactos/dll/win32/credui              # Synced to WineStaging-1.9.16
 reactos/dll/win32/crypt32             # Synced to WineStaging-1.9.16
 reactos/dll/win32/compstui            # Synced to WineStaging-1.9.11
 reactos/dll/win32/credui              # Synced to WineStaging-1.9.16
 reactos/dll/win32/crypt32             # Synced to WineStaging-1.9.16