evince r2996 - in trunk: . backend/djvu
- From: carlosgc svn gnome org
- To: svn-commits-list gnome org
- Subject: evince r2996 - in trunk: . backend/djvu
- Date: Tue, 8 Apr 2008 10:49:08 +0100 (BST)
Author: carlosgc
Date: Tue Apr 8 10:49:07 2008
New Revision: 2996
URL: http://svn.gnome.org/viewvc/evince?rev=2996&view=rev
Log:
2008-04-08 Carlos Garcia Campos <carlosgc gnome org>
* backend/djvu/djvu-links.c: (build_tree):
Make sure link title is a valid utf8 string. Fixes bug #526517.
Modified:
trunk/ChangeLog
trunk/backend/djvu/djvu-links.c
Modified: trunk/backend/djvu/djvu-links.c
==============================================================================
--- trunk/backend/djvu/djvu-links.c (original)
+++ trunk/backend/djvu/djvu-links.c Tue Apr 8 10:49:07 2008
@@ -169,16 +169,16 @@
/* The (bookmarks) cons */
iter = miniexp_cdr (iter);
} else if ( miniexp_length (iter) >= 2 ) {
+ gchar *utf8_title = NULL;
+
/* An entry */
if (!string_from_miniexp (miniexp_car (iter), &title)) goto unknown_entry;
if (!string_from_miniexp (miniexp_cadr (iter), &link_dest)) goto unknown_entry;
+
if (!g_utf8_validate (title, -1, NULL)) {
- gchar *utf8_title;
-
utf8_title = str_to_utf8 (title);
title_markup = g_markup_escape_text (utf8_title, -1);
- g_free (utf8_title);
} else {
title_markup = g_markup_escape_text (title, -1);
}
@@ -188,7 +188,7 @@
if (g_str_has_suffix (link_dest, ".djvu")) {
/* FIXME: component file identifiers */
} else if (ev_action) {
- ev_link = ev_link_new (title, ev_action);
+ ev_link = ev_link_new (utf8_title ? utf8_title : title, ev_action);
gtk_tree_store_append (GTK_TREE_STORE (model), &tree_iter, parent);
gtk_tree_store_set (GTK_TREE_STORE (model), &tree_iter,
EV_DOCUMENT_LINKS_COLUMN_MARKUP, title_markup,
@@ -205,7 +205,7 @@
}
g_free (title_markup);
-
+ g_free (utf8_title);
iter = miniexp_cddr (iter);
parent = &tree_iter;
} else {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]