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.

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

mercurial