You've already forked lazarus-ccr
richmemo: wrap SetRangeParams range changes into BeginUpdate/EndUpdate. Making sure that no updates would be visibile as well as refreshing by the end of the change
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@5059 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@@ -867,26 +867,31 @@ begin
|
|||||||
Exit;
|
Exit;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// manually looping from text ranges and re-applying
|
Lines.BeginUpdate;
|
||||||
// all the style. changing only the ones that in the mask
|
try
|
||||||
i := TextStart;
|
// manually looping from text ranges and re-applying
|
||||||
j := TextStart + TextLength;
|
// all the style. changing only the ones that in the mask
|
||||||
while i < j do begin
|
i := TextStart;
|
||||||
GetTextAttributes(i, p);
|
j := TextStart + TextLength;
|
||||||
|
while i < j do begin
|
||||||
|
GetTextAttributes(i, p);
|
||||||
|
|
||||||
if tmm_Name in ModifyMask then p.Name := fnt.Name;
|
if tmm_Name in ModifyMask then p.Name := fnt.Name;
|
||||||
if tmm_Color in ModifyMask then p.Color := fnt.Color;
|
if tmm_Color in ModifyMask then p.Color := fnt.Color;
|
||||||
if tmm_Size in ModifyMask then p.Size := fnt.Size;
|
if tmm_Size in ModifyMask then p.Size := fnt.Size;
|
||||||
if tmm_Styles in ModifyMask then p.Style := p.Style + AddFontStyle - RemoveFontStyle;
|
if tmm_Styles in ModifyMask then p.Style := p.Style + AddFontStyle - RemoveFontStyle;
|
||||||
if tmm_BackColor in ModifyMask then begin
|
if tmm_BackColor in ModifyMask then begin
|
||||||
p.HasBkClr:=fnt.HasBkClr;
|
p.HasBkClr:=fnt.HasBkClr;
|
||||||
p.BkColor:=fnt.BkColor;
|
p.BkColor:=fnt.BkColor;
|
||||||
|
end;
|
||||||
|
l := GetContStyleLength(i);
|
||||||
|
if i + l > j then l := j - i;
|
||||||
|
if l = 0 then Break;
|
||||||
|
SetTextAttributes(i, l, p);
|
||||||
|
inc(i, l);
|
||||||
end;
|
end;
|
||||||
l := GetContStyleLength(i);
|
finally
|
||||||
if i + l > j then l := j - i;
|
Lines.EndUpdate
|
||||||
if l = 0 then Break;
|
|
||||||
SetTextAttributes(i, l, p);
|
|
||||||
inc(i, l);
|
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user