[Bug 15640] Tile Studio 2.55: Can't export maps without an extension

wine-bugs at winehq.org wine-bugs at winehq.org
Sat May 16 14:09:29 CDT 2009


http://bugs.winehq.org/show_bug.cgi?id=15640





--- Comment #5 from Jaime Tejedor Gómez <metalbrain_coder at gmx.net>  2009-05-16 14:09:29 ---
Bug is still present in 1.1.21 , though the fixme message has stopped
appearing, since the resizable dialogs have been implemented.

This bug seems to be related:
http://bugs.winehq.org/show_bug.cgi?id=9548

I've made some tests, and found this in file dlls/comdlg32/filedlg.c, function
FILEDLG95_OnOpen:

        if (! *ext)
        {
            /* if no extension is specified with file name, then */
            /* attach the extension from file filter or default one */

            WCHAR *filterExt = NULL;
            LPWSTR lpstrFilter = NULL;
            static const WCHAR szwDot[] = {'.',0};
            int PathLength = lstrlenW(lpstrPathAndFile);

            /* Attach the dot*/
            lstrcatW(lpstrPathAndFile, szwDot);

            /*Get the file extension from file type filter*/
            lpstrFilter = (LPWSTR)
CBGetItemDataPtr(fodInfos->DlgInfos.hwndFileTypeCB,
                                            
fodInfos->ofnInfos->nFilterIndex-1);

            if (lpstrFilter != (LPWSTR)CB_ERR)  /* control is not empty */
                filterExt = PathFindExtensionW(lpstrFilter);

            if ( filterExt && *filterExt ) /* attach the file extension from
file type filter*/
                lstrcatW(lpstrPathAndFile, filterExt + 1);
            else if ( fodInfos->defext ) /* attach the default file extension*/
                lstrcatW(lpstrPathAndFile, fodInfos->defext);

            /* In Open dialog: if file does not exist try without extension */
            if (!(fodInfos->DlgInfos.dwDlgProp & FODPROP_SAVEDLG) &&
!PathFileExistsW(lpstrPathAndFile))
                  lpstrPathAndFile[PathLength] = '\0';
        }


when lpstrFilter is "*.*", it will add '.*' to the filename, causing the
problem. I made an ugly hack to avoid it and it worked, adding these lines:

        // Don't add any extension if filter extension is ".*"
    if(strcmp("L\".*\"",debugstr_w(filterExt))==0)
                lpstrPathAndFile[PathLength] = '\0';

but I'm sure there must be a proper way to do it.

-- 
Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
Do not reply to this email, post in Bugzilla using the
above URL to reply.
------- You are receiving this mail because: -------
You are watching all bug changes.


More information about the wine-bugs mailing list