Bug 213601: Switch some users of NS_NewAtom over to do_GetAtom. r=bzbarsky, sr=dbaron

This commit is contained in:
jaggernaut%netscape.com 2003-07-24 04:53:13 +00:00
Родитель afcb9c75c8
Коммит ef99140d6d
27 изменённых файлов: 71 добавлений и 72 удалений

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

@ -167,7 +167,7 @@ nsDOMDocumentType::GetInternalSubset(nsAString& aInternalSubset)
NS_IMETHODIMP NS_IMETHODIMP
nsDOMDocumentType::GetTag(nsIAtom** aResult) const nsDOMDocumentType::GetTag(nsIAtom** aResult) const
{ {
*aResult = NS_NewAtom(mName.get()); *aResult = NS_NewAtom(mName);
return NS_OK; return NS_OK;
} }

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

@ -1203,7 +1203,7 @@ nsXMLContentSink::ProcessMETATag(nsIContent* aContent)
aContent->GetAttr(kNameSpaceID_None, nsHTMLAtoms::content, result); aContent->GetAttr(kNameSpaceID_None, nsHTMLAtoms::content, result);
if (!result.IsEmpty()) { if (!result.IsEmpty()) {
ToLowerCase(header); ToLowerCase(header);
nsCOMPtr<nsIAtom> fieldAtom(dont_AddRef(NS_NewAtom(header))); nsCOMPtr<nsIAtom> fieldAtom(do_GetAtom(header));
rv = ProcessHeaderData(fieldAtom, result, aContent); rv = ProcessHeaderData(fieldAtom, result, aContent);
}//if (!result.IsEmpty()) }//if (!result.IsEmpty())
}//if (!header.IsEmpty()) }//if (!header.IsEmpty())

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

@ -1366,7 +1366,7 @@ nsDocShell::SetCharset(const char* aCharset)
GetDocumentCharsetInfo(getter_AddRefs(dcInfo)); GetDocumentCharsetInfo(getter_AddRefs(dcInfo));
if (dcInfo) { if (dcInfo) {
nsCOMPtr<nsIAtom> csAtom; nsCOMPtr<nsIAtom> csAtom;
csAtom = dont_AddRef(NS_NewAtom(aCharset)); csAtom = do_GetAtom(aCharset);
dcInfo->SetForcedCharset(csAtom); dcInfo->SetForcedCharset(csAtom);
} }
@ -2090,7 +2090,7 @@ nsDocShell::AddChild(nsIDocShellTreeItem * aChild)
return NS_OK; return NS_OK;
// set the child's parentCharset // set the child's parentCharset
nsCOMPtr<nsIAtom> parentCSAtom(dont_AddRef(NS_NewAtom(parentCS))); nsCOMPtr<nsIAtom> parentCSAtom(do_GetAtom(parentCS));
res = dcInfo->SetParentCharset(parentCSAtom); res = dcInfo->SetParentCharset(parentCSAtom);
if (NS_FAILED(res)) if (NS_FAILED(res))
return NS_OK; return NS_OK;

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

