From 97c086cc027cf7c0ddab0b29ed66fb9b620fe6d2 Mon Sep 17 00:00:00 2001 From: Alexey Date: Tue, 25 Oct 2022 17:52:33 +0300 Subject: [PATCH] refac --- app/formcolorsetup.pas | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/app/formcolorsetup.pas b/app/formcolorsetup.pas index 220154e451a..40da51ac26b 100644 --- a/app/formcolorsetup.pas +++ b/app/formcolorsetup.pas @@ -272,7 +272,6 @@ procedure TfmColorSetup.ListStylesDrawItem(Control: TWinControl; AIndex: Integer var C: TCanvas; st: TecSyntaxFormat; - S: string; NWidth: integer; begin if (AIndex<0) or (AIndex>=ListStyles.Items.Count) then exit; @@ -289,9 +288,8 @@ procedure TfmColorSetup.ListStylesDrawItem(Control: TWinControl; AIndex: Integer if st.BgColor=clNone then C.Brush.Color:= FColorBg; - S:= cExample; - NWidth:= C.TextWidth(S); - C.TextOut(ARect.Right-NWidth, ARect.Top, S); + NWidth:= C.TextWidth(cExample); + C.TextOut(ARect.Right-NWidth, ARect.Top, cExample); if st.BorderColorBottom<>clNone then begin @@ -307,10 +305,9 @@ procedure TfmColorSetup.ListStylesDrawItem(Control: TWinControl; AIndex: Integer else C.Brush.Color:= clWindow; - S:= ListStyles.Items[AIndex]; C.Font.Color:= clWindowText; C.Font.Style:= []; - C.TextOut(ARect.Left+cIndent, ARect.Top, S); + C.TextOut(ARect.Left+cIndent, ARect.Top, ListStyles.Items[AIndex]); end; procedure TfmColorSetup.OKButtonClick(Sender: TObject);