Bug 1349855 - Remove unused nsILocale. r=emk

After landing bug 1301640, 1st parameter of nsIScriptableDateFormat.FormatDateTime() is ignored now.  So it is unnecessary to create nsILocaleService from locale parameter.

MozReview-Commit-ID: GlqC0D9shdy
This commit is contained in:
Makoto Kato 2017-03-24 11:02:03 +09:00
Родитель e0caeb137c
Коммит 4113212e91
2 изменённых файлов: 2 добавлений и 16 удалений

Просмотреть файл

@ -132,8 +132,7 @@ interface nsIScriptableDateFormat : nsISupports
* you depend on any specific format or language.
*
* @param locale
* Locale code of locale used to format the date or an empty string
* to follow user preference.
Ignored. If you want to use specific locale, use Intl API instead.
* @param dateFormatSelector
* Indicate which format should preferably be used for the date.
* Use one of the dateFormat* constants.

Просмотреть файл

@ -5,14 +5,13 @@
#include "DateTimeFormat.h"
#include "mozilla/Sprintf.h"
#include "nsILocaleService.h"
#include "nsIScriptableDateFormat.h"
#include "nsCOMPtr.h"
#include "nsServiceManagerUtils.h"
static NS_DEFINE_CID(kLocaleServiceCID, NS_LOCALESERVICE_CID);
class nsScriptableDateFormat : public nsIScriptableDateFormat {
class nsScriptableDateFormat final : public nsIScriptableDateFormat {
public:
NS_DECL_ISUPPORTS
@ -73,20 +72,8 @@ NS_IMETHODIMP nsScriptableDateFormat::FormatDateTime(
return NS_ERROR_INVALID_ARG;
nsresult rv;
nsAutoString localeName(aLocale);
*dateTimeString = nullptr;
nsCOMPtr<nsILocale> locale;
// re-initialise locale pointer only if the locale was given explicitly
if (!localeName.IsEmpty()) {
// get locale service
nsCOMPtr<nsILocaleService> localeService(do_GetService(kLocaleServiceCID, &rv));
NS_ENSURE_SUCCESS(rv, rv);
// get locale
rv = localeService->NewLocale(localeName, getter_AddRefs(locale));
NS_ENSURE_SUCCESS(rv, rv);
}
tm tmTime;
time_t timetTime;