[gnumeric] core: fix problem with remote uris.



commit 45cdc81560d42cd5edeba10c23452af39446b87a
Author: Morten Welinder <terra gnome org>
Date:   Mon Nov 9 20:11:44 2009 -0500

    core: fix problem with remote uris.

 ChangeLog               |    5 +++++
 NEWS                    |    1 +
 component/gnumeric.c    |    4 ++--
 src/gui-clipboard.c     |    2 +-
 src/sheet-control-gui.c |    2 +-
 src/workbook-view.c     |   18 ++++++++----------
 src/workbook-view.h     |    9 +++++----
 7 files changed, 23 insertions(+), 18 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index a6f8af6..3b47031 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2009-11-09  Morten Welinder  <terra gnome org>
+
+	* src/workbook-view.c (wb_view_new_from_input): Add extra uri
+	argument.  All callers changes.  Fixes #601274.
+
 2009-11-08  Morten Welinder  <terra gnome org>
 
 	* src/xml-sax-write.c (xml_write_solver): Write target cell as
diff --git a/NEWS b/NEWS
index d2c2895..c74b0c3 100644
--- a/NEWS
+++ b/NEWS
@@ -11,6 +11,7 @@ Morten:
 	* Resurrect long-double support.
 	* More solver fixes.
 	* Plug another mps leak.
+	* Fix problem with remote uris.  [#601274]
 
 --------------------------------------------------------------------------
 Gnumeric 1.9.15
diff --git a/component/gnumeric.c b/component/gnumeric.c
index 9402b68..ef4bdb0 100644
--- a/component/gnumeric.c
+++ b/component/gnumeric.c
@@ -119,7 +119,7 @@ go_gnm_component_set_data (GOComponent *component)
 	g_object_set (G_OBJECT (io_context), "exec-main-loop", FALSE, NULL);
 	if (gognm->wv != NULL)
 		g_object_unref (gognm->wv);
-	gognm->wv = wb_view_new_from_input (input, NULL, io_context, NULL);
+	gognm->wv = wb_view_new_from_input (input, NULL, NULL, io_context, NULL);
 	g_object_unref (io_context);
 	gognm->sheet = wb_view_cur_sheet (gognm->wv);
 	sv = sheet_get_view (gognm->sheet, gognm->wv);
@@ -199,7 +199,7 @@ go_gnm_component_edit (GOComponent *component)
 		GsfInput *input = gsf_input_memory_new (component->data, component->length, FALSE);
 
 		g_object_set (G_OBJECT (io_context), "exec-main-loop", FALSE, NULL);
-		wv = wb_view_new_from_input (input, NULL, io_context, NULL);
+		wv = wb_view_new_from_input (input, NULL, NULL, io_context, NULL);
 		g_object_unref (io_context);
 	}
 	set_uifilename ("Gnumeric-embed.xml", actions, G_N_ELEMENTS (actions));
diff --git a/src/gui-clipboard.c b/src/gui-clipboard.c
index 4529262..4576e74 100644
--- a/src/gui-clipboard.c
+++ b/src/gui-clipboard.c
@@ -277,7 +277,7 @@ table_cellregion_read (WorkbookControl *wbc, char const *reader_id,
 
 	ioc = go_io_context_new (GO_CMD_CONTEXT (wbc));
 	input = gsf_input_memory_new (buffer, length, FALSE);
-	wb_view = wb_view_new_from_input  (input, reader, ioc, NULL);
+	wb_view = wb_view_new_from_input  (input, NULL, reader, ioc, NULL);
 	if (go_io_error_occurred (ioc) || wb_view == NULL) {
 		go_io_error_display (ioc);
 		goto out;
diff --git a/src/sheet-control-gui.c b/src/sheet-control-gui.c
index 1263ee2..f898fbf 100644
--- a/src/sheet-control-gui.c
+++ b/src/sheet-control-gui.c
@@ -3258,7 +3258,7 @@ scg_drag_receive_spreadsheet (SheetControlGUI *scg, const gchar *uri)
 	if (input != NULL) {
 		WorkbookView *wbv;
 
-		wbv = wb_view_new_from_input (input, NULL, ioc, NULL);
+		wbv = wb_view_new_from_input (input, uri, NULL, ioc, NULL);
 		if (wbv != NULL)
 			gui_wb_view_show (scg->wbcg,
 					  wbv);
diff --git a/src/workbook-view.c b/src/workbook-view.c
index aa7c791..dabb250 100644
--- a/src/workbook-view.c
+++ b/src/workbook-view.c
@@ -1113,10 +1113,11 @@ wb_view_save (WorkbookView *wbv, GOCmdContext *context)
 }
 
 WorkbookView *
-wb_view_new_from_input  (GsfInput *input,
-			 GOFileOpener const *optional_fmt,
-			 GOIOContext *io_context,
-			 char const *optional_enc)
+wb_view_new_from_input (GsfInput *input,
+			const char *optional_uri,
+			GOFileOpener const *optional_fmt,
+			GOIOContext *io_context,
+			char const *optional_enc)
 {
 	WorkbookView *new_wbv = NULL;
 
@@ -1168,11 +1169,8 @@ wb_view_new_from_input  (GsfInput *input,
 
 		new_wbv = workbook_view_new (NULL);
 		new_wb = wb_view_get_workbook (new_wbv);
-		if (NULL != (input_name = gsf_input_name (input))) {
-			char *uri = go_shell_arg_to_uri (input_name);
-			go_doc_set_uri (GO_DOC (new_wb), uri);
-			g_free (uri);
-		}
+		if (optional_uri)
+			go_doc_set_uri (GO_DOC (new_wb), optional_uri);
 
 		/* disable recursive dirtying while loading */
 		old = workbook_enable_recursive_dirty (new_wb, FALSE);
@@ -1231,7 +1229,7 @@ wb_view_new_from_uri (char const *uri,
 #if 0
 		g_printerr ("Reading %s\n", uri);
 #endif
-		res = wb_view_new_from_input (input,
+		res = wb_view_new_from_input (input, uri,
 					      optional_fmt, io_context,
 					      optional_enc);
 		g_object_unref (G_OBJECT (input));
diff --git a/src/workbook-view.h b/src/workbook-view.h
index 1fc2431..8f184a7 100644
--- a/src/workbook-view.h
+++ b/src/workbook-view.h
@@ -90,10 +90,11 @@ void	 wbv_save_to_output (WorkbookView *wbv, GOFileSaver const *fs,
 void     wb_view_save_to_uri (WorkbookView *wbv, GOFileSaver const *fs,
 			      char const *uri, GOIOContext *io_context);
 
-WorkbookView *wb_view_new_from_input  (GsfInput *input,
-				       GOFileOpener const *optional_format,
-				       GOIOContext *io_context,
-				       gchar const *optional_encoding);
+WorkbookView *wb_view_new_from_input (GsfInput *input,
+				      const char *optional_uri,
+				      GOFileOpener const *optional_format,
+				      GOIOContext *io_context,
+				      gchar const *optional_encoding);
 WorkbookView *wb_view_new_from_uri  (char const *uri,
 				     GOFileOpener const *optional_format,
 				     GOIOContext *io_context,



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