[SOLVED] Code clean up at /lcl/buttons.pp lazarus / 7-LCL ---------------------------------------------------------------------- lagprogramming · 2023-07-23 06:59 /lcl/buttons.pp has the following routines: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i function GetDefaultButtonIcon(idButton: Integer;  ScalePercent: Integer): TCustomBitmap;var  ResName: string;begin  Result := nil;  if (idButton < Low(BitBtnResNames)) or (idButton > High(BitBtnResNames)) then    Exit;  if BitBtnResNames[idButton] = '' then    Exit;  Result := GetDefaultGlyph(BitBtnResNames[idButton], ScalePercent);end;Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure LoadGlyphFromResource(AGlyph: TButtonGlyph; idButton: Integer);var  I: Integer;begin  if not((Low(TButtonImage)<=idButton) and (idButton<=High(TButtonImage))) then    Exit;  AGlyph.LCLGlyphName := BitBtnResNames[idButton];end;The variables are declared but never used. The following patch removes them: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i diff --git a/lcl/buttons.pp b/lcl/buttons.ppindex c441f1494a..55d9ae8988 100644--- a/lcl/buttons.pp+++ b/lcl/buttons.pp@@ -575,8 +575,6 @@ end;  function GetDefaultButtonIcon(idButton: Integer;   ScalePercent: Integer): TCustomBitmap;-var-  ResName: string; begin   Result := nil;   if (idButton < Low(BitBtnResNames)) or (idButton > High(BitBtnResNames)) then@@ -631,8 +629,6 @@ begin end;  procedure LoadGlyphFromResource(AGlyph: TButtonGlyph; idButton: Integer);-var-  I: Integer; begin   if not((Low(TButtonImage)<=idButton) and (idButton<=High(TButtonImage))) then     Exit; ---------------------------------------------------------------------- AlexTP · 2023-07-29 15:00 Posted to https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/40414