TAdvRichEditor doesn't recognize color on first SelectionChangedEvent

We load text as HTML which was previously saved with TAdvMiniHTMLIO. We have SpeedButtons representing the formatting of the text with the Down-State.

This works in general except for the first SelectionChanged-Event. When it fires the first time and the cursor stands on a text that is formatted, the formatting isn't read correctly.

Steps to reproduce:

  • Place a TAdvRichEditor and TAdvMiniHTMLIO on a form
  • Load Text into the RichEditor
  • Place the cursor into a red word - first event does nothing
  • Place the cursor somwhere else and back to a red word (or to another red word directly) - GetSelectionTextColor() works as expected.

Code for loading the text:

this->AdvRichEditorMiniHTMLIO1->Load(L"<FONT color=\"#000000\">11.12.2023&nbsp;Christian&nbsp;-&nbsp;Eine&nbsp;Erg&auml;nzung<BR></FONT><FONT color=\"#000000\">07.12.2023&nbsp;</FONT><FONT color=\"#000000\">Christian&nbsp;-&nbsp;<BR></FONT><FONT color=\"#000000\">04.12.2013:&nbsp;</FONT><U><FONT color=\"#DF0715\">Auftragskopie&nbsp;</FONT></U><FONT color=\"#000000\">an&nbsp;</FONT>", NULL, NULL);

Code for the SelectionChanged-Event:

	if (this->AdvRichEditor1->GetSelectionTextColor() == StringToColor(L"0x1507DF"))

Edit: We are using TAdvRichEditor Version and C++ Builder 12 Athens.

Thanks for reporting.
We traced & solved this issue. The next update will address this.

1 Like

Perfect, thank you!

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.