]> Pileus Git - ~andy/gtk/blobdiff - gtk/gtkfontbutton.c
GtkEntry: Sanity check the end_pos value in _get_display_text()
[~andy/gtk] / gtk / gtkfontbutton.c
index f7d65efb95059b7827e67dfd5a599cba3f86624a..f65b905b2d45a8e1fda13b49f8ba9a40ecf87374 100644 (file)
@@ -16,8 +16,7 @@
  * Library General Public License for more details.
  *
  * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Cambridge, MA 02139, USA.
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
  */
 /*
  * Modified by the GTK+ Team and others 2003.  See the AUTHORS
@@ -275,9 +274,9 @@ gtk_font_button_set_show_preview_entry (GtkFontButton *font_button,
   GtkFontButtonPrivate *priv = font_button->priv;
 
   if (priv->font_dialog)
-    return gtk_font_chooser_set_show_preview_entry (GTK_FONT_CHOOSER (priv->font_dialog), show);
-
-  priv->show_preview_entry = show != FALSE;
+    gtk_font_chooser_set_show_preview_entry (GTK_FONT_CHOOSER (priv->font_dialog), show);
+  else
+    priv->show_preview_entry = show != FALSE;
 }
 
 static PangoFontFamily *
@@ -1183,8 +1182,10 @@ gtk_font_button_update_font_info (GtkFontButton *font_button)
 
   if (font_button->priv->show_size) 
     {
-      gchar *size = g_strdup_printf ("%g",
-                                     pango_font_description_get_size (priv->font_desc) / (double)PANGO_SCALE);
+      /* mirror Pango, which doesn't translate this either */
+      gchar *size = g_strdup_printf ("%g%s",
+                                     pango_font_description_get_size (priv->font_desc) / (double)PANGO_SCALE,
+                                     pango_font_description_get_size_is_absolute (priv->font_desc) ? "px" : "");
       
       gtk_label_set_text (GTK_LABEL (font_button->priv->size_label), size);