Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MSPAINT] Fix CMainWindow::GetSaveFileName #5356

Merged
merged 1 commit into from
Jun 19, 2023

Conversation

katahiromz
Copy link
Contributor

@katahiromz katahiromz commented Jun 19, 2023

Purpose

Fix filename extension cases and "File Type" field.
JIRA issue: CORE-18867

Proposed changes

  • If no filename extension on save, then append .png to the filename.

TODO

  • Do tests.

Comparison

Tested on Win10.

BEFORE:
before
AFTER:
after

@katahiromz katahiromz added the bugfix For bugfix PRs. label Jun 19, 2023
@katahiromz katahiromz added this to New PRs in ReactOS PRs via automation Jun 19, 2023
@katahiromz katahiromz merged commit 19d8862 into reactos:master Jun 19, 2023
33 checks passed
ReactOS PRs automation moved this from New PRs to Done Jun 19, 2023
@katahiromz katahiromz deleted the get-save-filename branch June 19, 2023 05:15
{
if (aguidFileTypesE[i] == Gdiplus::ImageFormatPNG)
// Choose PNG
wcscat(pszFile, L".png");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not done automatically by the GetSaveFileName function?
How was the original code behaving when running on Windows?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done automatically

But the extension is in uppercase.

Copy link
Contributor

@HBelusca HBelusca Jun 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I understand "our" (well, Wine...) code, https://git.reactos.org/?p=reactos.git;a=blob;f=dll/win32/comdlg32/filedlg.c;hb=19d88628515506f9392384ae45bc7d38d1e9708a#l3159 is where the extension gets appended. But it doesn't seem to make it upper.

The extensions appear in upper-case:
image
because the file type strings, that we generate from ATL or whatever, are in uppercase.

EDIT: See
https://git.reactos.org/?p=reactos.git;a=blob;f=dll/win32/gdiplus/image.c;hb=19d88628515506f9392384ae45bc7d38d1e9708a#l4771

https://git.reactos.org/?p=reactos.git;a=blob;f=sdk/lib/atl/atlimage.h;hb=19d88628515506f9392384ae45bc7d38d1e9708a#l732

https://git.reactos.org/?p=reactos.git;a=blob;f=modules/rostests/apitests/atl/CImage.cpp;hb=19d88628515506f9392384ae45bc7d38d1e9708a#l281

It is those strings that need a fix, if needed (TODO: Verify whether the native Windows gdiplus ant ATL CImage also generate the extensions in uppercase or not). Not this hackfix from this PR.

Also, you (yet again... 🙄 ) made a PR that nobody could review because you committed it few hours later. Please definitively stop that.

@binarymaster binarymaster removed this from Done in ReactOS PRs Mar 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix For bugfix PRs.
Projects
None yet
2 participants