diff --git a/extensions/spellcheck/src/moz.build b/extensions/spellcheck/src/moz.build index 14d721caeb6..916382ee77a 100644 --- a/extensions/spellcheck/src/moz.build +++ b/extensions/spellcheck/src/moz.build @@ -7,7 +7,6 @@ include('/ipc/chromium/chromium-config.mozbuild') SOURCES += [ 'mozEnglishWordUtils.cpp', - 'mozGenericWordUtils.cpp', 'mozInlineSpellChecker.cpp', 'mozInlineSpellWordUtil.cpp', 'mozPersonalDictionary.cpp', diff --git a/extensions/spellcheck/src/mozGenericWordUtils.cpp b/extensions/spellcheck/src/mozGenericWordUtils.cpp deleted file mode 100644 index 75346d6a79b..00000000000 --- a/extensions/spellcheck/src/mozGenericWordUtils.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include "mozGenericWordUtils.h" - -NS_IMPL_ISUPPORTS(mozGenericWordUtils, mozISpellI18NUtil) - - // do something sensible but generic ... eventually. For now whine. - -mozGenericWordUtils::mozGenericWordUtils() -{ - /* member initializers and constructor code */ -} - -mozGenericWordUtils::~mozGenericWordUtils() -{ - /* destructor code */ -} - -NS_IMETHODIMP mozGenericWordUtils::GetLanguage(char16_t * *aLanguage) -{ - return NS_ERROR_NOT_IMPLEMENTED; -} - -NS_IMETHODIMP mozGenericWordUtils::GetRootForm(const char16_t *word, uint32_t type, char16_t ***words, uint32_t *count) -{ - return NS_ERROR_NOT_IMPLEMENTED; -} - -NS_IMETHODIMP mozGenericWordUtils::FromRootForm(const char16_t *word, const char16_t **iwords, uint32_t icount, char16_t ***owords, uint32_t *ocount) -{ - return NS_ERROR_NOT_IMPLEMENTED; -} - -NS_IMETHODIMP mozGenericWordUtils::FindNextWord(const char16_t *word, uint32_t length, uint32_t offset, int32_t *begin, int32_t *end) -{ - return NS_ERROR_NOT_IMPLEMENTED; -} - diff --git a/extensions/spellcheck/src/mozGenericWordUtils.h b/extensions/spellcheck/src/mozGenericWordUtils.h deleted file mode 100644 index a72a275f97a..00000000000 --- a/extensions/spellcheck/src/mozGenericWordUtils.h +++ /dev/null @@ -1,24 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef mozGenericWordUtils_h__ -#define mozGenericWordUtils_h__ - -#include "nsCOMPtr.h" -#include "mozISpellI18NUtil.h" -#include "nsCycleCollectionParticipant.h" - -class mozGenericWordUtils : public mozISpellI18NUtil -{ -protected: - virtual ~mozGenericWordUtils(); -public: - NS_DECL_ISUPPORTS - NS_DECL_MOZISPELLI18NUTIL - - mozGenericWordUtils(); -}; - -#endif diff --git a/extensions/spellcheck/src/mozSpellI18NManager.cpp b/extensions/spellcheck/src/mozSpellI18NManager.cpp index 41d3b628b82..9c11e7f80aa 100644 --- a/extensions/spellcheck/src/mozSpellI18NManager.cpp +++ b/extensions/spellcheck/src/mozSpellI18NManager.cpp @@ -5,36 +5,28 @@ #include "mozSpellI18NManager.h" #include "mozEnglishWordUtils.h" -#include "mozGenericWordUtils.h" #include "nsString.h" +#include "mozilla/nsRefPtr.h" NS_IMPL_ISUPPORTS(mozSpellI18NManager, mozISpellI18NManager) mozSpellI18NManager::mozSpellI18NManager() { - /* member initializers and constructor code */ } mozSpellI18NManager::~mozSpellI18NManager() { - /* destructor code */ } NS_IMETHODIMP mozSpellI18NManager::GetUtil(const char16_t *aLanguage, mozISpellI18NUtil **_retval) { - if( nullptr == _retval) { + if (!_retval) { return NS_ERROR_NULL_POINTER; } - *_retval = nullptr; - nsAutoString lang; - lang.Assign(aLanguage); - if(lang.EqualsLiteral("en")){ - *_retval = new mozEnglishWordUtils; - } - else{ - *_retval = new mozEnglishWordUtils; - } - NS_IF_ADDREF(*_retval); + // XXX TODO Actually handle multiple languages. + nsRefPtr utils = new mozEnglishWordUtils; + utils.forget(_retval); + return NS_OK; }