Removing unused code. Preliminary patch to bug 231162, r=jshin@mailaps.org, sr=dbaron.

This commit is contained in:
smontagu%smontagu.org 2004-01-21 06:40:17 +00:00
Родитель 6a8f1df53b
Коммит c1002122ce
3 изменённых файлов: 0 добавлений и 98 удалений

Просмотреть файл

@ -73,11 +73,6 @@ public:
NS_IMETHOD ToTitle( const PRUnichar* anArray, PRUnichar* aReturn,
PRUint32 aLen, PRBool aStartInWordBundary=PR_TRUE) = 0;
// The following nsString flavor one know how to handle special casing
NS_IMETHOD ToUpper(const PRUnichar* anIn, PRUint32 aLen, nsString& anOut, const PRUnichar* aLocale=nsnull) = 0;
NS_IMETHOD ToLower(const PRUnichar* anIn, PRUint32 aLen, nsString& anOut, const PRUnichar* aLocale=nsnull ) = 0;
NS_IMETHOD ToTitle(const PRUnichar* anIn, PRUint32 aLen, nsString& anOut, const PRUnichar* aLocale=nsnull, PRBool aStartInWordBoundary=PR_TRUE) = 0;
// case-insensitive PRUnichar* comparison - aResult returns similar
// to strcasecmp
NS_IMETHOD CaseInsensitiveCompare(const PRUnichar* aLeft, const PRUnichar* aRight, PRUint32 aLength, PRInt32* aResult) = 0;

Просмотреть файл

@ -340,96 +340,6 @@ nsresult nsCaseConversionImp2::ToTitle(
return NS_OK;
}
#define k_ss 0x00df
#define kDot_I 0x0130
#define kDot_i PRUnichar('i')
#define kDotLess_I PRUnichar('I')
#define kDotLess_i 0x0131
NS_IMETHODIMP nsCaseConversionImp2::ToUpper
(const PRUnichar* anIn, PRUint32 aLen, nsString& anOut, const PRUnichar* aLocale)
{
anOut.Assign(anIn,aLen);
// Special casing - Turkish dotless I
if((nsnull != aLocale ) && (PRUnichar('t')==aLocale[0]) && (PRUnichar('r') == aLocale[1]))
{
for(PRUnichar* s=(PRUnichar*)anOut.get(); *s ; s++)
{
if(kDot_i == *s)
*s = kDot_I;
}
}
ToUpper(anOut.get(), (PRUnichar*)anOut.get(), anOut.Length());
// Special casing - SS
PRInt32 idx=0;
for(PRUnichar* s=(PRUnichar*)anOut.get(); *s ; s++,idx++)
{
if(k_ss == *s) {
*s = PRUnichar('S') ;
anOut.Insert(PRUnichar('S'),idx);
// Insert may cause reallocate, so we need to get() again
s = (PRUnichar*)anOut.get() + idx;
idx++;
}
}
return NS_OK;
}
NS_IMETHODIMP nsCaseConversionImp2::ToLower
(const PRUnichar* anIn, PRUint32 aLen, nsString& anOut, const PRUnichar* aLocale)
{
anOut.Assign(anIn,aLen);
// Special casing - Turkish dotless I
if((nsnull != aLocale ) && (PRUnichar('t')==aLocale[0]) && (PRUnichar('r') == aLocale[1]))
{
for(PRUnichar* s=(PRUnichar*)anOut.get(); *s ; s++)
{
if(kDot_I == *s)
*s = kDot_I;
}
}
ToLower(anOut.get(), (PRUnichar*)anOut.get(), anOut.Length());
return NS_OK;
}
NS_IMETHODIMP nsCaseConversionImp2::ToTitle
(const PRUnichar* anIn, PRUint32 aLen, nsString& anOut, const PRUnichar* aLocale,
PRBool aStartInWordBoundary)
{
anOut.Assign(anIn,aLen);
// Special casing - Turkish dotless I
if((nsnull != aLocale ) && (PRUnichar('t')==aLocale[0]) && (PRUnichar('r') == aLocale[1]))
{
for(PRUnichar* s=(PRUnichar*)anOut.get(); *s ; s++)
{
if(kDot_i == *s)
*s = kDot_I;
}
}
ToTitle(anOut.get(), (PRUnichar*)anOut.get(), anOut.Length(),
aStartInWordBoundary);
// Special casing - SS
PRInt32 idx=0;
for(PRUnichar* s=(PRUnichar*)anOut.get(); *s ; s++,idx++)
{
if(k_ss == *s) {
*s = PRUnichar('S') ;
anOut.Insert(PRUnichar('S'),idx);
// Insert may cause reallocate, so we need to get() again
s = (PRUnichar*)anOut.get() + idx;
idx++;
}
}
return NS_OK;
}
// implementation moved from the old nsCRT routine
NS_IMETHODIMP
nsCaseConversionImp2::CaseInsensitiveCompare(const PRUnichar *aLeft,

Просмотреть файл

@ -67,9 +67,6 @@ public:
NS_IMETHOD ToTitle(const PRUnichar* anArray, PRUnichar* aReturn,
PRUint32 aLen, PRBool aStartInWordBoundary = PR_TRUE);
NS_IMETHOD ToUpper(const PRUnichar* anIn, PRUint32 aLen, nsString& anOut, const PRUnichar* aLocale=nsnull) ;
NS_IMETHOD ToLower(const PRUnichar* anIn, PRUint32 aLen, nsString& anOut, const PRUnichar* aLocale=nsnull );
NS_IMETHOD ToTitle(const PRUnichar* anIn, PRUint32 aLen, nsString& anOut, const PRUnichar* aLocale=nsnull, PRBool aStartInWordBoundary=PR_TRUE) ;
NS_IMETHOD CaseInsensitiveCompare(const PRUnichar* aLeft, const PRUnichar* aRight, PRUint32 aLength, PRInt32 *aResult);
private:
static nsrefcnt gInit;