Port bug 984466 - change CallQueryInterface to assert in cases of trivial conversions - rs=Neil. Bustage fix for CLOSED TREE
This commit is contained in:
Родитель
4c1d05f886
Коммит
2d4033abfa
|
@ -54,7 +54,7 @@ struct ExportAttributesTableStruct
|
|||
// for now, the oder of the attributes with true for includeForPlainText
|
||||
// should be in the same order as they are in the import code
|
||||
// see importMsgProperties and nsImportStringBundle.
|
||||
//
|
||||
//
|
||||
// XXX todo, merge with what's in nsAbLDAPProperties.cpp, so we can
|
||||
// use this for LDAP and LDIF export
|
||||
//
|
||||
|
@ -409,7 +409,7 @@ NS_IMETHODIMP nsAbManager::NotifyDirectoryItemDeleted(nsIAbDirectory *aParentDir
|
|||
(aParentDirectory, aItem));
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP nsAbManager::NotifyDirectoryDeleted(nsIAbDirectory *aParentDirectory,
|
||||
nsISupports *aDirectory)
|
||||
{
|
||||
|
@ -430,7 +430,8 @@ NS_IMETHODIMP nsAbManager::GetUserProfileDirectory(nsIFile **userDir)
|
|||
rv = NS_GetSpecialDirectory(NS_APP_USER_PROFILE_50_DIR, getter_AddRefs(profileDir));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
return CallQueryInterface(profileDir, userDir);
|
||||
profileDir.forget(userDir);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsAbManager::MailListNameExists(const char16_t *name, bool *exist)
|
||||
|
@ -710,11 +711,11 @@ nsAbManager::ExportDirectoryToDelimitedText(nsIAbDirectory *aDirectory, const ch
|
|||
if(newValue.FindChar('"') != -1)
|
||||
{
|
||||
needsQuotes = true;
|
||||
|
||||
|
||||
int32_t match = 0;
|
||||
uint32_t offset = 0;
|
||||
nsString oldSubstr = NS_LITERAL_STRING("\"");
|
||||
nsString newSubstr = NS_LITERAL_STRING("\"\"");
|
||||
nsString newSubstr = NS_LITERAL_STRING("\"\"");
|
||||
while (offset < newValue.Length()) {
|
||||
match = newValue.Find(oldSubstr, offset);
|
||||
if (match == -1)
|
||||
|
|
|
@ -1543,7 +1543,9 @@ nsresult MsgGetLocalFileFromURI(const nsACString &aUTF8Path, nsIFile **aFile)
|
|||
nsCOMPtr<nsIFile> argFile;
|
||||
rv = argFileURL->GetFile(getter_AddRefs(argFile));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
return CallQueryInterface(argFile, aFile);
|
||||
|
||||
argFile.forget(aFile);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
#ifndef MOZILLA_INTERNAL_API
|
||||
|
@ -1566,21 +1568,21 @@ NS_MSG_BASE bool MsgIsUTF8(const nsACString& aString)
|
|||
|
||||
while (ptr < done_reading) {
|
||||
uint8_t c;
|
||||
|
||||
|
||||
if (0 == state) {
|
||||
|
||||
c = *ptr++;
|
||||
|
||||
if ((c & 0x80) == 0x00)
|
||||
if ((c & 0x80) == 0x00)
|
||||
continue;
|
||||
|
||||
if ( c <= 0xC1 ) // [80-BF] where not expected, [C0-C1] for overlong.
|
||||
return false;
|
||||
else if ((c & 0xE0) == 0xC0)
|
||||
else if ((c & 0xE0) == 0xC0)
|
||||
state = 1;
|
||||
else if ((c & 0xF0) == 0xE0) {
|
||||
state = 2;
|
||||
if ( c == 0xE0 ) { // to exclude E0[80-9F][80-BF]
|
||||
if ( c == 0xE0 ) { // to exclude E0[80-9F][80-BF]
|
||||
overlong = true;
|
||||
olupper = 0x9F;
|
||||
} else if ( c == 0xED ) { // ED[A0-BF][80-BF] : surrogate codepoint
|
||||
|
@ -1595,7 +1597,7 @@ NS_MSG_BASE bool MsgIsUTF8(const nsACString& aString)
|
|||
overlong = true;
|
||||
olupper = 0x8F;
|
||||
}
|
||||
else if ( c == 0xF4 ) { // to exclude F4[90-BF][80-BF]
|
||||
else if ( c == 0xF4 ) { // to exclude F4[90-BF][80-BF]
|
||||
// actually not surrogates but codepoints beyond 0x10FFFF
|
||||
surrogate = true;
|
||||
slower = 0x90;
|
||||
|
@ -1603,7 +1605,7 @@ NS_MSG_BASE bool MsgIsUTF8(const nsACString& aString)
|
|||
} else
|
||||
return false; // Not UTF-8 string
|
||||
}
|
||||
|
||||
|
||||
while (ptr < done_reading && state) {
|
||||
c = *ptr++;
|
||||
--state;
|
||||
|
@ -1620,7 +1622,7 @@ NS_MSG_BASE bool MsgIsUTF8(const nsACString& aString)
|
|||
overlong = surrogate = false;
|
||||
}
|
||||
}
|
||||
return !state; // state != 0 at the end indicates an invalid UTF-8 seq.
|
||||
return !state; // state != 0 at the end indicates an invalid UTF-8 seq.
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -1708,7 +1710,7 @@ NS_MSG_BASE nsresult MsgEscapeString(const nsACString &aStr,
|
|||
return nu->EscapeString(aStr, aType, aResult);
|
||||
}
|
||||
|
||||
NS_MSG_BASE nsresult MsgUnescapeString(const nsACString &aStr, uint32_t aFlags,
|
||||
NS_MSG_BASE nsresult MsgUnescapeString(const nsACString &aStr, uint32_t aFlags,
|
||||
nsACString &aResult)
|
||||
{
|
||||
nsresult rv;
|
||||
|
@ -1809,7 +1811,7 @@ NS_MSG_BASE char16_t *MsgEscapeHTML2(const char16_t *aSourceBuffer,
|
|||
|
||||
char16_t *resultBuffer = (char16_t *)nsMemory::Alloc(aSourceBufferLen *
|
||||
6 * sizeof(char16_t) + sizeof(char16_t('\0')));
|
||||
|
||||
|
||||
char16_t *ptr = resultBuffer;
|
||||
|
||||
if (resultBuffer) {
|
||||
|
@ -1874,7 +1876,7 @@ NS_MSG_BASE void MsgCompressWhitespace(nsCString& aString)
|
|||
|
||||
// Loop through the white space
|
||||
char *wend = cur + 2;
|
||||
while (IS_SPACE(*wend))
|
||||
while (IS_SPACE(*wend))
|
||||
++wend;
|
||||
|
||||
uint32_t wlen = wend - cur - 1;
|
||||
|
@ -2082,7 +2084,7 @@ MsgExamineForProxy(const char *scheme, const char *host,
|
|||
spec.AppendInt(port);
|
||||
// XXXXX - Under no circumstances whatsoever should any code which
|
||||
// wants a uri do this. I do this here because I do not, in fact,
|
||||
// actually want a uri (the dummy uris created here may not be
|
||||
// actually want a uri (the dummy uris created here may not be
|
||||
// syntactically valid for the specific protocol), and all we need
|
||||
// is something which has a valid scheme, hostname, and a string
|
||||
// to pass to PAC if needed - bbaetz
|
||||
|
@ -2205,7 +2207,7 @@ NS_MSG_BASE nsresult MsgTermListToString(nsISupportsArray *aTermList, nsCString
|
|||
|
||||
rv = term->GetTermAsString(stream);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
|
||||
aOutString += stream;
|
||||
aOutString += ')';
|
||||
}
|
||||
|
|
|
@ -73,13 +73,13 @@ NS_IMPL_ISUPPORTS1(nsAppleMailImportModule, nsIImportModule)
|
|||
|
||||
NS_IMETHODIMP nsAppleMailImportModule::GetName(char16_t **aName)
|
||||
{
|
||||
return mBundle ?
|
||||
return mBundle ?
|
||||
mBundle->GetStringFromID(APPLEMAILIMPORT_NAME, aName) : NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsAppleMailImportModule::GetDescription(char16_t **aName)
|
||||
{
|
||||
return mBundle ?
|
||||
return mBundle ?
|
||||
mBundle->GetStringFromID(APPLEMAILIMPORT_DESCRIPTION, aName) : NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
|
@ -123,7 +123,7 @@ NS_IMETHODIMP nsAppleMailImportModule::GetImportInterface(const char *aImportTyp
|
|||
generic->SetData("name", nameString);
|
||||
generic->SetData("mailInterface", mail);
|
||||
|
||||
rv = CallQueryInterface(generic, aInterface);
|
||||
generic.forget(aInterface);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -172,7 +172,7 @@ NS_IMETHODIMP nsAppleMailImportMail::GetDefaultLocation(nsIFile **aLocation, boo
|
|||
if (NS_SUCCEEDED(rv)) {
|
||||
*aFound = true;
|
||||
*aUserVerify = false;
|
||||
CallQueryInterface(mailFolder, aLocation);
|
||||
mailFolder.forget(aLocation);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -210,7 +210,7 @@ NS_IMETHODIMP nsAppleMailImportMail::FindMailboxes(nsIFile *aMailboxFile, nsIArr
|
|||
// 2. look for "global" mailboxes, that don't belong to any specific account. they are inside the
|
||||
// root's Mailboxes/ folder
|
||||
nsCOMPtr<nsIFile> mailboxesDir(do_CreateInstance(NS_LOCAL_FILE_CONTRACTID, &rv));
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
mailboxesDir->InitWithFile(aMailboxFile);
|
||||
rv = mailboxesDir->Append(NS_LITERAL_STRING("Mailboxes"));
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
|
@ -298,7 +298,7 @@ void nsAppleMailImportMail::FindAccountMailDirs(nsIFile *aRoot, nsIMutableArray
|
|||
// now add all the children mailboxes
|
||||
mCurDepth++;
|
||||
FindMboxDirs(currentEntry, aMailboxDescs, aImportService);
|
||||
mCurDepth--;
|
||||
mCurDepth--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -424,8 +424,8 @@ nsresult nsAppleMailImportMail::FindMboxDirs(nsIFile *aFolder, nsIMutableArray *
|
|||
|
||||
// now find out if this is a .mbox dir
|
||||
nsAutoString currentFolderName;
|
||||
if (NS_SUCCEEDED(currentEntry->GetLeafName(currentFolderName)) &&
|
||||
(StringEndsWith(currentFolderName, NS_LITERAL_STRING(POP_MBOX_SUFFIX)) ||
|
||||
if (NS_SUCCEEDED(currentEntry->GetLeafName(currentFolderName)) &&
|
||||
(StringEndsWith(currentFolderName, NS_LITERAL_STRING(POP_MBOX_SUFFIX)) ||
|
||||
StringEndsWith(currentFolderName, NS_LITERAL_STRING(IMAP_MBOX_SUFFIX)))) {
|
||||
IMPORT_LOG1("Adding .mbox dir: %s", NS_ConvertUTF16toUTF8(currentFolderName).get());
|
||||
|
||||
|
@ -463,8 +463,8 @@ nsresult nsAppleMailImportMail::FindMboxDirs(nsIFile *aFolder, nsIMutableArray *
|
|||
FindMboxDirs(siblingMailboxDir, aMailboxDescs, aImportService);
|
||||
mCurDepth--;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -600,7 +600,7 @@ nsAppleMailImportMail::ImportMailbox(nsIImportMailboxDescriptor *aMailbox,
|
|||
|
||||
void nsAppleMailImportMail::ReportStatus(int32_t aErrorNum, nsString &aName, nsAString &aStream)
|
||||
{
|
||||
// get (and format, if needed) the error string from the bundle
|
||||
// get (and format, if needed) the error string from the bundle
|
||||
nsAutoString outString;
|
||||
const char16_t *fmt = { aName.get() };
|
||||
nsresult rv = mBundle->FormatStringFromID(aErrorNum, &fmt, 1, getter_Copies(outString));
|
||||
|
|
Загрузка…
Ссылка в новой задаче