summaryrefslogtreecommitdiff
path: root/Base/res/js/Spreadsheet/runtime.js
diff options
context:
space:
mode:
Diffstat (limited to 'Base/res/js/Spreadsheet/runtime.js')
-rw-r--r--Base/res/js/Spreadsheet/runtime.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/Base/res/js/Spreadsheet/runtime.js b/Base/res/js/Spreadsheet/runtime.js
index a0604d24f3..38977a4aee 100644
--- a/Base/res/js/Spreadsheet/runtime.js
+++ b/Base/res/js/Spreadsheet/runtime.js
@@ -197,6 +197,19 @@ class CommonRange {
});
return new SplitRange(cells);
}
+
+ unique() {
+ const cells = [];
+ const values = new Set();
+ this.forEach(cell => {
+ const value = cell.value();
+ if (!values.has(value)) {
+ values.add(value);
+ cells.push(cell);
+ }
+ });
+ return new SplitRange(cells);
+ }
}
class SplitRange extends CommonRange {