[SOLVED] Duplicate code removal in lcl/controls.pp lazarus / 7-LCL ---------------------------------------------------------------------- lagprogramming · 2023-04-03 11:30 procedure TControlChildSizing.Assign(Source: TPersistent); has useless duplication of the following code: 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 FEnlargeHorizontal:=SrcSizing.EnlargeHorizontal;    FEnlargeVertical:=SrcSizing.EnlargeVertical;    FShrinkHorizontal:=SrcSizing.ShrinkHorizontal;    FShrinkVertical:=SrcSizing.ShrinkVertical;    function TControlChildSizing.IsEqual(Sizing: TControlChildSizing): boolean; has useless duplication of the following code: 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 (FEnlargeHorizontal=Sizing.EnlargeHorizontal)      and (FEnlargeVertical=Sizing.EnlargeVertical)      and (FShrinkHorizontal=Sizing.ShrinkHorizontal)      and (FShrinkVertical=Sizing.ShrinkVertical)       The following patch removes the duplicate code. 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/controls.pp b/lcl/controls.ppindex 397076a37a..172b2e1e7f 100644--- a/lcl/controls.pp+++ b/lcl/controls.pp@@ -4033,10 +4033,6 @@ begin     SrcSizing:=TControlChildSizing(Source);     if IsEqual(SrcSizing) then exit; -    FEnlargeHorizontal:=SrcSizing.EnlargeHorizontal;-    FEnlargeVertical:=SrcSizing.EnlargeVertical;-    FShrinkHorizontal:=SrcSizing.ShrinkHorizontal;-    FShrinkVertical:=SrcSizing.ShrinkVertical;     FEnlargeHorizontal:=SrcSizing.EnlargeHorizontal;     FEnlargeVertical:=SrcSizing.EnlargeVertical;     FShrinkHorizontal:=SrcSizing.ShrinkHorizontal;@@ -4061,10 +4057,6 @@ end; function TControlChildSizing.IsEqual(Sizing: TControlChildSizing): Boolean; begin   Result:=(FEnlargeHorizontal=Sizing.EnlargeHorizontal)-      and (FEnlargeVertical=Sizing.EnlargeVertical)-      and (FShrinkHorizontal=Sizing.ShrinkHorizontal)-      and (FShrinkVertical=Sizing.ShrinkVertical)-      and (FEnlargeHorizontal=Sizing.EnlargeHorizontal)       and (FEnlargeVertical=Sizing.EnlargeVertical)       and (FShrinkHorizontal=Sizing.ShrinkHorizontal)       and (FShrinkVertical=Sizing.ShrinkVertical) ---------------------------------------------------------------------- Martin_fr · 2023-04-03 16:46 Please report on the bugtracker. Thanks ---------------------------------------------------------------------- JuhaManninen · 2023-04-04 22:38 I removed the duplicate lines. Thanks for noticing them.