goffice r2363 - in trunk: . docs/reference/tmpl goffice/app



Author: jody
Date: Fri Apr  3 20:42:18 2009
New Revision: 2363
URL: http://svn.gnome.org/viewvc/goffice?rev=2363&view=rev

Log:
2009-04-02  Jody Goldberg <jody gnome org>

	* goffice/app/file.c (go_file_saver_for_mime_type) : search the
	  default list first.
	(go_file_saver_for_file_name) : ditto.

Modified:
   trunk/ChangeLog
   trunk/NEWS
   trunk/docs/reference/tmpl/gog-plot.sgml
   trunk/goffice/app/file.c

Modified: trunk/NEWS
==============================================================================
--- trunk/NEWS	(original)
+++ trunk/NEWS	Fri Apr  3 20:42:18 2009
@@ -4,6 +4,9 @@
 	* Fixed gconf and gmathml propagation to pc file. [#576497]
 	* Added a new plot type: GogColorPolarPlot.
 
+Jody:
+	* Use priority when looking up savers by extension or mime.
+
 Morten:
 	* Add new go_format_is_time function.
 	* Pick sane bounds for time-formatted axes.  [Part of #574681]

Modified: trunk/docs/reference/tmpl/gog-plot.sgml
==============================================================================
--- trunk/docs/reference/tmpl/gog-plot.sgml	(original)
+++ trunk/docs/reference/tmpl/gog-plot.sgml	Fri Apr  3 20:42:18 2009
@@ -25,6 +25,7 @@
 @is_discrete: 
 @center_on_ticks: 
 @fmt: 
+ date_conv: 
 
 <!-- ##### MACRO GOG_PLOT_TYPE ##### -->
 <para>

Modified: trunk/goffice/app/file.c
==============================================================================
--- trunk/goffice/app/file.c	(original)
+++ trunk/goffice/app/file.c	Fri Apr  3 20:42:18 2009
@@ -996,11 +996,16 @@
 {
 	GList *l;
 
-	for (l = file_saver_list; l != NULL; l = l->next) {
-		if (!strcmp (go_file_saver_get_mime_type (l->data), mime_type)) {
-			return (l->data);
-		}
-	}
+	g_return_val_if_fail (mime_type != NULL, NULL);
+
+	for (l = default_file_saver_list ; l != NULL; l = l->next)
+		if (!strcmp (go_file_saver_get_mime_type (((DefaultFileSaver *)(l->data))->saver), mime_type))
+			return ((DefaultFileSaver *)(l->data))->saver;
+
+	for (l = file_saver_list; l != NULL; l = l->next)
+		if (!strcmp (go_file_saver_get_mime_type (l->data), mime_type))
+			return l->data;
+
 	return (NULL);
 }
 
@@ -1019,6 +1024,10 @@
 	GList *l;
 	char const *extension = gsf_extension_pointer (file_name);
 
+	for (l = default_file_saver_list ; l != NULL; l = l->next)
+		if (!strcmp (go_file_saver_get_extension (((DefaultFileSaver *)(l->data))->saver), extension))
+			return ((DefaultFileSaver *)(l->data))->saver;
+
 	for (l = file_saver_list; l != NULL; l = l->next)
 		if (!strcmp (go_file_saver_get_extension (l->data), extension))
 			return l->data;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]