Author: ptw
Date: 2007-07-19 19:01:28 -0700 (Thu, 19 Jul 2007)
New Revision: 5723

Modified:
   openlaszlo/branches/legals/lps/components/utils/layouts/wrappinglayout.lzx
Log:
Change 20070719-ptw-k by [EMAIL PROTECTED] on 2007-07-19 20:53:48 EDT
    in /Users/ptw/OpenLaszlo/legals
    for http://svn.openlaszlo.org/openlaszlo/branches/legals

Summary: Correctly default x and y spacing in wrapping layout

Bugs Fixed:
LPP-4215 'wrappinglayout construct() method refers to args.spacing, which is 
undefined. should refer to this.spacing'

Technical Reviewer: promanik (Message-Id: <[EMAIL PROTECTED]>)
QA Reviewer: ewinard (pending)

Details:
    x and y spacing default to the value of spacing, but that may be
    specified in the instance, so you have to look first in `args` for
    a user-specified spacing before falling back to `this.spacing`
    which is the class default value.

Tests:
    Test case in Jira passes



Modified: 
openlaszlo/branches/legals/lps/components/utils/layouts/wrappinglayout.lzx
===================================================================
--- openlaszlo/branches/legals/lps/components/utils/layouts/wrappinglayout.lzx  
2007-07-20 01:33:20 UTC (rev 5722)
+++ openlaszlo/branches/legals/lps/components/utils/layouts/wrappinglayout.lzx  
2007-07-20 02:01:28 UTC (rev 5723)
@@ -26,8 +26,11 @@
     <!--- @keywords private -->
     <method name="construct" args="parent, args">
         super.construct(parent, args);
-        if (args['xspacing'] == null) args.xspacing = args.spacing;
-        if (args['yspacing'] == null) args.yspacing = args.spacing;
+        <!-- The class default value is this.spacing, but the user may 
override that in args -->
+        <!-- If x and y spacing are not specified they take on the default 
value -->
+        var defaultSpacing = ('spacing' in args)?args.spacing:this.spacing;
+        if (! ('xspacing' in args)) args.xspacing = defaultSpacing;
+        if (! ('yspacing' in args)) args.yspacing = defaultSpacing;
     </method>
 
     <!--- @keywords private -->


_______________________________________________
Laszlo-checkins mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-checkins

Reply via email to