Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
officejs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
officejs
Commits
a882ef32
Commit
a882ef32
authored
May 29, 2012
by
Tristan Cavelier
Committed by
Sebastien Robin
Jun 07, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix bug: sort and limit did not modify the list.
parent
b0c669ec
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
27 deletions
+25
-27
OfficeJS/lib/jio/jio.js
OfficeJS/lib/jio/jio.js
+12
-13
OfficeJS/lib/jio/jio.min.js
OfficeJS/lib/jio/jio.min.js
+1
-1
OfficeJS/src/jio.js
OfficeJS/src/jio.js
+12
-13
No files found.
OfficeJS/lib/jio/jio.js
View file @
a882ef32
...
...
@@ -761,14 +761,15 @@ var JIO =
}
// check for sorting
if
(
!
priv
.
sorted
&&
typeof
priv
.
job
.
sort
!==
'
undefined
'
)
{
that
.
sortDocumentArray
(
{
documentarray
:
priv
.
res
.
return_value
}
);
that
.
sortDocumentArray
(
priv
.
res
.
return_value
);
}
// check for limiting
if
(
!
priv
.
limited
&&
typeof
priv
.
job
.
limit
!==
'
undefined
'
&&
typeof
priv
.
job
.
limit
.
begin
!==
'
undefined
'
&&
typeof
priv
.
job
.
limit
.
end
!==
'
undefined
'
)
{
that
.
limitDocumentArray
({
documentarray
:
priv
.
res
.
return_value
});
priv
.
res
.
return_value
=
that
.
limitDocumentArray
(
priv
.
res
.
return_value
);
}
};
priv
.
fail_removeDocument
=
function
()
{
...
...
@@ -936,11 +937,10 @@ var JIO =
/**
* Sorts a document list using sort parameters set in the job.
* @method sortDocumentArray
* @param {object} o
* - o.documentarray {array} the array we want to sort.
* @param {array} documentarray The array we want to sort.
*/
that
.
sortDocumentArray
=
function
(
o
)
{
o
.
documentarray
.
sort
(
function
(
row1
,
row2
)
{
that
.
sortDocumentArray
=
function
(
documentarray
)
{
documentarray
.
sort
(
function
(
row1
,
row2
)
{
var
k
,
res
;
for
(
k
in
priv
.
job
.
sort
)
{
var
sign
=
(
priv
.
job
.
sort
[
k
]
===
'
descending
'
?
-
1
:
1
);
...
...
@@ -961,17 +961,16 @@ var JIO =
};
/**
* Limits the document list. Get only the document between
* Limits the document list. Clones only the document list between
* begin and end set in limit object in the job.
* @method limitDocumentArray
* @param {object} o
* - o.documentarray {array} the array we wont to limit
* @param {array} documentarray The array we wont to limit
* @return {array} The new document list
*/
that
.
limitDocumentArray
=
function
(
o
)
{
o
.
documentarray
=
o
.
documentarray
.
slice
(
priv
.
job
.
limit
.
begin
,
priv
.
job
.
limit
.
end
);
that
.
limitDocumentArray
=
function
(
documentarray
)
{
that
.
limitDone
();
return
o
.
documentarray
;
return
documentarray
.
slice
(
priv
.
job
.
limit
.
begin
,
priv
.
job
.
limit
.
end
);
};
/**
...
...
OfficeJS/lib/jio/jio.min.js
View file @
a882ef32
This diff is collapsed.
Click to expand it.
OfficeJS/src/jio.js
View file @
a882ef32
...
...
@@ -758,14 +758,15 @@ var JIO =
}
// check for sorting
if
(
!
priv
.
sorted
&&
typeof
priv
.
job
.
sort
!==
'
undefined
'
)
{
that
.
sortDocumentArray
(
{
documentarray
:
priv
.
res
.
return_value
}
);
that
.
sortDocumentArray
(
priv
.
res
.
return_value
);
}
// check for limiting
if
(
!
priv
.
limited
&&
typeof
priv
.
job
.
limit
!==
'
undefined
'
&&
typeof
priv
.
job
.
limit
.
begin
!==
'
undefined
'
&&
typeof
priv
.
job
.
limit
.
end
!==
'
undefined
'
)
{
that
.
limitDocumentArray
({
documentarray
:
priv
.
res
.
return_value
});
priv
.
res
.
return_value
=
that
.
limitDocumentArray
(
priv
.
res
.
return_value
);
}
};
priv
.
fail_removeDocument
=
function
()
{
...
...
@@ -933,11 +934,10 @@ var JIO =
/**
* Sorts a document list using sort parameters set in the job.
* @method sortDocumentArray
* @param {object} o
* - o.documentarray {array} the array we want to sort.
* @param {array} documentarray The array we want to sort.
*/
that
.
sortDocumentArray
=
function
(
o
)
{
o
.
documentarray
.
sort
(
function
(
row1
,
row2
)
{
that
.
sortDocumentArray
=
function
(
documentarray
)
{
documentarray
.
sort
(
function
(
row1
,
row2
)
{
var
k
,
res
;
for
(
k
in
priv
.
job
.
sort
)
{
var
sign
=
(
priv
.
job
.
sort
[
k
]
===
'
descending
'
?
-
1
:
1
);
...
...
@@ -958,17 +958,16 @@ var JIO =
};
/**
* Limits the document list. Get only the document between
* Limits the document list. Clones only the document list between
* begin and end set in limit object in the job.
* @method limitDocumentArray
* @param {object} o
* - o.documentarray {array} the array we wont to limit
* @param {array} documentarray The array we wont to limit
* @return {array} The new document list
*/
that
.
limitDocumentArray
=
function
(
o
)
{
o
.
documentarray
=
o
.
documentarray
.
slice
(
priv
.
job
.
limit
.
begin
,
priv
.
job
.
limit
.
end
);
that
.
limitDocumentArray
=
function
(
documentarray
)
{
that
.
limitDone
();
return
o
.
documentarray
;
return
documentarray
.
slice
(
priv
.
job
.
limit
.
begin
,
priv
.
job
.
limit
.
end
);
};
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment