Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNickolay V. Shmyrev <nshmyrev@src.gnome.org>2006-01-06 23:03:44 (GMT)
committer Nickolay V. Shmyrev <nshmyrev@src.gnome.org>2006-01-06 23:03:44 (GMT)
commit68f32e3484d5cabf3e167c4ce1d40bd0991ccb68 (patch)
treeff15af0e35cf1e3dd78b837718da5e4b9b6b18c0
parent43398c4ea1a940bc2ee2921d5811fe8ee4144a65 (diff)
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.
-rw-r--r--ChangeLog11
-rw-r--r--ps/ps.c25
-rw-r--r--shell/ev-metadata-manager.c12
3 files changed, 32 insertions, 16 deletions
diff --git a/ChangeLog b/ChangeLog
index 8910785..12b4b5b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2006-01-07 Nickolay V. Shmyrev <nshmyrev@yandex.ru>
+
+ * 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 <nshmyrev@yandex.ru>
* shell/ev-window.c: (setup_document_from_metadata),
diff --git a/ps/ps.c b/ps/ps.c
index e79fb06..30b9e56 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 8249fb0..4103a35 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,