Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Update rich text when text of a run changes #2516

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

Merged
merged 1 commit into from
Nov 19, 2024
Merged

Update rich text when text of a run changes #2516

merged 1 commit into from
Nov 19, 2024

Conversation

jahav
Copy link
Member

@jahav jahav commented Nov 19, 2024

When a property setter IXLRichString.Text (basically a representation of a rich text run) was called, the enveloping rich text IXLRichText didn't change.

We have mutable API for rich texts, but the implementation must be immutable. Immutability is required by shared string table that stores whole rich text as one entry in a dictionary. Key in a dictionary must be immutable (keep same hash keys and so on).

To solve this problem, IXLRichText is mostly a facade that changes immutable text when user calls a mutating method.

Property setter IXLRichText.Text didn't call "update-immutable-rich-text" method and thus text wasn't changed.

My confidence in RichText and XLComment (aka. mutable-API-changing-immutable-XLImmutableRichText adapters) is low and they should be rethought and rewritten and XLFormattedText probably deleted. Let's add it to the never-ending pile "should be done".

Fixes #2430

We have mutable API for rich text string, but the implementation must be immutable. Immutability is required by shared string table, that stores whole rich text as one entry in a dictionary and it's not acceptable  to change the stored text.

To solve this problem, rich text is mostly a facade that changes immutable text when user calls a mutating method.

Property setter IXLRichText.Text didn't call "update-immutable-rich-text" method and thus text wasn't changed.

Fixes #2430
@jahav jahav added this to the v0.105.0 milestone Nov 19, 2024
@jahav jahav added bug triaged Checked and and verified that it is actionable (not dup, has required info) feature:rich-text and removed bug triaged Checked and and verified that it is actionable (not dup, has required info) feature:rich-text labels Nov 19, 2024
@jahav jahav merged commit d11dae0 into develop Nov 19, 2024
6 checks passed
@jahav jahav deleted the issue-2430 branch November 19, 2024 01:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Not possible to change "IXLRichString.Text" property
1 participant