aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@gnome.org>2003-10-17 17:57:07 +0800
committerMarco Pesenti Gritti <marco@src.gnome.org>2003-10-17 17:57:07 +0800
commit9981edca4e05057d8130bd529d701d60bac76378 (patch)
treeae4284ae981bf6d72e588a2c9ffcbad7153beaa7
parent7d6bee54d28aa5e8d7afb6c54ad4065a274d2f25 (diff)
downloadgsoc2013-epiphany-9981edca4e05057d8130bd529d701d60bac76378.tar
gsoc2013-epiphany-9981edca4e05057d8130bd529d701d60bac76378.tar.gz
gsoc2013-epiphany-9981edca4e05057d8130bd529d701d60bac76378.tar.bz2
gsoc2013-epiphany-9981edca4e05057d8130bd529d701d60bac76378.tar.lz
gsoc2013-epiphany-9981edca4e05057d8130bd529d701d60bac76378.tar.xz
gsoc2013-epiphany-9981edca4e05057d8130bd529d701d60bac76378.tar.zst
gsoc2013-epiphany-9981edca4e05057d8130bd529d701d60bac76378.zip
Fix Save As, we need ever to pass the url now. Now hope chpe stop to bug
2003-10-17 Marco Pesenti Gritti <marco@gnome.org> * embed/mozilla/mozilla-embed-persist.cpp: Fix Save As, we need ever to pass the url now. Now hope chpe stop to bug me about things xan broke ...
-rw-r--r--ChangeLog8
-rw-r--r--embed/mozilla/mozilla-embed-persist.cpp32
2 files changed, 27 insertions, 13 deletions
diff --git a/ChangeLog b/ChangeLog
index 2ee7ccbff..c4bd70b0f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2003-10-17 Marco Pesenti Gritti <marco@gnome.org>
+
+ * embed/mozilla/mozilla-embed-persist.cpp:
+
+ Fix Save As, we need ever to pass the url now.
+ Now hope chpe stop to bug me about things
+ xan broke ...
+
2003-10-16 Mark McLoughlin <mark@skynet.ie>
Change the behaviour of --nautilus-view such that the process
diff --git a/embed/mozilla/mozilla-embed-persist.cpp b/embed/mozilla/mozilla-embed-persist.cpp
index 8906a68f1..d374eb3f0 100644
--- a/embed/mozilla/mozilla-embed-persist.cpp
+++ b/embed/mozilla/mozilla-embed-persist.cpp
@@ -147,7 +147,6 @@ static gresult
impl_save (EphyEmbedPersist *persist)
{
nsresult rv;
- nsAutoString s;
char *filename;
char *uri;
int max_size;
@@ -168,7 +167,13 @@ impl_save (EphyEmbedPersist *persist)
NULL);
g_return_val_if_fail (filename != NULL, G_FAILED);
-
+
+ EphyWrapper *wrapper;
+
+ g_return_val_if_fail (embed != NULL, G_FAILED);
+ wrapper = (EphyWrapper *) mozilla_embed_get_ephy_wrapper (MOZILLA_EMBED(embed));
+ g_return_val_if_fail (wrapper != NULL, G_FAILED);
+
nsCOMPtr<nsIWebBrowserPersist> webPersist =
MOZILLA_EMBED_PERSIST (persist)->priv->mPersist;
if (!webPersist) return G_FAILED;
@@ -188,13 +193,20 @@ impl_save (EphyEmbedPersist *persist)
/* Get the uri to save to */
nsCOMPtr<nsIURI> inURI;
+ nsCAutoString sURI;
+
if (uri)
{
- nsAutoString s;
- s.AssignWithConversion(uri);
- rv = NS_NewURI(getter_AddRefs(inURI), s);
- if (NS_FAILED(rv) || !inURI) return G_FAILED;
+ sURI.Assign (uri);
}
+ else
+ {
+ rv = wrapper->GetDocumentUrl (sURI);
+ if (NS_FAILED(rv)) return G_FAILED;
+ }
+
+ rv = NS_NewURI(getter_AddRefs(inURI), sURI);
+ if (NS_FAILED(rv) || !inURI) return G_FAILED;
/* Filename to save to */
nsAutoString inFilename;
@@ -203,13 +215,7 @@ impl_save (EphyEmbedPersist *persist)
nsCOMPtr<nsIDOMDocument> DOMDocument;
nsCOMPtr<nsIInputStream> postData;
if (!uri)
- {
- EphyWrapper *wrapper;
-
- g_return_val_if_fail (embed != NULL, G_FAILED);
- wrapper = (EphyWrapper *) mozilla_embed_get_ephy_wrapper (MOZILLA_EMBED(embed));
- g_return_val_if_fail (wrapper != NULL, G_FAILED);
-
+ {
/* Get the DOM document */
if (flags & EMBED_PERSIST_MAINDOC)
{