[Xfce4-commits] [apps/mousepad] 01/01: Fix line number printing when option is disabled

noreply at xfce.org noreply at xfce.org
Sat Jul 12 05:20:12 CEST 2014


This is an automated email from the git hooks/post-receive script.

mbrush pushed a commit to branch master
in repository apps/mousepad.

commit 8525dbdaf58cce86f235ec92923e1c48f493c6d9
Author: Matthew Brush <mbrush at codebrainz.ca>
Date:   Fri Jul 11 20:17:53 2014 -0700

    Fix line number printing when option is disabled
    
    Closes #9813 (https://bugzilla.xfce.org/show_bug.cgi?id=9813)
    
    Thanks to Christian Hesse for providing the patch.
---
 mousepad/mousepad-print.c |   19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/mousepad/mousepad-print.c b/mousepad/mousepad-print.c
index f9ae90f..2a97b45 100644
--- a/mousepad/mousepad-print.c
+++ b/mousepad/mousepad-print.c
@@ -285,6 +285,12 @@ mousepad_print_settings_load (GtkPrintOperation *operation)
     else
       gtk_source_print_compositor_set_line_numbers_font_name (print->compositor, body_font);
 
+    /* setup line number printing */
+    if (print->print_line_numbers)
+      gtk_source_print_compositor_set_print_line_numbers (print->compositor, print->line_number_increment);
+    else
+      gtk_source_print_compositor_set_print_line_numbers (print->compositor, 0);
+
     /* cleanup */
     g_free (body_font);
     g_free (header_font);
@@ -501,6 +507,10 @@ mousepad_print_button_toggled (GtkWidget     *button,
   {
     print->print_line_numbers = active;
     gtk_widget_set_sensitive (print->widget_line_numbers_hbox, active);
+    if (active)
+      gtk_source_print_compositor_set_print_line_numbers (print->compositor, print->line_number_increment);
+    else
+      gtk_source_print_compositor_set_print_line_numbers (print->compositor, 0);
   }
   else if (button == print->widget_text_wrapping)
     gtk_source_print_compositor_set_wrap_mode (print->compositor, active ? GTK_WRAP_WORD : GTK_WRAP_NONE);
@@ -535,13 +545,8 @@ mousepad_print_spin_value_changed (GtkSpinButton *button,
 {
   print->line_number_increment = gtk_spin_button_get_value_as_int (button);
 
-  if (print->line_number_increment > 0 && print->print_line_numbers)
-    {
-      gtk_source_print_compositor_set_print_line_numbers (print->compositor,
-                                                          print->line_number_increment);
-    }
-  else
-    gtk_source_print_compositor_set_print_line_numbers (print->compositor, 0);
+  gtk_source_print_compositor_set_print_line_numbers (print->compositor,
+                                                      print->line_number_increment);
 }
 
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list