-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Properly add and remove reflect children #1661
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
Conversation
|
I'll look to see what sort of automated tests can be added for this when I recover from investigating the issue. 😴 |
|
Thank you Jeremy! #1034 in commit 462c242 made the following change: @@ -3803,9 +3801,8 @@ namespace System.Windows.Forms
value.AddReflectChild();
}
- Control c = ReflectParent as Control;
reflectParent = value;
- if (c != null)
+ if (ReflectParent is Control c)
{
c.RemoveReflectChild();
}The orginal code that come from .NET Fx: Control c = ReflectParent as Control;
reflectParent = value;
if (c != null) {
c.RemoveReflectChild();
}A significance of the order of instructions isn't particularly obvious. |
Codecov Report
@@ Coverage Diff @@
## master #1661 +/- ##
===================================================
- Coverage 25.93581% 25.88709% -0.04872%
===================================================
Files 807 807
Lines 267788 267786 -2
Branches 37960 37960
===================================================
- Hits 69453 69322 -131
- Misses 193404 193526 +122
- Partials 4931 4938 +7
|
|
I've enhanced our manual integration tests and reworded the commit message (hope you don't mind). 💭 I wonder if we can enhance our integration tests to perform actions (like change selected item in a combo) and assert a label has the expected text? |
Fixes dotnet#1311 Fixes dotnet#1520 Fixes dotnet#1607 Fixes dotnet#1644 The bug was introduced as part of refactoring in dotnet#1034 - ordering got flipped with switching `as` to `is`. The confusion was likely caused by the fact that the property setter called its own getter. Update the code to be more explicit in terminology to hopefully avoid this from happening again.
|
Added more manual tests for richtextboxes |
|
Does this actually fix #1520 as claimed in PR description? There was a stackoverflow article linked in #1631 (resolved duplicate of #1520) which explains "friendly name hyperlinks" as a feature being added in RTF 5.0 and WinForms never being updated to support it. From that description it doesn't sound like being cause by this particular regression, since it already regressed in Desktop Framework long before. If #1520 is solved by this PR then #1631 might need to be revisisted. |
It does. |
|
I see, I'd recommend to reopen/unduplicate #1631 then because it probably doesn't get fixed by this PR (can't test easily at the moment, but I added an example to the issue) |
|
tactics approved - preview 9 |
The bug was introduced as part of refactoring in #1034 - ordering got flipped with switching
astois.The confusion was likely caused by the fact that the property setter called its own getter.
Update the code to be more explicit in terminology to hopefully avoid this from happening again.
Fixes #1311
Fixes #1520
Fixes #1607
Fixes #1644
Proposed changes
Customer Impact
Regression?
Risk
Test methodology
Test environment(s)
Host (useful for support):
Version: 3.0.0-preview8-28405-07
Commit: d01b2fb7bc
Microsoft Reviewers: Open in CodeFlow