Bug 461047 follow-up patch - Fix a number of small issues from the nsStringArray to nsTArray<nsString> switchover, mostly related to signed vs unsigned array sizes. r+sr=roc

This commit is contained in:
Daniel Holbert 2009-02-10 12:39:43 -08:00
Родитель f6229466f3
Коммит f8f9766310
6 изменённых файлов: 15 добавлений и 14 удалений

Просмотреть файл

@ -172,7 +172,7 @@ nsNameList::ContainsNS(const nsAString& aNamespaceURI, const nsAString& aName,
PRBool *aResult)
{
PRUint32 index = mNames.IndexOf(aName);
if (index != PRUint32(-1)) {
if (index != mNames.NoIndex) {
*aResult = mNamespaceURIs[index].Equals(aNamespaceURI);
}
else {

Просмотреть файл

@ -58,7 +58,6 @@
#include "nsDoubleHashtable.h"
#include "nsString.h"
#include "nsVoidArray.h"
#include "nsTArray.h"
#include "txCore.h"
#include "nsAutoPtr.h"
@ -423,7 +422,7 @@ public:
"called without matching shutdown()");
if (mNamespaces)
return MB_TRUE;
mNamespaces = new nsTArray<nsString>();
mNamespaces = new nsStringArray();
if (!mNamespaces)
return MB_FALSE;
/*
@ -453,10 +452,10 @@ public:
}
private:
static nsTArray<nsString>* mNamespaces;
static nsStringArray* mNamespaces;
};
#define TX_IMPL_DOM_STATICS \
nsTArray<nsString>* txStandaloneNamespaceManager::mNamespaces = 0
nsStringArray* txStandaloneNamespaceManager::mNamespaces = 0
#endif

Просмотреть файл

@ -254,7 +254,7 @@ nsresult NodeDefinition::getBaseURI(nsAString& aURI)
while (count > 0) {
nsAutoString dest;
URIUtils::resolveHref(*baseUrls[--count], aURI, dest);
URIUtils::resolveHref(baseUrls[--count], aURI, dest);
aURI = dest;
}
}

Просмотреть файл

@ -3727,9 +3727,9 @@ nsresult
nsHTMLEditor::RemoveStyleSheetFromList(const nsAString &aURL)
{
// is it already in the list?
PRInt32 foundIndex;
PRUint32 foundIndex;
foundIndex = mStyleSheetURLs.IndexOf(aURL);
if (foundIndex < 0)
if (foundIndex == mStyleSheetURLs.NoIndex)
return NS_ERROR_FAILURE;
// Attempt both removals; if one fails there's not much we can do.
@ -3749,9 +3749,9 @@ nsHTMLEditor::GetStyleSheetForURL(const nsAString &aURL,
*aStyleSheet = 0;
// is it already in the list?
PRInt32 foundIndex;
PRUint32 foundIndex;
foundIndex = mStyleSheetURLs.IndexOf(aURL);
if (foundIndex < 0)
if (foundIndex == mStyleSheetURLs.NoIndex)
return NS_OK; //No sheet -- don't fail!
*aStyleSheet = mStyleSheets[foundIndex];
@ -3771,6 +3771,8 @@ nsHTMLEditor::GetURLForStyleSheet(nsICSSStyleSheet *aStyleSheet,
PRInt32 foundIndex = mStyleSheets.IndexOf(aStyleSheet);
// Don't fail if we don't find it in our list
// Note: mStyleSheets is nsCOMArray, so its IndexOf() method
// returns -1 on failure.
if (foundIndex == -1)
return NS_OK;

Просмотреть файл

@ -166,7 +166,7 @@ NS_IMETHODIMP
nsCommandLine::RemoveArguments(PRInt32 aStart, PRInt32 aEnd)
{
NS_ENSURE_ARG_MIN(aStart, 0);
NS_ENSURE_ARG_MAX(aEnd, mArgs.Length() - 1);
NS_ENSURE_ARG_MAX(aEnd + 1, mArgs.Length());
for (PRInt32 i = aEnd; i >= aStart; --i) {
mArgs.RemoveElementAt(i);

Просмотреть файл

@ -125,8 +125,8 @@ NSView* nsFilePicker::GetAccessoryView()
// set up popup button
NSPopUpButton* popupButton = [[[NSPopUpButton alloc] initWithFrame:NSMakeRect(0, 0, 0, 0) pullsDown:NO] autorelease];
PRInt32 numMenuItems = mTitles.Length();
for (int i = 0; i < numMenuItems; i++) {
PRUint32 numMenuItems = mTitles.Length();
for (PRUint32 i = 0; i < numMenuItems; i++) {
const nsString& currentTitle = mTitles[i];
NSString *titleString;
if (currentTitle.IsEmpty()) {
@ -423,7 +423,7 @@ nsFilePicker::GenerateFilterList()
NSMutableString *giantFilterString = [[[NSMutableString alloc] initWithString:@""] autorelease];
// Loop through each of the filter strings
for (PRInt32 loop = 0; PRInt32(loop < mFilters.Length()); loop++) {
for (PRUint32 loop = 0; loop < mFilters.Length(); loop++) {
const nsString& filterWide = mFilters[loop];
// separate individual filters