Fix #83568 - BASE tag inserted when downloading file to a local drive

r=adamlock, sr=rpotts
This commit is contained in:
chak%netscape.com 2001-12-06 22:06:45 +00:00
parent bb484aad10
commit a0d6f76ada

View File

@ -660,6 +660,7 @@ void CBrowserView::OnFileSaveAs()
CString strFullPath = cf.GetPathName(); // Will be like: c:\tmp\junk.htm
char *pStrFullPath = strFullPath.GetBuffer(0); // Get char * for later use
BOOL bSaveAll = FALSE;
CString strDataPath;
char *pStrDataPath = NULL;
if(cf.m_ofn.nFilterIndex == 2)
@ -668,6 +669,8 @@ void CBrowserView::OnFileSaveAs()
// user want to save the complete document including
// all frames, images, scripts, stylesheets etc.
bSaveAll = TRUE;
int idxPeriod = strFullPath.ReverseFind('.');
strDataPath = strFullPath.Mid(0, idxPeriod);
strDataPath += "_files";
@ -694,7 +697,10 @@ void CBrowserView::OnFileSaveAs()
NS_NewLocalFile(pStrDataPath, TRUE, getter_AddRefs(dataPath));
}
persist->SaveDocument(nsnull, file, dataPath);
if(bSaveAll)
persist->SaveDocument(nsnull, file, dataPath);
else
persist->SaveURI(nsnull, nsnull, file);
}
}
}