Sophie

Sophie

distrib > Mandriva > 2009.0 > i586 > by-pkgid > 2cf9a63095fc36c222212e4c29e60bf8 > files > 10

seamonkey-1.1.18-1mdv2009.0.src.rpm

--- mozilla/gfx/src/gtk/nsDeviceContextGTK.cpp.uifont	2002-12-21 03:50:43.000000000 +0100
+++ mozilla/gfx/src/gtk/nsDeviceContextGTK.cpp	2003-03-14 16:22:34.000000000 +0100
@@ -42,6 +42,8 @@
 
 #include "nspr.h"
 #include "nsIPref.h"
+#include "nsIPrefService.h"
+#include "nsIPrefBranch.h"
 #include "nsIServiceManager.h"
 #include "nsCRT.h"
 
@@ -940,6 +942,23 @@
       fontName.Append(PRUnichar(','));
     }
   }
+
+  // Allow the values calculated above to be overidden by preferences
+  nsCOMPtr<nsIPrefBranch> prefBranch(do_GetService(NS_PREFSERVICE_CONTRACTID));
+  if (prefBranch) {
+    nsXPIDLCString name;
+    prefBranch->GetCharPref("font.uifont.name", getter_Copies(name));
+
+    if (name)
+      aFont->name.AssignWithConversion(name);
+
+    PRInt32 pointheight = 0;
+    prefBranch->GetIntPref("font.uifont.pointheight", &pointheight);
+
+    if (pointheight)
+      aFont->size = NSIntPointsToTwips(pointheight);
+  }
+
   return NS_OK;
 }
 #endif /* MOZ_WIDGET_GTK */
@@ -969,6 +988,22 @@
 
   aFont->size = NSIntPointsToTwips(size / PANGO_SCALE);
 
+  // Allow the values calculated above to be overidden by preferences
+  nsCOMPtr<nsIPrefBranch> prefBranch(do_GetService(NS_PREFSERVICE_CONTRACTID));
+  if (prefBranch) {
+    nsXPIDLCString name;
+    prefBranch->GetCharPref("font.uifont.name", getter_Copies(name));
+
+    if (name)
+      aFont->name.AssignWithConversion(name);
+
+    PRInt32 pointheight = 0;
+    prefBranch->GetIntPref("font.uifont.pointheight", &pointheight);
+
+    if (pointheight)
+      aFont->size = NSIntPointsToTwips(pointheight);
+  }
+
   return NS_OK;
 }
 #endif /* MOZ_WIDGET_GTK2 */