extensions/spellcheck/src/mozSpellI18NManager.cpp

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
michael@0 2 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 3 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 5
michael@0 6 #include "mozSpellI18NManager.h"
michael@0 7 #include "mozEnglishWordUtils.h"
michael@0 8 #include "mozGenericWordUtils.h"
michael@0 9 #include "nsString.h"
michael@0 10
michael@0 11 NS_IMPL_ISUPPORTS(mozSpellI18NManager, mozISpellI18NManager)
michael@0 12
michael@0 13 mozSpellI18NManager::mozSpellI18NManager()
michael@0 14 {
michael@0 15 /* member initializers and constructor code */
michael@0 16 }
michael@0 17
michael@0 18 mozSpellI18NManager::~mozSpellI18NManager()
michael@0 19 {
michael@0 20 /* destructor code */
michael@0 21 }
michael@0 22
michael@0 23 /* mozISpellI18NUtil GetUtil (in wstring language); */
michael@0 24 NS_IMETHODIMP mozSpellI18NManager::GetUtil(const char16_t *aLanguage, mozISpellI18NUtil **_retval)
michael@0 25 {
michael@0 26 if( nullptr == _retval) {
michael@0 27 return NS_ERROR_NULL_POINTER;
michael@0 28 }
michael@0 29 *_retval = nullptr;
michael@0 30 nsAutoString lang;
michael@0 31 lang.Assign(aLanguage);
michael@0 32 if(lang.EqualsLiteral("en")){
michael@0 33 *_retval = new mozEnglishWordUtils;
michael@0 34 }
michael@0 35 else{
michael@0 36 *_retval = new mozEnglishWordUtils;
michael@0 37 }
michael@0 38
michael@0 39 NS_IF_ADDREF(*_retval);
michael@0 40 return NS_OK;
michael@0 41 }

mercurial