richmemo: efficient way of setting attributes

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@4377 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
skalogryz
2015-10-12 20:20:41 +00:00
parent 180a1d049d
commit 3e0fabe544
4 changed files with 96 additions and 21 deletions

View File

@@ -850,6 +850,16 @@ begin
if (ModifyMask = []) or (TextLength = 0) then Exit;
if TWSCustomRichMemoClass(WidgetSetClass).isInternalChange(Self, ModifyMask) then
begin
// more effecient from OS view
TWSCustomRichMemoClass(WidgetSetClass).SetTextAttributesInternal(Self,
TextStart, TextLength, ModifyMask, fnt);
Exit;
end;
// manually looping from text ranges and re-applying
// all the style. changing only the ones that in the mask
i := TextStart;
j := TextStart + TextLength;
while i < j do begin