aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenrik Paul <henrik@vaadin.com>2014-08-08 09:55:22 +0300
committerTeemu Suo-Anttila <teemusa@vaadin.com>2014-08-08 08:34:19 +0000
commit1102d5fb4eec9a712cd8f770dfa023e842abd830 (patch)
tree8068c917ce248773599621e8449acff92a8ab290
parent22a57cd110380c988a6dd3d510f9773c19755aa0 (diff)
downloadvaadin-framework-1102d5fb4eec9a712cd8f770dfa023e842abd830.tar.gz
vaadin-framework-1102d5fb4eec9a712cd8f770dfa023e842abd830.zip
Re-fixes "remove all rows" bug without breaking unit tests (#13334)
This partly reverts a9fc5d5be Change-Id: I1d2f81e1d88c0057e6ba869358845ce4e9466a28
-rw-r--r--client/src/com/vaadin/client/data/AbstractRemoteDataSource.java4
-rw-r--r--shared/src/com/vaadin/shared/ui/grid/Range.java6
2 files changed, 3 insertions, 7 deletions
diff --git a/client/src/com/vaadin/client/data/AbstractRemoteDataSource.java b/client/src/com/vaadin/client/data/AbstractRemoteDataSource.java
index bec6e330bc..1ce68ced17 100644
--- a/client/src/com/vaadin/client/data/AbstractRemoteDataSource.java
+++ b/client/src/com/vaadin/client/data/AbstractRemoteDataSource.java
@@ -381,7 +381,9 @@ public abstract class AbstractRemoteDataSource<T> implements DataSource<T> {
}
Range removedRange = Range.withLength(firstRowIndex, count);
- if (removedRange.intersects(cached)) {
+ if (cached.isSubsetOf(removedRange)) {
+ cached = Range.withLength(0, 0);
+ } else if (removedRange.intersects(cached)) {
Range[] partitions = cached.partitionWith(removedRange);
Range remainsBefore = partitions[0];
Range transposedRemainsAfter = partitions[2].offsetBy(-removedRange
diff --git a/shared/src/com/vaadin/shared/ui/grid/Range.java b/shared/src/com/vaadin/shared/ui/grid/Range.java
index 4f7e37b9ad..2054845320 100644
--- a/shared/src/com/vaadin/shared/ui/grid/Range.java
+++ b/shared/src/com/vaadin/shared/ui/grid/Range.java
@@ -369,12 +369,6 @@ public final class Range implements Serializable {
* if the two ranges aren't connected
*/
public Range combineWith(Range other) throws IllegalArgumentException {
- if (other.isEmpty()) {
- return this;
- } else if (isEmpty()) {
- return other;
- }
-
if (getStart() > other.getEnd() || other.getStart() > getEnd()) {
throw new IllegalArgumentException("There is a gap between " + this
+ " and " + other);