зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1368418 part 3 - Remove nsCategoryImp. r=emk
MozReview-Commit-ID: 5qCoeqfM2s5 --HG-- extra : rebase_source : 6dc1693ce61bea4ec35469a3388c75a9fb64e5b3
This commit is contained in:
Родитель
143db590ff
Коммит
ac6cc1d36a
|
@ -199,7 +199,6 @@
|
|||
#include "nsTextFragment.h"
|
||||
#include "nsTextNode.h"
|
||||
#include "nsThreadUtils.h"
|
||||
#include "nsUnicharUtilCIID.h"
|
||||
#include "nsUnicodeProperties.h"
|
||||
#include "nsViewManager.h"
|
||||
#include "nsViewportInfo.h"
|
||||
|
@ -1759,9 +1758,9 @@ nsContentUtils::IsFirstLetterPunctuationAt(const nsTextFragment* aFrag, uint32_t
|
|||
// static
|
||||
bool nsContentUtils::IsAlphanumeric(uint32_t aChar)
|
||||
{
|
||||
nsIUGenCategory::nsUGenCategory cat = mozilla::unicode::GetGenCategory(aChar);
|
||||
nsUGenCategory cat = mozilla::unicode::GetGenCategory(aChar);
|
||||
|
||||
return (cat == nsIUGenCategory::kLetter || cat == nsIUGenCategory::kNumber);
|
||||
return (cat == nsUGenCategory::kLetter || cat == nsUGenCategory::kNumber);
|
||||
}
|
||||
|
||||
// static
|
||||
|
|
|
@ -67,7 +67,6 @@
|
|||
#include "nsDirectoryServiceUtils.h"
|
||||
#include "nsDirectoryServiceDefs.h"
|
||||
#include "mozISpellI18NManager.h"
|
||||
#include "nsUnicharUtilCIID.h"
|
||||
#include "nsUnicharUtils.h"
|
||||
#include "nsCRT.h"
|
||||
#include "mozInlineSpellChecker.h"
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
#include "nsReadableUtils.h"
|
||||
#include "nsIServiceManager.h"
|
||||
#include "nsUnicharUtils.h"
|
||||
#include "nsUnicharUtilCIID.h"
|
||||
#include "nsUnicodeProperties.h"
|
||||
#include "nsCRT.h"
|
||||
#include "mozilla/Likely.h"
|
||||
|
@ -134,7 +133,7 @@ NS_IMETHODIMP mozEnglishWordUtils::GetRootForm(const char16_t *aWord, uint32_t t
|
|||
bool mozEnglishWordUtils::ucIsAlpha(char16_t aChar)
|
||||
{
|
||||
// XXX we have to fix callers to handle the full Unicode range
|
||||
return nsIUGenCategory::kLetter == mozilla::unicode::GetGenCategory(aChar);
|
||||
return nsUGenCategory::kLetter == mozilla::unicode::GetGenCategory(aChar);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP mozEnglishWordUtils::FindNextWord(const char16_t *word, uint32_t length, uint32_t offset, int32_t *begin, int32_t *end)
|
||||
|
|
|
@ -12,7 +12,6 @@
|
|||
#include "nsIDOMRange.h"
|
||||
#include "nsIEditor.h"
|
||||
#include "nsIDOMNode.h"
|
||||
#include "nsUnicharUtilCIID.h"
|
||||
#include "nsUnicodeProperties.h"
|
||||
#include "nsServiceManagerUtils.h"
|
||||
#include "nsIContent.h"
|
||||
|
@ -851,9 +850,9 @@ WordSplitState::ClassifyCharacter(int32_t aIndex, bool aRecurse) const
|
|||
|
||||
// this will classify the character, we want to treat "ignorable" characters
|
||||
// such as soft hyphens, and also ZWJ and ZWNJ as word characters.
|
||||
nsIUGenCategory::nsUGenCategory
|
||||
charCategory = mozilla::unicode::GetGenCategory(mDOMWordText[aIndex]);
|
||||
if (charCategory == nsIUGenCategory::kLetter ||
|
||||
nsUGenCategory charCategory =
|
||||
mozilla::unicode::GetGenCategory(mDOMWordText[aIndex]);
|
||||
if (charCategory == nsUGenCategory::kLetter ||
|
||||
IsIgnorableCharacter(mDOMWordText[aIndex]) ||
|
||||
mDOMWordText[aIndex] == 0x200C /* ZWNJ */ ||
|
||||
mDOMWordText[aIndex] == 0x200D /* ZWJ */)
|
||||
|
@ -902,10 +901,10 @@ WordSplitState::ClassifyCharacter(int32_t aIndex, bool aRecurse) const
|
|||
}
|
||||
|
||||
// all other punctuation
|
||||
if (charCategory == nsIUGenCategory::kSeparator ||
|
||||
charCategory == nsIUGenCategory::kOther ||
|
||||
charCategory == nsIUGenCategory::kPunctuation ||
|
||||
charCategory == nsIUGenCategory::kSymbol) {
|
||||
if (charCategory == nsUGenCategory::kSeparator ||
|
||||
charCategory == nsUGenCategory::kOther ||
|
||||
charCategory == nsUGenCategory::kPunctuation ||
|
||||
charCategory == nsUGenCategory::kSymbol) {
|
||||
// Don't break on hyphens, as hunspell handles them on its own.
|
||||
if (aIndex > 0 &&
|
||||
mDOMWordText[aIndex] == '-' &&
|
||||
|
@ -1033,7 +1032,7 @@ WordSplitState::ShouldSkipWord(int32_t aStart, int32_t aLength)
|
|||
|
||||
// check to see if the word contains a digit
|
||||
for (int32_t i = aStart; i < last; i ++) {
|
||||
if (unicode::GetGenCategory(mDOMWordText[i]) == nsIUGenCategory::kNumber) {
|
||||
if (unicode::GetGenCategory(mDOMWordText[i]) == nsUGenCategory::kNumber) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,9 +26,9 @@
|
|||
#include "gfxGraphiteShaper.h"
|
||||
#include "gfxHarfBuzzShaper.h"
|
||||
#include "gfxUserFontSet.h"
|
||||
#include "nsIUGenCategory.h"
|
||||
#include "nsSpecialCasingData.h"
|
||||
#include "nsTextRunTransformations.h"
|
||||
#include "nsUGenCategory.h"
|
||||
#include "nsUnicodeProperties.h"
|
||||
#include "nsStyleConsts.h"
|
||||
#include "mozilla/AppUnits.h"
|
||||
|
@ -699,7 +699,7 @@ gfxShapedText::FilterIfIgnorable(uint32_t aIndex, uint32_t aCh)
|
|||
// if they're followed by additional characters in the same cluster.
|
||||
// Some fonts use them to carry the width of a whole cluster of
|
||||
// combining jamos; see bug 1238243.
|
||||
if (GetGenCategory(aCh) == nsIUGenCategory::kLetter &&
|
||||
if (GetGenCategory(aCh) == nsUGenCategory::kLetter &&
|
||||
aIndex + 1 < GetLength() &&
|
||||
!GetCharacterGlyphs()[aIndex + 1].IsClusterStart()) {
|
||||
return false;
|
||||
|
|
|
@ -11,8 +11,6 @@
|
|||
#include "nsSampleWordBreaker.h"
|
||||
|
||||
// unicharutil
|
||||
#include "nsCategoryImp.h"
|
||||
#include "nsUnicharUtilCIID.h"
|
||||
#include "nsEntityConverter.h"
|
||||
#include "nsSaveAsCharset.h"
|
||||
#include "nsUnicodeNormalizer.h"
|
||||
|
@ -32,8 +30,6 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsSampleWordBreaker)
|
|||
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsStringBundleService, Init)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsStringBundleTextOverride, Init)
|
||||
|
||||
NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsCategoryImp,
|
||||
nsCategoryImp::GetInstance)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsEntityConverter)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsSaveAsCharset)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsUnicodeNormalizer)
|
||||
|
@ -42,7 +38,6 @@ NS_DEFINE_NAMED_CID(MOZ_LOCALESERVICE_CID);
|
|||
NS_DEFINE_NAMED_CID(MOZ_OSPREFERENCES_CID);
|
||||
NS_DEFINE_NAMED_CID(NS_LBRK_CID);
|
||||
NS_DEFINE_NAMED_CID(NS_WBRK_CID);
|
||||
NS_DEFINE_NAMED_CID(NS_UNICHARCATEGORY_CID);
|
||||
NS_DEFINE_NAMED_CID(NS_ENTITYCONVERTER_CID);
|
||||
NS_DEFINE_NAMED_CID(NS_SAVEASCHARSET_CID);
|
||||
NS_DEFINE_NAMED_CID(NS_UNICODE_NORMALIZER_CID);
|
||||
|
@ -59,7 +54,6 @@ static const mozilla::Module::CIDEntry kIntlCIDs[] = {
|
|||
{ &kMOZ_OSPREFERENCES_CID, false, nullptr, mozilla::intl::OSPreferencesConstructor },
|
||||
{ &kNS_LBRK_CID, false, nullptr, nsJISx4051LineBreakerConstructor },
|
||||
{ &kNS_WBRK_CID, false, nullptr, nsSampleWordBreakerConstructor },
|
||||
{ &kNS_UNICHARCATEGORY_CID, false, nullptr, nsCategoryImpConstructor },
|
||||
{ &kNS_ENTITYCONVERTER_CID, false, nullptr, nsEntityConverterConstructor },
|
||||
{ &kNS_SAVEASCHARSET_CID, false, nullptr, nsSaveAsCharsetConstructor },
|
||||
{ &kNS_UNICODE_NORMALIZER_CID, false, nullptr, nsUnicodeNormalizerConstructor },
|
||||
|
@ -78,7 +72,6 @@ static const mozilla::Module::ContractIDEntry kIntlContracts[] = {
|
|||
{ MOZ_OSPREFERENCES_CONTRACTID, &kMOZ_OSPREFERENCES_CID },
|
||||
{ NS_LBRK_CONTRACTID, &kNS_LBRK_CID },
|
||||
{ NS_WBRK_CONTRACTID, &kNS_WBRK_CID },
|
||||
{ NS_UNICHARCATEGORY_CONTRACTID, &kNS_UNICHARCATEGORY_CID },
|
||||
{ NS_ENTITYCONVERTER_CONTRACTID, &kNS_ENTITYCONVERTER_CID },
|
||||
{ NS_SAVEASCHARSET_CONTRACTID, &kNS_SAVEASCHARSET_CID },
|
||||
{ NS_UNICODE_NORMALIZER_CONTRACTID, &kNS_UNICODE_NORMALIZER_CID },
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
#include "nsIFile.h"
|
||||
#include "nsUTF8Utils.h"
|
||||
#include "nsUnicodeProperties.h"
|
||||
#include "nsUnicharUtilCIID.h"
|
||||
#include "nsIURI.h"
|
||||
|
||||
#include "hyphen.h"
|
||||
|
@ -66,8 +65,8 @@ nsHyphenator::Hyphenate(const nsAString& aString, nsTArray<bool>& aHyphens)
|
|||
}
|
||||
}
|
||||
|
||||
nsIUGenCategory::nsUGenCategory cat = mozilla::unicode::GetGenCategory(ch);
|
||||
if (cat == nsIUGenCategory::kLetter || cat == nsIUGenCategory::kMark) {
|
||||
nsUGenCategory cat = mozilla::unicode::GetGenCategory(ch);
|
||||
if (cat == nsUGenCategory::kLetter || cat == nsUGenCategory::kMark) {
|
||||
if (!inWord) {
|
||||
inWord = true;
|
||||
wordStart = i;
|
||||
|
|
|
@ -665,7 +665,7 @@ public:
|
|||
// characters, etc) then we want a shorter "conservative" range
|
||||
uint32_t conservativeRangeStart, conservativeRangeEnd;
|
||||
if (index < mLength &&
|
||||
nsIUGenCategory::kLetter ==
|
||||
nsUGenCategory::kLetter ==
|
||||
(mText ? GetGenCategory(mText[index])
|
||||
: GetGenCategory(GetUnicodeCharAt(index)))) {
|
||||
// Primarily for hyphenated word prefixes/suffixes; we add 1 to Start
|
||||
|
|
|
@ -16,13 +16,11 @@ XPIDL_SOURCES += [
|
|||
XPIDL_MODULE = 'unicharutil'
|
||||
|
||||
EXPORTS += [
|
||||
'nsIUGenCategory.h',
|
||||
'nsUnicharUtilCIID.h',
|
||||
'nsUGenCategory.h',
|
||||
'nsUnicodeNormalizer.h',
|
||||
]
|
||||
|
||||
UNIFIED_SOURCES += [
|
||||
'nsCategoryImp.cpp',
|
||||
'nsEntityConverter.cpp',
|
||||
'nsSaveAsCharset.cpp',
|
||||
]
|
||||
|
|
|
@ -1,32 +0,0 @@
|
|||
/* -*- Mode: C; tab-width: 4; 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 "nscore.h"
|
||||
#include "nsISupports.h"
|
||||
#include "nsCategoryImp.h"
|
||||
#include "nsUnicodeProperties.h"
|
||||
|
||||
NS_IMPL_QUERY_INTERFACE(nsCategoryImp, nsIUGenCategory)
|
||||
|
||||
NS_IMETHODIMP_(MozExternalRefCountType) nsCategoryImp::AddRef(void)
|
||||
{
|
||||
return MozExternalRefCountType(1);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP_(MozExternalRefCountType) nsCategoryImp::Release(void)
|
||||
{
|
||||
return MozExternalRefCountType(1);
|
||||
}
|
||||
|
||||
nsCategoryImp* nsCategoryImp::GetInstance()
|
||||
{
|
||||
static nsCategoryImp categoryImp;
|
||||
return &categoryImp;
|
||||
}
|
||||
|
||||
nsIUGenCategory::nsUGenCategory nsCategoryImp::Get(uint32_t aChar)
|
||||
{
|
||||
return mozilla::unicode::GetGenCategory(aChar);
|
||||
}
|
|
@ -1,22 +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 nsCategoryImp_h__
|
||||
#define nsCategoryImp_h__
|
||||
|
||||
#include "nsIUGenCategory.h"
|
||||
|
||||
class nsCategoryImp : public nsIUGenCategory {
|
||||
NS_DECL_THREADSAFE_ISUPPORTS
|
||||
|
||||
public:
|
||||
static nsCategoryImp* GetInstance();
|
||||
|
||||
/**
|
||||
* Give a Unichar, return a nsUGenCategory
|
||||
*/
|
||||
virtual nsUGenCategory Get(uint32_t aChar) override;
|
||||
};
|
||||
|
||||
#endif /* nsCategoryImp_h__ */
|
|
@ -1,47 +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 nsIUGenCategory_h__
|
||||
#define nsIUGenCategory_h__
|
||||
|
||||
|
||||
#include "nsISupports.h"
|
||||
#include "nscore.h"
|
||||
|
||||
// {671fea05-fcee-4b1c-82a3-6eb03eda8ddc}
|
||||
#define NS_IUGENCATEGORY_IID \
|
||||
{ 0x671fea05, 0xfcee, 0x4b1c, \
|
||||
{ 0x82, 0xa3, 0x6e, 0xb0, 0x3e, 0xda, 0x8d, 0xdc } }
|
||||
|
||||
|
||||
class nsIUGenCategory : public nsISupports {
|
||||
|
||||
public:
|
||||
|
||||
NS_DECLARE_STATIC_IID_ACCESSOR(NS_IUGENCATEGORY_IID)
|
||||
|
||||
/**
|
||||
* Read http://unicode.org/reports/tr44/#General_Category_Values
|
||||
* for the detailed definition of the following categories
|
||||
*/
|
||||
typedef enum {
|
||||
kUndefined = 0,
|
||||
kMark = 1, // Mn, Mc, and Me
|
||||
kNumber = 2, // Nd, Nl, and No
|
||||
kSeparator = 3, // Zs, Zl, and Zp
|
||||
kOther = 4, // Cc, Cf, Cs, Co, and Cn
|
||||
kLetter = 5, // Lu, Ll, Lt, Lm, and Lo
|
||||
kPunctuation = 6, // Pc, Pd, Ps, Pe, Pi, Pf, and Po
|
||||
kSymbol = 7 // Sm, Sc, Sk, and So
|
||||
} nsUGenCategory;
|
||||
|
||||
/**
|
||||
* Give a Unichar, return a nsUGenCategory
|
||||
*/
|
||||
virtual nsUGenCategory Get(uint32_t aChar) = 0;
|
||||
};
|
||||
|
||||
NS_DEFINE_STATIC_IID_ACCESSOR(nsIUGenCategory, NS_IUGENCATEGORY_IID)
|
||||
|
||||
#endif /* nsIUGenCategory_h__ */
|
|
@ -0,0 +1,25 @@
|
|||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
||||
/* 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 nsUGenCategory_h
|
||||
#define nsUGenCategory_h
|
||||
|
||||
/**
|
||||
* Read http://unicode.org/reports/tr44/#General_Category_Values
|
||||
* for the detailed definition of the following categories
|
||||
*/
|
||||
enum class nsUGenCategory {
|
||||
kUndefined = 0,
|
||||
kMark = 1, // Mn, Mc, and Me
|
||||
kNumber = 2, // Nd, Nl, and No
|
||||
kSeparator = 3, // Zs, Zl, and Zp
|
||||
kOther = 4, // Cc, Cf, Cs, Co, and Cn
|
||||
kLetter = 5, // Lu, Ll, Lt, Lm, and Lo
|
||||
kPunctuation = 6, // Pc, Pd, Ps, Pe, Pi, Pf, and Po
|
||||
kSymbol = 7 // Sm, Sc, Sk, and So
|
||||
};
|
||||
|
||||
#endif // nsUGenCategory_h
|
|
@ -1,18 +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 nsUnicharUtilCIID_h__
|
||||
#define nsUnicharUtilCIID_h__
|
||||
|
||||
|
||||
#include "nsISupports.h"
|
||||
#include "nscore.h"
|
||||
|
||||
#define NS_UNICHARCATEGORY_CID \
|
||||
{ 0x748a1132, 0x671a, 0x409a, \
|
||||
{ 0x8d, 0x1d, 0xf1, 0xcd, 0xf6, 0xb3, 0xa6, 0xb4 } }
|
||||
|
||||
#define NS_UNICHARCATEGORY_CONTRACTID "@mozilla.org/intl/unicharcategory;1"
|
||||
|
||||
#endif
|
|
@ -216,7 +216,7 @@ IrishCasing::GetClass(uint32_t aCh)
|
|||
return sLcClasses[aCh - 'a'];
|
||||
} else if (aCh >= 'A' && aCh <= 'Z') {
|
||||
return sUcClasses[aCh - 'A'];
|
||||
} else if (GetGenCategory(aCh) == nsIUGenCategory::kLetter) {
|
||||
} else if (GetGenCategory(aCh) == nsUGenCategory::kLetter) {
|
||||
if (aCh == a_ACUTE || aCh == e_ACUTE || aCh == i_ACUTE ||
|
||||
aCh == o_ACUTE || aCh == u_ACUTE) {
|
||||
return kClass_vowel;
|
||||
|
|
|
@ -98,41 +98,41 @@ to provide the most compact storage, depending on the distribution
|
|||
of values.
|
||||
*/
|
||||
|
||||
const nsIUGenCategory::nsUGenCategory sDetailedToGeneralCategory[] = {
|
||||
const nsUGenCategory sDetailedToGeneralCategory[] = {
|
||||
/*
|
||||
* The order here corresponds to the HB_UNICODE_GENERAL_CATEGORY_* constants
|
||||
* of the hb_unicode_general_category_t enum in gfx/harfbuzz/src/hb-unicode.h.
|
||||
*/
|
||||
/* CONTROL */ nsIUGenCategory::kOther,
|
||||
/* FORMAT */ nsIUGenCategory::kOther,
|
||||
/* UNASSIGNED */ nsIUGenCategory::kOther,
|
||||
/* PRIVATE_USE */ nsIUGenCategory::kOther,
|
||||
/* SURROGATE */ nsIUGenCategory::kOther,
|
||||
/* LOWERCASE_LETTER */ nsIUGenCategory::kLetter,
|
||||
/* MODIFIER_LETTER */ nsIUGenCategory::kLetter,
|
||||
/* OTHER_LETTER */ nsIUGenCategory::kLetter,
|
||||
/* TITLECASE_LETTER */ nsIUGenCategory::kLetter,
|
||||
/* UPPERCASE_LETTER */ nsIUGenCategory::kLetter,
|
||||
/* COMBINING_MARK */ nsIUGenCategory::kMark,
|
||||
/* ENCLOSING_MARK */ nsIUGenCategory::kMark,
|
||||
/* NON_SPACING_MARK */ nsIUGenCategory::kMark,
|
||||
/* DECIMAL_NUMBER */ nsIUGenCategory::kNumber,
|
||||
/* LETTER_NUMBER */ nsIUGenCategory::kNumber,
|
||||
/* OTHER_NUMBER */ nsIUGenCategory::kNumber,
|
||||
/* CONNECT_PUNCTUATION */ nsIUGenCategory::kPunctuation,
|
||||
/* DASH_PUNCTUATION */ nsIUGenCategory::kPunctuation,
|
||||
/* CLOSE_PUNCTUATION */ nsIUGenCategory::kPunctuation,
|
||||
/* FINAL_PUNCTUATION */ nsIUGenCategory::kPunctuation,
|
||||
/* INITIAL_PUNCTUATION */ nsIUGenCategory::kPunctuation,
|
||||
/* OTHER_PUNCTUATION */ nsIUGenCategory::kPunctuation,
|
||||
/* OPEN_PUNCTUATION */ nsIUGenCategory::kPunctuation,
|
||||
/* CURRENCY_SYMBOL */ nsIUGenCategory::kSymbol,
|
||||
/* MODIFIER_SYMBOL */ nsIUGenCategory::kSymbol,
|
||||
/* MATH_SYMBOL */ nsIUGenCategory::kSymbol,
|
||||
/* OTHER_SYMBOL */ nsIUGenCategory::kSymbol,
|
||||
/* LINE_SEPARATOR */ nsIUGenCategory::kSeparator,
|
||||
/* PARAGRAPH_SEPARATOR */ nsIUGenCategory::kSeparator,
|
||||
/* SPACE_SEPARATOR */ nsIUGenCategory::kSeparator
|
||||
/* CONTROL */ nsUGenCategory::kOther,
|
||||
/* FORMAT */ nsUGenCategory::kOther,
|
||||
/* UNASSIGNED */ nsUGenCategory::kOther,
|
||||
/* PRIVATE_USE */ nsUGenCategory::kOther,
|
||||
/* SURROGATE */ nsUGenCategory::kOther,
|
||||
/* LOWERCASE_LETTER */ nsUGenCategory::kLetter,
|
||||
/* MODIFIER_LETTER */ nsUGenCategory::kLetter,
|
||||
/* OTHER_LETTER */ nsUGenCategory::kLetter,
|
||||
/* TITLECASE_LETTER */ nsUGenCategory::kLetter,
|
||||
/* UPPERCASE_LETTER */ nsUGenCategory::kLetter,
|
||||
/* COMBINING_MARK */ nsUGenCategory::kMark,
|
||||
/* ENCLOSING_MARK */ nsUGenCategory::kMark,
|
||||
/* NON_SPACING_MARK */ nsUGenCategory::kMark,
|
||||
/* DECIMAL_NUMBER */ nsUGenCategory::kNumber,
|
||||
/* LETTER_NUMBER */ nsUGenCategory::kNumber,
|
||||
/* OTHER_NUMBER */ nsUGenCategory::kNumber,
|
||||
/* CONNECT_PUNCTUATION */ nsUGenCategory::kPunctuation,
|
||||
/* DASH_PUNCTUATION */ nsUGenCategory::kPunctuation,
|
||||
/* CLOSE_PUNCTUATION */ nsUGenCategory::kPunctuation,
|
||||
/* FINAL_PUNCTUATION */ nsUGenCategory::kPunctuation,
|
||||
/* INITIAL_PUNCTUATION */ nsUGenCategory::kPunctuation,
|
||||
/* OTHER_PUNCTUATION */ nsUGenCategory::kPunctuation,
|
||||
/* OPEN_PUNCTUATION */ nsUGenCategory::kPunctuation,
|
||||
/* CURRENCY_SYMBOL */ nsUGenCategory::kSymbol,
|
||||
/* MODIFIER_SYMBOL */ nsUGenCategory::kSymbol,
|
||||
/* MATH_SYMBOL */ nsUGenCategory::kSymbol,
|
||||
/* OTHER_SYMBOL */ nsUGenCategory::kSymbol,
|
||||
/* LINE_SEPARATOR */ nsUGenCategory::kSeparator,
|
||||
/* PARAGRAPH_SEPARATOR */ nsUGenCategory::kSeparator,
|
||||
/* SPACE_SEPARATOR */ nsUGenCategory::kSeparator
|
||||
};
|
||||
|
||||
#ifdef ENABLE_INTL_API
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
#define NS_UNICODEPROPERTIES_H
|
||||
|
||||
#include "nsBidiUtils.h"
|
||||
#include "nsIUGenCategory.h"
|
||||
#include "nsUGenCategory.h"
|
||||
#include "nsUnicodeScriptCodes.h"
|
||||
#include "harfbuzz/hb.h"
|
||||
|
||||
|
@ -23,7 +23,7 @@ namespace mozilla {
|
|||
|
||||
namespace unicode {
|
||||
|
||||
extern const nsIUGenCategory::nsUGenCategory sDetailedToGeneralCategory[];
|
||||
extern const nsUGenCategory sDetailedToGeneralCategory[];
|
||||
|
||||
/* This MUST match the values assigned by genUnicodePropertyData.pl! */
|
||||
enum VerticalOrientation {
|
||||
|
@ -234,8 +234,8 @@ inline bool IsDefaultIgnorable(uint32_t aCh)
|
|||
|
||||
#endif // !ENABLE_INTL_API
|
||||
|
||||
// returns the simplified Gen Category as defined in nsIUGenCategory
|
||||
inline nsIUGenCategory::nsUGenCategory GetGenCategory(uint32_t aCh) {
|
||||
// returns the simplified Gen Category as defined in nsUGenCategory
|
||||
inline nsUGenCategory GetGenCategory(uint32_t aCh) {
|
||||
return sDetailedToGeneralCategory[GetGeneralCategory(aCh)];
|
||||
}
|
||||
|
||||
|
|
|
@ -307,7 +307,7 @@ nsCaseTransformTextRunFactory::TransformString(
|
|||
bool ntPrefix = false; // true immediately after a word-initial 'n' or 't'
|
||||
// when doing Irish lowercasing
|
||||
uint32_t sigmaIndex = uint32_t(-1);
|
||||
nsIUGenCategory::nsUGenCategory cat;
|
||||
nsUGenCategory cat;
|
||||
|
||||
uint8_t style = aAllUppercase ? NS_STYLE_TEXT_TRANSFORM_UPPERCASE : 0;
|
||||
bool forceNonFullWidth = false;
|
||||
|
@ -377,7 +377,7 @@ nsCaseTransformTextRunFactory::TransformString(
|
|||
cat = mozilla::unicode::GetGenCategory(ch);
|
||||
|
||||
if (languageSpecificCasing == eLSCB_Irish &&
|
||||
cat == nsIUGenCategory::kLetter) {
|
||||
cat == nsUGenCategory::kLetter) {
|
||||
// See bug 1018805 for Irish lowercasing requirements
|
||||
if (!prevIsLetter && (ch == 'n' || ch == 't')) {
|
||||
ntPrefix = true;
|
||||
|
@ -414,7 +414,7 @@ nsCaseTransformTextRunFactory::TransformString(
|
|||
// a CAPITAL SIGMA to FINAL SIGMA; if we now find another letter, we
|
||||
// need to change it to SMALL SIGMA.
|
||||
if (sigmaIndex != uint32_t(-1)) {
|
||||
if (cat == nsIUGenCategory::kLetter) {
|
||||
if (cat == nsUGenCategory::kLetter) {
|
||||
aConvertedString.SetCharAt(GREEK_SMALL_LETTER_SIGMA, sigmaIndex);
|
||||
}
|
||||
}
|
||||
|
@ -439,8 +439,8 @@ nsCaseTransformTextRunFactory::TransformString(
|
|||
// ignore diacritics for the purpose of contextual sigma mapping;
|
||||
// otherwise, reset prevIsLetter appropriately and clear the
|
||||
// sigmaIndex marker
|
||||
if (cat != nsIUGenCategory::kMark) {
|
||||
prevIsLetter = (cat == nsIUGenCategory::kLetter);
|
||||
if (cat != nsUGenCategory::kMark) {
|
||||
prevIsLetter = (cat == nsUGenCategory::kLetter);
|
||||
sigmaIndex = uint32_t(-1);
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче