View Issue Details

IDProjectCategoryView StatusLast Update
0020490PatchesLCLpublic2011-10-15 21:41
ReporterHans-Peter Diettrich Assigned ToJuha Manninen  
PrioritynormalSeveritytweakReproducibilityhave not tried
Status resolvedResolutionfixed 
Product Version0.9.31 (SVN) 
Summary0020490: Minor patch for TWinControl.RealizeBoundsRecursive
DescriptionThis patch removes duplicate indexed access to Controls[], and adjusts the local variable type to the correct TControl.
TagsNo tags attached.
Fixed in Revisionr32914
LazTarget-
Widgetset
Attached Files

Activities

2011-10-15 11:04

 

twc.RealizeBoundsRecursive.patch (851 bytes)   
Index: include/wincontrol.inc
===================================================================
--- include/wincontrol.inc	(revision 32804)
+++ include/wincontrol.inc	(working copy)
@@ -8259,7 +8259,7 @@
 var
   i: Integer;
   OldRealizing: boolean;
-  AWinControl: TWinControl;
+  AControl: TControl;
 begin
   if not HandleAllocated then exit;
   OldRealizing:=wcfRealizingBounds in FWinControlFlags;
@@ -8267,9 +8267,9 @@
   try
     if FControls<>nil then begin
       for i:=0 to FControls.Count-1 do begin
-        AWinControl:=TWinControl(FControls[i]);
-        if (AWinControl is TWinControl) then
-          TWinControl(FControls[i]).RealizeBoundsRecursive;
+        AControl:=FControls[i];
+        if (AControl is TWinControl) then
+          TWinControl(AControl).RealizeBoundsRecursive;
       end;
     end;
     RealizeBounds;

Hans-Peter Diettrich

2011-10-15 11:14

reporter   ~0052988

Question: is the handling of wcfRealizingBounds correct?
Why is this flag reset *only* when it was set *before* this method was called?

Shouldn't it read like this:
  finally
    if *not* OldRealizing then
      Exclude(FWinControlFlags,wcfRealizingBounds);
  end;

Juha Manninen

2011-10-15 12:13

developer   ~0052990

I applied the patch in r32901. Thanks.
What about the question? Can you test if the change is needed?

Juha Manninen

2011-10-15 12:34

developer   ~0052992

Damn DoDi, you didn't test your patch at all. It does not even compile. I tested on Windows only after committing (I work on Linux).
Now reverted.
I must be more careful in future.

Hans-Peter Diettrich

2011-10-15 14:51

reporter   ~0053003

You're right, I compiled the wrong file :-(
In the patch I missed one mandatory cast:
        AControl:=TControl(FControls[i]);

Juha Manninen

2011-10-15 21:40

developer   ~0053030

I committed the patch from Windows. Mattias has fixed the finally section.

Issue History

Date Modified Username Field Change
2011-10-15 11:04 Hans-Peter Diettrich New Issue
2011-10-15 11:04 Hans-Peter Diettrich File Added: twc.RealizeBoundsRecursive.patch
2011-10-15 11:14 Hans-Peter Diettrich Note Added: 0052988
2011-10-15 12:04 Juha Manninen Status new => assigned
2011-10-15 12:04 Juha Manninen Assigned To => Juha Manninen
2011-10-15 12:13 Juha Manninen Note Added: 0052990
2011-10-15 12:34 Juha Manninen LazTarget => -
2011-10-15 12:34 Juha Manninen Note Added: 0052992
2011-10-15 12:34 Juha Manninen Status assigned => feedback
2011-10-15 14:51 Hans-Peter Diettrich Note Added: 0053003
2011-10-15 21:40 Juha Manninen Status feedback => resolved
2011-10-15 21:40 Juha Manninen Resolution open => fixed
2011-10-15 21:40 Juha Manninen Note Added: 0053030
2011-10-15 21:41 Juha Manninen Fixed in Revision => r32914