mirror of
https://github.com/reactos/reactos.git
synced 2025-04-29 18:48:53 +00:00
[MSPAINT] Fix CMainWindow::GetSaveFileName (#5356)
Fix filename extension cases and "File Type" field. If no filename extension on save, then append ".png" to the filename. CORE-18867
This commit is contained in:
parent
64ef3ced9c
commit
19d8862851
1 changed files with 10 additions and 5 deletions
|
@ -123,13 +123,18 @@ BOOL CMainWindow::GetSaveFileName(IN OUT LPTSTR pszFile, INT cchMaxFile)
|
|||
sfn.lpfnHook = OFNHookProc;
|
||||
sfn.lpstrDefExt = L"png";
|
||||
|
||||
// Choose PNG
|
||||
for (INT i = 0; i < aguidFileTypesE.GetSize(); ++i)
|
||||
LPWSTR pchDotExt = PathFindExtensionW(pszFile);
|
||||
if (*pchDotExt == UNICODE_NULL)
|
||||
{
|
||||
if (aguidFileTypesE[i] == Gdiplus::ImageFormatPNG)
|
||||
// Choose PNG
|
||||
wcscat(pszFile, L".png");
|
||||
for (INT i = 0; i < aguidFileTypesE.GetSize(); ++i)
|
||||
{
|
||||
sfn.nFilterIndex = i + 1;
|
||||
break;
|
||||
if (aguidFileTypesE[i] == Gdiplus::ImageFormatPNG)
|
||||
{
|
||||
sfn.nFilterIndex = i + 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue