flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mih...@apache.org
Subject [1/3] git commit: [flex-sdk] [refs/heads/develop] - FLEX-34880 Placed only one state setter (SortField.compareFunction) behind mx_internal (thus also renaming it to SortField.compareFunction_) to provide the template for the others. Also removed it from
Date Sun, 06 Nov 2016 18:10:58 GMT
Repository: flex-sdk
Updated Branches:
  refs/heads/develop 522a06d61 -> 0b5a634da


FLEX-34880
Placed only one state setter (SortField.compareFunction) behind mx_internal (thus also renaming
it to SortField.compareFunction_) to provide the template for the others. Also removed it
from the interface (ISortField).


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

Branch: refs/heads/develop
Commit: 2b09e327281211d26d65dd5d061b02d645cbdd39
Parents: 522a06d
Author: Mihai Chira <mihaic@apache.org>
Authored: Sun Nov 6 16:58:13 2016 +0100
Committer: Mihai Chira <mihaic@apache.org>
Committed: Sun Nov 6 16:58:13 2016 +0100

----------------------------------------------------------------------
 .../src/mx/collections/GroupingCollection.as           |  2 +-
 .../src/mx/collections/GroupingCollection2.as          |  2 +-
 .../advancedgrids/src/mx/olap/DefaultCubeImpl.as       |  6 +++---
 .../components/supportClasses/MobileGridColumn.as      |  4 ++--
 .../framework/src/mx/collections/ISortField.as         |  8 +-------
 .../projects/framework/src/mx/collections/SortField.as |  4 ++--
 frameworks/projects/mx/src/mx/controls/DataGrid.as     | 13 ++++---------
 .../projects/spark/src/spark/collections/SortField.as  |  9 +++++----
 .../src/spark/components/gridClasses/GridColumn.as     |  2 +-
 .../newComps/CustComp_sortField_compareFunction.mxml   |  5 ++---
 10 files changed, 22 insertions(+), 33 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/2b09e327/frameworks/projects/advancedgrids/src/mx/collections/GroupingCollection.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/advancedgrids/src/mx/collections/GroupingCollection.as b/frameworks/projects/advancedgrids/src/mx/collections/GroupingCollection.as
index 7f1155b..e023569 100644
--- a/frameworks/projects/advancedgrids/src/mx/collections/GroupingCollection.as
+++ b/frameworks/projects/advancedgrids/src/mx/collections/GroupingCollection.as
@@ -1113,7 +1113,7 @@ public class GroupingCollection extends HierarchicalData implements
IGroupingCol
             var sortField:SortField = new SortField(groupingField.name, 
                         groupingField.caseInsensitive, 
                         groupingField.descending, groupingField.numeric);
-            sortField.compareFunction = groupingField.compareFunction;
+            sortField.mx_internal::compareFunction_ = groupingField.compareFunction;
             fields.push(sortField);
         }
         

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/2b09e327/frameworks/projects/advancedgrids/src/mx/collections/GroupingCollection2.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/advancedgrids/src/mx/collections/GroupingCollection2.as b/frameworks/projects/advancedgrids/src/mx/collections/GroupingCollection2.as
index 6ceeac7..1b73f86 100644
--- a/frameworks/projects/advancedgrids/src/mx/collections/GroupingCollection2.as
+++ b/frameworks/projects/advancedgrids/src/mx/collections/GroupingCollection2.as
@@ -1154,7 +1154,7 @@ public class GroupingCollection2 extends HierarchicalData implements
IGroupingCo
             var sortField:SortField = new SortField(groupingField.name, 
                         groupingField.caseInsensitive, 
                         groupingField.descending, groupingField.numeric);
-            sortField.compareFunction = groupingField.compareFunction;
+            sortField.mx_internal::compareFunction_ = groupingField.compareFunction;
             fields.push(sortField);
         }
         

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/2b09e327/frameworks/projects/advancedgrids/src/mx/olap/DefaultCubeImpl.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/advancedgrids/src/mx/olap/DefaultCubeImpl.as b/frameworks/projects/advancedgrids/src/mx/olap/DefaultCubeImpl.as
index 041147d..e6ed9bb 100644
--- a/frameworks/projects/advancedgrids/src/mx/olap/DefaultCubeImpl.as
+++ b/frameworks/projects/advancedgrids/src/mx/olap/DefaultCubeImpl.as
@@ -382,14 +382,14 @@ public class DefaultCubeImpl implements IOLAPCubeImpl
                 newSort = new Sort;
                 var fields:Array = [];
                 
