[evince] [libdocument] Remove unneeded check for numeric page labels
- From: Carlos Garcia Campos <carlosgc src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [evince] [libdocument] Remove unneeded check for numeric page labels
- Date: Mon, 4 Jan 2010 13:18:33 +0000 (UTC)
commit 82a2794c325f01202d694fc03850cf9cd356111d
Author: Carlos Garcia Campos <carlosgc gnome org>
Date: Mon Jan 4 14:17:25 2010 +0100
[libdocument] Remove unneeded check for numeric page labels
libdocument/ev-document.c | 16 ++++------------
1 files changed, 4 insertions(+), 12 deletions(-)
---
diff --git a/libdocument/ev-document.c b/libdocument/ev-document.c
index 4906851..c126293 100644
--- a/libdocument/ev-document.c
+++ b/libdocument/ev-document.c
@@ -293,18 +293,10 @@ ev_document_load (EvDocument *document,
page_label = _ev_document_get_page_label (document, page);
if (page_label) {
- if (priv->page_labels) {
- priv->page_labels[i] = page_label;
- } else {
- gchar *numeric_label;
-
- numeric_label = g_strdup_printf ("%d", i + 1);
- if (strcmp (numeric_label, page_label) != 0) {
- priv->page_labels = g_new0 (gchar *, priv->n_pages);
- priv->page_labels[i] = page_label;
- }
- g_free (numeric_label);
- }
+ if (!priv->page_labels)
+ priv->page_labels = g_new0 (gchar *, priv->n_pages);
+
+ priv->page_labels[i] = page_label;
priv->max_label = MAX (priv->max_label,
g_utf8_strlen (page_label, 256));
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]