Remove old nav4rounding pref. Patch by Daniel Kraft <d@daniel-kraft.net>,

r=dbaron, sr=jst
This commit is contained in:
bzbarsky%mit.edu 2005-01-12 04:07:22 +00:00
parent f9ef2b77dc
commit 1194cfe6b9
4 changed files with 3 additions and 66 deletions

View File

@ -38,7 +38,6 @@
#include "nsDeviceContextWin.h"
#include "nsRenderingContextWin.h"
#include "nsDeviceContextSpecWin.h"
#include "nsIPref.h"
#include "nsIServiceManager.h"
#include "nsCOMPtr.h"
#include "nsIScreenManager.h"
@ -54,13 +53,8 @@
#define DOC_TITLE_LENGTH 64
static NS_DEFINE_CID(kPrefCID, NS_PREF_CID);
PRBool nsDeviceContextWin::gRound = PR_FALSE;
PRUint32 nsDeviceContextWin::sNumberOfScreens = 0;
static char* nav4rounding = "font.size.nav4rounding";
#include "prlog.h"
#ifdef PR_LOGGING
PRLogModuleInfo * kGfxPrintingLogMod = PR_NewLogModule("printing-gfx");
@ -84,17 +78,6 @@ nsDeviceContextWin :: nsDeviceContextWin()
mSpec = nsnull;
mCachedClientRect = PR_FALSE;
mCachedFullRect = PR_FALSE;
nsresult res = NS_ERROR_FAILURE;
nsCOMPtr<nsIPref> prefs(do_GetService(kPrefCID, &res));
if (NS_SUCCEEDED(res)) {
static PRBool roundingInitialized = PR_FALSE;
if (!roundingInitialized) {
roundingInitialized = PR_TRUE;
PrefChanged(nav4rounding, this);
}
prefs->RegisterCallback(nav4rounding, PrefChanged, this);
}
}
nsDeviceContextWin :: ~nsDeviceContextWin()
@ -114,12 +97,6 @@ nsDeviceContextWin :: ~nsDeviceContextWin()
}
NS_IF_RELEASE(mSpec);
nsresult res = NS_ERROR_FAILURE;
nsCOMPtr<nsIPref> prefs(do_GetService(kPrefCID, &res));
if (NS_SUCCEEDED(res)) {
prefs->UnregisterCallback(nav4rounding, PrefChanged, this);
}
}
NS_IMETHODIMP nsDeviceContextWin :: Init(nsNativeWidget aWidget)
@ -905,20 +882,6 @@ NS_IMETHODIMP nsDeviceContextWin :: EndPage(void)
return NS_OK;
}
int
nsDeviceContextWin :: PrefChanged(const char* aPref, void* aClosure)
{
nsresult res = NS_ERROR_FAILURE;
nsCOMPtr<nsIPref> prefs(do_GetService(kPrefCID, &res));
if (NS_SUCCEEDED(res)) {
prefs->GetBoolPref(nav4rounding, &gRound);
nsDeviceContextWin* deviceContext = (nsDeviceContextWin*) aClosure;
deviceContext->FlushFontCache();
}
return 0;
}
char*
nsDeviceContextWin :: GetACPString(const nsAString& aStr)
{

View File

@ -123,9 +123,6 @@ protected:
public:
HDC mDC;
static PRBool gRound;
static int PrefChanged(const char* aPref, void* aClosure);
};
#endif /* nsDeviceContextWin_h___ */

View File

@ -497,28 +497,9 @@ void
nsFontMetricsWin::FillLogFont(LOGFONT* logFont, PRInt32 aWeight,
PRBool aSizeOnly)
{
float app2dev, app2twip, scale;
float app2dev;
app2dev = mDeviceContext->AppUnitsToDevUnits();
if (nsDeviceContextWin::gRound) {
app2twip = mDeviceContext->DevUnitsToTwips();
mDeviceContext->GetCanonicalPixelScale(scale);
app2twip *= app2dev * scale;
// This interesting bit of code rounds the font size off to the floor point
// value. This is necessary for proper font scaling under windows.
PRInt32 sizePoints = NSTwipsToFloorIntPoints(nscoord(mFont.size*app2twip));
float rounded = ((float)NSIntPointsToTwips(sizePoints)) / app2twip;
// round font size off to floor point size to be windows compatible
// this is proper (windows) rounding
logFont->lfHeight = - NSToIntRound(rounded * app2dev);
// this floor rounding is to make ours compatible with Nav 4.0
//logFont->lfHeight = - LONG(rounded * app2dev);
}
else {
logFont->lfHeight = - NSToIntRound(mFont.size * app2dev);
}
// Quick return if we came here just to compute the font size
if (aSizeOnly) return;

View File

@ -1025,8 +1025,6 @@ pref("font.size.fixed.zh-TW", 16);
pref("font.size.variable.zh-HK", 16);
pref("font.size.fixed.zh-HK", 16);
pref("font.size.nav4rounding", false);
pref("ui.key.menuAccessKeyFocuses", true);
// override double-click word selection behavior.
@ -1386,8 +1384,6 @@ pref("font.size.fixed.zh-TW", 16);
pref("font.size.variable.zh-HK", 16);
pref("font.size.fixed.zh-HK", 16);
pref("font.size.nav4rounding", false);
pref("netinst.profile.show_profile_wizard", true);
pref("middlemouse.paste", true);