-                var field:ISortField ;
+                var field:ISortField;
                 for each (level in levels)
                 {
                 	if (level.attribute && level.attribute.userDataFunction)
                     {
                     	attr = level.attribute;
-	                    field= new SortField(attr.dataField);
-	                    field.compareFunction = attr.dataCompareFunction;
+	                    field = new SortField(attr.dataField);
+	                    SortField(field).mx_internal::compareFunction_ = attr.dataCompareFunction;
 		                fields.push(field);
     	            }
                 	else

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/2b09e327/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/MobileGridColumn.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/MobileGridColumn.as
b/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/MobileGridColumn.as
index 44b3995..ca8ab27 100644
--- a/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/MobileGridColumn.as
+++ b/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/MobileGridColumn.as
@@ -21,7 +21,7 @@ package spark.components.supportClasses
 
 import flash.events.EventDispatcher;
 import flash.events.IEventDispatcher;
-
+import mx.core.mx_internal;
 import mx.core.ClassFactory;
 import mx.core.IFactory;
 import mx.core.mx_internal;
@@ -322,7 +322,7 @@ public class MobileGridColumn extends EventDispatcher
             {
                 return ObjectUtil.stringCompare(labelFunction(a), labelFunction(b));
             };
-            sortField.compareFunction = cF;
+            sortField.mx_internal::compareFunction = cF;
         }
         sortField.descending = column.sortDescending;
         return sortField;

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/2b09e327/frameworks/projects/framework/src/mx/collections/ISortField.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/framework/src/mx/collections/ISortField.as b/frameworks/projects/framework/src/mx/collections/ISortField.as
index 766bd69..4186d0b 100644
--- a/frameworks/projects/framework/src/mx/collections/ISortField.as
+++ b/frameworks/projects/framework/src/mx/collections/ISortField.as
@@ -19,7 +19,7 @@
 
 package mx.collections
 {
-/**
+    /**
  *  The <code>ISortField</code> interface defines the interface for classes that
  *  are used with <code>ISort</code> classes, to provide the sorting information
  *  required to sort the specific fields or property in a collection view.
@@ -79,12 +79,6 @@ public interface ISortField
     function get compareFunction():Function;
 
     /**
-     *  @deprecated A future release of Apache Flex SDK will remove this function. Please
use the constructor
-     *  argument instead.
-     */
-    function set compareFunction(c:Function):void;
-
-    /**
      *  Specifies whether this field should be sorted in descending
      *  order.
      *

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/2b09e327/frameworks/projects/framework/src/mx/collections/SortField.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/framework/src/mx/collections/SortField.as b/frameworks/projects/framework/src/mx/collections/SortField.as
index a465656..554d7c3 100644
--- a/frameworks/projects/framework/src/mx/collections/SortField.as
+++ b/frameworks/projects/framework/src/mx/collections/SortField.as
@@ -146,7 +146,7 @@ public class SortField extends EventDispatcher implements ISortField
 
         if(customCompareFunction != null)
         {
-            compareFunction = customCompareFunction;
+            mx_internal::compareFunction_ = customCompareFunction;
         }
         else if (updateSortCompareType() == false)
         {
@@ -302,7 +302,7 @@ public class SortField extends EventDispatcher implements ISortField
      *  @deprecated A future release of Apache Flex SDK will remove this function. Please
use the constructor
      *  argument instead.
      */
-    public function set compareFunction(c:Function):void
+    mx_internal function set compareFunction_(c:Function):void
     {
         _compareFunction = c;
         _usingCustomCompareFunction = (c != null);

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/2b09e327/frameworks/projects/mx/src/mx/controls/DataGrid.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/mx/src/mx/controls/DataGrid.as b/frameworks/projects/mx/src/mx/controls/DataGrid.as
index a035e70..b4a8825 100644
--- a/frameworks/projects/mx/src/mx/controls/DataGrid.as
+++ b/frameworks/projects/mx/src/mx/controls/DataGrid.as
@@ -3981,14 +3981,10 @@ public class DataGrid extends DataGridBase implements IIMESupport
                 }
             }
             else
-                s = new Sort;
+                s = new Sort();
 
             if (!f)
