diff --git a/mozilla/content/events/src/nsEventStateManager.cpp b/mozilla/content/events/src/nsEventStateManager.cpp index 8d80c83b32c..65f0b8fdcd4 100644 --- a/mozilla/content/events/src/nsEventStateManager.cpp +++ b/mozilla/content/events/src/nsEventStateManager.cpp @@ -428,7 +428,7 @@ nsEventStateManager::ShiftFocus() if (nsnull == mDocument) { nsCOMPtr presShell; mPresContext->GetShell(getter_AddRefs(presShell)); - if (nsnull != presShell) { + if (presShell) { presShell->GetDocument(&mDocument); if (nsnull == mDocument) { return; diff --git a/mozilla/content/html/content/src/nsHTMLBodyElement.cpp b/mozilla/content/html/content/src/nsHTMLBodyElement.cpp index 540b5b99c67..8699139d98f 100644 --- a/mozilla/content/html/content/src/nsHTMLBodyElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLBodyElement.cpp @@ -653,10 +653,10 @@ MapAttributesInto(nsIHTMLAttributes* aAttributes, nsCOMPtr presShell; aPresContext->GetShell(getter_AddRefs(presShell)); - if (nsnull != presShell) { + if (presShell) { nsCOMPtr doc; presShell->GetDocument(getter_AddRefs(doc)); - if (nsnull != doc) { + if (doc) { nsIHTMLContentContainer* htmlContainer; if (NS_OK == doc->QueryInterface(kIHTMLContentContainerIID, (void**)&htmlContainer)) { diff --git a/mozilla/content/html/content/src/nsHTMLFontElement.cpp b/mozilla/content/html/content/src/nsHTMLFontElement.cpp index c29a9fc1034..8cbea837c54 100644 --- a/mozilla/content/html/content/src/nsHTMLFontElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLFontElement.cpp @@ -211,7 +211,7 @@ MapAttributesInto(nsIHTMLAttributes* aAttributes, nsCOMPtr dc; aPresContext->GetDeviceContext(getter_AddRefs(dc)); - if (nsnull != dc) { + if (dc) { nsAutoString familyList; value.GetStringValue(familyList); diff --git a/mozilla/content/html/content/src/nsHTMLFormElement.cpp b/mozilla/content/html/content/src/nsHTMLFormElement.cpp index de1ed08139e..1766b2d131d 100644 --- a/mozilla/content/html/content/src/nsHTMLFormElement.cpp +++ b/mozilla/content/html/content/src/nsHTMLFormElement.cpp @@ -284,7 +284,7 @@ nsHTMLFormElement::Submit() if ((NS_OK == result) && formMan) { nsCOMPtr context; shell->GetPresContext(getter_AddRefs(context)); - if (nsnull != context) { + if (context) { // XXX We're currently passing in null for the frame. // It works for now, but might not always // be correct. In the future, we might not need the diff --git a/mozilla/content/html/document/src/nsHTMLContentSink.cpp b/mozilla/content/html/document/src/nsHTMLContentSink.cpp index 1bbec34bd6c..b830ea4fc97 100644 --- a/mozilla/content/html/document/src/nsHTMLContentSink.cpp +++ b/mozilla/content/html/document/src/nsHTMLContentSink.cpp @@ -1460,10 +1460,10 @@ HTMLContentSink::DidBuildModel(PRInt32 aQualityLevel) PRInt32 i, ns = mDocument->GetNumberOfShells(); for (i = 0; i < ns; i++) { nsCOMPtr shell(mDocument->GetShellAt(i)); - if (nsnull != shell) { + if (shell) { nsCOMPtr vm; nsresult rv = shell->GetViewManager(getter_AddRefs(vm)); - if(NS_SUCCEEDED(rv) && (nsnull != vm)) { + if(NS_SUCCEEDED(rv) && vm) { vm->SetQuality(nsContentQuality(aQualityLevel)); } } @@ -1972,7 +1972,7 @@ HTMLContentSink::StartLayout() PRInt32 i, ns = mDocument->GetNumberOfShells(); for (i = 0; i < ns; i++) { nsCOMPtr shell(mDocument->GetShellAt(i)); - if (nsnull != shell) { + if (shell) { // Make shell an observer for next time shell->BeginObservingDocument(); @@ -1986,7 +1986,7 @@ HTMLContentSink::StartLayout() // Now trigger a refresh nsCOMPtr vm; shell->GetViewManager(getter_AddRefs(vm)); - if (nsnull != vm) { + if (vm) { vm->EnableRefresh(); } } @@ -2008,10 +2008,10 @@ HTMLContentSink::StartLayout() PRInt32 i, ns = mDocument->GetNumberOfShells(); for (i = 0; i < ns; i++) { nsCOMPtr shell(mDocument->GetShellAt(i)); - if (nsnull != shell) { + if (shell) { nsCOMPtr vm; shell->GetViewManager(getter_AddRefs(vm)); - if (nsnull != vm) { + if (vm) { nsIView* rootView = nsnull; vm->GetRootView(rootView); if (nsnull != rootView) { @@ -2039,13 +2039,13 @@ HTMLContentSink::ScrollToRef() PRInt32 i, ns = mDocument->GetNumberOfShells(); for (i = 0; i < ns; i++) { nsCOMPtr shell(mDocument->GetShellAt(i)); - if (nsnull != shell) { + if (shell) { nsIFrame* frame; shell->GetPrimaryFrameFor(mRefContent, &frame); if (nsnull != frame) { nsCOMPtr vm; shell->GetViewManager(getter_AddRefs(vm)); - if (nsnull != vm) { + if (vm) { nsIView* viewportView = nsnull; vm->GetRootView(viewportView); if (nsnull != viewportView) { diff --git a/mozilla/content/html/document/src/nsHTMLDocument.cpp b/mozilla/content/html/document/src/nsHTMLDocument.cpp index 31f5f00efe2..c1ead9bc866 100644 --- a/mozilla/content/html/document/src/nsHTMLDocument.cpp +++ b/mozilla/content/html/document/src/nsHTMLDocument.cpp @@ -525,7 +525,7 @@ nsHTMLDocument::InsertStyleSheetAt(nsIStyleSheet* aSheet, PRInt32 aIndex, PRBool nsIPresShell* shell = (nsIPresShell*)mPresShells.ElementAt(index); nsCOMPtr set; shell->GetStyleSet(getter_AddRefs(set)); - if (nsnull != set) { + if (set) { set->AddDocStyleSheet(aSheet, this); } } diff --git a/mozilla/content/html/document/src/nsImageDocument.cpp b/mozilla/content/html/document/src/nsImageDocument.cpp index 8422dba7312..d42c2e3d4b0 100644 --- a/mozilla/content/html/document/src/nsImageDocument.cpp +++ b/mozilla/content/html/document/src/nsImageDocument.cpp @@ -221,7 +221,7 @@ nsImageDocument::StartImageLoad(nsIURL* aURL, nsIStreamListener*& aListener) if (nsnull != shell) { nsCOMPtr cx; shell->GetPresContext(getter_AddRefs(cx)); - if (nsnull != cx) { + if (cx) { nsIImageGroup* group = nsnull; cx->GetImageGroup(&group); if (nsnull != group) { @@ -327,7 +327,7 @@ nsImageDocument::StartLayout() // XXX It's unfortunate that this has to be here nsCOMPtr vm; shell->GetViewManager(getter_AddRefs(vm)); - if (nsnull != vm) { + if (vm) { vm->EnableRefresh(); } diff --git a/mozilla/content/html/style/src/nsCSSStyleRule.cpp b/mozilla/content/html/style/src/nsCSSStyleRule.cpp index 32d9206d16d..12d291d2af6 100644 --- a/mozilla/content/html/style/src/nsCSSStyleRule.cpp +++ b/mozilla/content/html/style/src/nsCSSStyleRule.cpp @@ -1169,7 +1169,7 @@ void MapDeclarationInto(nsICSSDeclaration* aDeclaration, if (eCSSUnit_String == ourFont->mFamily.GetUnit()) { nsCOMPtr dc; aPresContext->GetDeviceContext(getter_AddRefs(dc)); - if (nsnull != dc) { + if (dc) { nsAutoString familyList; ourFont->mFamily.GetStringValue(familyList); diff --git a/mozilla/content/xml/document/src/nsXMLContentSink.cpp b/mozilla/content/xml/document/src/nsXMLContentSink.cpp index cff7be3cfc3..70a1da0d56d 100644 --- a/mozilla/content/xml/document/src/nsXMLContentSink.cpp +++ b/mozilla/content/xml/document/src/nsXMLContentSink.cpp @@ -230,7 +230,7 @@ nsXMLContentSink::DidBuildModel(PRInt32 aQualityLevel) PRInt32 i, ns = mDocument->GetNumberOfShells(); for (i = 0; i < ns; i++) { nsCOMPtr shell(mDocument->GetShellAt(i)); - if (nsnull != shell) { + if (shell) { nsCOMPtr vm; shell->GetViewManager(getter_AddRefs(vm)); if(vm) { @@ -1323,7 +1323,7 @@ nsXMLContentSink::StartLayout() // Now trigger a refresh nsCOMPtr vm; shell->GetViewManager(getter_AddRefs(vm)); - if (nsnull != vm) { + if (vm) { vm->EnableRefresh(); } @@ -1356,7 +1356,7 @@ nsXMLContentSink::StartLayout() if (nsnull != shell) { nsCOMPtrvm; shell->GetViewManager(getter_AddRefs(vm)); - if (nsnull != vm) { + if (vm) { nsIView* rootView = nsnull; vm->GetRootView(rootView); if (nsnull != rootView) { diff --git a/mozilla/content/xul/document/src/nsXULDocument.cpp b/mozilla/content/xul/document/src/nsXULDocument.cpp index d87a59ccb51..2725d3227a0 100644 --- a/mozilla/content/xul/document/src/nsXULDocument.cpp +++ b/mozilla/content/xul/document/src/nsXULDocument.cpp @@ -1145,7 +1145,7 @@ XULDocumentImpl::AddStyleSheet(nsIStyleSheet* aSheet) nsIPresShell* shell = NS_STATIC_CAST(nsIPresShell*, mPresShells[index]); nsCOMPtr set; shell->GetStyleSet(getter_AddRefs(set)); - if (nsnull != set) { + if (set) { set->AddDocStyleSheet(aSheet, this); } } @@ -1174,7 +1174,7 @@ XULDocumentImpl::SetStyleSheetDisabledState(nsIStyleSheet* aSheet, nsIPresShell* shell = (nsIPresShell*)mPresShells.ElementAt(index); nsCOMPtr set; shell->GetStyleSet(getter_AddRefs(set)); - if (nsnull != set) { + if (set) { if (aDisabled) { set->RemoveDocStyleSheet(aSheet); } @@ -2150,7 +2150,7 @@ XULDocumentImpl::StartLayout(void) // Now trigger a refresh nsCOMPtr vm; shell->GetViewManager(getter_AddRefs(vm)); - if (nsnull != vm) { + if (vm) { vm->EnableRefresh(); } diff --git a/mozilla/layout/base/nsPresContext.cpp b/mozilla/layout/base/nsPresContext.cpp index 3d9d54730b6..6466c966a86 100644 --- a/mozilla/layout/base/nsPresContext.cpp +++ b/mozilla/layout/base/nsPresContext.cpp @@ -242,8 +242,8 @@ nsPresContext::SetShell(nsIPresShell* aShell) if (nsnull != mShell) { nsCOMPtr doc; if (NS_SUCCEEDED(mShell->GetDocument(getter_AddRefs(doc)))) { - NS_ASSERTION(nsnull != doc, "expect document here"); - if (nsnull != doc) { + NS_ASSERTION(doc, "expect document here"); + if (doc) { doc->GetBaseURL(mBaseURL); } } @@ -320,7 +320,7 @@ nsPresContext::ResolveStyleContextFor(nsIContent* aContent, nsCOMPtr set; nsresult rv = mShell->GetStyleSet(getter_AddRefs(set)); if (NS_SUCCEEDED(rv)) { - if (nsnull != set) { + if (set) { result = set->ResolveStyleFor(this, aContent, aParentContext, aForceUnique); if (nsnull == result) { @@ -348,7 +348,7 @@ nsPresContext::ResolvePseudoStyleContextFor(nsIContent* aParentContent, nsCOMPtr set; nsresult rv = mShell->GetStyleSet(getter_AddRefs(set)); if (NS_SUCCEEDED(rv)) { - if (nsnull != set) { + if (set) { result = set->ResolvePseudoStyleFor(this, aParentContent, aPseudoTag, aParentContext, aForceUnique); if (nsnull == result) { @@ -376,7 +376,7 @@ nsPresContext::ProbePseudoStyleContextFor(nsIContent* aParentContent, nsCOMPtr set; nsresult rv = mShell->GetStyleSet(getter_AddRefs(set)); if (NS_SUCCEEDED(rv)) { - if (nsnull != set) { + if (set) { result = set->ProbePseudoStyleFor(this, aParentContent, aPseudoTag, aParentContext, aForceUnique); } diff --git a/mozilla/layout/base/nsPresShell.cpp b/mozilla/layout/base/nsPresShell.cpp index 93d4ef1b8d5..1e50e9f25c0 100644 --- a/mozilla/layout/base/nsPresShell.cpp +++ b/mozilla/layout/base/nsPresShell.cpp @@ -1160,7 +1160,7 @@ PresShell::CreateRenderingContext(nsIFrame *aFrame, nsIRenderingContext* result = nsnull; rv = mPresContext->GetDeviceContext(getter_AddRefs(dx)); - if (NS_SUCCEEDED(rv) && (nsnull != dx)) { + if (NS_SUCCEEDED(rv) && dx) { if (nsnull != view) { rv = dx->CreateRenderingContext(view, result); } diff --git a/mozilla/layout/base/src/nsPresContext.cpp b/mozilla/layout/base/src/nsPresContext.cpp index 3d9d54730b6..6466c966a86 100644 --- a/mozilla/layout/base/src/nsPresContext.cpp +++ b/mozilla/layout/base/src/nsPresContext.cpp @@ -242,8 +242,8 @@ nsPresContext::SetShell(nsIPresShell* aShell) if (nsnull != mShell) { nsCOMPtr doc; if (NS_SUCCEEDED(mShell->GetDocument(getter_AddRefs(doc)))) { - NS_ASSERTION(nsnull != doc, "expect document here"); - if (nsnull != doc) { + NS_ASSERTION(doc, "expect document here"); + if (doc) { doc->GetBaseURL(mBaseURL); } } @@ -320,7 +320,7 @@ nsPresContext::ResolveStyleContextFor(nsIContent* aContent, nsCOMPtr set; nsresult rv = mShell->GetStyleSet(getter_AddRefs(set)); if (NS_SUCCEEDED(rv)) { - if (nsnull != set) { + if (set) { result = set->ResolveStyleFor(this, aContent, aParentContext, aForceUnique); if (nsnull == result) { @@ -348,7 +348,7 @@ nsPresContext::ResolvePseudoStyleContextFor(nsIContent* aParentContent, nsCOMPtr set; nsresult rv = mShell->GetStyleSet(getter_AddRefs(set)); if (NS_SUCCEEDED(rv)) { - if (nsnull != set) { + if (set) { result = set->ResolvePseudoStyleFor(this, aParentContent, aPseudoTag, aParentContext, aForceUnique); if (nsnull == result) { @@ -376,7 +376,7 @@ nsPresContext::ProbePseudoStyleContextFor(nsIContent* aParentContent, nsCOMPtr set; nsresult rv = mShell->GetStyleSet(getter_AddRefs(set)); if (NS_SUCCEEDED(rv)) { - if (nsnull != set) { + if (set) { result = set->ProbePseudoStyleFor(this, aParentContent, aPseudoTag, aParentContext, aForceUnique); } diff --git a/mozilla/layout/base/src/nsRangeList.cpp b/mozilla/layout/base/src/nsRangeList.cpp index 39d79922c16..ea5a22eacda 100644 --- a/mozilla/layout/base/src/nsRangeList.cpp +++ b/mozilla/layout/base/src/nsRangeList.cpp @@ -753,7 +753,7 @@ nsRangeList::TakeFocus(nsIFocusTracker *aTracker, nsIFrame *aFrame, PRInt32 aOff nsCOMPtroldContent; if (NS_SUCCEEDED(frame->GetContent(getter_AddRefs(oldContent))) && oldContent){ nsCOMPtr oldDomNode(oldContent); - if ((nsnull != oldDomNode) && (oldDomNode == GetFocusNode())) { + if (oldDomNode && (oldDomNode == GetFocusNode())) { nsCOMPtr anchorContent; if (NS_SUCCEEDED(anchor->GetContent(getter_AddRefs(anchorContent))) && anchorContent){ nsCOMPtranchorDomNode(anchorContent); diff --git a/mozilla/layout/events/src/nsEventStateManager.cpp b/mozilla/layout/events/src/nsEventStateManager.cpp index 8d80c83b32c..65f0b8fdcd4 100644 --- a/mozilla/layout/events/src/nsEventStateManager.cpp +++ b/mozilla/layout/events/src/nsEventStateManager.cpp @@ -428,7 +428,7 @@ nsEventStateManager::ShiftFocus() if (nsnull == mDocument) { nsCOMPtr presShell; mPresContext->GetShell(getter_AddRefs(presShell)); - if (nsnull != presShell) { + if (presShell) { presShell->GetDocument(&mDocument); if (nsnull == mDocument) { return; diff --git a/mozilla/layout/forms/nsFormControlFrame.cpp b/mozilla/layout/forms/nsFormControlFrame.cpp index 46c7be5ea0c..77aaa107484 100644 --- a/mozilla/layout/forms/nsFormControlFrame.cpp +++ b/mozilla/layout/forms/nsFormControlFrame.cpp @@ -226,7 +226,7 @@ nsFormControlFrame::Reflow(nsIPresContext& aPresContext, PRBool requiresWidget = PR_TRUE; // Checkto see if the device context supports widgets at all - if (nsnull != dx) { + if (dx) { dx->SupportsNativeWidgets(requiresWidget); } diff --git a/mozilla/layout/forms/nsListControlFrame.cpp b/mozilla/layout/forms/nsListControlFrame.cpp index d6fabda2f7c..4a5159c4b73 100644 --- a/mozilla/layout/forms/nsListControlFrame.cpp +++ b/mozilla/layout/forms/nsListControlFrame.cpp @@ -841,7 +841,7 @@ nsListControlFrame::GetScrollBarDimensions(nsIPresContext& aPresContext, float scale; nsCOMPtr dx; aPresContext.GetDeviceContext(getter_AddRefs(dx)); - if (nsnull != dx) { + if (dx) { float sbWidth; float sbHeight; dx->GetCanonicalPixelScale(scale); diff --git a/mozilla/layout/forms/nsTextControlFrame.cpp b/mozilla/layout/forms/nsTextControlFrame.cpp index c9f9f48f57a..7467b68a8dd 100644 --- a/mozilla/layout/forms/nsTextControlFrame.cpp +++ b/mozilla/layout/forms/nsTextControlFrame.cpp @@ -273,7 +273,7 @@ nsTextControlFrame::GetDesiredSize(nsIPresContext* aPresContext, aPresContext->GetPixelsToTwips(&p2t); nsCOMPtr dx; aPresContext->GetDeviceContext(getter_AddRefs(dx)); - if (nsnull != dx) { + if (dx) { float sbWidth; float sbHeight; dx->GetCanonicalPixelScale(scale); diff --git a/mozilla/layout/generic/nsBulletFrame.cpp b/mozilla/layout/generic/nsBulletFrame.cpp index 68b5e12684d..7d9dea2ae88 100644 --- a/mozilla/layout/generic/nsBulletFrame.cpp +++ b/mozilla/layout/generic/nsBulletFrame.cpp @@ -315,7 +315,7 @@ UpdateBulletCB(nsIPresContext& aPresContext, nsIFrame* aFrame, PRIntn aStatus) // frame. nsCOMPtr shell; rv = aPresContext.GetShell(getter_AddRefs(shell)); - if (NS_SUCCEEDED(rv) && (nsnull != shell)) { + if (NS_SUCCEEDED(rv) && shell) { nsIReflowCommand* cmd; rv = NS_NewHTMLReflowCommand(&cmd, aFrame, nsIReflowCommand::ContentChanged); diff --git a/mozilla/layout/generic/nsFrame.cpp b/mozilla/layout/generic/nsFrame.cpp index 002861ff517..049a400328f 100644 --- a/mozilla/layout/generic/nsFrame.cpp +++ b/mozilla/layout/generic/nsFrame.cpp @@ -363,7 +363,7 @@ nsFrame::DeleteFrame(nsIPresContext& aPresContext) if (mState & NS_FRAME_EXTERNAL_REFERENCE) { nsCOMPtr shell; nsresult rv = aPresContext.GetShell(getter_AddRefs(shell)); - if (NS_SUCCEEDED(rv) && (nsnull != shell)) { + if (NS_SUCCEEDED(rv) && shell) { shell->ClearFrameRefs(this); } } @@ -594,10 +594,10 @@ nsFrame::DisplaySelection(nsIPresContext& aPresContext, PRBool isOkToTurnOn) nsCOMPtr shell; nsresult rv = aPresContext.GetShell(getter_AddRefs(shell)); - if (NS_SUCCEEDED(rv) && (nsnull != shell)) { + if (NS_SUCCEEDED(rv) && shell) { nsCOMPtr doc; rv = shell->GetDocument(getter_AddRefs(doc)); - if (NS_SUCCEEDED(rv) && (nsnull != doc)) { + if (NS_SUCCEEDED(rv) && doc) { result = doc->GetDisplaySelection(); if (isOkToTurnOn && !result) { doc->SetDisplaySelection(PR_TRUE); @@ -705,7 +705,7 @@ nsFrame::HandlePress(nsIPresContext& aPresContext, mDidDrag = PR_FALSE; nsCOMPtr shell; nsresult rv = aPresContext.GetShell(getter_AddRefs(shell)); - if (NS_SUCCEEDED(rv) && (nsnull != shell)) { + if (NS_SUCCEEDED(rv) && shell) { nsCOMPtr acx; rv = shell->CreateRenderingContext(this, getter_AddRefs(acx)); if (NS_SUCCEEDED(rv)){ @@ -923,7 +923,7 @@ NS_IMETHODIMP nsFrame::HandleDrag(nsIPresContext& aPresContext, mDidDrag = PR_FALSE; nsCOMPtr shell; nsresult rv = aPresContext.GetShell(getter_AddRefs(shell)); - if (NS_SUCCEEDED(rv) && (nsnull != shell)) { + if (NS_SUCCEEDED(rv) && shell) { nsCOMPtr acx; rv = shell->CreateRenderingContext(this, getter_AddRefs(acx)); if (NS_SUCCEEDED(rv)) { @@ -1348,7 +1348,7 @@ nsFrame::ContentChanged(nsIPresContext* aPresContext, { nsCOMPtr shell; nsresult rv = aPresContext->GetShell(getter_AddRefs(shell)); - if (NS_SUCCEEDED(rv) && (nsnull != shell)) { + if (NS_SUCCEEDED(rv) && shell) { nsIReflowCommand* reflowCmd; rv = NS_NewHTMLReflowCommand(&reflowCmd, this, nsIReflowCommand::ContentChanged); diff --git a/mozilla/layout/generic/nsHTMLReflowCommand.cpp b/mozilla/layout/generic/nsHTMLReflowCommand.cpp index c41c559501f..96d53c00cf9 100644 --- a/mozilla/layout/generic/nsHTMLReflowCommand.cpp +++ b/mozilla/layout/generic/nsHTMLReflowCommand.cpp @@ -145,7 +145,7 @@ NS_IMETHODIMP nsHTMLReflowCommand::Dispatch(nsIPresContext& aPresContext, #ifdef NS_DEBUG nsCOMPtr shell; aPresContext.GetShell(getter_AddRefs(shell)); - if (nsnull != shell) { + if (shell) { nsIFrame* rootFrame; shell->GetRootFrame(&rootFrame); NS_ASSERTION(rootFrame == root, "bad root frame"); diff --git a/mozilla/layout/generic/nsInlineFrame.cpp b/mozilla/layout/generic/nsInlineFrame.cpp index 1aeb0f59c38..db41fb8e2d2 100644 --- a/mozilla/layout/generic/nsInlineFrame.cpp +++ b/mozilla/layout/generic/nsInlineFrame.cpp @@ -451,7 +451,7 @@ nsInlineFrame::SetInitialChildList(nsIPresContext& aPresContext, } nsCOMPtr shell; nsresult rv = aPresContext.GetShell(getter_AddRefs(shell)); - if (NS_SUCCEEDED(rv) && (nsnull != shell)) { + if (NS_SUCCEEDED(rv) && shell) { rv = AppendFrames(aPresContext, *shell, aFrameList, PR_FALSE); } return rv; diff --git a/mozilla/layout/generic/nsLeafFrame.cpp b/mozilla/layout/generic/nsLeafFrame.cpp index 79c7803a3bb..ba0f3c79adc 100644 --- a/mozilla/layout/generic/nsLeafFrame.cpp +++ b/mozilla/layout/generic/nsLeafFrame.cpp @@ -115,7 +115,7 @@ nsLeafFrame::ContentChanged(nsIPresContext* aPresContext, if (NS_SUCCEEDED(rv)) { nsCOMPtr shell; rv = aPresContext->GetShell(getter_AddRefs(shell)); - if (NS_SUCCEEDED(rv) && (nsnull != shell)) { + if (NS_SUCCEEDED(rv) && shell) { shell->AppendReflowCommand(cmd); } NS_RELEASE(cmd); diff --git a/mozilla/layout/generic/nsTextFrame.cpp b/mozilla/layout/generic/nsTextFrame.cpp index 208a38bae5b..9ee3a71cbd6 100644 --- a/mozilla/layout/generic/nsTextFrame.cpp +++ b/mozilla/layout/generic/nsTextFrame.cpp @@ -512,7 +512,7 @@ TextFrame::ContentChanged(nsIPresContext* aPresContext, if (NS_SUCCEEDED(rv)) { nsCOMPtr shell; rv = aPresContext->GetShell(getter_AddRefs(shell)); - if (NS_SUCCEEDED(rv) && (nsnull != shell)) { + if (NS_SUCCEEDED(rv) && shell) { shell->AppendReflowCommand(cmd); NS_RELEASE(cmd); } diff --git a/mozilla/layout/html/base/src/nsBulletFrame.cpp b/mozilla/layout/html/base/src/nsBulletFrame.cpp index 68b5e12684d..7d9dea2ae88 100644 --- a/mozilla/layout/html/base/src/nsBulletFrame.cpp +++ b/mozilla/layout/html/base/src/nsBulletFrame.cpp @@ -315,7 +315,7 @@ UpdateBulletCB(nsIPresContext& aPresContext, nsIFrame* aFrame, PRIntn aStatus) // frame. nsCOMPtr shell; rv = aPresContext.GetShell(getter_AddRefs(shell)); - if (NS_SUCCEEDED(rv) && (nsnull != shell)) { + if (NS_SUCCEEDED(rv) && shell) { nsIReflowCommand* cmd; rv = NS_NewHTMLReflowCommand(&cmd, aFrame, nsIReflowCommand::ContentChanged); diff --git a/mozilla/layout/html/base/src/nsFrame.cpp b/mozilla/layout/html/base/src/nsFrame.cpp index 002861ff517..049a400328f 100644 --- a/mozilla/layout/html/base/src/nsFrame.cpp +++ b/mozilla/layout/html/base/src/nsFrame.cpp @@ -363,7 +363,7 @@ nsFrame::DeleteFrame(nsIPresContext& aPresContext) if (mState & NS_FRAME_EXTERNAL_REFERENCE) { nsCOMPtr shell; nsresult rv = aPresContext.GetShell(getter_AddRefs(shell)); - if (NS_SUCCEEDED(rv) && (nsnull != shell)) { + if (NS_SUCCEEDED(rv) && shell) { shell->ClearFrameRefs(this); } } @@ -594,10 +594,10 @@ nsFrame::DisplaySelection(nsIPresContext& aPresContext, PRBool isOkToTurnOn) nsCOMPtr shell; nsresult rv = aPresContext.GetShell(getter_AddRefs(shell)); - if (NS_SUCCEEDED(rv) && (nsnull != shell)) { + if (NS_SUCCEEDED(rv) && shell) { nsCOMPtr doc; rv = shell->GetDocument(getter_AddRefs(doc)); - if (NS_SUCCEEDED(rv) && (nsnull != doc)) { + if (NS_SUCCEEDED(rv) && doc) { result = doc->GetDisplaySelection(); if (isOkToTurnOn && !result) { doc->SetDisplaySelection(PR_TRUE); @@ -705,7 +705,7 @@ nsFrame::HandlePress(nsIPresContext& aPresContext, mDidDrag = PR_FALSE; nsCOMPtr shell; nsresult rv = aPresContext.GetShell(getter_AddRefs(shell)); - if (NS_SUCCEEDED(rv) && (nsnull != shell)) { + if (NS_SUCCEEDED(rv) && shell) { nsCOMPtr acx; rv = shell->CreateRenderingContext(this, getter_AddRefs(acx)); if (NS_SUCCEEDED(rv)){ @@ -923,7 +923,7 @@ NS_IMETHODIMP nsFrame::HandleDrag(nsIPresContext& aPresContext, mDidDrag = PR_FALSE; nsCOMPtr shell; nsresult rv = aPresContext.GetShell(getter_AddRefs(shell)); - if (NS_SUCCEEDED(rv) && (nsnull != shell)) { + if (NS_SUCCEEDED(rv) && shell) { nsCOMPtr acx; rv = shell->CreateRenderingContext(this, getter_AddRefs(acx)); if (NS_SUCCEEDED(rv)) { @@ -1348,7 +1348,7 @@ nsFrame::ContentChanged(nsIPresContext* aPresContext, { nsCOMPtr shell; nsresult rv = aPresContext->GetShell(getter_AddRefs(shell)); - if (NS_SUCCEEDED(rv) && (nsnull != shell)) { + if (NS_SUCCEEDED(rv) && shell) { nsIReflowCommand* reflowCmd; rv = NS_NewHTMLReflowCommand(&reflowCmd, this, nsIReflowCommand::ContentChanged); diff --git a/mozilla/layout/html/base/src/nsHTMLReflowCommand.cpp b/mozilla/layout/html/base/src/nsHTMLReflowCommand.cpp index c41c559501f..96d53c00cf9 100644 --- a/mozilla/layout/html/base/src/nsHTMLReflowCommand.cpp +++ b/mozilla/layout/html/base/src/nsHTMLReflowCommand.cpp @@ -145,7 +145,7 @@ NS_IMETHODIMP nsHTMLReflowCommand::Dispatch(nsIPresContext& aPresContext, #ifdef NS_DEBUG nsCOMPtr shell; aPresContext.GetShell(getter_AddRefs(shell)); - if (nsnull != shell) { + if (shell) { nsIFrame* rootFrame; shell->GetRootFrame(&rootFrame); NS_ASSERTION(rootFrame == root, "bad root frame"); diff --git a/mozilla/layout/html/base/src/nsInlineFrame.cpp b/mozilla/layout/html/base/src/nsInlineFrame.cpp index 1aeb0f59c38..db41fb8e2d2 100644 --- a/mozilla/layout/html/base/src/nsInlineFrame.cpp +++ b/mozilla/layout/html/base/src/nsInlineFrame.cpp @@ -451,7 +451,7 @@ nsInlineFrame::SetInitialChildList(nsIPresContext& aPresContext, } nsCOMPtr shell; nsresult rv = aPresContext.GetShell(getter_AddRefs(shell)); - if (NS_SUCCEEDED(rv) && (nsnull != shell)) { + if (NS_SUCCEEDED(rv) && shell) { rv = AppendFrames(aPresContext, *shell, aFrameList, PR_FALSE); } return rv; diff --git a/mozilla/layout/html/base/src/nsLeafFrame.cpp b/mozilla/layout/html/base/src/nsLeafFrame.cpp index 79c7803a3bb..ba0f3c79adc 100644 --- a/mozilla/layout/html/base/src/nsLeafFrame.cpp +++ b/mozilla/layout/html/base/src/nsLeafFrame.cpp @@ -115,7 +115,7 @@ nsLeafFrame::ContentChanged(nsIPresContext* aPresContext, if (NS_SUCCEEDED(rv)) { nsCOMPtr shell; rv = aPresContext->GetShell(getter_AddRefs(shell)); - if (NS_SUCCEEDED(rv) && (nsnull != shell)) { + if (NS_SUCCEEDED(rv) && shell) { shell->AppendReflowCommand(cmd); } NS_RELEASE(cmd); diff --git a/mozilla/layout/html/base/src/nsPresShell.cpp b/mozilla/layout/html/base/src/nsPresShell.cpp index 93d4ef1b8d5..1e50e9f25c0 100644 --- a/mozilla/layout/html/base/src/nsPresShell.cpp +++ b/mozilla/layout/html/base/src/nsPresShell.cpp @@ -1160,7 +1160,7 @@ PresShell::CreateRenderingContext(nsIFrame *aFrame, nsIRenderingContext* result = nsnull; rv = mPresContext->GetDeviceContext(getter_AddRefs(dx)); - if (NS_SUCCEEDED(rv) && (nsnull != dx)) { + if (NS_SUCCEEDED(rv) && dx) { if (nsnull != view) { rv = dx->CreateRenderingContext(view, result); } diff --git a/mozilla/layout/html/base/src/nsTextFrame.cpp b/mozilla/layout/html/base/src/nsTextFrame.cpp index 208a38bae5b..9ee3a71cbd6 100644 --- a/mozilla/layout/html/base/src/nsTextFrame.cpp +++ b/mozilla/layout/html/base/src/nsTextFrame.cpp @@ -512,7 +512,7 @@ TextFrame::ContentChanged(nsIPresContext* aPresContext, if (NS_SUCCEEDED(rv)) { nsCOMPtr shell; rv = aPresContext->GetShell(getter_AddRefs(shell)); - if (NS_SUCCEEDED(rv) && (nsnull != shell)) { + if (NS_SUCCEEDED(rv) && shell) { shell->AppendReflowCommand(cmd); NS_RELEASE(cmd); } diff --git a/mozilla/layout/html/content/src/nsHTMLBodyElement.cpp b/mozilla/layout/html/content/src/nsHTMLBodyElement.cpp index 540b5b99c67..8699139d98f 100644 --- a/mozilla/layout/html/content/src/nsHTMLBodyElement.cpp +++ b/mozilla/layout/html/content/src/nsHTMLBodyElement.cpp @@ -653,10 +653,10 @@ MapAttributesInto(nsIHTMLAttributes* aAttributes, nsCOMPtr presShell; aPresContext->GetShell(getter_AddRefs(presShell)); - if (nsnull != presShell) { + if (presShell) { nsCOMPtr doc; presShell->GetDocument(getter_AddRefs(doc)); - if (nsnull != doc) { + if (doc) { nsIHTMLContentContainer* htmlContainer; if (NS_OK == doc->QueryInterface(kIHTMLContentContainerIID, (void**)&htmlContainer)) { diff --git a/mozilla/layout/html/content/src/nsHTMLFontElement.cpp b/mozilla/layout/html/content/src/nsHTMLFontElement.cpp index c29a9fc1034..8cbea837c54 100644 --- a/mozilla/layout/html/content/src/nsHTMLFontElement.cpp +++ b/mozilla/layout/html/content/src/nsHTMLFontElement.cpp @@ -211,7 +211,7 @@ MapAttributesInto(nsIHTMLAttributes* aAttributes, nsCOMPtr dc; aPresContext->GetDeviceContext(getter_AddRefs(dc)); - if (nsnull != dc) { + if (dc) { nsAutoString familyList; value.GetStringValue(familyList); diff --git a/mozilla/layout/html/content/src/nsHTMLFormElement.cpp b/mozilla/layout/html/content/src/nsHTMLFormElement.cpp index de1ed08139e..1766b2d131d 100644 --- a/mozilla/layout/html/content/src/nsHTMLFormElement.cpp +++ b/mozilla/layout/html/content/src/nsHTMLFormElement.cpp @@ -284,7 +284,7 @@ nsHTMLFormElement::Submit() if ((NS_OK == result) && formMan) { nsCOMPtr context; shell->GetPresContext(getter_AddRefs(context)); - if (nsnull != context) { + if (context) { // XXX We're currently passing in null for the frame. // It works for now, but might not always // be correct. In the future, we might not need the diff --git a/mozilla/layout/html/document/src/nsHTMLContentSink.cpp b/mozilla/layout/html/document/src/nsHTMLContentSink.cpp index 1bbec34bd6c..b830ea4fc97 100644 --- a/mozilla/layout/html/document/src/nsHTMLContentSink.cpp +++ b/mozilla/layout/html/document/src/nsHTMLContentSink.cpp @@ -1460,10 +1460,10 @@ HTMLContentSink::DidBuildModel(PRInt32 aQualityLevel) PRInt32 i, ns = mDocument->GetNumberOfShells(); for (i = 0; i < ns; i++) { nsCOMPtr shell(mDocument->GetShellAt(i)); - if (nsnull != shell) { + if (shell) { nsCOMPtr vm; nsresult rv = shell->GetViewManager(getter_AddRefs(vm)); - if(NS_SUCCEEDED(rv) && (nsnull != vm)) { + if(NS_SUCCEEDED(rv) && vm) { vm->SetQuality(nsContentQuality(aQualityLevel)); } } @@ -1972,7 +1972,7 @@ HTMLContentSink::StartLayout() PRInt32 i, ns = mDocument->GetNumberOfShells(); for (i = 0; i < ns; i++) { nsCOMPtr shell(mDocument->GetShellAt(i)); - if (nsnull != shell) { + if (shell) { // Make shell an observer for next time shell->BeginObservingDocument(); @@ -1986,7 +1986,7 @@ HTMLContentSink::StartLayout() // Now trigger a refresh nsCOMPtr vm; shell->GetViewManager(getter_AddRefs(vm)); - if (nsnull != vm) { + if (vm) { vm->EnableRefresh(); } } @@ -2008,10 +2008,10 @@ HTMLContentSink::StartLayout() PRInt32 i, ns = mDocument->GetNumberOfShells(); for (i = 0; i < ns; i++) { nsCOMPtr shell(mDocument->GetShellAt(i)); - if (nsnull != shell) { + if (shell) { nsCOMPtr vm; shell->GetViewManager(getter_AddRefs(vm)); - if (nsnull != vm) { + if (vm) { nsIView* rootView = nsnull; vm->GetRootView(rootView); if (nsnull != rootView) { @@ -2039,13 +2039,13 @@ HTMLContentSink::ScrollToRef() PRInt32 i, ns = mDocument->GetNumberOfShells(); for (i = 0; i < ns; i++) { nsCOMPtr shell(mDocument->GetShellAt(i)); - if (nsnull != shell) { + if (shell) { nsIFrame* frame; shell->GetPrimaryFrameFor(mRefContent, &frame); if (nsnull != frame) { nsCOMPtr vm; shell->GetViewManager(getter_AddRefs(vm)); - if (nsnull != vm) { + if (vm) { nsIView* viewportView = nsnull; vm->GetRootView(viewportView); if (nsnull != viewportView) { diff --git a/mozilla/layout/html/document/src/nsHTMLDocument.cpp b/mozilla/layout/html/document/src/nsHTMLDocument.cpp index 31f5f00efe2..c1ead9bc866 100644 --- a/mozilla/layout/html/document/src/nsHTMLDocument.cpp +++ b/mozilla/layout/html/document/src/nsHTMLDocument.cpp @@ -525,7 +525,7 @@ nsHTMLDocument::InsertStyleSheetAt(nsIStyleSheet* aSheet, PRInt32 aIndex, PRBool nsIPresShell* shell = (nsIPresShell*)mPresShells.ElementAt(index); nsCOMPtr set; shell->GetStyleSet(getter_AddRefs(set)); - if (nsnull != set) { + if (set) { set->AddDocStyleSheet(aSheet, this); } } diff --git a/mozilla/layout/html/document/src/nsImageDocument.cpp b/mozilla/layout/html/document/src/nsImageDocument.cpp index 8422dba7312..d42c2e3d4b0 100644 --- a/mozilla/layout/html/document/src/nsImageDocument.cpp +++ b/mozilla/layout/html/document/src/nsImageDocument.cpp @@ -221,7 +221,7 @@ nsImageDocument::StartImageLoad(nsIURL* aURL, nsIStreamListener*& aListener) if (nsnull != shell) { nsCOMPtr cx; shell->GetPresContext(getter_AddRefs(cx)); - if (nsnull != cx) { + if (cx) { nsIImageGroup* group = nsnull; cx->GetImageGroup(&group); if (nsnull != group) { @@ -327,7 +327,7 @@ nsImageDocument::StartLayout() // XXX It's unfortunate that this has to be here nsCOMPtr vm; shell->GetViewManager(getter_AddRefs(vm)); - if (nsnull != vm) { + if (vm) { vm->EnableRefresh(); } diff --git a/mozilla/layout/html/forms/src/nsFormControlFrame.cpp b/mozilla/layout/html/forms/src/nsFormControlFrame.cpp index 46c7be5ea0c..77aaa107484 100644 --- a/mozilla/layout/html/forms/src/nsFormControlFrame.cpp +++ b/mozilla/layout/html/forms/src/nsFormControlFrame.cpp @@ -226,7 +226,7 @@ nsFormControlFrame::Reflow(nsIPresContext& aPresContext, PRBool requiresWidget = PR_TRUE; // Checkto see if the device context supports widgets at all - if (nsnull != dx) { + if (dx) { dx->SupportsNativeWidgets(requiresWidget); } diff --git a/mozilla/layout/html/forms/src/nsListControlFrame.cpp b/mozilla/layout/html/forms/src/nsListControlFrame.cpp index d6fabda2f7c..4a5159c4b73 100644 --- a/mozilla/layout/html/forms/src/nsListControlFrame.cpp +++ b/mozilla/layout/html/forms/src/nsListControlFrame.cpp @@ -841,7 +841,7 @@ nsListControlFrame::GetScrollBarDimensions(nsIPresContext& aPresContext, float scale; nsCOMPtr dx; aPresContext.GetDeviceContext(getter_AddRefs(dx)); - if (nsnull != dx) { + if (dx) { float sbWidth; float sbHeight; dx->GetCanonicalPixelScale(scale); diff --git a/mozilla/layout/html/forms/src/nsSelectControlFrame.cpp b/mozilla/layout/html/forms/src/nsSelectControlFrame.cpp index b90227db5b4..80f0dacea8f 100644 --- a/mozilla/layout/html/forms/src/nsSelectControlFrame.cpp +++ b/mozilla/layout/html/forms/src/nsSelectControlFrame.cpp @@ -356,7 +356,7 @@ nsSelectControlFrame::GetDesiredSize(nsIPresContext* aPresContext, float scale; nsCOMPtr dx; aPresContext->GetDeviceContext(getter_AddRefs(dx)); - if (nsnull != dx) { + if (dx) { float sbWidth; float sbHeight; dx->GetCanonicalPixelScale(scale); diff --git a/mozilla/layout/html/forms/src/nsTextControlFrame.cpp b/mozilla/layout/html/forms/src/nsTextControlFrame.cpp index c9f9f48f57a..7467b68a8dd 100644 --- a/mozilla/layout/html/forms/src/nsTextControlFrame.cpp +++ b/mozilla/layout/html/forms/src/nsTextControlFrame.cpp @@ -273,7 +273,7 @@ nsTextControlFrame::GetDesiredSize(nsIPresContext* aPresContext, aPresContext->GetPixelsToTwips(&p2t); nsCOMPtr dx; aPresContext->GetDeviceContext(getter_AddRefs(dx)); - if (nsnull != dx) { + if (dx) { float sbWidth; float sbHeight; dx->GetCanonicalPixelScale(scale); diff --git a/mozilla/layout/html/style/src/nsCSSStyleRule.cpp b/mozilla/layout/html/style/src/nsCSSStyleRule.cpp index 32d9206d16d..12d291d2af6 100644 --- a/mozilla/layout/html/style/src/nsCSSStyleRule.cpp +++ b/mozilla/layout/html/style/src/nsCSSStyleRule.cpp @@ -1169,7 +1169,7 @@ void MapDeclarationInto(nsICSSDeclaration* aDeclaration, if (eCSSUnit_String == ourFont->mFamily.GetUnit()) { nsCOMPtr dc; aPresContext->GetDeviceContext(getter_AddRefs(dc)); - if (nsnull != dc) { + if (dc) { nsAutoString familyList; ourFont->mFamily.GetStringValue(familyList); diff --git a/mozilla/layout/style/nsCSSStyleRule.cpp b/mozilla/layout/style/nsCSSStyleRule.cpp index 32d9206d16d..12d291d2af6 100644 --- a/mozilla/layout/style/nsCSSStyleRule.cpp +++ b/mozilla/layout/style/nsCSSStyleRule.cpp @@ -1169,7 +1169,7 @@ void MapDeclarationInto(nsICSSDeclaration* aDeclaration, if (eCSSUnit_String == ourFont->mFamily.GetUnit()) { nsCOMPtr dc; aPresContext->GetDeviceContext(getter_AddRefs(dc)); - if (nsnull != dc) { + if (dc) { nsAutoString familyList; ourFont->mFamily.GetStringValue(familyList); diff --git a/mozilla/layout/xml/document/src/nsXMLContentSink.cpp b/mozilla/layout/xml/document/src/nsXMLContentSink.cpp index cff7be3cfc3..70a1da0d56d 100644 --- a/mozilla/layout/xml/document/src/nsXMLContentSink.cpp +++ b/mozilla/layout/xml/document/src/nsXMLContentSink.cpp @@ -230,7 +230,7 @@ nsXMLContentSink::DidBuildModel(PRInt32 aQualityLevel) PRInt32 i, ns = mDocument->GetNumberOfShells(); for (i = 0; i < ns; i++) { nsCOMPtr shell(mDocument->GetShellAt(i)); - if (nsnull != shell) { + if (shell) { nsCOMPtr vm; shell->GetViewManager(getter_AddRefs(vm)); if(vm) { @@ -1323,7 +1323,7 @@ nsXMLContentSink::StartLayout() // Now trigger a refresh nsCOMPtr vm; shell->GetViewManager(getter_AddRefs(vm)); - if (nsnull != vm) { + if (vm) { vm->EnableRefresh(); } @@ -1356,7 +1356,7 @@ nsXMLContentSink::StartLayout() if (nsnull != shell) { nsCOMPtrvm; shell->GetViewManager(getter_AddRefs(vm)); - if (nsnull != vm) { + if (vm) { nsIView* rootView = nsnull; vm->GetRootView(rootView); if (nsnull != rootView) { diff --git a/mozilla/rdf/content/src/nsXULDocument.cpp b/mozilla/rdf/content/src/nsXULDocument.cpp index d87a59ccb51..2725d3227a0 100644 --- a/mozilla/rdf/content/src/nsXULDocument.cpp +++ b/mozilla/rdf/content/src/nsXULDocument.cpp @@ -1145,7 +1145,7 @@ XULDocumentImpl::AddStyleSheet(nsIStyleSheet* aSheet) nsIPresShell* shell = NS_STATIC_CAST(nsIPresShell*, mPresShells[index]); nsCOMPtr set; shell->GetStyleSet(getter_AddRefs(set)); - if (nsnull != set) { + if (set) { set->AddDocStyleSheet(aSheet, this); } } @@ -1174,7 +1174,7 @@ XULDocumentImpl::SetStyleSheetDisabledState(nsIStyleSheet* aSheet, nsIPresShell* shell = (nsIPresShell*)mPresShells.ElementAt(index); nsCOMPtr set; shell->GetStyleSet(getter_AddRefs(set)); - if (nsnull != set) { + if (set) { if (aDisabled) { set->RemoveDocStyleSheet(aSheet); } @@ -2150,7 +2150,7 @@ XULDocumentImpl::StartLayout(void) // Now trigger a refresh nsCOMPtr vm; shell->GetViewManager(getter_AddRefs(vm)); - if (nsnull != vm) { + if (vm) { vm->EnableRefresh(); } diff --git a/mozilla/webshell/tests/viewer/nsBrowserWindow.cpp b/mozilla/webshell/tests/viewer/nsBrowserWindow.cpp index 96baf0fdaf4..25316657209 100644 --- a/mozilla/webshell/tests/viewer/nsBrowserWindow.cpp +++ b/mozilla/webshell/tests/viewer/nsBrowserWindow.cpp @@ -655,7 +655,7 @@ NS_IMETHODIMP nsBrowserWindow::FindNext(const nsString &aSearchStr, PRBool aMatc if (nsnull != shell) { nsCOMPtr doc; shell->GetDocument(getter_AddRefs(doc)); - if (nsnull != doc) { + if (doc) { //PRBool foundIt = PR_FALSE; doc->FindNext(aSearchStr, aMatchCase, aSearchDown, aIsFound); if (!aIsFound) { @@ -675,7 +675,7 @@ NS_IMETHODIMP nsBrowserWindow::ForceRefresh() if (nsnull != shell) { nsCOMPtr vm; shell->GetViewManager(getter_AddRefs(vm)); - if (nsnull != vm) { + if (vm) { nsIView* root; vm->GetRootView(root); if (nsnull != root) { @@ -738,7 +738,7 @@ nsEventStatus nsBrowserWindow::ProcessDialogEvent(nsGUIEvent *aEvent) if (nsnull != shell) { nsCOMPtr doc; shell->GetDocument(getter_AddRefs(doc)); - if (nsnull != doc) { + if (doc) { PRBool foundIt = PR_FALSE; doc->FindNext(searchStr, matchCase, findDwn, foundIt); if (!foundIt) { @@ -1103,7 +1103,7 @@ nsBrowserWindow::DoSelectAll() if (nsnull != shell) { nsCOMPtr doc; shell->GetDocument(getter_AddRefs(doc)); - if (nsnull != doc) { + if (doc) { doc->SelectAll(); ForceRefresh(); } @@ -2154,7 +2154,7 @@ nsBrowserWindow::DoCopy() if (nsnull != shell) { nsCOMPtr doc; shell->GetDocument(getter_AddRefs(doc)); - if (nsnull != doc) { + if (doc) { nsString buffer; nsIDOMSelection* sel = nsnull; @@ -2594,7 +2594,7 @@ DumpContentRecurse(nsIWebShell* aWebShell, FILE* out) if (nsnull != shell) { nsCOMPtr doc; shell->GetDocument(getter_AddRefs(doc)); - if (nsnull != doc) { + if (doc) { nsIContent* root = doc->GetRootContent(); if (nsnull != root) { root->List(out); @@ -2672,7 +2672,7 @@ DumpViewsRecurse(nsIWebShell* aWebShell, FILE* out) if (nsnull != shell) { nsCOMPtr vm; shell->GetViewManager(getter_AddRefs(vm)); - if (nsnull != vm) { + if (vm) { nsIView* root; vm->GetRootView(root); if (nsnull != root) { @@ -2711,7 +2711,7 @@ nsBrowserWindow::DumpStyleSheets(FILE* out) if (nsnull != shell) { nsCOMPtr styleSet; shell->GetStyleSet(getter_AddRefs(styleSet)); - if (nsnull == styleSet) { + if (!styleSet) { fputs("null style set\n", out); } else { styleSet->List(out); @@ -2730,7 +2730,7 @@ nsBrowserWindow::DumpStyleContexts(FILE* out) if (nsnull != shell) { nsCOMPtr styleSet; shell->GetStyleSet(getter_AddRefs(styleSet)); - if (nsnull == styleSet) { + if (!styleSet) { fputs("null style set\n", out); } else { nsIFrame* root; @@ -2850,7 +2850,7 @@ nsBrowserWindow::DoDebugSave() if (nsnull != shell) { nsCOMPtr doc; shell->GetDocument(getter_AddRefs(doc)); - if (nsnull != doc) { + if (doc) { nsString buffer; doc->CreateXIF(buffer); @@ -2911,7 +2911,7 @@ nsBrowserWindow::DoToggleSelection() if (nsnull != shell) { nsCOMPtr doc; shell->GetDocument(getter_AddRefs(doc)); - if (nsnull != doc) { + if (doc) { PRBool current = doc->GetDisplaySelection(); doc->SetDisplaySelection(!current); ForceRefresh(); @@ -3046,7 +3046,7 @@ nsBrowserWindow::DispatchStyleMenu(PRInt32 aID) nsAutoString defaultStyle; nsCOMPtr doc; shell->GetDocument(getter_AddRefs(doc)); - if (nsnull != doc) { + if (doc) { nsIAtom* defStyleAtom = NS_NewAtom("default-style"); doc->GetHeaderData(defStyleAtom, defaultStyle); NS_RELEASE(defStyleAtom); @@ -3084,7 +3084,7 @@ nsBrowserWindow::DispatchStyleMenu(PRInt32 aID) if (nsnull != shell) { nsCOMPtr doc; shell->GetDocument(getter_AddRefs(doc)); - if (nsnull != doc) { + if (doc) { nsAutoString defaultStyle; nsIAtom* defStyleAtom = NS_NewAtom("default-style"); doc->GetHeaderData(defStyleAtom, defaultStyle); diff --git a/mozilla/webshell/tests/viewer/nsViewerApp.cpp b/mozilla/webshell/tests/viewer/nsViewerApp.cpp index 96edb09cd68..34ef1cdb6a6 100644 --- a/mozilla/webshell/tests/viewer/nsViewerApp.cpp +++ b/mozilla/webshell/tests/viewer/nsViewerApp.cpp @@ -967,7 +967,7 @@ nsViewerApp::CreateRobot(nsBrowserWindow* aWindow) if (nsnull != shell) { nsCOMPtr doc; shell->GetDocument(getter_AddRefs(doc)); - if (nsnull!=doc) { + if (doc) { const char * str; nsresult rv = doc->GetDocumentURL()->GetSpec(&str); if (NS_FAILED(rv)) { diff --git a/mozilla/webshell/tests/viewer/nsWebCrawler.cpp b/mozilla/webshell/tests/viewer/nsWebCrawler.cpp index ba0d2d6e178..66c5c6eba91 100644 --- a/mozilla/webshell/tests/viewer/nsWebCrawler.cpp +++ b/mozilla/webshell/tests/viewer/nsWebCrawler.cpp @@ -263,7 +263,7 @@ nsWebCrawler:: EndLoadURL(nsIWebShell* aShell, if (nsnull != shell) { nsCOMPtr vm; shell->GetViewManager(getter_AddRefs(vm)); - if (nsnull != vm) { + if (vm) { nsIView* rootView; vm->GetRootView(rootView); vm->UpdateView(rootView, nsnull, NS_VMREFRESH_IMMEDIATE); diff --git a/mozilla/webshell/tests/viewer/nsXPBaseWindow.cpp b/mozilla/webshell/tests/viewer/nsXPBaseWindow.cpp index c097529a874..15096590845 100644 --- a/mozilla/webshell/tests/viewer/nsXPBaseWindow.cpp +++ b/mozilla/webshell/tests/viewer/nsXPBaseWindow.cpp @@ -271,7 +271,7 @@ void nsXPBaseWindow::ForceRefresh() if (nsnull != shell) { nsCOMPtr vm; shell->GetViewManager(getter_AddRefs(vm)); - if (nsnull != vm) { + if (vm) { nsIView* root; vm->GetRootView(root); if (nsnull != root) { @@ -415,7 +415,7 @@ NS_IMETHODIMP nsXPBaseWindow::EndLoadURL(nsIWebShell* aShell, const PRUnichar* a if (nsnull != shell) { nsCOMPtr doc; shell->GetDocument(getter_AddRefs(doc)); - if (nsnull != doc) { + if (doc) { mContentRoot = doc->GetRootContent(); mDocIsLoaded = PR_TRUE; if (nsnull != mWindowListener) { @@ -515,7 +515,7 @@ NS_IMETHODIMP nsXPBaseWindow::GetDocument(nsIDOMHTMLDocument *& aDocument) if (nsnull != shell) { nsCOMPtr doc; shell->GetDocument(getter_AddRefs(doc)); - if (nsnull != doc) { + if (doc) { doc->QueryInterface(kIDOMHTMLDocumentIID,(void **)&htmlDoc); } NS_RELEASE(shell);