intl/unicharutil/src/nsCaseConversionImp2.cpp

Wed, 31 Dec 2014 07:22:50 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 07:22:50 +0100
branch
TOR_BUG_3246
changeset 4
fc2d59ddac77
permissions
-rw-r--r--

Correct previous dual key logic pending first delivery installment.

     1 /* -*- Mode: C; tab-width: 4; 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 "nsCaseConversionImp2.h"
     7 #include "nsUnicharUtils.h"
     9 NS_IMETHODIMP_(MozExternalRefCountType) nsCaseConversionImp2::AddRef(void)
    10 {
    11   return (MozExternalRefCountType)1;
    12 }
    14 NS_IMETHODIMP_(MozExternalRefCountType) nsCaseConversionImp2::Release(void)
    15 {
    16   return (MozExternalRefCountType)1;
    17 }
    19 NS_IMPL_QUERY_INTERFACE(nsCaseConversionImp2, nsICaseConversion)
    21 NS_IMETHODIMP nsCaseConversionImp2::ToUpper(char16_t aChar, char16_t* aReturn)
    22 {
    23   *aReturn = ToUpperCase(aChar);
    24   return NS_OK;
    25 }
    27 NS_IMETHODIMP nsCaseConversionImp2::ToLower(char16_t aChar, char16_t* aReturn)
    28 {
    29   *aReturn = ToLowerCase(aChar);
    30   return NS_OK;
    31 }
    33 NS_IMETHODIMP nsCaseConversionImp2::ToTitle(char16_t aChar, char16_t* aReturn)
    34 {
    35   *aReturn = ToTitleCase(aChar);
    36   return NS_OK;
    37 }
    39 NS_IMETHODIMP nsCaseConversionImp2::ToUpper(const char16_t* anArray,
    40                                          char16_t* aReturn,
    41                                          uint32_t aLen)
    42 {
    43   ToUpperCase(anArray, aReturn, aLen);
    44   return NS_OK;
    45 }
    47 NS_IMETHODIMP nsCaseConversionImp2::ToLower(const char16_t* anArray,
    48                                          char16_t* aReturn,
    49                                          uint32_t aLen)
    50 {
    51   ToLowerCase(anArray, aReturn, aLen);
    52   return NS_OK;
    53 }
    55 NS_IMETHODIMP
    56 nsCaseConversionImp2::CaseInsensitiveCompare(const char16_t *aLeft,
    57                                              const char16_t *aRight,
    58                                              uint32_t aCount, int32_t* aResult)
    59 {
    60   *aResult = ::CaseInsensitiveCompare(aLeft, aRight, aCount);
    61   return NS_OK;
    62 }

mercurial