Fix for bug #308996; get mime-type to fe_URLToLocalName so file is saved with proper extension
git-svn-id: svn://10.0.0.236/trunk@12313 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
4ca84e93c6
commit
d4394128cb
@ -24,6 +24,7 @@
|
||||
#include "cxsave.h"
|
||||
#include "extgen.h"
|
||||
#include "intl_csi.h"
|
||||
#include "netcache.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#undef THIS_FILE
|
||||
@ -529,9 +530,20 @@ BOOL CSaveCX::CanCreate(URL_Struct* pUrl)
|
||||
if (!IsSavingToGlobal()) {
|
||||
// Query for a filename if we don't have one already
|
||||
if(m_csFileName.IsEmpty()) {
|
||||
// If not provided, try to acquire URL struct.
|
||||
BOOL bAcquiredUrl = FALSE;
|
||||
if ( !pUrl ) {
|
||||
// Try to get URL struct from cache.
|
||||
pUrl = NET_CreateURLStruct(m_csAnchor, NET_DONT_RELOAD);
|
||||
if ( pUrl ) {
|
||||
NET_FindURLInCache(pUrl, GetContext());
|
||||
bAcquiredUrl = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef MOZ_MAIL_NEWS
|
||||
char * pSuggested = MimeGuessURLContentName(GetContext(),m_csAnchor);
|
||||
|
||||
// get the mime content type
|
||||
if (pSuggested && *pSuggested) {
|
||||
// check if the file doesn't have an extension
|
||||
@ -549,6 +561,12 @@ BOOL CSaveCX::CanCreate(URL_Struct* pUrl)
|
||||
XP_FREE(pSuggested);
|
||||
}
|
||||
|
||||
// Free URL struct if we acquired it.
|
||||
if ( bAcquiredUrl ) {
|
||||
NET_FreeURLStruct(pUrl);
|
||||
pUrl = 0;
|
||||
}
|
||||
|
||||
if(pUserName == NULL) {
|
||||
DestroyContext();
|
||||
return(FALSE);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user