From 2e91e607c06a209c66c868df479ec3f624825a02 Mon Sep 17 00:00:00 2001 From: "pierre%netscape.com" Date: Sat, 4 Dec 1999 13:52:15 +0000 Subject: [PATCH] 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". --- gfx/src/mac/nsDeviceContextMac.cpp | 11 ++++++++++- widget/src/mac/nsDeviceContextMac.cpp | 11 ++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/gfx/src/mac/nsDeviceContextMac.cpp b/gfx/src/mac/nsDeviceContextMac.cpp index 3d43a8afff8..79c6bd5fd25 100644 --- a/gfx/src/mac/nsDeviceContextMac.cpp +++ b/gfx/src/mac/nsDeviceContextMac.cpp @@ -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); } diff --git a/widget/src/mac/nsDeviceContextMac.cpp b/widget/src/mac/nsDeviceContextMac.cpp index 3d43a8afff8..79c6bd5fd25 100644 --- a/widget/src/mac/nsDeviceContextMac.cpp +++ b/widget/src/mac/nsDeviceContextMac.cpp @@ -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); }