flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From erikdebr...@apache.org
Subject [2/2] git commit: [flex-asjs] [refs/heads/develop] - Some more null checks to make GCC warnings go away
Date Sat, 16 Nov 2013 19:30:05 GMT
Some more null checks to make GCC warnings go away

Signed-off-by: Erik de Bruin <erik@ixsoftware.nl>


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/edf99894
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/edf99894
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/edf99894

Branch: refs/heads/develop
Commit: edf998940783d54e3e3fe398d4c173e9f0b2f4e0
Parents: ffb2dcf
Author: Erik de Bruin <erik@ixsoftware.nl>
Authored: Sat Nov 16 19:54:57 2013 +0100
Committer: Erik de Bruin <erik@ixsoftware.nl>
Committed: Sat Nov 16 19:54:57 2013 +0100

----------------------------------------------------------------------
 .../org/apache/flex/html/staticControls/List.js | 29 ++++++++++++--------
 1 file changed, 17 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/edf99894/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/List.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/List.js b/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/List.js
index 7f35a82..bfc60d3 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/List.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/html/staticControls/List.js
@@ -68,7 +68,7 @@ org.apache.flex.html.staticControls.List.prototype.addedToParent =
   goog.base(this, 'addedToParent');
 
   var c = this.getBeadByType(org.apache.flex.core.IDataProviderItemRendererMapper);
-  if (c == null) {
+  if (org.apache.flex.core.ValuesManager.valuesImpl.getValue && !c) {
     c = org.apache.flex.core.ValuesManager.valuesImpl.getValue(this,'iDataProviderItemRendererMapper');
     if (c) {
       var bead = new c;
@@ -98,7 +98,10 @@ org.apache.flex.html.staticControls.List.prototype.internalChildren =
   var listView =
       this.getBeadByType(org.apache.flex.html.staticControls.beads.ListView);
   var dg = listView.get_dataGroup();
-  var items = dg.renderers;
+  var items = null;
+  if (dg.renderers) {
+    items = dg.renderers;
+  }
   return items;
 };
 
@@ -110,16 +113,18 @@ org.apache.flex.html.staticControls.List.prototype.internalChildren
=
 org.apache.flex.html.staticControls.List.prototype.selectedHandler =
     function(event) {
   var itemRenderer = event.currentTarget;
-  var n = this.renderers.length;
-  var i;
-  for (i = 0; i < n; i++) {
-    var test = this.renderers[i];
-    if (test == itemRenderer) {
-      this.model.set_selectedIndex(i);
-      itemRenderer.set_selected(true);
-    }
-    else {
-      test.set_selected(false);
+  if (this.renderers) {
+    var n = this.renderers.length;
+    var i;
+    for (i = 0; i < n; i++) {
+      var test = this.renderers[i];
+      if (test == itemRenderer) {
+        this.model.set_selectedIndex(i);
+        itemRenderer.set_selected(true);
+      }
+      else {
+        test.set_selected(false);
+      }
     }
   }
 };


Mime
View raw message