Forum > LCL

[SOLVED] Code clean up at /lcl/buttons.pp

(1/1)

lagprogramming:
/lcl/buttons.pp has the following routines:

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---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  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---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  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---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:
Posted to https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/40414

Navigation

[0] Message Index

Go to full version