From b79ad6fa5582bb1d3c6ea26d3b622cc7d3d5845d Mon Sep 17 00:00:00 2001 From: Fred Jendrzejewski Date: Fri, 16 Jan 2009 20:51:04 +1300 Subject: [PATCH] Bug 461047. Replace nsStringArray with nsTArray. r+sr=roc --HG-- extra : rebase_source : 7a20af24c97867efbb28dafa6a70ea1b4cf00e58 --- accessible/src/base/nsAccessible.cpp | 8 +- accessible/src/base/nsAccessible.h | 5 +- .../base/public/nsIXPathEvaluatorInternal.h | 3 +- content/base/src/nsContentSink.cpp | 14 ++-- content/base/src/nsContentSink.h | 1 + content/base/src/nsDOMLists.cpp | 37 +++++---- content/base/src/nsDOMLists.h | 10 ++- content/base/src/nsDocument.cpp | 22 +++--- content/base/src/nsNameSpaceManager.cpp | 18 +++-- content/base/src/nsStyleLinkElement.cpp | 6 +- content/base/src/nsStyleLinkElement.h | 4 +- .../html/content/public/nsIFormProcessor.h | 4 +- .../html/content/src/nsHTMLLinkElement.cpp | 10 +-- .../html/content/src/nsHTMLScriptElement.cpp | 1 + .../html/document/src/nsHTMLContentSink.cpp | 9 ++- content/xslt/src/main/txTestExpr.cpp | 23 +++--- content/xslt/src/xml/txDOM.h | 7 +- content/xslt/src/xml/txNodeDefinition.cpp | 11 +-- content/xslt/src/xpath/nsXPathEvaluator.cpp | 8 +- content/xslt/src/xpath/nsXPathEvaluator.h | 2 +- content/xul/templates/src/nsTemplateRule.cpp | 14 ++-- content/xul/templates/src/nsTemplateRule.h | 3 +- dom/src/storage/nsDOMStorage.cpp | 22 +++--- dom/src/storage/nsDOMStorage.h | 3 +- dom/src/storage/nsDOMStorageDB.cpp | 10 +-- dom/src/storage/nsDOMStorageDB.h | 2 +- .../composer/src/nsEditorParserObserver.cpp | 4 +- editor/composer/src/nsEditorParserObserver.h | 4 +- editor/composer/src/nsEditorSpellCheck.cpp | 39 ++++------ editor/composer/src/nsEditorSpellCheck.h | 4 +- editor/libeditor/html/nsHTMLCSSUtils.cpp | 24 +++--- editor/libeditor/html/nsHTMLCSSUtils.h | 5 +- editor/libeditor/html/nsHTMLEditor.cpp | 31 +++----- editor/libeditor/html/nsHTMLEditor.h | 5 +- editor/txtsvc/public/nsISpellChecker.h | 10 +-- .../spellcheck/src/mozPersonalDictionary.cpp | 11 ++- .../spellcheck/src/mozPersonalDictionary.h | 3 +- extensions/spellcheck/src/mozSpellChecker.cpp | 16 ++-- extensions/spellcheck/src/mozSpellChecker.h | 11 +-- gfx/src/thebes/nsThebesFontEnumerator.cpp | 11 +-- gfx/thebes/public/gfxBeOSPlatform.h | 3 +- gfx/thebes/public/gfxOS2Platform.h | 3 +- gfx/thebes/public/gfxPangoFonts.h | 1 + gfx/thebes/public/gfxPlatform.h | 3 +- gfx/thebes/public/gfxPlatformGtk.h | 3 +- gfx/thebes/public/gfxPlatformMac.h | 2 +- gfx/thebes/public/gfxQtPlatform.h | 3 +- gfx/thebes/public/gfxWindowsPlatform.h | 5 +- gfx/thebes/src/gfxBeOSPlatform.cpp | 4 +- gfx/thebes/src/gfxFT2Fonts.cpp | 19 ++--- gfx/thebes/src/gfxFontconfigUtils.cpp | 11 +-- gfx/thebes/src/gfxFontconfigUtils.h | 2 +- gfx/thebes/src/gfxOS2Fonts.cpp | 17 +++-- gfx/thebes/src/gfxOS2Platform.cpp | 11 +-- gfx/thebes/src/gfxPangoFonts.cpp | 1 + gfx/thebes/src/gfxPlatform.cpp | 3 +- gfx/thebes/src/gfxPlatformGtk.cpp | 4 +- gfx/thebes/src/gfxPlatformMac.cpp | 3 +- gfx/thebes/src/gfxQtPlatform.cpp | 3 +- gfx/thebes/src/gfxQuartzFontCache.h | 3 +- gfx/thebes/src/gfxQuartzFontCache.mm | 9 ++- gfx/thebes/src/gfxWindowsPlatform.cpp | 13 ++-- intl/chardet/src/nsMetaCharsetObserver.cpp | 52 +++++++------ intl/chardet/src/nsMetaCharsetObserver.h | 13 ++-- intl/chardet/src/nsXMLEncodingObserver.h | 5 +- intl/locale/src/nsLocale.cpp | 11 ++- intl/locale/src/nsLocale.h | 5 +- layout/base/nsIPresShell.h | 1 - layout/mathml/base/src/nsMathMLChar.cpp | 22 +++--- .../mathml/content/src/nsMathMLOperators.cpp | 25 ++++--- parser/htmlparser/public/nsIElementObserver.h | 5 +- parser/htmlparser/src/CNavDTD.cpp | 9 +-- parser/htmlparser/src/nsDTDUtils.cpp | 18 ++--- security/manager/ssl/src/nsKeygenHandler.cpp | 4 +- security/manager/ssl/src/nsKeygenHandler.h | 4 +- storage/src/mozStorageStatementWrapper.cpp | 2 +- storage/src/mozStorageStatementWrapper.h | 3 +- .../src/nsAutoCompleteSimpleResult.cpp | 75 ++++++++----------- .../src/nsAutoCompleteSimpleResult.h | 14 +++- .../commandlines/src/nsCommandLine.cpp | 35 +++++---- .../components/filepicker/src/nsFileView.cpp | 9 ++- .../components/places/src/nsNavHistory.cpp | 33 ++++---- toolkit/components/places/src/nsNavHistory.h | 2 +- .../places/src/nsNavHistoryAutoComplete.cpp | 42 +++++------ .../test/relicense_inputs/need_to_relicense.h | 5 +- tools/relic/test/relicense_inputs/npl.h | 5 +- .../relicense_outputs/need_to_relicense.h | 5 +- tools/relic/test/relicense_outputs/npl.h | 5 +- widget/src/beos/nsDeviceContextSpecB.cpp | 15 ++-- widget/src/cocoa/nsFilePicker.h | 5 +- widget/src/cocoa/nsFilePicker.mm | 24 +++--- widget/src/gtk2/nsDeviceContextSpecG.cpp | 21 +++--- widget/src/os2/nsDeviceContextSpecOS2.cpp | 13 ++-- widget/src/os2/nsFilePicker.cpp | 24 +++--- widget/src/os2/nsFilePicker.h | 5 +- widget/src/windows/nsDeviceContextSpecWin.cpp | 5 +- xpcom/ds/nsStringEnumerator.cpp | 22 +++--- xpcom/ds/nsStringEnumerator.h | 13 ++-- xpcom/io/nsLocalFileOSX.mm | 11 +-- 99 files changed, 574 insertions(+), 554 deletions(-) diff --git a/accessible/src/base/nsAccessible.cpp b/accessible/src/base/nsAccessible.cpp index be8e086bcda..7a1dd6f606e 100644 --- a/accessible/src/base/nsAccessible.cpp +++ b/accessible/src/base/nsAccessible.cpp @@ -112,10 +112,10 @@ NS_IMPL_ISUPPORTS1(nsAccessibleDOMStringList, nsIDOMDOMStringList) NS_IMETHODIMP nsAccessibleDOMStringList::Item(PRUint32 aIndex, nsAString& aResult) { - if (aIndex >= (PRUint32)mNames.Count()) { + if (aIndex >= mNames.Length()) { SetDOMStringToNull(aResult); } else { - mNames.StringAt(aIndex, aResult); + aResult = mNames.ElementAt(aIndex); } return NS_OK; @@ -124,7 +124,7 @@ nsAccessibleDOMStringList::Item(PRUint32 aIndex, nsAString& aResult) NS_IMETHODIMP nsAccessibleDOMStringList::GetLength(PRUint32 *aLength) { - *aLength = (PRUint32)mNames.Count(); + *aLength = mNames.Length(); return NS_OK; } @@ -132,7 +132,7 @@ nsAccessibleDOMStringList::GetLength(PRUint32 *aLength) NS_IMETHODIMP nsAccessibleDOMStringList::Contains(const nsAString& aString, PRBool *aResult) { - *aResult = mNames.IndexOf(aString) > -1; + *aResult = mNames.Contains(aString); return NS_OK; } diff --git a/accessible/src/base/nsAccessible.h b/accessible/src/base/nsAccessible.h index 81c792c1244..88f3d070f22 100644 --- a/accessible/src/base/nsAccessible.h +++ b/accessible/src/base/nsAccessible.h @@ -55,6 +55,7 @@ #include "nsINameSpaceManager.h" #include "nsWeakReference.h" #include "nsString.h" +#include "nsTArray.h" #include "nsIDOMDOMStringList.h" #include "nsARIAMap.h" @@ -88,11 +89,11 @@ public: NS_DECL_NSIDOMDOMSTRINGLIST PRBool Add(const nsAString& aName) { - return mNames.AppendString(aName); + return mNames.AppendElement(aName) != nsnull; } private: - nsStringArray mNames; + nsTArray mNames; }; diff --git a/content/base/public/nsIXPathEvaluatorInternal.h b/content/base/public/nsIXPathEvaluatorInternal.h index 42f8d7d1948..96593eca7e1 100644 --- a/content/base/public/nsIXPathEvaluatorInternal.h +++ b/content/base/public/nsIXPathEvaluatorInternal.h @@ -40,6 +40,7 @@ #define nsIXPathEvaluatorInternal_h__ #include "nsCOMArray.h" +#include "nsTArray.h" class nsIDOMDocument; class nsIDOMXPathExpression; @@ -62,7 +63,7 @@ public: NS_IMETHOD CreateExpression(const nsAString &aExpression, nsIDOMXPathNSResolver *aResolver, - nsStringArray *aNamespaceURIs, + nsTArray *aNamespaceURIs, nsCStringArray *aContractIDs, nsCOMArray *aState, nsIDOMXPathExpression **aResult) = 0; diff --git a/content/base/src/nsContentSink.cpp b/content/base/src/nsContentSink.cpp index 2f190602263..4d37e4d0fc1 100644 --- a/content/base/src/nsContentSink.cpp +++ b/content/base/src/nsContentSink.cpp @@ -356,7 +356,7 @@ nsContentSink::ScriptAvailable(nsresult aResult, // aElement will not be in mScriptElements if a