diff --git a/content/base/src/nsDOMDocumentType.cpp b/content/base/src/nsDOMDocumentType.cpp index 87a278cb41a..d73be225b6d 100644 --- a/content/base/src/nsDOMDocumentType.cpp +++ b/content/base/src/nsDOMDocumentType.cpp @@ -167,7 +167,7 @@ nsDOMDocumentType::GetInternalSubset(nsAString& aInternalSubset) NS_IMETHODIMP nsDOMDocumentType::GetTag(nsIAtom** aResult) const { - *aResult = NS_NewAtom(mName.get()); + *aResult = NS_NewAtom(mName); return NS_OK; } diff --git a/content/xml/document/src/nsXMLContentSink.cpp b/content/xml/document/src/nsXMLContentSink.cpp index fbe911363e5..21c65d8aa21 100644 --- a/content/xml/document/src/nsXMLContentSink.cpp +++ b/content/xml/document/src/nsXMLContentSink.cpp @@ -1203,7 +1203,7 @@ nsXMLContentSink::ProcessMETATag(nsIContent* aContent) aContent->GetAttr(kNameSpaceID_None, nsHTMLAtoms::content, result); if (!result.IsEmpty()) { ToLowerCase(header); - nsCOMPtr fieldAtom(dont_AddRef(NS_NewAtom(header))); + nsCOMPtr fieldAtom(do_GetAtom(header)); rv = ProcessHeaderData(fieldAtom, result, aContent); }//if (!result.IsEmpty()) }//if (!header.IsEmpty()) diff --git a/docshell/base/nsDocShell.cpp b/docshell/base/nsDocShell.cpp index 4446efb47ea..057a2317730 100644 --- a/docshell/base/nsDocShell.cpp +++ b/docshell/base/nsDocShell.cpp @@ -1366,7 +1366,7 @@ nsDocShell::SetCharset(const char* aCharset) GetDocumentCharsetInfo(getter_AddRefs(dcInfo)); if (dcInfo) { nsCOMPtr csAtom; - csAtom = dont_AddRef(NS_NewAtom(aCharset)); + csAtom = do_GetAtom(aCharset); dcInfo->SetForcedCharset(csAtom); } @@ -2090,7 +2090,7 @@ nsDocShell::AddChild(nsIDocShellTreeItem * aChild) return NS_OK; // set the child's parentCharset - nsCOMPtr parentCSAtom(dont_AddRef(NS_NewAtom(parentCS))); + nsCOMPtr parentCSAtom(do_GetAtom(parentCS)); res = dcInfo->SetParentCharset(parentCSAtom); if (NS_FAILED(res)) return NS_OK; diff --git a/dom/src/base/nsDOMClassInfo.cpp b/dom/src/base/nsDOMClassInfo.cpp index ecd37b13cd0..7c03385d05f 100644 --- a/dom/src/base/nsDOMClassInfo.cpp +++ b/dom/src/base/nsDOMClassInfo.cpp @@ -4537,7 +4537,7 @@ nsEventReceiverSH::RegisterCompileHandler(nsIXPConnectWrappedNative *wrapper, const PRUnichar *ustr = NS_REINTERPRET_CAST(const PRUnichar *, ::JS_GetStringChars(str)); - nsCOMPtr atom(getter_AddRefs(NS_NewAtom(ustr))); + nsCOMPtr atom(do_GetAtom(ustr)); NS_ENSURE_TRUE(atom, NS_ERROR_OUT_OF_MEMORY); if (compile) { diff --git a/editor/composer/src/nsComposeTxtSrvFilter.cpp b/editor/composer/src/nsComposeTxtSrvFilter.cpp index ab44d72c818..4b965c2f3b5 100644 --- a/editor/composer/src/nsComposeTxtSrvFilter.cpp +++ b/editor/composer/src/nsComposeTxtSrvFilter.cpp @@ -46,12 +46,12 @@ nsComposeTxtSrvFilter::nsComposeTxtSrvFilter() : mIsForMail(PR_FALSE) { - mBlockQuoteAtom = getter_AddRefs(do_GetAtom("blockquote")); - mTypeAtom = getter_AddRefs(do_GetAtom("type")); - mScriptAtom = getter_AddRefs(do_GetAtom("script")); - mTextAreaAtom = getter_AddRefs(do_GetAtom("textarea")); - mSelectAreaAtom = getter_AddRefs(do_GetAtom("select")); - mMapAtom = getter_AddRefs(do_GetAtom("map")); + mBlockQuoteAtom = do_GetAtom("blockquote"); + mTypeAtom = do_GetAtom("type"); + mScriptAtom = do_GetAtom("script"); + mTextAreaAtom = do_GetAtom("textarea"); + mSelectAreaAtom = do_GetAtom("select"); + mMapAtom = do_GetAtom("map"); } NS_IMPL_ISUPPORTS1(nsComposeTxtSrvFilter, nsITextServicesFilter); diff --git a/editor/libeditor/html/nsHTMLAnonymousUtils.cpp b/editor/libeditor/html/nsHTMLAnonymousUtils.cpp index 8e999684335..0a599d9bc85 100644 --- a/editor/libeditor/html/nsHTMLAnonymousUtils.cpp +++ b/editor/libeditor/html/nsHTMLAnonymousUtils.cpp @@ -209,7 +209,7 @@ nsHTMLEditor::CheckSelectionStateForAnonymousButtons(nsISelection * aSelection) res = focusElement->GetTagName(focusTagName); if (NS_FAILED(res)) return res; ToLowerCase(focusTagName); - nsCOMPtr focusTagAtom = getter_AddRefs(NS_NewAtom(focusTagName)); + nsCOMPtr focusTagAtom = do_GetAtom(focusTagName); nsCOMPtr absPosElement; if (mIsAbsolutelyPositioningEnabled) { diff --git a/editor/libeditor/html/nsHTMLEditor.cpp b/editor/libeditor/html/nsHTMLEditor.cpp index 3abf0936fb6..e735a62c9ff 100644 --- a/editor/libeditor/html/nsHTMLEditor.cpp +++ b/editor/libeditor/html/nsHTMLEditor.cpp @@ -167,11 +167,11 @@ nsHTMLEditor::nsHTMLEditor() , mSnapToGridEnabled(PR_FALSE) , mGridSize(0) { - mBoldAtom = getter_AddRefs(NS_NewAtom("b")); - mItalicAtom = getter_AddRefs(NS_NewAtom("i")); - mUnderlineAtom = getter_AddRefs(NS_NewAtom("u")); - mFontAtom = getter_AddRefs(NS_NewAtom("font")); - mLinkAtom = getter_AddRefs(NS_NewAtom("a")); + mBoldAtom = do_GetAtom("b"); + mItalicAtom = do_GetAtom("i"); + mUnderlineAtom = do_GetAtom("u"); + mFontAtom = do_GetAtom("font"); + mLinkAtom = do_GetAtom("a"); ++sInstanceCount; } @@ -664,7 +664,7 @@ nsHTMLEditor::NodeIsBlockStatic(nsIDOMNode *aNode, PRBool *aIsBlock) if (NS_SUCCEEDED(result)) { ToLowerCase(tagName); - nsIAtom *tagAtom = NS_NewAtom(tagName); + nsCOMPtr tagAtom = do_GetAtom(tagName); if (!tagAtom) { return NS_ERROR_NULL_POINTER; } if (tagAtom==nsEditProperty::p || @@ -703,7 +703,6 @@ nsHTMLEditor::NodeIsBlockStatic(nsIDOMNode *aNode, PRBool *aIsBlock) { *aIsBlock = PR_TRUE; } - NS_RELEASE(tagAtom); result = NS_OK; } } else { @@ -4856,7 +4855,7 @@ nsHTMLEditor::GetNextElementByTagName(nsIDOMElement *aCurrentElement, if (!aCurrentElement || !aTagName || !aReturn) return NS_ERROR_NULL_POINTER; - nsIAtom *tagAtom = NS_NewAtom(*aTagName); + nsCOMPtr tagAtom = do_GetAtom(*aTagName); if (!tagAtom) { return NS_ERROR_NULL_POINTER; } if (tagAtom==nsEditProperty::th) tagAtom=nsEditProperty::td; @@ -4877,7 +4876,7 @@ nsHTMLEditor::GetNextElementByTagName(nsIDOMElement *aCurrentElement, nsCOMPtr atom = GetTag(currentNode); - if (tagAtom==atom.get()) + if (tagAtom == atom) { nsCOMPtr element = do_QueryInterface(currentNode); if (!element) return NS_ERROR_NULL_POINTER; diff --git a/editor/libeditor/text/nsTextEditRulesBidi.cpp b/editor/libeditor/text/nsTextEditRulesBidi.cpp index cf4b4a612d9..90ddd558bfd 100644 --- a/editor/libeditor/text/nsTextEditRulesBidi.cpp +++ b/editor/libeditor/text/nsTextEditRulesBidi.cpp @@ -96,7 +96,7 @@ nsTextEditRules::CheckBidiLevelForDeletion(nsIDOMNode *aSelNode, PRUint8 levelAfter; PRUint8 levelBefore; - nsCOMPtr embeddingLevel = getter_AddRefs(NS_NewAtom("EmbeddingLevel")); + nsCOMPtr embeddingLevel = do_GetAtom("EmbeddingLevel"); // Get the bidi level of the frame before the caret res = frameBefore->GetBidiProperty(context, embeddingLevel, (void**)&levelBefore,sizeof(PRUint8)); @@ -120,7 +120,7 @@ nsTextEditRules::CheckBidiLevelForDeletion(nsIDOMNode *aSelNode, { // there was no frameAfter, i.e. the caret is at the end of the // document -- use the base paragraph level - nsCOMPtr baseLevel = getter_AddRefs(NS_NewAtom("BaseLevel")); + nsCOMPtr baseLevel = do_GetAtom("BaseLevel"); res = frameBefore->GetBidiProperty(context, baseLevel, (void**)&levelAfter,sizeof(PRUint8)); if (NS_FAILED(res)) return res; diff --git a/embedding/browser/webBrowser/nsContextMenuInfo.cpp b/embedding/browser/webBrowser/nsContextMenuInfo.cpp index 350ae2be628..a4a1424e71e 100644 --- a/embedding/browser/webBrowser/nsContextMenuInfo.cpp +++ b/embedding/browser/webBrowser/nsContextMenuInfo.cpp @@ -354,8 +354,8 @@ nsresult nsContextMenuInfo::GetFrameForBackgroundUpdate(nsIPresContext *aPresCon // make sure that this is the HTML or BODY element nsCOMPtr tag; pContent->GetTag(getter_AddRefs(tag)); - nsCOMPtr mTag_html = getter_AddRefs(NS_NewAtom("html")); - nsCOMPtr mTag_body = getter_AddRefs(NS_NewAtom("body")); + nsCOMPtr mTag_html = do_GetAtom("html"); + nsCOMPtr mTag_body = do_GetAtom("body"); if (tag && tag.get() == mTag_html || tag.get() == mTag_body) { @@ -365,7 +365,7 @@ nsresult nsContextMenuInfo::GetFrameForBackgroundUpdate(nsIPresContext *aPresCon while (pCanvasFrame) { nsCOMPtr parentType; pCanvasFrame->GetFrameType(getter_AddRefs(parentType)); - nsCOMPtr mTag_canvasFrame = getter_AddRefs(NS_NewAtom("CanvasFrame")); + nsCOMPtr mTag_canvasFrame = do_GetAtom("CanvasFrame"); if (parentType.get() == mTag_canvasFrame) { *aBGFrame = pCanvasFrame; break; diff --git a/embedding/browser/webBrowser/nsDocShellTreeOwner.cpp b/embedding/browser/webBrowser/nsDocShellTreeOwner.cpp index d815bca59a2..e96c7401a0a 100644 --- a/embedding/browser/webBrowser/nsDocShellTreeOwner.cpp +++ b/embedding/browser/webBrowser/nsDocShellTreeOwner.cpp @@ -897,9 +897,9 @@ DefaultTooltipTextProvider::DefaultTooltipTextProvider() { // There are certain element types which we don't want to use // as tool tip text. - mTag_dialog = getter_AddRefs(NS_NewAtom("dialog")); - mTag_dialogheader = getter_AddRefs(NS_NewAtom("dialogheader")); - mTag_window = getter_AddRefs(NS_NewAtom("window")); + mTag_dialog = do_GetAtom("dialog"); + mTag_dialogheader = do_GetAtom("dialogheader"); + mTag_window = do_GetAtom("window"); } /* void getNodeText (in nsIDOMNode aNode, out wstring aText); */ diff --git a/extensions/sql/base/src/mozSqlService.cpp b/extensions/sql/base/src/mozSqlService.cpp index 8bc57a15e8b..7ff3acdd1f5 100644 --- a/extensions/sql/base/src/mozSqlService.cpp +++ b/extensions/sql/base/src/mozSqlService.cpp @@ -108,7 +108,7 @@ mozSqlService::Init() if (NS_FAILED(rv)) return rv; nsCOMPtr sink = do_QueryInterface(mInner); if (sink) { - nsCOMPtr prefix = getter_AddRefs(NS_NewAtom("SQL")); + nsCOMPtr prefix = do_GetAtom("SQL"); sink->AddNameSpace(prefix, NS_ConvertASCIItoUCS2(SQL_NAMESPACE_URI)); } diff --git a/extensions/transformiix/source/xslt/txMozillaXMLOutput.cpp b/extensions/transformiix/source/xslt/txMozillaXMLOutput.cpp index bfc146d4b6e..ce7fa6cb364 100644 --- a/extensions/transformiix/source/xslt/txMozillaXMLOutput.cpp +++ b/extensions/transformiix/source/xslt/txMozillaXMLOutput.cpp @@ -634,7 +634,7 @@ void txMozillaXMLOutput::endHTMLElement(nsIDOMElement* aElement, return; TX_ToLowerCase(httpEquiv); - nsCOMPtr header = dont_AddRef(NS_NewAtom(httpEquiv)); + nsCOMPtr header = do_GetAtom(httpEquiv); processHTTPEquiv(header, value); } diff --git a/extensions/webservices/schema/src/nsSchemaLoader.cpp b/extensions/webservices/schema/src/nsSchemaLoader.cpp index bc329ab1827..0e086a687a7 100644 --- a/extensions/webservices/schema/src/nsSchemaLoader.cpp +++ b/extensions/webservices/schema/src/nsSchemaLoader.cpp @@ -493,7 +493,7 @@ nsBuiltinSchemaCollection::GetBuiltinType(const nsAString& aName, rv = CallQueryInterface(sup, aType); } else { - nsCOMPtr typeName = dont_AddRef(NS_NewAtom(aName)); + nsCOMPtr typeName = do_GetAtom(aName); PRUint16 typeVal; if (typeName == nsSchemaAtoms::sAnyType_atom) { typeVal = nsISchemaBuiltinType::BUILTIN_TYPE_ANYTYPE; diff --git a/gfx/src/nsDeviceContext.cpp b/gfx/src/nsDeviceContext.cpp index c4be6c7bb3f..9e74bee6869 100644 --- a/gfx/src/nsDeviceContext.cpp +++ b/gfx/src/nsDeviceContext.cpp @@ -310,7 +310,7 @@ DeviceContextImpl::GetLocaleLangGroup(void) langService->GetLocaleLanguageGroup(getter_AddRefs(mLocaleLangGroup)); } if (!mLocaleLangGroup) { - mLocaleLangGroup = getter_AddRefs(NS_NewAtom("x-western")); + mLocaleLangGroup = do_GetAtom("x-western"); } } } diff --git a/gfx/src/windows/nsNativeThemeWin.cpp b/gfx/src/windows/nsNativeThemeWin.cpp index ca8b8873c2c..78793f6ec17 100644 --- a/gfx/src/windows/nsNativeThemeWin.cpp +++ b/gfx/src/windows/nsNativeThemeWin.cpp @@ -169,15 +169,15 @@ nsNativeThemeWin::nsNativeThemeWin() { getThemeColor = (GetThemeColorPtr)GetProcAddress(mThemeDLL, "GetThemeColor"); } - mCheckedAtom = getter_AddRefs(NS_NewAtom("checked")); - mInputAtom = getter_AddRefs(NS_NewAtom("input")); - mInputCheckedAtom = getter_AddRefs(NS_NewAtom("_moz-input-checked")); - mDisabledAtom = getter_AddRefs(NS_NewAtom("disabled")); - mSelectedAtom = getter_AddRefs(NS_NewAtom("selected")); - mTypeAtom = getter_AddRefs(NS_NewAtom("type")); - mReadOnlyAtom = getter_AddRefs(NS_NewAtom("readonly")); - mDefaultAtom = getter_AddRefs(NS_NewAtom("default")); - mClassAtom = getter_AddRefs(NS_NewAtom("class")); + mCheckedAtom = do_GetAtom("checked"); + mInputAtom = do_GetAtom("input"); + mInputCheckedAtom = do_GetAtom("_moz-input-checked"); + mDisabledAtom = do_GetAtom("disabled"); + mSelectedAtom = do_GetAtom("selected"); + mTypeAtom = do_GetAtom("type"); + mReadOnlyAtom = do_GetAtom("readonly"); + mDefaultAtom = do_GetAtom("default"); + mClassAtom = do_GetAtom("class"); } nsNativeThemeWin::~nsNativeThemeWin() { diff --git a/intl/locale/src/nsLanguageAtomService.cpp b/intl/locale/src/nsLanguageAtomService.cpp index 9758aa9d79c..9aac87af375 100644 --- a/intl/locale/src/nsLanguageAtomService.cpp +++ b/intl/locale/src/nsLanguageAtomService.cpp @@ -209,7 +209,7 @@ nsLanguageAtomService::LookupLanguage(const PRUnichar* aLanguage, } } } - nsCOMPtr langGroup = getter_AddRefs(NS_NewAtom(langGroupStr)); + nsCOMPtr langGroup = do_GetAtom(langGroupStr); language->Init(lowered, langGroup); lang = language; mLangs->AppendElement(lang); @@ -237,7 +237,7 @@ nsLanguageAtomService::LookupCharSet(const char* aCharSet, NS_ENSURE_TRUE(mCharSets, NS_ERROR_FAILURE); } if (!mUnicode) { - mUnicode = getter_AddRefs(NS_NewAtom("x-unicode")); + mUnicode = do_GetAtom("x-unicode"); } nsCOMPtr langGroup; diff --git a/layout/xul/base/src/tree/src/nsTreeBodyFrame.cpp b/layout/xul/base/src/tree/src/nsTreeBodyFrame.cpp index 849b865cffe..7e8a31ba801 100644 --- a/layout/xul/base/src/tree/src/nsTreeBodyFrame.cpp +++ b/layout/xul/base/src/tree/src/nsTreeBodyFrame.cpp @@ -215,7 +215,7 @@ nsTreeColumn::nsTreeColumn(nsIContent* aColElement, nsIFrame* aFrame) // If we have an ID, cache the ID as an atom. if (!mID.IsEmpty()) { - mIDAtom = getter_AddRefs(NS_NewAtom(mID)); + mIDAtom = do_GetAtom(mID); } const nsStyleVisibility* vis = aFrame->GetStyleVisibility(); diff --git a/mailnews/addrbook/src/nsAbView.cpp b/mailnews/addrbook/src/nsAbView.cpp index bab085b3615..ffcacc4309f 100644 --- a/mailnews/addrbook/src/nsAbView.cpp +++ b/mailnews/addrbook/src/nsAbView.cpp @@ -77,7 +77,7 @@ NS_IMPL_ISUPPORTS4(nsAbView, nsIAbView, nsITreeView, nsIAbListener, nsIObserver) nsAbView::nsAbView() { - mMailListAtom = getter_AddRefs(NS_NewAtom("MailList")); + mMailListAtom = do_GetAtom("MailList"); mSuppressSelectionChange = PR_FALSE; mSuppressCountChange = PR_FALSE; mGeneratedNameFormat = 0; diff --git a/mailnews/base/src/nsMessengerWinIntegration.cpp b/mailnews/base/src/nsMessengerWinIntegration.cpp index 73851a0cb81..513c981d28e 100644 --- a/mailnews/base/src/nsMessengerWinIntegration.cpp +++ b/mailnews/base/src/nsMessengerWinIntegration.cpp @@ -264,8 +264,8 @@ private: nsMessengerWinIntegration::nsMessengerWinIntegration() { - mDefaultServerAtom = getter_AddRefs(NS_NewAtom("DefaultServer")); - mTotalUnreadMessagesAtom = getter_AddRefs(NS_NewAtom("TotalUnreadMessages")); + mDefaultServerAtom = do_GetAtom("DefaultServer"); + mTotalUnreadMessagesAtom = do_GetAtom("TotalUnreadMessages"); mFirstTimeFolderUnreadCountChanged = PR_TRUE; mInboxURI = nsnull; @@ -273,7 +273,7 @@ nsMessengerWinIntegration::nsMessengerWinIntegration() mStoreUnreadCounts = PR_FALSE; mIntervalTime = 0; - mBiffStateAtom = getter_AddRefs(NS_NewAtom("BiffState")); + mBiffStateAtom = do_GetAtom("BiffState"); mBiffIconVisible = PR_FALSE; mSuppressBiffIcon = PR_FALSE; mAlertInProgress = PR_FALSE; diff --git a/mailnews/base/src/nsMsgDBView.cpp b/mailnews/base/src/nsMsgDBView.cpp index 8534cc33db2..f758ae5570f 100644 --- a/mailnews/base/src/nsMsgDBView.cpp +++ b/mailnews/base/src/nsMsgDBView.cpp @@ -451,7 +451,7 @@ nsresult nsMsgDBView::GetLabelPrefStringAndAtom(const char *aPrefName, nsString& * later in AppendLabelProperties() */ NS_IF_RELEASE(*aColorAtom); prefColorTree.AppendWithConversion(aColor.get() + 1); - *aColorAtom = NS_NewAtom(prefColorTree.get()); + *aColorAtom = NS_NewAtom(prefColorTree); NS_ENSURE_TRUE(*aColorAtom, NS_ERROR_FAILURE); return rv; @@ -1721,7 +1721,7 @@ NS_IMETHODIMP nsMsgDBView::Open(nsIMsgFolder *folder, nsMsgViewSortTypeValue sor if (redirectorType.IsEmpty()) mRedirectorTypeAtom = nsnull; else - mRedirectorTypeAtom = getter_AddRefs(NS_NewAtom(redirectorType.get())); + mRedirectorTypeAtom = do_GetAtom(redirectorType.get()); mIsNews = !strcmp("nntp",type.get()); GetImapDeleteModel(nsnull); diff --git a/mailnews/imap/src/nsImapIncomingServer.cpp b/mailnews/imap/src/nsImapIncomingServer.cpp index d5cf2142dad..c64d878b3c3 100644 --- a/mailnews/imap/src/nsImapIncomingServer.cpp +++ b/mailnews/imap/src/nsImapIncomingServer.cpp @@ -1661,7 +1661,7 @@ NS_IMETHODIMP nsImapIncomingServer::OnlineFolderRename(nsIMsgWindow *msgWindow, if (NS_SUCCEEDED(rv)) { nsCOMPtr folderRenameAtom; - folderRenameAtom = getter_AddRefs(NS_NewAtom("RenameCompleted")); + folderRenameAtom = do_GetAtom("RenameCompleted"); newFolder->NotifyFolderEvent(folderRenameAtom); } } diff --git a/mailnews/imap/src/nsImapMailFolder.cpp b/mailnews/imap/src/nsImapMailFolder.cpp index 4c119052687..1bb3eef1c6f 100644 --- a/mailnews/imap/src/nsImapMailFolder.cpp +++ b/mailnews/imap/src/nsImapMailFolder.cpp @@ -914,13 +914,13 @@ NS_IMETHODIMP nsImapMailFolder::CreateClientSubfolderInfo(const char *folderName if(childSupports && NS_SUCCEEDED(rv)) { NotifyItemAdded(folderSupports, childSupports, "folderView"); - folderCreateAtom = getter_AddRefs(NS_NewAtom("FolderCreateCompleted")); + folderCreateAtom = do_GetAtom("FolderCreateCompleted"); child->NotifyFolderEvent(folderCreateAtom); } } else { - folderCreateAtom = getter_AddRefs(NS_NewAtom("FolderCreateFailed")); + folderCreateAtom = do_GetAtom("FolderCreateFailed"); NotifyFolderEvent(folderCreateAtom); } } @@ -4441,7 +4441,7 @@ nsImapMailFolder::OnStopRunningUrl(nsIURI *aUrl, nsresult aExitCode) if (NS_FAILED(aExitCode)) { nsCOMPtr folderRenameAtom; - folderRenameAtom = getter_AddRefs(NS_NewAtom("RenameCompleted")); + folderRenameAtom = do_GetAtom("RenameCompleted"); NotifyFolderEvent(folderRenameAtom); } break; @@ -4467,7 +4467,7 @@ nsImapMailFolder::OnStopRunningUrl(nsIURI *aUrl, nsresult aExitCode) if (NS_FAILED(aExitCode)) //if success notification already done { nsCOMPtr folderCreateAtom; - folderCreateAtom = getter_AddRefs(NS_NewAtom("FolderCreateFailed")); + folderCreateAtom = do_GetAtom("FolderCreateFailed"); NotifyFolderEvent(folderCreateAtom); } break; diff --git a/mailnews/local/src/nsLocalMailFolder.cpp b/mailnews/local/src/nsLocalMailFolder.cpp index e0014ec7e63..d98150e6d46 100644 --- a/mailnews/local/src/nsLocalMailFolder.cpp +++ b/mailnews/local/src/nsLocalMailFolder.cpp @@ -1326,7 +1326,7 @@ NS_IMETHODIMP nsMsgLocalMailFolder::Rename(const PRUnichar *aNewName, nsIMsgWind NotifyItemAdded(parentSupports, newFolderSupports, "folderView"); } } - folderRenameAtom = getter_AddRefs(NS_NewAtom("RenameCompleted")); + folderRenameAtom = do_GetAtom("RenameCompleted"); newFolder->NotifyFolderEvent(folderRenameAtom); } } @@ -3446,7 +3446,7 @@ nsMsgLocalMailFolder::NotifyCompactCompleted() { (void) RefreshSizeOnDisk(); nsCOMPtr compactCompletedAtom; - compactCompletedAtom = getter_AddRefs(NS_NewAtom("CompactCompleted")); + compactCompletedAtom = do_GetAtom("CompactCompleted"); NotifyFolderEvent(compactCompletedAtom); return NS_OK; } diff --git a/mailnews/news/src/nsNntpIncomingServer.cpp b/mailnews/news/src/nsNntpIncomingServer.cpp index d71d23bf32d..bb32a6a60d1 100644 --- a/mailnews/news/src/nsNntpIncomingServer.cpp +++ b/mailnews/news/src/nsNntpIncomingServer.cpp @@ -114,8 +114,8 @@ nsNntpIncomingServer::nsNntpIncomingServer() : nsMsgLineBuffer(nsnull, PR_FALSE) mLastUpdatedTime = 0; // these atoms are used for subscribe search - mSubscribedAtom = getter_AddRefs(NS_NewAtom("subscribed")); - mNntpAtom = getter_AddRefs(NS_NewAtom("nntp")); + mSubscribedAtom = do_GetAtom("subscribed"); + mNntpAtom = do_GetAtom("nntp"); // our filters are on the server, they are on a per newsgroup basis // but this will make the filter UI enable for news accounts diff --git a/rdf/base/src/nsRDFXMLSerializer.cpp b/rdf/base/src/nsRDFXMLSerializer.cpp index 40236f6d2ca..d9b62d4ca91 100644 --- a/rdf/base/src/nsRDFXMLSerializer.cpp +++ b/rdf/base/src/nsRDFXMLSerializer.cpp @@ -133,10 +133,10 @@ nsRDFXMLSerializer::Init(nsIRDFDataSource* aDataSource) // Add the ``RDF'' prefix, by default. nsCOMPtr prefix; - prefix = getter_AddRefs(NS_NewAtom("RDF")); + prefix = do_GetAtom("RDF"); AddNameSpace(prefix, NS_LITERAL_STRING("http://www.w3.org/1999/02/22-rdf-syntax-ns#")); - prefix = getter_AddRefs(NS_NewAtom("NC")); + prefix = do_GetAtom("NC"); AddNameSpace(prefix, NS_LITERAL_STRING("http://home.netscape.com/NC-rdf#")); return NS_OK; @@ -998,7 +998,7 @@ nsRDFXMLSerializer::EnsureNameSpaceFor(nsIRDFResource* aResource) aResource->GetValueConst(&s); printf("*** Creating namespace for %s\n", s); #endif - nsCOMPtr prefix = getter_AddRefs(NS_NewAtom(nameSpacePrefix)); + nsCOMPtr prefix = do_GetAtom(nameSpacePrefix); mNameSpaces.Put(nameSpaceURI, prefix); } diff --git a/webshell/tests/viewer/nsWebCrawler.cpp b/webshell/tests/viewer/nsWebCrawler.cpp index 7f2941aba45..b9c041e4681 100644 --- a/webshell/tests/viewer/nsWebCrawler.cpp +++ b/webshell/tests/viewer/nsWebCrawler.cpp @@ -179,12 +179,12 @@ nsWebCrawler::nsWebCrawler(nsViewerApp* aViewer) mDelay = 200 /*msec*/; // XXXwaterson straigt outta my arse mMaxPages = -1; mRecord = nsnull; - mLinkTag = getter_AddRefs(NS_NewAtom("a")); - mFrameTag = getter_AddRefs(NS_NewAtom("frame")); - mIFrameTag = getter_AddRefs(NS_NewAtom("iframe")); - mHrefAttr = getter_AddRefs(NS_NewAtom("href")); - mSrcAttr = getter_AddRefs(NS_NewAtom("src")); - mBaseHrefAttr = getter_AddRefs(NS_NewAtom("_base_href")); + mLinkTag = do_GetAtom("a"); + mFrameTag = do_GetAtom("frame"); + mIFrameTag = do_GetAtom("iframe"); + mHrefAttr = do_GetAtom("href"); + mSrcAttr = do_GetAtom("src"); + mBaseHrefAttr = do_GetAtom("_base_href"); mVisited = new AtomHashTable(); mVerbose = nsnull; LL_I2L(mStartLoad, 0); @@ -772,7 +772,7 @@ nsWebCrawler::FindURLsIn(nsIDocument* aDocument, nsIContent* aNode) nsresult rv; rv = NS_MakeAbsoluteURI(absURLSpec, src, docURL); if (NS_OK == rv) { - nsCOMPtr urlAtom = getter_AddRefs(NS_NewAtom(absURLSpec)); + nsCOMPtr urlAtom = do_GetAtom(absURLSpec); if (0 == mVisited->Get(urlAtom)) { // Remember the URL as visited so that we don't go there again mVisited->Put(urlAtom, "visited"); diff --git a/xpfe/components/filepicker/src/nsFileView.cpp b/xpfe/components/filepicker/src/nsFileView.cpp index 622d7db4993..c4fd0f1a3a0 100644 --- a/xpfe/components/filepicker/src/nsFileView.cpp +++ b/xpfe/components/filepicker/src/nsFileView.cpp @@ -133,8 +133,8 @@ nsFileView::~nsFileView() nsresult nsFileView::Init() { - mDirectoryAtom = dont_AddRef(NS_NewAtom("directory")); - mFileAtom = dont_AddRef(NS_NewAtom("file")); + mDirectoryAtom = do_GetAtom("directory"); + mFileAtom = do_GetAtom("file"); NS_NewISupportsArray(getter_AddRefs(mFileList)); NS_NewISupportsArray(getter_AddRefs(mDirList)); NS_NewISupportsArray(getter_AddRefs(mFilteredFiles));