Skip to content

Update rich text when text of a run changes#2516

Merged
jahav merged 1 commit intodevelopfrom
issue-2430
Nov 19, 2024
Merged

Update rich text when text of a run changes#2516
jahav merged 1 commit intodevelopfrom
issue-2430

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
@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

1 participant