зеркало из https://github.com/mozilla/pjs.git
Fixing bug 382009, Remove |nsXPIDLString|s from Camino. r=mento/sr=pink. Trunk only.
This commit is contained in:
Родитель
063a9f2ea6
Коммит
57af4b709a
|
@ -41,7 +41,6 @@
|
|||
|
||||
#import "CHBrowserService.h"
|
||||
|
||||
#include "nsXPIDLString.h"
|
||||
#include "nsString.h"
|
||||
#include "nsIServiceManager.h"
|
||||
#include "nsIConsoleService.h"
|
||||
|
@ -75,9 +74,9 @@ nsConsoleListener::~nsConsoleListener()
|
|||
NS_IMETHODIMP nsConsoleListener::Observe(nsIConsoleMessage* aMessage)
|
||||
{
|
||||
if (aMessage) {
|
||||
nsXPIDLString msgString;
|
||||
aMessage->GetMessage(getter_Copies(msgString));
|
||||
[[JSConsole sharedJSConsole] logMessage:[NSString stringWith_nsAString:msgString]];
|
||||
nsAutoString msgBuffer;
|
||||
aMessage->GetMessage(getter_Copies(msgBuffer));
|
||||
[[JSConsole sharedJSConsole] logMessage:[NSString stringWith_nsAString:msgBuffer]];
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
|
|
|
@ -2145,7 +2145,7 @@ enum BWCOpenDest {
|
|||
if (entryURI)
|
||||
entryURI->GetSpec(uriSpec);
|
||||
|
||||
nsXPIDLString textStr;
|
||||
nsAutoString textStr;
|
||||
entry->GetTitle(getter_Copies(textStr));
|
||||
|
||||
curTitle = [NSString stringWith_nsAString:textStr];
|
||||
|
@ -3040,7 +3040,7 @@ enum BWCOpenDest {
|
|||
nsCOMPtr<nsIHistoryEntry> entry;
|
||||
inHistory->GetEntryAtIndex(i, PR_FALSE, getter_AddRefs(entry));
|
||||
if (entry) {
|
||||
nsXPIDLString textStr;
|
||||
nsAutoString textStr;
|
||||
entry->GetTitle(getter_Copies(textStr));
|
||||
NSString* title = [[NSString stringWith_nsAString: textStr] stringByTruncatingTo:kMaxTitleLength at:kTruncateAtMiddle];
|
||||
NSMenuItem *newItem = [inPopup addItemWithTitle:title action:@selector(historyItemAction:) keyEquivalent:@""];
|
||||
|
|
|
@ -539,17 +539,16 @@ CocoaPromptService::GetCommonDialogLocaleString(const char *key)
|
|||
rv = service->CreateBundle(kCommonDialogsStrings, getter_AddRefs(mCommonDialogStringBundle));
|
||||
else
|
||||
rv = NS_ERROR_FAILURE;
|
||||
if (NS_FAILED(rv)) return returnValue;
|
||||
NS_ENSURE_SUCCESS(rv, returnValue);
|
||||
}
|
||||
|
||||
nsXPIDLString string;
|
||||
nsAutoString string;
|
||||
rv = mCommonDialogStringBundle->GetStringFromName(NS_ConvertASCIItoUTF16(key).get(), getter_Copies(string));
|
||||
if (NS_FAILED(rv)) return returnValue;
|
||||
NS_ENSURE_SUCCESS(rv, returnValue);
|
||||
|
||||
returnValue = [NSString stringWithPRUnichars:string];
|
||||
returnValue = [NSString stringWith_nsAString:string];
|
||||
// take care of the fact that it could have windows shortcut specified by ampersand
|
||||
returnValue = [returnValue stringByRemovingWindowsShortcutAmpersand];
|
||||
return returnValue;
|
||||
return [returnValue stringByRemovingWindowsShortcutAmpersand];
|
||||
}
|
||||
|
||||
NSString *
|
||||
|
|
|
@ -1025,21 +1025,30 @@ SecurityDialogs::AlertDialog(nsIInterfaceRequestor *ctx, const char *prefName,
|
|||
if (!prompt) return NS_ERROR_FAILURE;
|
||||
|
||||
// Get messages strings from localization file
|
||||
nsXPIDLString windowTitle, message, dontShowAgain;
|
||||
nsAutoString windowTitle, message, dontShowAgain;
|
||||
mSecurityStringBundle->GetStringFromName(NS_LITERAL_STRING("Title").get(),
|
||||
getter_Copies(windowTitle));
|
||||
mSecurityStringBundle->GetStringFromName(dialogMessageName,
|
||||
getter_Copies(message));
|
||||
if ( prefName )
|
||||
mSecurityStringBundle->GetStringFromName(showAgainName,
|
||||
getter_Copies(dontShowAgain));
|
||||
if (!windowTitle.get() || !message.get()) return NS_ERROR_FAILURE;
|
||||
if (prefName)
|
||||
mSecurityStringBundle->GetStringFromName(showAgainName,getter_Copies(dontShowAgain));
|
||||
|
||||
if ( prefName )
|
||||
rv = prompt->AlertCheck(windowTitle, message, dontShowAgain, &prefValue);
|
||||
else
|
||||
rv = prompt->AlertCheck(windowTitle, message, nil, nil);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
if (!windowTitle.get() || !message.get())
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
if (prefName) {
|
||||
rv = prompt->AlertCheck(PromiseFlatString(windowTitle).get(),
|
||||
PromiseFlatString(message).get(),
|
||||
PromiseFlatString(dontShowAgain).get(),
|
||||
&prefValue);
|
||||
}
|
||||
else {
|
||||
rv = prompt->AlertCheck(PromiseFlatString(windowTitle).get(),
|
||||
PromiseFlatString(message).get(),
|
||||
nil, nil);
|
||||
}
|
||||
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
if (prefName && !prefValue)
|
||||
pref->SetBoolPref(prefName, PR_FALSE);
|
||||
|
|
|
@ -146,7 +146,7 @@ NeckoCacheHelper::FaviconForURIIsMissing(const nsACString& inFaviconURI, PRBool*
|
|||
nsresult rv = mCacheSession->OpenCacheEntry(inFaviconURI, nsICache::ACCESS_READ, nsICache::NON_BLOCKING, getter_AddRefs(entryDesc));
|
||||
if (NS_SUCCEEDED(rv) && entryDesc)
|
||||
{
|
||||
nsXPIDLCString metadataString;
|
||||
nsCAutoString metadataString;
|
||||
entryDesc->GetMetaDataElement(kMissingFaviconMetadataKey, getter_Copies(metadataString));
|
||||
*outKnownMissing = metadataString.EqualsLiteral("1");
|
||||
}
|
||||
|
@ -223,7 +223,7 @@ NeckoCacheHelper::GetFaviconLocationForPageURI(const nsACString& inPageURI, nsAC
|
|||
if (NS_FAILED(rv)) return rv;
|
||||
if (!entryDesc) return NS_ERROR_FAILURE;
|
||||
|
||||
nsXPIDLCString faviconLocation;
|
||||
nsCAutoString faviconLocation;
|
||||
rv = entryDesc->GetMetaDataElement(kFaviconURILocationMetadataKey, getter_Copies(faviconLocation));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
|
|
|
@ -848,9 +848,9 @@ const char kDirServiceContractID[] = "@mozilla.org/file/directory_service;1";
|
|||
if (!webFind)
|
||||
return nil;
|
||||
|
||||
nsXPIDLString searchString;
|
||||
nsAutoString searchString;
|
||||
webFind->GetSearchString(getter_Copies(searchString));
|
||||
return [NSString stringWithPRUnichars:searchString.get()];
|
||||
return [NSString stringWith_nsAString:PromiseFlatString(searchString)];
|
||||
}
|
||||
|
||||
- (void)saveURL: (NSView*)aFilterView url: (NSString*)aURLSpec suggestedFilename: (NSString*)aFilename
|
||||
|
@ -1497,7 +1497,7 @@ const char kDirServiceContractID[] = "@mozilla.org/file/directory_service;1";
|
|||
NSString* cipherNameString = @"";
|
||||
if (sslStatus)
|
||||
{
|
||||
nsXPIDLCString cipherName;
|
||||
nsCAutoString cipherName;
|
||||
sslStatus->GetCipherName(getter_Copies(cipherName));
|
||||
cipherNameString = [NSString stringWith_nsACString:cipherName];
|
||||
}
|
||||
|
|
|
@ -60,7 +60,6 @@
|
|||
#include "nsISimpleEnumerator.h"
|
||||
|
||||
#include "nsNetUtil.h"
|
||||
#include "nsXPIDLString.h"
|
||||
#include "nsString.h"
|
||||
|
||||
#include "nsComponentManagerUtils.h"
|
||||
|
|
|
@ -127,7 +127,7 @@ public:
|
|||
nsDependentCSubstring datasource; // should always be "history" ?
|
||||
nsDependentCSubstring property; // AgeInDays, Hostname, etc
|
||||
nsDependentCSubstring method; // is, isgreater, isless
|
||||
nsXPIDLString text; // text to match
|
||||
nsString text;
|
||||
rowMatchCallback match; // matching callback if needed
|
||||
};
|
||||
|
||||
|
@ -1487,7 +1487,7 @@ nsSimpleGlobalHistory::RemoveObserver(nsIHistoryObserver* inObserver)
|
|||
nsresult
|
||||
nsSimpleGlobalHistory::SaveByteOrder(const char *aByteOrder)
|
||||
{
|
||||
if (PL_strcmp(aByteOrder, "BE") != 0 && PL_strcmp(aByteOrder, "LE") != 0) {
|
||||
if (strcmp(aByteOrder, "BE") != 0 && strcmp(aByteOrder, "LE") != 0) {
|
||||
NS_WARNING("Invalid byte order argument.");
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
}
|
||||
|
@ -1501,20 +1501,16 @@ nsSimpleGlobalHistory::SaveByteOrder(const char *aByteOrder)
|
|||
|
||||
// Get the file byte order.
|
||||
nsresult
|
||||
nsSimpleGlobalHistory::GetByteOrder(char **_retval)
|
||||
nsSimpleGlobalHistory::GetByteOrder(nsACString & aRetVal)
|
||||
{
|
||||
NS_ENSURE_SUCCESS(OpenDB(), NS_ERROR_FAILURE);
|
||||
|
||||
NS_ENSURE_ARG_POINTER(_retval);
|
||||
NS_ENSURE_STATE(mMetaRow);
|
||||
|
||||
nsCAutoString byteOrder;
|
||||
mdb_err err = GetRowValue(mMetaRow, kToken_ByteOrder, byteOrder);
|
||||
NS_ENSURE_TRUE(err == 0, NS_ERROR_FAILURE);
|
||||
|
||||
*_retval = ToNewCString(byteOrder);
|
||||
NS_ENSURE_TRUE(*_retval, NS_ERROR_OUT_OF_MEMORY);
|
||||
|
||||
aRetVal.Assign(byteOrder);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -1890,14 +1886,15 @@ nsSimpleGlobalHistory::InitByteOrder(PRBool aForce)
|
|||
#ifdef IS_BIG_ENDIAN
|
||||
NS_NAMED_LITERAL_CSTRING(machine_byte_order, "BE");
|
||||
#endif
|
||||
nsXPIDLCString file_byte_order;
|
||||
nsCAutoString fileByteOrder;
|
||||
nsresult rv = NS_OK;
|
||||
|
||||
if (!aForce)
|
||||
rv = GetByteOrder(getter_Copies(file_byte_order));
|
||||
rv = GetByteOrder(fileByteOrder);
|
||||
if (aForce || NS_FAILED(rv) ||
|
||||
!(file_byte_order.EqualsLiteral("BE") ||
|
||||
file_byte_order.EqualsLiteral("LE"))) {
|
||||
!(fileByteOrder.EqualsLiteral("BE") ||
|
||||
fileByteOrder.EqualsLiteral("LE")))
|
||||
{
|
||||
// Byte order is not yet set, or needs to be reset; initialize it.
|
||||
mReverseByteOrder = PR_FALSE;
|
||||
rv = SaveByteOrder(machine_byte_order.get());
|
||||
|
@ -1905,7 +1902,7 @@ nsSimpleGlobalHistory::InitByteOrder(PRBool aForce)
|
|||
return rv;
|
||||
}
|
||||
else
|
||||
mReverseByteOrder = !file_byte_order.Equals(machine_byte_order);
|
||||
mReverseByteOrder = !fileByteOrder.Equals(machine_byte_order);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -1947,7 +1944,7 @@ nsSimpleGlobalHistory::CheckHostnameEntries()
|
|||
|
||||
// cached variables used in the loop
|
||||
nsCAutoString url;
|
||||
nsXPIDLCString hostname;
|
||||
nsCAutoString hostname;
|
||||
|
||||
nsCOMPtr<nsIIOService> ioService = do_GetService(NS_IOSERVICE_CONTRACTID);
|
||||
if (!ioService) return NS_ERROR_FAILURE;
|
||||
|
@ -2356,7 +2353,8 @@ nsSimpleGlobalHistory::RowMatches(nsIMdbRow *aRow, SearchQueryData *aQuery)
|
|||
rowVal.BeginReading(start);
|
||||
rowVal.EndReading(end);
|
||||
|
||||
NS_ConvertUTF16toUTF8 utf8Value(term->text);
|
||||
nsCAutoString utf8Value;
|
||||
CopyUTF16toUTF8(term->text, utf8Value);
|
||||
|
||||
if (term->method.Equals("is")) {
|
||||
if (!utf8Value.Equals(rowVal, nsCaseInsensitiveCStringComparator()))
|
||||
|
@ -2631,7 +2629,7 @@ nsSimpleGlobalHistory::AutoCompleteSearch(const nsACString& aSearchString,
|
|||
PRBool searchPrevious = PR_FALSE;
|
||||
nsAutoString searchString = NS_ConvertUTF8toUTF16(aSearchString);
|
||||
if (aPrevResults) {
|
||||
nsXPIDLString prevURL;
|
||||
nsAutoString prevURL;
|
||||
aPrevResults->GetSearchString(getter_Copies(prevURL));
|
||||
// if search string begins with the previous search string, it's a go
|
||||
searchPrevious = StringBeginsWith(searchString, prevURL);
|
||||
|
|
|
@ -258,7 +258,7 @@ protected:
|
|||
// byte order
|
||||
//
|
||||
nsresult SaveByteOrder(const char *aByteOrder);
|
||||
nsresult GetByteOrder(char **_retval);
|
||||
nsresult GetByteOrder(nsACString & aRetVal);
|
||||
nsresult InitByteOrder(PRBool aForce);
|
||||
void SwapBytes(const PRUnichar *source, PRUnichar *dest, PRInt32 aLen);
|
||||
|
||||
|
|
|
@ -838,7 +838,7 @@ public:
|
|||
|
||||
nsAutoString keyString;
|
||||
[inKey assignTo_nsAString:keyString];
|
||||
nsXPIDLString nameString;
|
||||
nsAutoString nameString;
|
||||
mPIPNSSBundle->GetStringFromName(keyString.get(), getter_Copies(nameString));
|
||||
return [NSString stringWith_nsAString:nameString];
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче