зеркало из https://github.com/mozilla/gecko-dev.git
Convert users of nsCRT::ToUpper(PRUnichar) to ToUpper(PRUnichar) for bug 100214, r=jag, sr=scc
This commit is contained in:
Родитель
fd3d42097e
Коммит
6ae8a9bee0
|
@ -37,6 +37,7 @@
|
|||
#include "nsHashtable.h"
|
||||
#include "nsILanguageAtomService.h"
|
||||
#include "nsIServiceManager.h"
|
||||
#include "nsUnicharUtils.h"
|
||||
|
||||
|
||||
NS_IMPL_ISUPPORTS1(DeviceContextImpl, nsIDeviceContext)
|
||||
|
@ -368,7 +369,7 @@ public:
|
|||
virtual PRBool Equals(const nsHashKey *aKey) const;
|
||||
virtual nsHashKey *Clone(void) const;
|
||||
|
||||
nsAutoString mString;
|
||||
nsString mString;
|
||||
};
|
||||
|
||||
PRUint32 FontAliasKey::HashCode(void) const
|
||||
|
@ -378,7 +379,7 @@ PRUint32 FontAliasKey::HashCode(void) const
|
|||
PRUnichar ch;
|
||||
while ((ch = *string++) != 0) {
|
||||
// FYI: hash = hash*37 + ch
|
||||
ch = nsCRT::ToUpper(ch);
|
||||
ch = ToUpperCase(ch);
|
||||
hash = ((hash << 5) + (hash << 2) + hash) + ch;
|
||||
}
|
||||
return hash;
|
||||
|
|
|
@ -38,6 +38,7 @@
|
|||
#include "nscore.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsReadableUtils.h"
|
||||
#include "nsUnicharUtils.h"
|
||||
#include "nsListControlFrame.h"
|
||||
#include "nsFormControlFrame.h" // for COMPARE macro
|
||||
#include "nsFormControlHelper.h"
|
||||
|
@ -4136,7 +4137,7 @@ nsListControlFrame::KeyPress(nsIDOMEvent* aKeyEvent)
|
|||
|
||||
default: { // Select option with this as the first character
|
||||
// XXX Not I18N compliant
|
||||
code = (PRUint32)nsCRT::ToLower((PRUnichar)code);
|
||||
code = (PRUint32)ToLowerCase((PRUnichar)code);
|
||||
PRInt32 selectedIndex = (mSelectedIndex == kNothingSelected ? 0 : mSelectedIndex+1) % numOptions;
|
||||
PRInt32 startedAtIndex = selectedIndex;
|
||||
PRBool loopedAround = PR_FALSE;
|
||||
|
|
|
@ -43,6 +43,7 @@
|
|||
#include "nsSplittableFrame.h"
|
||||
#include "nsLineLayout.h"
|
||||
#include "nsString.h"
|
||||
#include "nsUnicharUtils.h"
|
||||
#include "nsIPresContext.h"
|
||||
#include "nsIContent.h"
|
||||
#include "nsStyleConsts.h"
|
||||
|
@ -2571,7 +2572,8 @@ nsTextFrame::RenderString(nsIRenderingContext& aRenderingContext,
|
|||
nsIFontMetrics* nextFont;
|
||||
nscoord nextY, glyphWidth;
|
||||
PRUnichar ch = *aBuffer;
|
||||
if (aTextStyle.mSmallCaps && (nsCRT::IsLower(ch) || (ch == kSZLIG))) {
|
||||
if (aTextStyle.mSmallCaps &&
|
||||
(IsLowerCase(ch) || (ch == kSZLIG))) {
|
||||
nextFont = aTextStyle.mSmallFont;
|
||||
nextY = smallY;
|
||||
PRUnichar upper_ch;
|
||||
|
@ -2579,7 +2581,7 @@ nsTextFrame::RenderString(nsIRenderingContext& aRenderingContext,
|
|||
if (ch == kSZLIG)
|
||||
upper_ch = (PRUnichar)'S';
|
||||
else
|
||||
upper_ch = nsCRT::ToUpper(ch);
|
||||
upper_ch = ToUpperCase(ch);
|
||||
if (lastFont != aTextStyle.mSmallFont) {
|
||||
aRenderingContext.SetFont(aTextStyle.mSmallFont);
|
||||
aRenderingContext.GetWidth(upper_ch, charWidth);
|
||||
|
@ -2707,13 +2709,14 @@ nsTextFrame::GetTextDimensionsOrLength(nsIRenderingContext& aRenderingContext,
|
|||
nsTextDimensions sum, glyphDimensions;
|
||||
while (--length >= 0) {
|
||||
PRUnichar ch = *inBuffer++;
|
||||
if (aStyle.mSmallCaps && (nsCRT::IsLower(ch) || (ch == kSZLIG))) {
|
||||
if (aStyle.mSmallCaps &&
|
||||
(IsLowerCase(ch) || (ch == kSZLIG))) {
|
||||
PRUnichar upper_ch;
|
||||
// German szlig should be expanded to "SS".
|
||||
if (ch == kSZLIG)
|
||||
upper_ch = (PRUnichar)'S';
|
||||
else
|
||||
upper_ch = nsCRT::ToUpper(ch);
|
||||
upper_ch = ToUpperCase(ch);
|
||||
if (lastFont != aStyle.mSmallFont) {
|
||||
lastFont = aStyle.mSmallFont;
|
||||
aRenderingContext.SetFont(lastFont);
|
||||
|
|
|
@ -43,6 +43,7 @@
|
|||
#include "nsSplittableFrame.h"
|
||||
#include "nsLineLayout.h"
|
||||
#include "nsString.h"
|
||||
#include "nsUnicharUtils.h"
|
||||
#include "nsIPresContext.h"
|
||||
#include "nsIContent.h"
|
||||
#include "nsStyleConsts.h"
|
||||
|
@ -2571,7 +2572,8 @@ nsTextFrame::RenderString(nsIRenderingContext& aRenderingContext,
|
|||
nsIFontMetrics* nextFont;
|
||||
nscoord nextY, glyphWidth;
|
||||
PRUnichar ch = *aBuffer;
|
||||
if (aTextStyle.mSmallCaps && (nsCRT::IsLower(ch) || (ch == kSZLIG))) {
|
||||
if (aTextStyle.mSmallCaps &&
|
||||
(IsLowerCase(ch) || (ch == kSZLIG))) {
|
||||
nextFont = aTextStyle.mSmallFont;
|
||||
nextY = smallY;
|
||||
PRUnichar upper_ch;
|
||||
|
@ -2579,7 +2581,7 @@ nsTextFrame::RenderString(nsIRenderingContext& aRenderingContext,
|
|||
if (ch == kSZLIG)
|
||||
upper_ch = (PRUnichar)'S';
|
||||
else
|
||||
upper_ch = nsCRT::ToUpper(ch);
|
||||
upper_ch = ToUpperCase(ch);
|
||||
if (lastFont != aTextStyle.mSmallFont) {
|
||||
aRenderingContext.SetFont(aTextStyle.mSmallFont);
|
||||
aRenderingContext.GetWidth(upper_ch, charWidth);
|
||||
|
@ -2707,13 +2709,14 @@ nsTextFrame::GetTextDimensionsOrLength(nsIRenderingContext& aRenderingContext,
|
|||
nsTextDimensions sum, glyphDimensions;
|
||||
while (--length >= 0) {
|
||||
PRUnichar ch = *inBuffer++;
|
||||
if (aStyle.mSmallCaps && (nsCRT::IsLower(ch) || (ch == kSZLIG))) {
|
||||
if (aStyle.mSmallCaps &&
|
||||
(IsLowerCase(ch) || (ch == kSZLIG))) {
|
||||
PRUnichar upper_ch;
|
||||
// German szlig should be expanded to "SS".
|
||||
if (ch == kSZLIG)
|
||||
upper_ch = (PRUnichar)'S';
|
||||
else
|
||||
upper_ch = nsCRT::ToUpper(ch);
|
||||
upper_ch = ToUpperCase(ch);
|
||||
if (lastFont != aStyle.mSmallFont) {
|
||||
lastFont = aStyle.mSmallFont;
|
||||
aRenderingContext.SetFont(lastFont);
|
||||
|
|
|
@ -38,6 +38,7 @@
|
|||
#include "nscore.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsReadableUtils.h"
|
||||
#include "nsUnicharUtils.h"
|
||||
#include "nsListControlFrame.h"
|
||||
#include "nsFormControlFrame.h" // for COMPARE macro
|
||||
#include "nsFormControlHelper.h"
|
||||
|
@ -4136,7 +4137,7 @@ nsListControlFrame::KeyPress(nsIDOMEvent* aKeyEvent)
|
|||
|
||||
default: { // Select option with this as the first character
|
||||
// XXX Not I18N compliant
|
||||
code = (PRUint32)nsCRT::ToLower((PRUnichar)code);
|
||||
code = (PRUint32)ToLowerCase((PRUnichar)code);
|
||||
PRInt32 selectedIndex = (mSelectedIndex == kNothingSelected ? 0 : mSelectedIndex+1) % numOptions;
|
||||
PRInt32 startedAtIndex = selectedIndex;
|
||||
PRBool loopedAround = PR_FALSE;
|
||||
|
|
|
@ -41,6 +41,7 @@ REQUIRES = xpcom \
|
|||
rdf \
|
||||
msglocal \
|
||||
intl \
|
||||
unicharutil \
|
||||
pref \
|
||||
timer \
|
||||
msgnews \
|
||||
|
|
|
@ -37,6 +37,7 @@
|
|||
#include "msgCore.h"
|
||||
#include "nsMsgSearchAdapter.h"
|
||||
#include "nsXPIDLString.h"
|
||||
#include "nsUnicharUtils.h"
|
||||
#include "nsReadableUtils.h"
|
||||
#include "nsMsgSearchScopeTerm.h"
|
||||
#include "nsMsgResultElement.h"
|
||||
|
@ -107,8 +108,8 @@ PRUnichar *nsMsgSearchNews::EncodeToWildmat (const PRUnichar *value)
|
|||
if (nsCRT::IsAsciiAlpha(*value))
|
||||
{
|
||||
*walkValue++ = (PRUnichar)'[';
|
||||
*walkValue++ = nsCRT::ToUpper((PRUnichar)*value);
|
||||
*walkValue++ = nsCRT::ToLower((PRUnichar)*value);
|
||||
*walkValue++ = ToUpperCase((PRUnichar)*value);
|
||||
*walkValue++ = ToLowerCase((PRUnichar)*value);
|
||||
*walkValue++ = (PRUnichar)']';
|
||||
}
|
||||
else
|
||||
|
|
Загрузка…
Ссылка в новой задаче