@ -4537,7 +4537,7 @@ nsEventReceiverSH::RegisterCompileHandler(nsIXPConnectWrappedNative *wrapper,
const PRUnichar *ustr = NS_REINTERPRET_CAST(const PRUnichar *, const PRUnichar *ustr = NS_REINTERPRET_CAST(const PRUnichar *,
::JS_GetStringChars(str)); ::JS_GetStringChars(str));
nsCOMPtr<nsIAtom> atom(getter_AddRefs(NS_NewAtom(ustr))); nsCOMPtr<nsIAtom> atom(do_GetAtom(ustr));
NS_ENSURE_TRUE(atom, NS_ERROR_OUT_OF_MEMORY); NS_ENSURE_TRUE(atom, NS_ERROR_OUT_OF_MEMORY);
if (compile) { if (compile) {

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

@ -46,12 +46,12 @@ nsComposeTxtSrvFilter::nsComposeTxtSrvFilter() :
mIsForMail(PR_FALSE) mIsForMail(PR_FALSE)
{ {
mBlockQuoteAtom = getter_AddRefs(do_GetAtom("blockquote")); mBlockQuoteAtom = do_GetAtom("blockquote");
mTypeAtom = getter_AddRefs(do_GetAtom("type")); mTypeAtom = do_GetAtom("type");
mScriptAtom = getter_AddRefs(do_GetAtom("script")); mScriptAtom = do_GetAtom("script");
mTextAreaAtom = getter_AddRefs(do_GetAtom("textarea")); mTextAreaAtom = do_GetAtom("textarea");
mSelectAreaAtom = getter_AddRefs(do_GetAtom("select")); mSelectAreaAtom = do_GetAtom("select");
mMapAtom = getter_AddRefs(do_GetAtom("map")); mMapAtom = do_GetAtom("map");
} }
NS_IMPL_ISUPPORTS1(nsComposeTxtSrvFilter, nsITextServicesFilter); NS_IMPL_ISUPPORTS1(nsComposeTxtSrvFilter, nsITextServicesFilter);

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

@ -209,7 +209,7 @@ nsHTMLEditor::CheckSelectionStateForAnonymousButtons(nsISelection * aSelection)
res = focusElement->GetTagName(focusTagName); res = focusElement->GetTagName(focusTagName);
if (NS_FAILED(res)) return res; if (NS_FAILED(res)) return res;
ToLowerCase(focusTagName); ToLowerCase(focusTagName);
nsCOMPtr<nsIAtom> focusTagAtom = getter_AddRefs(NS_NewAtom(focusTagName)); nsCOMPtr<nsIAtom> focusTagAtom = do_GetAtom(focusTagName);
nsCOMPtr<nsIDOMElement> absPosElement; nsCOMPtr<nsIDOMElement> absPosElement;
if (mIsAbsolutelyPositioningEnabled) { if (mIsAbsolutelyPositioningEnabled) {

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

@ -167,11 +167,11 @@ nsHTMLEditor::nsHTMLEditor()
, mSnapToGridEnabled(PR_FALSE) , mSnapToGridEnabled(PR_FALSE)
, mGridSize(0) , mGridSize(0)
{ {
mBoldAtom = getter_AddRefs(NS_NewAtom("b")); mBoldAtom = do_GetAtom("b");
mItalicAtom = getter_AddRefs(NS_NewAtom("i")); mItalicAtom = do_GetAtom("i");
mUnderlineAtom = getter_AddRefs(NS_NewAtom("u")); mUnderlineAtom = do_GetAtom("u");
mFontAtom = getter_AddRefs(NS_NewAtom("font")); mFontAtom = do_GetAtom("font");
mLinkAtom = getter_AddRefs(NS_NewAtom("a")); mLinkAtom = do_GetAtom("a");
++sInstanceCount; ++sInstanceCount;
} }
@ -664,7 +664,7 @@ nsHTMLEditor::NodeIsBlockStatic(nsIDOMNode *aNode, PRBool *aIsBlock)
if (NS_SUCCEEDED(result)) if (NS_SUCCEEDED(result))
{ {
ToLowerCase(tagName); ToLowerCase(tagName);
nsIAtom *tagAtom = NS_NewAtom(tagName); nsCOMPtr<nsIAtom> tagAtom = do_GetAtom(tagName);
if (!tagAtom) { return NS_ERROR_NULL_POINTER; } if (!tagAtom) { return NS_ERROR_NULL_POINTER; }
if (tagAtom==nsEditProperty::p || if (tagAtom==nsEditProperty::p ||
@ -703,7 +703,6 @@ nsHTMLEditor::NodeIsBlockStatic(nsIDOMNode *aNode, PRBool *aIsBlock)
{ {
*aIsBlock = PR_TRUE; *aIsBlock = PR_TRUE;
} }
NS_RELEASE(tagAtom);
result = NS_OK; result = NS_OK;
} }
} else { } else {
@ -4856,7 +4855,7 @@ nsHTMLEditor::GetNextElementByTagName(nsIDOMElement *aCurrentElement,
if (!aCurrentElement || !aTagName || !aReturn) if (!aCurrentElement || !aTagName || !aReturn)
return NS_ERROR_NULL_POINTER; return NS_ERROR_NULL_POINTER;
nsIAtom *tagAtom = NS_NewAtom(*aTagName); nsCOMPtr<nsIAtom> tagAtom = do_GetAtom(*aTagName);
if (!tagAtom) { return NS_ERROR_NULL_POINTER; } if (!tagAtom) { return NS_ERROR_NULL_POINTER; }
if (tagAtom==nsEditProperty::th) if (tagAtom==nsEditProperty::th)
tagAtom=nsEditProperty::td; tagAtom=nsEditProperty::td;
@ -4877,7 +4876,7 @@ nsHTMLEditor::GetNextElementByTagName(nsIDOMElement *aCurrentElement,
nsCOMPtr<nsIAtom> atom = GetTag(currentNode); nsCOMPtr<nsIAtom> atom = GetTag(currentNode);
if (tagAtom==atom.get()) if (tagAtom == atom)
{ {
nsCOMPtr<nsIDOMElement> element = do_QueryInterface(currentNode); nsCOMPtr<nsIDOMElement> element = do_QueryInterface(currentNode);
if (!element) return NS_ERROR_NULL_POINTER; if (!element) return NS_ERROR_NULL_POINTER;

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

@ -96,7 +96,7 @@ nsTextEditRules::CheckBidiLevelForDeletion(nsIDOMNode *aSelNode,
PRUint8 levelAfter; PRUint8 levelAfter;
PRUint8 levelBefore; PRUint8 levelBefore;
nsCOMPtr<nsIAtom> embeddingLevel = getter_AddRefs(NS_NewAtom("EmbeddingLevel")); nsCOMPtr<nsIAtom> embeddingLevel = do_GetAtom("EmbeddingLevel");
// Get the bidi level of the frame before the caret // Get the bidi level of the frame before the caret
res = frameBefore->GetBidiProperty(context, embeddingLevel, (void**)&levelBefore,sizeof(PRUint8)); 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 // there was no frameAfter, i.e. the caret is at the end of the
// document -- use the base paragraph level // document -- use the base paragraph level
nsCOMPtr<nsIAtom> baseLevel = getter_AddRefs(NS_NewAtom("BaseLevel")); nsCOMPtr<nsIAtom> baseLevel = do_GetAtom("BaseLevel");
res = frameBefore->GetBidiProperty(context, baseLevel, (void**)&levelAfter,sizeof(PRUint8)); res = frameBefore->GetBidiProperty(context, baseLevel, (void**)&levelAfter,sizeof(PRUint8));
if (NS_FAILED(res)) if (NS_FAILED(res))
return res; return res;

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

@ -354,8 +354,8 @@ nsresult nsContextMenuInfo::GetFrameForBackgroundUpdate(nsIPresContext *aPresCon
// make sure that this is the HTML or BODY element // make sure that this is the HTML or BODY element
nsCOMPtr<nsIAtom> tag; nsCOMPtr<nsIAtom> tag;
pContent->GetTag(getter_AddRefs(tag)); pContent->GetTag(getter_AddRefs(tag));
nsCOMPtr<nsIAtom> mTag_html = getter_AddRefs(NS_NewAtom("html")); nsCOMPtr<nsIAtom> mTag_html = do_GetAtom("html");
nsCOMPtr<nsIAtom> mTag_body = getter_AddRefs(NS_NewAtom("body")); nsCOMPtr<nsIAtom> mTag_body = do_GetAtom("body");
if (tag && if (tag &&
tag.get() == mTag_html || tag.get() == mTag_html ||
tag.get() == mTag_body) { tag.get() == mTag_body) {
@ -365,7 +365,7 @@ nsresult nsContextMenuInfo::GetFrameForBackgroundUpdate(nsIPresContext *aPresCon
while (pCanvasFrame) { while (pCanvasFrame) {
nsCOMPtr<nsIAtom> parentType; nsCOMPtr<nsIAtom> parentType;
pCanvasFrame->GetFrameType(getter_AddRefs(parentType)); pCanvasFrame->GetFrameType(getter_AddRefs(parentType));
nsCOMPtr<nsIAtom> mTag_canvasFrame = getter_AddRefs(NS_NewAtom("CanvasFrame")); nsCOMPtr<nsIAtom> mTag_canvasFrame = do_GetAtom("CanvasFrame");
if (parentType.get() == mTag_canvasFrame) { if (parentType.get() == mTag_canvasFrame) {
*aBGFrame = pCanvasFrame; *aBGFrame = pCanvasFrame;
break; break;

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

@ -897,9 +897,9 @@ DefaultTooltipTextProvider::DefaultTooltipTextProvider()
{ {
// There are certain element types which we don't want to use // There are certain element types which we don't want to use
// as tool tip text. // as tool tip text.
mTag_dialog = getter_AddRefs(NS_NewAtom("dialog")); mTag_dialog = do_GetAtom("dialog");
mTag_dialogheader = getter_AddRefs(NS_NewAtom("dialogheader")); mTag_dialogheader = do_GetAtom("dialogheader");
mTag_window = getter_AddRefs(NS_NewAtom("window")); mTag_window = do_GetAtom("window");
} }
/* void getNodeText (in nsIDOMNode aNode, out wstring aText); */ /* void getNodeText (in nsIDOMNode aNode, out wstring aText); */

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

@ -108,7 +108,7 @@ mozSqlService::Init()
if (NS_FAILED(rv)) return rv; if (NS_FAILED(rv)) return rv;
nsCOMPtr<nsIRDFXMLSink> sink = do_QueryInterface(mInner); nsCOMPtr<nsIRDFXMLSink> sink = do_QueryInterface(mInner);
if (sink) { if (sink) {
nsCOMPtr<nsIAtom> prefix = getter_AddRefs(NS_NewAtom("SQL")); nsCOMPtr<nsIAtom> prefix = do_GetAtom("SQL");
sink->AddNameSpace(prefix, NS_ConvertASCIItoUCS2(SQL_NAMESPACE_URI)); sink->AddNameSpace(prefix, NS_ConvertASCIItoUCS2(SQL_NAMESPACE_URI));
} }

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

@ -634,7 +634,7 @@ void txMozillaXMLOutput::endHTMLElement(nsIDOMElement* aElement,
return; return;
TX_ToLowerCase(httpEquiv); TX_ToLowerCase(httpEquiv);
nsCOMPtr<nsIAtom> header = dont_AddRef(NS_NewAtom(httpEquiv)); nsCOMPtr<nsIAtom> header = do_GetAtom(httpEquiv);
processHTTPEquiv(header, value); processHTTPEquiv(header, value);
} }

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

@ -493,7 +493,7 @@ nsBuiltinSchemaCollection::GetBuiltinType(const nsAString& aName,
rv = CallQueryInterface(sup, aType); rv = CallQueryInterface(sup, aType);
} }
else { else {
nsCOMPtr<nsIAtom> typeName = dont_AddRef(NS_NewAtom(aName)); nsCOMPtr<nsIAtom> typeName = do_GetAtom(aName);
PRUint16 typeVal; PRUint16 typeVal;
if (typeName == nsSchemaAtoms::sAnyType_atom) { if (typeName == nsSchemaAtoms::sAnyType_atom) {
typeVal = nsISchemaBuiltinType::BUILTIN_TYPE_ANYTYPE; typeVal = nsISchemaBuiltinType::BUILTIN_TYPE_ANYTYPE;

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

@ -310,7 +310,7 @@ DeviceContextImpl::GetLocaleLangGroup(void)
langService->GetLocaleLanguageGroup(getter_AddRefs(mLocaleLangGroup)); langService->GetLocaleLanguageGroup(getter_AddRefs(mLocaleLangGroup));
} }
if (!mLocaleLangGroup) { if (!mLocaleLangGroup) {
mLocaleLangGroup = getter_AddRefs(NS_NewAtom("x-western")); mLocaleLangGroup = do_GetAtom("x-western");
} }
} }
} }

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

@ -169,15 +169,15 @@ nsNativeThemeWin::nsNativeThemeWin() {
getThemeColor = (GetThemeColorPtr)GetProcAddress(mThemeDLL, "GetThemeColor"); getThemeColor = (GetThemeColorPtr)GetProcAddress(mThemeDLL, "GetThemeColor");
} }
mCheckedAtom = getter_AddRefs(NS_NewAtom("checked")); mCheckedAtom = do_GetAtom("checked");
mInputAtom = getter_AddRefs(NS_NewAtom("input")); mInputAtom = do_GetAtom("input");
mInputCheckedAtom = getter_AddRefs(NS_NewAtom("_moz-input-checked")); mInputCheckedAtom = do_GetAtom("_moz-input-checked");
mDisabledAtom = getter_AddRefs(NS_NewAtom("disabled")); mDisabledAtom = do_GetAtom("disabled");
mSelectedAtom = getter_AddRefs(NS_NewAtom("selected")); mSelectedAtom = do_GetAtom("selected");
mTypeAtom = getter_AddRefs(NS_NewAtom("type")); mTypeAtom = do_GetAtom("type");
mReadOnlyAtom = getter_AddRefs(NS_NewAtom("readonly")); mReadOnlyAtom = do_GetAtom("readonly");
mDefaultAtom = getter_AddRefs(NS_NewAtom("default")); mDefaultAtom = do_GetAtom("default");
mClassAtom = getter_AddRefs(NS_NewAtom("class")); mClassAtom = do_GetAtom("class");
} }
nsNativeThemeWin::~nsNativeThemeWin() { nsNativeThemeWin::~nsNativeThemeWin() {

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

@ -209,7 +209,7 @@ nsLanguageAtomService::LookupLanguage(const PRUnichar* aLanguage,
} }
} }
} }
nsCOMPtr<nsIAtom> langGroup = getter_AddRefs(NS_NewAtom(langGroupStr)); nsCOMPtr<nsIAtom> langGroup = do_GetAtom(langGroupStr);
language->Init(lowered, langGroup); language->Init(lowered, langGroup);
lang = language; lang = language;
mLangs->AppendElement(lang); mLangs->AppendElement(lang);
@ -237,7 +237,7 @@ nsLanguageAtomService::LookupCharSet(const char* aCharSet,
NS_ENSURE_TRUE(mCharSets, NS_ERROR_FAILURE); NS_ENSURE_TRUE(mCharSets, NS_ERROR_FAILURE);
} }
if (!mUnicode) { if (!mUnicode) {
mUnicode = getter_AddRefs(NS_NewAtom("x-unicode")); mUnicode = do_GetAtom("x-unicode");
} }
nsCOMPtr<nsIAtom> langGroup; nsCOMPtr<nsIAtom> langGroup;

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

@ -215,7 +215,7 @@ nsTreeColumn::nsTreeColumn(nsIContent* aColElement, nsIFrame* aFrame)
// If we have an ID, cache the ID as an atom. // If we have an ID, cache the ID as an atom.
if (!mID.IsEmpty()) { if (!mID.IsEmpty()) {
mIDAtom = getter_AddRefs(NS_NewAtom(mID)); mIDAtom = do_GetAtom(mID);
} }
const nsStyleVisibility* vis = aFrame->GetStyleVisibility(); const nsStyleVisibility* vis = aFrame->GetStyleVisibility();

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

@ -77,7 +77,7 @@ NS_IMPL_ISUPPORTS4(nsAbView, nsIAbView, nsITreeView, nsIAbListener, nsIObserver)
nsAbView::nsAbView() nsAbView::nsAbView()
{ {
mMailListAtom = getter_AddRefs(NS_NewAtom("MailList")); mMailListAtom = do_GetAtom("MailList");
mSuppressSelectionChange = PR_FALSE; mSuppressSelectionChange = PR_FALSE;
mSuppressCountChange = PR_FALSE; mSuppressCountChange = PR_FALSE;
mGeneratedNameFormat = 0; mGeneratedNameFormat = 0;

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

@ -264,8 +264,8 @@ private:
nsMessengerWinIntegration::nsMessengerWinIntegration() nsMessengerWinIntegration::nsMessengerWinIntegration()
{ {
mDefaultServerAtom = getter_AddRefs(NS_NewAtom("DefaultServer")); mDefaultServerAtom = do_GetAtom("DefaultServer");
mTotalUnreadMessagesAtom = getter_AddRefs(NS_NewAtom("TotalUnreadMessages")); mTotalUnreadMessagesAtom = do_GetAtom("TotalUnreadMessages");
mFirstTimeFolderUnreadCountChanged = PR_TRUE; mFirstTimeFolderUnreadCountChanged = PR_TRUE;
mInboxURI = nsnull; mInboxURI = nsnull;
@ -273,7 +273,7 @@ nsMessengerWinIntegration::nsMessengerWinIntegration()
mStoreUnreadCounts = PR_FALSE; mStoreUnreadCounts = PR_FALSE;
mIntervalTime = 0; mIntervalTime = 0;
mBiffStateAtom = getter_AddRefs(NS_NewAtom("BiffState")); mBiffStateAtom = do_GetAtom("BiffState");
mBiffIconVisible = PR_FALSE; mBiffIconVisible = PR_FALSE;
mSuppressBiffIcon = PR_FALSE; mSuppressBiffIcon = PR_FALSE;
mAlertInProgress = PR_FALSE; mAlertInProgress = PR_FALSE;

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

@ -451,7 +451,7 @@ nsresult nsMsgDBView::GetLabelPrefStringAndAtom(const char *aPrefName, nsString&
* later in AppendLabelProperties() */ * later in AppendLabelProperties() */
NS_IF_RELEASE(*aColorAtom); NS_IF_RELEASE(*aColorAtom);
prefColorTree.AppendWithConversion(aColor.get() + 1); prefColorTree.AppendWithConversion(aColor.get() + 1);
*aColorAtom = NS_NewAtom(prefColorTree.get()); *aColorAtom = NS_NewAtom(prefColorTree);
NS_ENSURE_TRUE(*aColorAtom, NS_ERROR_FAILURE); NS_ENSURE_TRUE(*aColorAtom, NS_ERROR_FAILURE);
return rv; return rv;
@ -1721,7 +1721,7 @@ NS_IMETHODIMP nsMsgDBView::Open(nsIMsgFolder *folder, nsMsgViewSortTypeValue sor
if (redirectorType.IsEmpty()) if (redirectorType.IsEmpty())
mRedirectorTypeAtom = nsnull; mRedirectorTypeAtom = nsnull;
else else
mRedirectorTypeAtom = getter_AddRefs(NS_NewAtom(redirectorType.get())); mRedirectorTypeAtom = do_GetAtom(redirectorType.get());
mIsNews = !strcmp("nntp",type.get()); mIsNews = !strcmp("nntp",type.get());
GetImapDeleteModel(nsnull); GetImapDeleteModel(nsnull);

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

@ -1661,7 +1661,7 @@ NS_IMETHODIMP nsImapIncomingServer::OnlineFolderRename(nsIMsgWindow *msgWindow,
if (NS_SUCCEEDED(rv)) if (NS_SUCCEEDED(rv))
{ {
nsCOMPtr <nsIAtom> folderRenameAtom; nsCOMPtr <nsIAtom> folderRenameAtom;
folderRenameAtom = getter_AddRefs(NS_NewAtom("RenameCompleted")); folderRenameAtom = do_GetAtom("RenameCompleted");
newFolder->NotifyFolderEvent(folderRenameAtom); newFolder->NotifyFolderEvent(folderRenameAtom);
} }
} }

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

@ -914,13 +914,13 @@ NS_IMETHODIMP nsImapMailFolder::CreateClientSubfolderInfo(const char *folderName
if(childSupports && NS_SUCCEEDED(rv)) if(childSupports && NS_SUCCEEDED(rv))
{ {
NotifyItemAdded(folderSupports, childSupports, "folderView"); NotifyItemAdded(folderSupports, childSupports, "folderView");
folderCreateAtom = getter_AddRefs(NS_NewAtom("FolderCreateCompleted")); folderCreateAtom = do_GetAtom("FolderCreateCompleted");
child->NotifyFolderEvent(folderCreateAtom); child->NotifyFolderEvent(folderCreateAtom);
} }
} }
else else
{ {
folderCreateAtom = getter_AddRefs(NS_NewAtom("FolderCreateFailed")); folderCreateAtom = do_GetAtom("FolderCreateFailed");
NotifyFolderEvent(folderCreateAtom); NotifyFolderEvent(folderCreateAtom);
} }
} }
@ -4441,7 +4441,7 @@ nsImapMailFolder::OnStopRunningUrl(nsIURI *aUrl, nsresult aExitCode)
if (NS_FAILED(aExitCode)) if (NS_FAILED(aExitCode))
{ {
nsCOMPtr <nsIAtom> folderRenameAtom; nsCOMPtr <nsIAtom> folderRenameAtom;
folderRenameAtom = getter_AddRefs(NS_NewAtom("RenameCompleted")); folderRenameAtom = do_GetAtom("RenameCompleted");
NotifyFolderEvent(folderRenameAtom); NotifyFolderEvent(folderRenameAtom);
} }
break; break;
@ -4467,7 +4467,7 @@ nsImapMailFolder::OnStopRunningUrl(nsIURI *aUrl, nsresult aExitCode)
if (NS_FAILED(aExitCode)) //if success notification already done if (NS_FAILED(aExitCode)) //if success notification already done
{ {
nsCOMPtr <nsIAtom> folderCreateAtom; nsCOMPtr <nsIAtom> folderCreateAtom;
folderCreateAtom = getter_AddRefs(NS_NewAtom("FolderCreateFailed")); folderCreateAtom = do_GetAtom("FolderCreateFailed");
NotifyFolderEvent(folderCreateAtom); NotifyFolderEvent(folderCreateAtom);
} }
break; break;

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

@ -1326,7 +1326,7 @@ NS_IMETHODIMP nsMsgLocalMailFolder::Rename(const PRUnichar *aNewName, nsIMsgWind
NotifyItemAdded(parentSupports, newFolderSupports, "folderView"); NotifyItemAdded(parentSupports, newFolderSupports, "folderView");
} }
} }
folderRenameAtom = getter_AddRefs(NS_NewAtom("RenameCompleted")); folderRenameAtom = do_GetAtom("RenameCompleted");
newFolder->NotifyFolderEvent(folderRenameAtom); newFolder->NotifyFolderEvent(folderRenameAtom);
} }
} }
@ -3446,7 +3446,7 @@ nsMsgLocalMailFolder::NotifyCompactCompleted()
{ {
(void) RefreshSizeOnDisk(); (void) RefreshSizeOnDisk();
nsCOMPtr <nsIAtom> compactCompletedAtom; nsCOMPtr <nsIAtom> compactCompletedAtom;
compactCompletedAtom = getter_AddRefs(NS_NewAtom("CompactCompleted")); compactCompletedAtom = do_GetAtom("CompactCompleted");
NotifyFolderEvent(compactCompletedAtom); NotifyFolderEvent(compactCompletedAtom);
return NS_OK; return NS_OK;
} }

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

@ -114,8 +114,8 @@ nsNntpIncomingServer::nsNntpIncomingServer() : nsMsgLineBuffer(nsnull, PR_FALSE)
mLastUpdatedTime = 0; mLastUpdatedTime = 0;
// these atoms are used for subscribe search // these atoms are used for subscribe search
mSubscribedAtom = getter_AddRefs(NS_NewAtom("subscribed")); mSubscribedAtom = do_GetAtom("subscribed");
mNntpAtom = getter_AddRefs(NS_NewAtom("nntp")); mNntpAtom = do_GetAtom("nntp");
// our filters are on the server, they are on a per newsgroup basis // our filters are on the server, they are on a per newsgroup basis
// but this will make the filter UI enable for news accounts // but this will make the filter UI enable for news accounts

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

@ -133,10 +133,10 @@ nsRDFXMLSerializer::Init(nsIRDFDataSource* aDataSource)
// Add the ``RDF'' prefix, by default. // Add the ``RDF'' prefix, by default.
nsCOMPtr<nsIAtom> prefix; nsCOMPtr<nsIAtom> 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#")); 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#")); AddNameSpace(prefix, NS_LITERAL_STRING("http://home.netscape.com/NC-rdf#"));
return NS_OK; return NS_OK;
@ -998,7 +998,7 @@ nsRDFXMLSerializer::EnsureNameSpaceFor(nsIRDFResource* aResource)
aResource->GetValueConst(&s); aResource->GetValueConst(&s);
printf("*** Creating namespace for %s\n", s); printf("*** Creating namespace for %s\n", s);
#endif #endif
nsCOMPtr<nsIAtom> prefix = getter_AddRefs(NS_NewAtom(nameSpacePrefix)); nsCOMPtr<nsIAtom> prefix = do_GetAtom(nameSpacePrefix);
mNameSpaces.Put(nameSpaceURI, prefix); mNameSpaces.Put(nameSpaceURI, prefix);
} }

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

@ -179,12 +179,12 @@ nsWebCrawler::nsWebCrawler(nsViewerApp* aViewer)
mDelay = 200 /*msec*/; // XXXwaterson straigt outta my arse mDelay = 200 /*msec*/; // XXXwaterson straigt outta my arse
mMaxPages = -1; mMaxPages = -1;
mRecord = nsnull; mRecord = nsnull;
mLinkTag = getter_AddRefs(NS_NewAtom("a")); mLinkTag = do_GetAtom("a");
mFrameTag = getter_AddRefs(NS_NewAtom("frame")); mFrameTag = do_GetAtom("frame");
mIFrameTag = getter_AddRefs(NS_NewAtom("iframe")); mIFrameTag = do_GetAtom("iframe");
mHrefAttr = getter_AddRefs(NS_NewAtom("href")); mHrefAttr = do_GetAtom("href");
mSrcAttr = getter_AddRefs(NS_NewAtom("src")); mSrcAttr = do_GetAtom("src");
mBaseHrefAttr = getter_AddRefs(NS_NewAtom("_base_href")); mBaseHrefAttr = do_GetAtom("_base_href");
mVisited = new AtomHashTable(); mVisited = new AtomHashTable();
mVerbose = nsnull; mVerbose = nsnull;
LL_I2L(mStartLoad, 0); LL_I2L(mStartLoad, 0);
@ -772,7 +772,7 @@ nsWebCrawler::FindURLsIn(nsIDocument* aDocument, nsIContent* aNode)
nsresult rv; nsresult rv;
rv = NS_MakeAbsoluteURI(absURLSpec, src, docURL); rv = NS_MakeAbsoluteURI(absURLSpec, src, docURL);
if (NS_OK == rv) { if (NS_OK == rv) {
nsCOMPtr<nsIAtom> urlAtom = getter_AddRefs(NS_NewAtom(absURLSpec)); nsCOMPtr<nsIAtom> urlAtom = do_GetAtom(absURLSpec);
if (0 == mVisited->Get(urlAtom)) { if (0 == mVisited->Get(urlAtom)) {
// Remember the URL as visited so that we don't go there again // Remember the URL as visited so that we don't go there again
mVisited->Put(urlAtom, "visited"); mVisited->Put(urlAtom, "visited");

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

@ -133,8 +133,8 @@ nsFileView::~nsFileView()
nsresult nsresult
nsFileView::Init() nsFileView::Init()
{ {
mDirectoryAtom = dont_AddRef(NS_NewAtom("directory")); mDirectoryAtom = do_GetAtom("directory");
mFileAtom = dont_AddRef(NS_NewAtom("file")); mFileAtom = do_GetAtom("file");
NS_NewISupportsArray(getter_AddRefs(mFileList)); NS_NewISupportsArray(getter_AddRefs(mFileList));
NS_NewISupportsArray(getter_AddRefs(mDirList)); NS_NewISupportsArray(getter_AddRefs(mDirList));
NS_NewISupportsArray(getter_AddRefs(mFilteredFiles)); NS_NewISupportsArray(getter_AddRefs(mFilteredFiles));