[patch] SmartTableModel fixes ...

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[patch] SmartTableModel fixes ...

oetiker
compiling SmartTableModel with the latest generator (as of this
morning) suggests the following fixes:

Index: MSmartUnitTests.js
===================================================================
--- MSmartUnitTests.js  (revision 19377)
+++ MSmartUnitTests.js  (working copy)
@@ -65,7 +65,7 @@
                // Establish columns
                var columns = { "number": 0, "string": 1, "object": 2, "function": 3, "random": 4 };
                model.setColumns(function () {
-                       C = [];
+                       var C = [];
                        for (name in columns) {
                            var index = columns[name];
                            C[index] = name;
@@ -686,7 +686,7 @@
                var all = [];
                var added = 0;
                for (i = 0; i < N; i++) {
-                   A = [];
+                   var A = [];
                    var size = (Math.random() & 7) + 1;
                    for (var j = 0; j < size; j++) {
                        var x = (Math.random() * ~0) ^ 0;
Index: Smart.js
===================================================================
--- Smart.js    (revision 19377)
+++ Smart.js    (working copy)
@@ -692,7 +692,9 @@
                    var span;
                    var A = this.getRowArray(view);
                    for (i = 0; i < len; i += span) {
-                       var row = base = rowsToRemove[i];
+
+                       var base = rowsToRemove[i];
+                       var row = base;
                        span = 1;
                        for (var j = 1; i + j < len; j++)
                            if (rowsToRemove[i + j] == row - j) // row indices *decrease* as we step j

cheers
tobi


--
Tobi Oetiker, OETIKER+PARTNER AG, Aarweg 15 CH-4600 Olten, Switzerland
http://it.oetiker.ch [hidden email] ++41 62 775 9902 / sb: -9900

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: [patch] SmartTableModel fixes ...

fritz
Applied to qooxdoo-contrib/trunk ...

Thanks and cheers,
Fritz

On Fri, 16 Oct 2009, Tobias Oetiker wrote:

> compiling SmartTableModel with the latest generator (as of this
> morning) suggests the following fixes:
>
> Index: MSmartUnitTests.js
> ===================================================================
> --- MSmartUnitTests.js  (revision 19377)
> +++ MSmartUnitTests.js  (working copy)
> @@ -65,7 +65,7 @@
>                // Establish columns
>                var columns = { "number": 0, "string": 1, "object": 2, "function": 3, "random": 4 };
>                model.setColumns(function () {
> -                       C = [];
> +                       var C = [];
>                        for (name in columns) {
>                            var index = columns[name];
>                            C[index] = name;
> @@ -686,7 +686,7 @@
>                var all = [];
>                var added = 0;
>                for (i = 0; i < N; i++) {
> -                   A = [];
> +                   var A = [];
>                    var size = (Math.random() & 7) + 1;
>                    for (var j = 0; j < size; j++) {
>                        var x = (Math.random() * ~0) ^ 0;
> Index: Smart.js
> ===================================================================
> --- Smart.js    (revision 19377)
> +++ Smart.js    (working copy)
> @@ -692,7 +692,9 @@
>                    var span;
>                    var A = this.getRowArray(view);
>                    for (i = 0; i < len; i += span) {
> -                       var row = base = rowsToRemove[i];
> +
> +                       var base = rowsToRemove[i];
> +                       var row = base;
>                        span = 1;
>                        for (var j = 1; i + j < len; j++)
>                            if (rowsToRemove[i + j] == row - j) // row indices *decrease* as we step j
>
> cheers
> tobi
>
>
>

--
Oetiker+Partner AG tel: +41 62 775 9903 (direct)
Fritz Zaucker                        +41 62 775 9900 (switch board)
Aarweg 15                            +41 79 675 0630 (mobile)
CH-4600 Olten                   fax: +41 62 775 9905
Schweiz                         web: www.oetiker.ch

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel