[gedit/wip/printing-enhancements: 2/2] print-preview: misc code improvements
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gedit/wip/printing-enhancements: 2/2] print-preview: misc code improvements
- Date: Sun, 28 Jun 2015 04:35:01 +0000 (UTC)
commit 3f346ca08b3c024e6023492e89b7bf4a9fff5438
Author: Sébastien Wilmet <swilmet gnome org>
Date: Sun Jun 28 06:01:56 2015 +0200
print-preview: misc code improvements
gedit/gedit-print-preview.c | 18 +++++-------------
1 files changed, 5 insertions(+), 13 deletions(-)
---
diff --git a/gedit/gedit-print-preview.c b/gedit/gedit-print-preview.c
index dd4393c..3b0b383 100644
--- a/gedit/gedit-print-preview.c
+++ b/gedit/gedit-print-preview.c
@@ -155,7 +155,8 @@ update_tile_size (GeditPrintPreview *preview)
}
/* Zoom should always be set with one of these two function
- * so that the tile size is properly updated */
+ * so that the tile size is properly updated.
+ */
static void
set_zoom_factor (GeditPrintPreview *preview,
@@ -296,27 +297,18 @@ page_entry_insert_text (GtkEditable *editable,
gint length,
gint *position)
{
- gunichar c;
- const gchar *p;
const gchar *end;
+ const gchar *p;
- p = text;
end = text + length;
- while (p != end)
+ for (p = text; p < end; p = g_utf8_next_char (p))
{
- const gchar *next;
- next = g_utf8_next_char (p);
-
- c = g_utf8_get_char (p);
-
- if (!g_unichar_isdigit (c))
+ if (!g_unichar_isdigit (g_utf8_get_char (p)))
{
g_signal_stop_emission_by_name (editable, "insert-text");
break;
}
-
- p = next;
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]