-            {
-                f = new SortField(c.dataField, false, desc, null, null, c.sortCompareFunction);
-                f.sortCompareType = c.sortCompareType;
-            }
-
+                f = new SortField(c.dataField, false, desc, null, c.sortCompareType, c.sortCompareFunction);
 
             c.sortDescending = desc;
             var dir:String = (desc) ? "DESC" : "ASC";
@@ -4000,14 +3996,13 @@ public class DataGrid extends DataGridBase implements IIMESupport
             sortColumn = c;
 
             // if you have a labelFunction you must supply a sortCompareFunction
-            f.name = c.dataField;
-            f.compareFunction = c.sortCompareFunction;
+            SortField(f).mx_internal::compareFunction_ = c.sortCompareFunction;
             f.descending = desc;
             s.fields = [f];
         }
+
         collection.sort = s;
         collection.refresh();
-
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/2b09e327/frameworks/projects/spark/src/spark/collections/SortField.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/spark/src/spark/collections/SortField.as b/frameworks/projects/spark/src/spark/collections/SortField.as
index 760b725..c58e4a3 100644
--- a/frameworks/projects/spark/src/spark/collections/SortField.as
+++ b/frameworks/projects/spark/src/spark/collections/SortField.as
@@ -19,7 +19,7 @@
 
 package spark.collections
 {
-
+    import mx.core.mx_internal;
     import flash.events.Event;
     import mx.styles.IAdvancedStyleClient;
     import mx.collections.ISortField;
@@ -27,9 +27,10 @@ package spark.collections
     import mx.core.IFlexModule;
     import mx.core.IMXMLObject;
     import mx.utils.ObjectUtil;
-
     import spark.globalization.SortingCollator;
 
+    use namespace mx_internal;
+
     [ResourceBundle("collections")]
 
 //--------------------------------------
@@ -266,9 +267,9 @@ public class SortField extends mx.collections.SortField implements IAdvancedStyl
      *  @deprecated A future release of Apache Flex SDK will remove this function. Please
use the constructor
      *  argument instead.
      */
-    override public function set compareFunction(c:Function):void
+    override mx_internal function set compareFunction_(c:Function):void
     {
-        super.compareFunction = c;
+        super.mx_internal::compareFunction_ = c;
     }
 
 

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/2b09e327/frameworks/projects/spark/src/spark/components/gridClasses/GridColumn.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/spark/src/spark/components/gridClasses/GridColumn.as b/frameworks/projects/spark/src/spark/components/gridClasses/GridColumn.as
index f3812e2..c82c1cb 100644
--- a/frameworks/projects/spark/src/spark/components/gridClasses/GridColumn.as
+++ b/frameworks/projects/spark/src/spark/components/gridClasses/GridColumn.as
@@ -1609,7 +1609,7 @@ public class GridColumn extends EventDispatcher
             }
         }
         
-        sortField.compareFunction = compareFunc;
+        SortField(sortField).mx_internal::compareFunction_ = compareFunc;
         sortField.descending = column.sortDescending;
         return sortField;
     }

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/2b09e327/mustella/tests/spark/collections/Sort/SWFs/newComps/CustComp_sortField_compareFunction.mxml
----------------------------------------------------------------------
diff --git a/mustella/tests/spark/collections/Sort/SWFs/newComps/CustComp_sortField_compareFunction.mxml
b/mustella/tests/spark/collections/Sort/SWFs/newComps/CustComp_sortField_compareFunction.mxml
index b71634b..098923c 100644
--- a/mustella/tests/spark/collections/Sort/SWFs/newComps/CustComp_sortField_compareFunction.mxml
+++ b/mustella/tests/spark/collections/Sort/SWFs/newComps/CustComp_sortField_compareFunction.mxml
@@ -107,10 +107,9 @@
 				sfCN.setStyle("locale","zh-CN");
 				sfScriptName.setStyle("locale","zh-CN");
 				
-				sfCFScript= new spark.collections.SortField("name");
+				sfCFScript= new spark.collections.SortField("name", false, null, null, mySortCompareFunction);
 				this.addStyleClient(sfCFScript);
-				sfCFScript.compareFunction=mySortCompareFunction;
-				
+
 				stCFScript=new Sort();
 				this.addStyleClient(stCFScript);
 				


Mime
View raw message