Skip to content

Fix PrintDialog to return DialogResult.Cancel when cancelled or closed#10928

Merged
JeremyKuhne merged 1 commit intodotnet:mainfrom
elachlan:PrintDialog
Feb 22, 2024
Merged

Fix PrintDialog to return DialogResult.Cancel when cancelled or closed#10928
JeremyKuhne merged 1 commit intodotnet:mainfrom
elachlan:PrintDialog

Conversation

@elachlan
Copy link
Contributor

@elachlan elachlan commented Feb 21, 2024

Fixes #10920

Microsoft Reviewers: Open in CodeFlow

@elachlan elachlan requested a review from a team as a code owner February 21, 2024 23:06
@elachlan
Copy link
Contributor Author

CC: @JeremyKuhne

@elachlan elachlan requested a review from JeremyKuhne February 21, 2024 23:07
@elachlan elachlan added the waiting-review This item is waiting on review by one or more members of team label Feb 21, 2024
Copy link
Member

@JeremyKuhne JeremyKuhne left a comment

Choose a reason for hiding this comment

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

Thanks! I don't know where I got HRESULT from. 😕

@JeremyKuhne JeremyKuhne removed the waiting-review This item is waiting on review by one or more members of team label Feb 21, 2024
@elachlan
Copy link
Contributor Author

Yeah, it happens. At least we have a test now!

There are a couple of things I found:

  1. DialogHostForm doesn't work with UseEXDialog = true;, hence no tests for that.
  2. CommDlgExtendedError docs are missing an entry for CDERR_GENERALCODES and any mention of zero being no error https://learn.microsoft.com/en-us/windows/win32/api/commdlg/nf-commdlg-commdlgextendederror

@codecov
Copy link

codecov bot commented Feb 21, 2024

Codecov Report

Attention: 5 lines in your changes are missing coverage. Please review.

Comparison is base (2441a36) 73.16090% compared to head (6dda778) 73.17039%.
Report is 7 commits behind head on main.

Additional details and impacted files
@@                 Coverage Diff                 @@
##                main      #10928         +/-   ##
===================================================
+ Coverage   73.16090%   73.17039%   +0.00948%     
===================================================
  Files           3087        3090          +3     
  Lines         633665      633647         -18     
  Branches       47402       47398          -4     
===================================================
+ Hits          463595      463642         +47     
+ Misses        166558      166458        -100     
- Partials        3512        3547         +35     
Flag Coverage Δ
Debug 73.17039% <80.00000%> (+0.00948%) ⬆️
integration 18.40184% <28.57143%> (+0.17547%) ⬆️
production 46.64012% <28.57143%> (+0.01172%) ⬆️
test 94.99504% <100.00000%> (+0.00059%) ⬆️
unit 43.52744% <0.00000%> (-0.03263%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

@JeremyKuhne JeremyKuhne merged commit 8f56143 into dotnet:main Feb 22, 2024
@elachlan elachlan deleted the PrintDialog branch February 22, 2024 00:13
@lonitra lonitra added this to the 9.0 Preview2 milestone Feb 23, 2024
KlausLoeffelmann pushed a commit to KlausLoeffelmann/winforms that referenced this pull request Mar 5, 2024
…losed (dotnet#10928)

Fix PrintDialog to return DialogResult.Cancel when cancelled or closed and add tests
@github-actions github-actions bot locked and limited conversation to collaborators Mar 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The DialogResult of PrintDialog is not correct when setting its UseEXDialog is false and clicking Cancel for dialog

3 participants