Bug 475621. Make saving an iframe which points to an image work when doing "save page, complete". r+sr=bzbarsky
authorarno renevier <arno@renevier.net>
Tue, 03 Feb 2009 22:28:02 +0100
changeset 24827 46ee46c2c52a80f19f17826f6e6cb7c85dde52f3
parent 24826 2a10c8f1fa11e84bf99aaa7b02ff7baad648274a
child 24828 c224a8b5416f32a6c5b96c8aa52f205f40ae4482
push idunknown
push userunknown
push dateunknown
bugs475621
milestone1.9.2a1pre
Bug 475621. Make saving an iframe which points to an image work when doing "save page, complete". r+sr=bzbarsky
embedding/components/webbrowserpersist/src/nsWebBrowserPersist.cpp
--- a/embedding/components/webbrowserpersist/src/nsWebBrowserPersist.cpp
+++ b/embedding/components/webbrowserpersist/src/nsWebBrowserPersist.cpp
@@ -3829,32 +3829,38 @@ nsWebBrowserPersist::MakeAndStoreLocalFi
     NS_ENSURE_ARG_POINTER(aURI);
 
     nsCAutoString spec;
     nsresult rv = aURI->GetSpec(spec);
     NS_ENSURE_SUCCESS(rv, NS_ERROR_FAILURE);
 
     // Create a sensibly named filename for the URI and store in the URI map
     nsCStringKey key(spec.get());
+    URIData *data;
     if (mURIMap.Exists(&key))
     {
+        data = (URIData *) mURIMap.Get(&key);
+        if (aNeedsPersisting)
+        {
+          data->mNeedsPersisting = PR_TRUE;
+        }
         if (aData)
         {
-            *aData = (URIData *) mURIMap.Get(&key);
+            *aData = data;
         }
         return NS_OK;
     }
 
     // Create a unique file name for the uri
     nsString filename;
     rv = MakeFilenameFromURI(aURI, filename);
     NS_ENSURE_SUCCESS(rv, NS_ERROR_FAILURE);
 
     // Store the file name
-    URIData *data = new URIData;
+    data = new URIData;
     NS_ENSURE_TRUE(data, NS_ERROR_OUT_OF_MEMORY);
 
     data->mNeedsPersisting = aNeedsPersisting;
     data->mNeedsFixup = PR_TRUE;
     data->mFilename = filename;
     data->mSaved = PR_FALSE;
     data->mIsSubFrame = PR_FALSE;
     data->mDataPath = mCurrentDataPath;