You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by mk...@apache.org on 2013/09/05 03:26:45 UTC
git commit: [flex-sdk] [refs/heads/develop] - FLEX-33710: Changed the
Range out of bounds check to a try/catch for a range error.
Updated Branches:
refs/heads/develop b1d0359b6 -> 1bef09730
FLEX-33710: Changed the Range out of bounds check to a try/catch for a range error.
Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/1bef0973
Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/1bef0973
Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/1bef0973
Branch: refs/heads/develop
Commit: 1bef09730660a8bf33d51083f9e1420fef72ef16
Parents: b1d0359
Author: Mark Kessler <Ke...@gmail.com>
Authored: Wed Sep 4 21:23:37 2013 -0400
Committer: Mark Kessler <Ke...@gmail.com>
Committed: Wed Sep 4 21:23:37 2013 -0400
----------------------------------------------------------------------
.../projects/spark/src/spark/components/DataGrid.as | 16 +++++-----------
1 file changed, 5 insertions(+), 11 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/1bef0973/frameworks/projects/spark/src/spark/components/DataGrid.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/spark/src/spark/components/DataGrid.as b/frameworks/projects/spark/src/spark/components/DataGrid.as
index 9fa5449..3ee69f0 100644
--- a/frameworks/projects/spark/src/spark/components/DataGrid.as
+++ b/frameworks/projects/spark/src/spark/components/DataGrid.as
@@ -4769,24 +4769,18 @@ public class DataGrid extends SkinnableContainerBase
*/
protected function isCellEditable(rowIndex:int, columnIndex:int):Boolean
{
- //
- // Index out of bounds tests.
- //
- if (columnIndex < 0 || rowIndex < 0)
+ try
{
- return false;
+ var dataItem:Object = dataProvider.getItemAt(rowIndex);
+ var column:GridColumn = GridColumn(columns.getItemAt(columnIndex));
+ var dataField:String = column.dataField;
}
-
- if (columnIndex >= columnsLength || rowIndex >= dataProvider.length)
+ catch (e:RangeError)
{
return false;
}
- var dataItem:Object = dataProvider.getItemAt(rowIndex);
- var column:GridColumn = GridColumn(columns.getItemAt(columnIndex));
- var dataField:String = column.dataField;
-
return isDataEditable(dataItem, dataField);
}