Remove LRE/LRO characters from results and error messages #1161
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #504
Calculation results, Memory items, History items and error messages should be displayed LtoR whatever the current culture.
To this end, the current version of the code relies on ViewModels to format the string and add special characters (0x202a, 0x202c or 0x202d) to force Xaml to display the text left-to-right.
This implementation isn't ideal and case many issues with the clipboard when users try to copy-paste the result of a calculation.
This PR will move the management of the direction of the text-flow from the data (strings in view-models) to the UI renderer using the XAML property
FlowDirection
.Now that the strings are exempt of special characters, copy-paste will work correctly, whatever the application destination.
Description of the changes:
Example of the UI when we only remove the special characters
After we force Xaml to render controls left-to-right
How changes were validated: