Changeset 8279 for trunk/src


Ignore:
Timestamp:
Apr 17, 2002, 3:42:45 PM (23 years ago)
Author:
sandervl
Message:

PF: If application specifies full path in file dialog structure (and initial dir string is NULL), then change to the directory.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/comdlg32/filedlg95.c

    r7137 r8279  
    10831083{
    10841084  LPITEMIDLIST pidlItemId = NULL;
    1085  
     1085  CHAR *dopstr = NULL;
     1086
    10861087  FileOpenDlgInfos *fodInfos = (FileOpenDlgInfos *) lParam;
    10871088
     
    10891090  fodInfos->ofnInfos->lpstrInitialDir, fodInfos->ofnInfos->lpstrFile);
    10901091
     1092#ifdef __WIN32OS2__
     1093  /*@PF
     1094  How can Wine miss this?? Very common situation for Windows apps!
     1095  If InitialDir is NULL and we have full blown path in lpstrFile we set
     1096  directory to it.
     1097
     1098  Q: What about Unicode?
     1099  */
     1100
     1101  if (fodInfos->ofnInfos->lpstrInitialDir == NULL && fodInfos->ofnInfos->lpstrFile &&
     1102    !PathIsRelativeA(fodInfos->ofnInfos->lpstrFile) &&
     1103    PathGetDriveNumberA(fodInfos->ofnInfos->lpstrFile) != -1)
     1104  {
     1105   dopstr = HEAP_strdupA(GetProcessHeap(), 0,fodInfos->ofnInfos->lpstrFile);     
     1106   *strrchr(dopstr,'\\') = '\0';
     1107   fodInfos->ofnInfos->lpstrInitialDir = dopstr;
     1108  }
     1109#endif
     1110
    10911111  /* Get the initial directory pidl */
    1092 
    10931112  if(!(pidlItemId = GetPidlFromName(fodInfos->Shell.FOIShellFolder,fodInfos->ofnInfos->lpstrInitialDir)))
    10941113  {
     
    10981117    pidlItemId = GetPidlFromName(fodInfos->Shell.FOIShellFolder, path);
    10991118  }
    1100 
     1119 
    11011120  /* Initialise shell objects */
    11021121  FILEDLG95_SHELL_Init(hwnd);
     
    11141133  COMDLG32_SHFree(pidlItemId);
    11151134
     1135#ifdef __WIN32OS2__
     1136  /* Free dopstr */
     1137  if (dopstr)
     1138  {
     1139   fodInfos->ofnInfos->lpstrInitialDir = NULL;
     1140   HEAP_free(dopstr);
     1141  } 
     1142#endif
    11161143  return TRUE;
    11171144}
Note: See TracChangeset for help on using the changeset viewer.