зеркало из https://github.com/mozilla/pjs.git
20747 "[PP] The Font FACE attribute is case-sensitive". FontNameKey now computes the hash-value on lower-case strings. Also added a few out-commented lines in GetScreenResolution that may be useful later for #18136 "Fixing the font size mess".
This commit is contained in:
Родитель
190ba77382
Коммит
2e91e607c0
|
@ -470,7 +470,9 @@ FontNameKey::FontNameKey(const nsString& aString)
|
|||
|
||||
PRUint32 FontNameKey::HashValue(void) const
|
||||
{
|
||||
return nsCRT::HashValue(mString.GetUnicode());
|
||||
nsString str;
|
||||
mString.ToLowerCase(str);
|
||||
return nsCRT::HashValue(str.GetUnicode());
|
||||
}
|
||||
|
||||
PRBool FontNameKey::Equals(const nsHashKey *aKey) const
|
||||
|
@ -643,6 +645,13 @@ PRUint32 nsDeviceContextMac::GetScreenResolution()
|
|||
if (NS_SUCCEEDED(prefs->GetIntPref("browser.screen_resolution", &intVal))) {
|
||||
mPixelsPerInch = intVal;
|
||||
}
|
||||
#if 0
|
||||
else {
|
||||
short hppi, vppi;
|
||||
::ScreenRes(&hppi, &vppi);
|
||||
mPixelsPerInch = hppi * 1.17f;
|
||||
}
|
||||
#endif
|
||||
nsServiceManager::ReleaseService(kPrefCID, prefs);
|
||||
}
|
||||
|
||||
|
|
|
@ -470,7 +470,9 @@ FontNameKey::FontNameKey(const nsString& aString)
|
|||
|
||||
PRUint32 FontNameKey::HashValue(void) const
|
||||
{
|
||||
return nsCRT::HashValue(mString.GetUnicode());
|
||||
nsString str;
|
||||
mString.ToLowerCase(str);
|
||||
return nsCRT::HashValue(str.GetUnicode());
|
||||
}
|
||||
|
||||
PRBool FontNameKey::Equals(const nsHashKey *aKey) const
|
||||
|
@ -643,6 +645,13 @@ PRUint32 nsDeviceContextMac::GetScreenResolution()
|
|||
if (NS_SUCCEEDED(prefs->GetIntPref("browser.screen_resolution", &intVal))) {
|
||||
mPixelsPerInch = intVal;
|
||||
}
|
||||
#if 0
|
||||
else {
|
||||
short hppi, vppi;
|
||||
::ScreenRes(&hppi, &vppi);
|
||||
mPixelsPerInch = hppi * 1.17f;
|
||||
}
|
||||
#endif
|
||||
nsServiceManager::ReleaseService(kPrefCID, prefs);
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче