From 68f32e3484d5cabf3e167c4ce1d40bd0991ccb68 Mon Sep 17 00:00:00 2001 From: "Nickolay V. Shmyrev" Date: Fri, 6 Jan 2006 23:03:44 +0000 Subject: [PATCH] Commit workaround Mozilla problem. Fix for the bug #325919 * ps/ps.c: (psscan): Commit workaround Mozilla problem. Fix for the bug #325919 * shell/ev-metadata-manager.c: (parse_value), (parseItem), (save_item): Fix for year 2038 problem. --- ChangeLog | 11 +++++++++++ ps/ps.c | 25 ++++++++++++++++--------- shell/ev-metadata-manager.c | 12 +++++------- 3 files changed, 32 insertions(+), 16 deletions(-) diff --git a/ChangeLog b/ChangeLog index 89107851..12b4b5bc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2006-01-07 Nickolay V. Shmyrev + + * ps/ps.c: (psscan): + + Commit workaround Mozilla problem. Fix for the bug #325919 + + * shell/ev-metadata-manager.c: (parse_value), (parseItem), + (save_item): + + Fix for year 2038 problem. + 2006-01-06 Nickolay V. Shmyrev * shell/ev-window.c: (setup_document_from_metadata), diff --git a/ps/ps.c b/ps/ps.c index e79fb063..30b9e567 100644 --- a/ps/ps.c +++ b/ps/ps.c @@ -619,7 +619,7 @@ psscan(FILE * file, int respect_eof, const gchar * fname) if(!DSCcomment(line)) { /* Do nothing */ } - else if(doc->default_page_orientation == NONE && + else if(doc->default_page_orientation == GTK_GS_ORIENTATION_NONE && iscomment(line + 2, "PageOrientation:")) { sscanf(line + length("%%PageOrientation:"), "%256s", text); if(strcmp(text, "Portrait") == 0) { @@ -747,7 +747,7 @@ psscan(FILE * file, int respect_eof, const gchar * fname) if(!DSCcomment(line)) { /* Do nothing */ } - else if(doc->default_page_orientation == NONE && + else if(doc->default_page_orientation == GTK_GS_ORIENTATION_NONE && iscomment(line + 2, "PageOrientation:")) { sscanf(line + length("%%PageOrientation:"), "%256s", text); if(strcmp(text, "Portrait") == 0) { @@ -813,13 +813,21 @@ psscan(FILE * file, int respect_eof, const gchar * fname) doc->lensetup = section_len - line_len; } - /* Added this (Nov. 2, 1999) when I noticed that - a Postscript file would load in gv but not in ggv - - dmg@csg.uwaterloo.ca */ + /* HACK: Mozilla 1.8 Workaround. + + It seems that Mozilla 1.8 generates important postscript code + after the '%%EndProlog' and before the first page comment '%%Page: x y'. + See comment below also. + */ + + if(doc->beginprolog && !doc->beginsetup) { + doc->lenprolog += section_len - line_len; + doc->endprolog = position; + } + + /* HACK: Windows NT Workaround - /* BEGIN Windows NT fix ###jp### - Mark Pfeifer (pfeiferm%ppddev@comet.cmis.abbott.com) told me + Mark Pfeifer (pfeiferm%ppddev@comet.cmis.abbott.com) noticed about problems when viewing Windows NT 3.51 generated postscript files with gv. He found that the relevant postscript files show important postscript code after the '%%EndSetup' and before @@ -837,7 +845,6 @@ psscan(FILE * file, int respect_eof, const gchar * fname) doc->endsetup = position; } } - /* END Windows NT fix ###jp## */ /* Individual Pages */ diff --git a/shell/ev-metadata-manager.c b/shell/ev-metadata-manager.c index 8249fb06..4103a351 100644 --- a/shell/ev-metadata-manager.c +++ b/shell/ev-metadata-manager.c @@ -142,13 +142,13 @@ parse_value (xmlChar *value, xmlChar *type) g_value_set_string (ret, (char *)value); break; case G_TYPE_INT: - g_value_set_int (ret, atoi ((char *)value)); + g_value_set_int (ret, g_ascii_strtoull ((char *)value, NULL, 0)); break; case G_TYPE_DOUBLE: g_value_set_double (ret, g_ascii_strtod ((char *)value, NULL)); break; case G_TYPE_BOOLEAN: - g_value_set_boolean (ret, atoi ((char *)value)); + g_value_set_boolean (ret, g_ascii_strtoull ((char *)value, NULL, 0)); break; } @@ -179,7 +179,7 @@ parseItem (xmlDocPtr doc, xmlNodePtr cur) item = g_new0 (Item, 1); - item->atime = atol ((char *)atime); + item->atime = g_ascii_strtoull((char*)atime, NULL, 0); item->values = g_hash_table_new_full (g_str_hash, g_str_equal, @@ -569,10 +569,8 @@ save_item (const gchar *key, const gpointer *data, xmlNodePtr parent) xmlSetProp (xml_node, (const xmlChar *)"uri", (const xmlChar *)key); - /* FIXME: is the cast right? - Paolo */ - atime = g_strdup_printf ("%d", (int)item->atime); - xmlSetProp (xml_node, (const xmlChar *)"atime", (const xmlChar *)atime); - + atime = g_strdup_printf ("%ld", item->atime); + xmlSetProp (xml_node, (const xmlChar *)"atime", (const xmlChar *)atime); g_free (atime); g_hash_table_foreach (item->values, -- 2.43.5