View Issue Details

IDProjectCategoryView StatusLast Update
0033546Lazarus CCRPackagespublic2020-01-13 16:20
ReporterBob Richardson Assigned ToDmitry Boyarintsev  
Status resolvedResolutionfixed 
Summary0033546: RichMemo - Losing Background color
DescriptionThis is a problem with RichMemo. Perhaps I should be mentioning this to skalogryz, not here? When editing an RTF file, I can apply a background color with no problem (e.g. yellow). When I then insert some text within that yellow background text, the new text has the default (white) background, not yellow.
Additional InformationI think the fix is an easy one. In the Win32RichMemoProc unit, make this change:

procedure CharFormatToFontParams(const fmt: TCHARFORMAT2; var Params: TIntFontParams);
  Params.Name := fmt.szFaceName;
  Params.Size := Round(fmt.yHeight / TwipsInFontSize);
  Params.Color := fmt.crTextColor;
  Params.Style := EffectsToFontStyles(fmt.dwEffects);

  if fmt.cbSize > sizeof(CHARFORMAT) then
    Params.HasBkClr := (fmt.dwEffects and CFE_AUTOBACKCOLOR) = 0;
// if Params.HasBkClr then Params.Color:=Params.Color; // I changed this
    if Params.HasBkClr then Params.BkColor := fmt.crBackColor;
    Params.VScriptPos := EffectsToVScriptPost(fmt.dwEffects);
TagsNo tags attached.
Attached Files


Dmitry Boyarintsev

2020-01-13 16:20

developer   ~0120408

the issue was resolved in r5836

Issue History

Date Modified Username Field Change
2018-04-02 00:13 Bob Richardson New Issue
2018-12-16 16:34 Bart Broersma Project Packages => Lazarus CCR
2019-01-29 19:56 Dmitry Boyarintsev Status new => assigned
2019-01-29 19:56 Dmitry Boyarintsev Assigned To => Dmitry Boyarintsev
2020-01-13 16:20 Dmitry Boyarintsev Status assigned => resolved
2020-01-13 16:20 Dmitry Boyarintsev Resolution open => fixed
2020-01-13 16:20 Dmitry Boyarintsev Note Added: 0120408