Bläddra i källkod

It is not necessary to set the DefAttributes font

I seems that it might be related to RichEdit 2.0.
Or the fact that DefAttributes.Assign is already called from TCustomRichEdit.CMFontChanged

Source commit: 84c6af392d8400caafbc971822b77f449abba26f
Martin Prikryl 11 månader sedan
förälder
incheckning
a2f254413c
1 ändrade filer med 1 tillägg och 3 borttagningar
  1. 1 3
      source/forms/Editor.cpp

+ 1 - 3
source/forms/Editor.cpp

@@ -206,14 +206,11 @@ void __fastcall TEditorRichEdit::ApplyFont()
   TWinConfiguration::RestoreFont(FFontConfiguration, NewFont.get());
   // Rich Edit 4.1 scales the font on its own
   NewFont->Color = GetWindowTextColor(Color, FFontColor);
-  // setting DefAttributes may take quite time, even if the font attributes
-  // do not change, so avoid that if not necessary
   if (!FInitialized ||
       !SameFont(Font, NewFont.get()) ||
       (Font->Color != NewFont->Color))
   {
     Font->Assign(NewFont.get());
-    DefAttributes->Assign(Font);
   }
 }
 //---------------------------------------------------------------------------
@@ -230,6 +227,7 @@ void __fastcall TEditorRichEdit::SetFormat(
 
   // setting DefAttributes is noop if we do not have a handle
   // (btw code below would create one anyway)
+  // (and we now do not set DefAttributes anymore anyway)
   HandleNeeded();
 
   LockWindowUpdate(Handle);