You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by cf...@apache.org on 2013/01/17 00:31:34 UTC
svn commit: r1434491 -
/flex/sdk/branches/develop/frameworks/projects/mobilecomponents/src/spark/components/DateSpinner.as
Author: cframpton
Date: Wed Jan 16 23:31:34 2013
New Revision: 1434491
URL: http://svn.apache.org/viewvc?rev=1434491&view=rev
Log:
Fix mustella DateSpinner test RTEs. Handle the case where the font isn't embedded correctly and the label length is 0. The DataSpinner will be missing text but it should not RTE. Currently this is the case for the zh_CN tests since we don't have an open source font.
Modified:
flex/sdk/branches/develop/frameworks/projects/mobilecomponents/src/spark/components/DateSpinner.as
Modified: flex/sdk/branches/develop/frameworks/projects/mobilecomponents/src/spark/components/DateSpinner.as
URL: http://svn.apache.org/viewvc/flex/sdk/branches/develop/frameworks/projects/mobilecomponents/src/spark/components/DateSpinner.as?rev=1434491&r1=1434490&r2=1434491&view=diff
==============================================================================
--- flex/sdk/branches/develop/frameworks/projects/mobilecomponents/src/spark/components/DateSpinner.as (original)
+++ flex/sdk/branches/develop/frameworks/projects/mobilecomponents/src/spark/components/DateSpinner.as Wed Jan 16 23:31:34 2013
@@ -1254,8 +1254,12 @@ public class DateSpinner extends Skinnab
private function getLongestLabel(list:IList):Object
{
var idx:int = -1;
- var maxWidth:Number = 0;
var labelWidth:Number;
+
+ // Even if all 0 because font not embedded correctly, want to return 0 as the longest
+ // so the typicalItem is non-null.
+ var maxWidth:Number = -1;
+
for (var i:int = 0; i < list.length; i++)
{
// note: measureText() measures UITextField while our labels will be
@@ -1271,7 +1275,8 @@ public class DateSpinner extends Skinnab
if (idx != -1)
return list.getItemAt(idx);
- return null;
+ // The case where the list is empty. This shouldn't happen.
+ return {};
}
// set textAlign on list based on position, listType, or typicalItem content type: