Bug 517218 - Backout bug 515455 which didn't address the real issue. r=roc

This commit is contained in:
Sylvain Pasche 2009-09-25 18:40:48 +02:00
Родитель 47cbbeabc8
Коммит ab455408c7
1 изменённых файлов: 3 добавлений и 23 удалений

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

@ -629,30 +629,10 @@ nsThebesDeviceContext::SetDPI()
nsCOMPtr<nsIPrefBranch> prefs = do_GetService(NS_PREFSERVICE_CONTRACTID);
if (prefs) {
const char *prefName = "layout.css.devPixelsPerPx";
PRInt32 prefType = nsIPrefBranch::PREF_INVALID;
PRInt32 prefInt;
nsXPIDLCString prefString;
nsresult rv;
prefs->GetPrefType(prefName, &prefType);
switch (prefType) {
case nsIPrefBranch::PREF_INT:
// Backward compatibility for applications that haven't migrated
// to a string yet.
rv = prefs->GetIntPref(prefName, &prefInt);
if (NS_SUCCEEDED(rv)) {
prefDevPixelsPerCSSPixel = static_cast<float>(prefInt);
}
break;
case nsIPrefBranch::PREF_STRING:
rv = prefs->GetCharPref(prefName, getter_Copies(prefString));
if (NS_SUCCEEDED(rv) && !prefString.IsEmpty()) {
prefDevPixelsPerCSSPixel = static_cast<float>(atof(prefString));
}
break;
nsresult rv = prefs->GetCharPref("layout.css.devPixelsPerPx", getter_Copies(prefString));
if (NS_SUCCEEDED(rv) && !prefString.IsEmpty()) {
prefDevPixelsPerCSSPixel = static_cast<float>(atof(prefString));
}
}