-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Try fix DataGrid HTML clipboard data faulty #10477
base: main
Are you sure you want to change the base?
Try fix DataGrid HTML clipboard data faulty #10477
Conversation
LGTM, this should be backported imho. A unit test wouldn't hurt. |
I don't really like the code this has been changed to, it's too fragile and might not survive git handling of new lines. |
Thx so much - for the ultra-quick reaction to this as well as just in general for maintaining the framework. |
@miloush What do you suggest? Thank you. How about back to origin code? |
Yeah that's a good point as raw string literals always emit whatever is in the source, and there's no way to emit specific line-endings (unfortunately, the language team has not shown any traction on a proposal to handle this). @lindexi We could just use a syntax like $"abcd \r\n" +
$"xxx \r\n" +
$"xxx \r\n"; Roslyn will lower this into one interpolated handler and it will look "decent" in the code. It will emit more But a test for the method would be enough to keep using the raw string literals here (I'm a fanboy) imho. It's an internal function by design and can be easily tested. |
Follow @h3xds1nz 's suggestion.
031cfea
to
6a1975b
Compare
Fixes #10476
Main PR
Description
The #8519 introduces behavior changed. And this pr restore the origin behavior.
The origin behavior is:
wpf/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Controls/DataGridClipboardHelper.cs
Lines 17 to 20 in d4ffc34
But after #8519 , it is:
wpf/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Controls/DataGridClipboardHelper.cs
Lines 83 to 113 in a792086
which wrong with double CR/LFs (
\r\n\r\n
)Customer Impact
Fixes #10476
Regression
See #8519
Testing
Only CI.
Risk
Normal. This PR will changed the DataGrid clipboard behavior.
Cc @halgab
Microsoft Reviewers: Open in CodeFlow