View Issue Details

IDProjectCategoryView StatusLast Update
0021732LazarusLCLpublic2012-04-24 14:39
ReporterDavid Jenkins Assigned ToZeljan Rikalo  
PrioritynormalSeverityminorReproducibilitysometimes
Status closedResolutionfixed 
Product Version0.9.30.5 (SVN) 
Summary0021732: TCarbonSpinEdit.CreateWidget has possible bad loop
DescriptionCalling GetEditBounds results in a call to GetPreferredSize that can rely on Widget already being created. So the call in TCarbonSpinEdit.CreateWidget to CreateEditUniCodeTextControl with GetEditBounds() as a param creates a bad loop.

Suggested fix is to drop GetEditBounds call and instead call SetBounds(ParamsToRect(AParams)) at the bottom of the function.

Patch against 36681 attached.
TagsNo tags attached.
Fixed in Revision36962
LazTarget-
WidgetsetCarbon
Attached Files

Activities

2012-04-13 16:40

 

carbonedits.pp.patch (733 bytes)   
--- /Users/djenkins/laz-changes/13882/carbonedits.pp	2012-04-09 16:28:32.000000000 
+++ /Users/djenkins/laz-changes/13882/carbonedits.pp.ss	2012-04-09 16:29:23.000000000 
@@ -1151,8 +1151,7 @@
   CreateCFString(AParams.Caption, CFString);
   try
     if OSError(
-      CreateEditUniCodeTextControl(GetTopParentWindow,
-        HIRectToCarbonRect(GetEditBounds(ParamsToHIRect(AParams))),
+      CreateEditUniCodeTextControl(GetTopParentWindow, ParamsToCarbonRect(AParams),
         CFString, False, nil, Widget),
       Self, SCreateWidget, 'CreateEditUniCodeTextControl') then RaiseCreateWidgetError(LCLObject);
   finally
@@ -1179,6 +1178,7 @@
     
   inherited;
   
+  SetBounds(ParamsToRect(AParams));
   UpdateControl;
 end;
 
carbonedits.pp.patch (733 bytes)   

2012-04-19 21:17

 

svn_patch-21732 (788 bytes)   
Index: lcl/interfaces/carbon/carbonedits.pp
===================================================================
--- lcl/interfaces/carbon/carbonedits.pp	(revision 36681)
+++ lcl/interfaces/carbon/carbonedits.pp	(working copy)
@@ -1151,8 +1151,7 @@
   CreateCFString(AParams.Caption, CFString);
   try
     if OSError(
-      CreateEditUniCodeTextControl(GetTopParentWindow,
-        HIRectToCarbonRect(GetEditBounds(ParamsToHIRect(AParams))),
+      CreateEditUniCodeTextControl(GetTopParentWindow, ParamsToCarbonRect(AParams),
         CFString, False, nil, Widget),
       Self, SCreateWidget, 'CreateEditUniCodeTextControl') then RaiseCreateWidgetError(LCLObject);
   finally
@@ -1179,6 +1178,7 @@
     
   inherited;
   
+  SetBounds(ParamsToRect(AParams));
   UpdateControl;
 end;
 
svn_patch-21732 (788 bytes)   

Zeljan Rikalo

2012-04-21 17:35

developer   ~0058848

Please test and close if ok.

Issue History

Date Modified Username Field Change
2012-04-13 16:40 David Jenkins New Issue
2012-04-13 16:40 David Jenkins File Added: carbonedits.pp.patch
2012-04-13 16:40 David Jenkins Widgetset => Carbon
2012-04-19 21:17 David Jenkins File Added: svn_patch-21732
2012-04-21 17:35 Zeljan Rikalo Fixed in Revision => 36962
2012-04-21 17:35 Zeljan Rikalo LazTarget => -
2012-04-21 17:35 Zeljan Rikalo Status new => resolved
2012-04-21 17:35 Zeljan Rikalo Resolution open => fixed
2012-04-21 17:35 Zeljan Rikalo Assigned To => Zeljan Rikalo
2012-04-21 17:35 Zeljan Rikalo Note Added: 0058848
2012-04-24 14:39 David Jenkins Status resolved => closed