From 3f9dfa09f4709a996c07a5bdfdbf1b1e0acac463 Mon Sep 17 00:00:00 2001 From: Jorg K Date: Sun, 8 Oct 2017 16:30:04 +0200 Subject: [PATCH] Backed out changeset 78406bb70ae5 (bug 571807) for causing test failures (importing non-existent Locale.jsm). a=backout CLOSED TREE DONTBUILD --- calendar/base/modules/calUtils.jsm | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/calendar/base/modules/calUtils.jsm b/calendar/base/modules/calUtils.jsm index 44d96367a9..445554c25f 100644 --- a/calendar/base/modules/calUtils.jsm +++ b/calendar/base/modules/calUtils.jsm @@ -7,7 +7,6 @@ var gCalThreadingEnabled; Components.utils.import("resource://gre/modules/XPCOMUtils.jsm"); Components.utils.import("resource://gre/modules/Services.jsm"); Components.utils.import("resource://gre/modules/Preferences.jsm"); -Components.utils.import("resource://gre/modules/Locale.jsm"); // Usually the backend loader gets loaded via profile-after-change, but in case // a calendar component hooks in earlier, its very likely it will use calUtils. @@ -628,15 +627,9 @@ var cal = { // column without scrolling past all the empty values). return -(seA.length - seB.length) * modifier; } - // To support alphanumeric sorting. - let locale = Locale.getLocale(); - if (modifier == 1) { - return seA.localeCompare(seB, locale, - { numeric: true, sensitivity: 'base' }); - } else { - return seB.localeCompare(seA, locale, - { numeric: true, sensitivity: 'base' }); - } + let collator = cal.createLocaleCollator(); + let comparison = collator.compareString(0, seA, seB); + return comparison * modifier; }; default: return function(sortEntryA, sortEntryB) {