diff --git a/mozilla/content/html/style/src/nsCSSStyleSheet.cpp b/mozilla/content/html/style/src/nsCSSStyleSheet.cpp index 472bf6e7372..b0fce35d38c 100644 --- a/mozilla/content/html/style/src/nsCSSStyleSheet.cpp +++ b/mozilla/content/html/style/src/nsCSSStyleSheet.cpp @@ -220,7 +220,7 @@ PRInt32 CSSStyleSheetImpl::RulesMatching(nsIPresContext* aPresContext, child = ((CSSStyleSheetImpl*)child)->mNext; } - PRInt32 count = ((nsnull != mRules) ? mRules->Count() : 0); + PRInt32 count = (mRules.IsNotNull() ? mRules->Count() : 0); for (PRInt32 index = 0; index < count; index++) { nsICSSStyleRulePtr rule = (nsICSSStyleRule*)mRules->ElementAt(index); @@ -272,12 +272,12 @@ void CSSStyleSheetImpl::AppendStyleSheet(nsICSSStyleSheet* aSheet) { NS_PRECONDITION(nsnull != aSheet, "null arg"); - if (nsnull == mFirstChild) { + if (mFirstChild.IsNull()) { mFirstChild.SetAddRef(aSheet); } else { nsICSSStyleSheet* child = mFirstChild; - while (nsnull != ((CSSStyleSheetImpl*)child)->mNext) { + while (((CSSStyleSheetImpl*)child)->mNext.IsNotNull()) { child = ((CSSStyleSheetImpl*)child)->mNext; } ((CSSStyleSheetImpl*)child)->mNext.SetAddRef(aSheet); @@ -289,7 +289,7 @@ void CSSStyleSheetImpl::PrependStyleRule(nsICSSStyleRule* aRule) NS_PRECONDITION(nsnull != aRule, "null arg"); //XXX replace this with a binary search? PRInt32 weight = aRule->GetWeight(); - if (nsnull == mRules) { + if (mRules.IsNull()) { if (NS_OK != NS_NewISupportsArray(mRules.AssignPtr())) return; } @@ -309,7 +309,7 @@ void CSSStyleSheetImpl::AppendStyleRule(nsICSSStyleRule* aRule) //XXX replace this with a binary search? PRInt32 weight = aRule->GetWeight(); - if (nsnull == mRules) { + if (mRules.IsNull()) { if (NS_OK != NS_NewISupportsArray(mRules.AssignPtr())) return; } @@ -343,7 +343,7 @@ void CSSStyleSheetImpl::List(FILE* out, PRInt32 aIndent) const child = ((CSSStyleSheetImpl*)child)->mNext; } - PRInt32 count = ((nsnull != mRules) ? mRules->Count() : 0); + PRInt32 count = (mRules.IsNotNull() ? mRules->Count() : 0); for (index = 0; index < count; index++) { nsICSSStyleRulePtr rule = (nsICSSStyleRule*)mRules->ElementAt(index); diff --git a/mozilla/layout/base/nsPresContext.cpp b/mozilla/layout/base/nsPresContext.cpp index ef54a55f0d0..191aae3eed0 100644 --- a/mozilla/layout/base/nsPresContext.cpp +++ b/mozilla/layout/base/nsPresContext.cpp @@ -36,6 +36,7 @@ static NS_DEFINE_IID(kIPresContextIID, NS_IPRESCONTEXT_IID); +#if 0 // XXX this code needs to move far away from here static nsIImageManager* gImageManager = nsnull; static void InitImageLibrary() @@ -50,8 +51,9 @@ static void InitImageLibrary() printf("can't initialize image library\n"); } // XXX end code with no home... +#endif -class ImageLoader : nsIImageRequestObserver { +class ImageLoader : public nsIImageRequestObserver { public: ImageLoader(nsPresContext* aCX, nsIImageGroup* aGroup, nsIFrame* aFrame); ~ImageLoader(); diff --git a/mozilla/layout/base/src/nsPresContext.cpp b/mozilla/layout/base/src/nsPresContext.cpp index ef54a55f0d0..191aae3eed0 100644 --- a/mozilla/layout/base/src/nsPresContext.cpp +++ b/mozilla/layout/base/src/nsPresContext.cpp @@ -36,6 +36,7 @@ static NS_DEFINE_IID(kIPresContextIID, NS_IPRESCONTEXT_IID); +#if 0 // XXX this code needs to move far away from here static nsIImageManager* gImageManager = nsnull; static void InitImageLibrary() @@ -50,8 +51,9 @@ static void InitImageLibrary() printf("can't initialize image library\n"); } // XXX end code with no home... +#endif -class ImageLoader : nsIImageRequestObserver { +class ImageLoader : public nsIImageRequestObserver { public: ImageLoader(nsPresContext* aCX, nsIImageGroup* aGroup, nsIFrame* aFrame); ~ImageLoader(); diff --git a/mozilla/layout/base/src/nsReflowCommand.cpp b/mozilla/layout/base/src/nsReflowCommand.cpp index 4e04fcfc0c9..34a72cb37c4 100644 --- a/mozilla/layout/base/src/nsReflowCommand.cpp +++ b/mozilla/layout/base/src/nsReflowCommand.cpp @@ -237,5 +237,5 @@ nsIFrame* nsReflowCommand::GetNext() const if (count > 0) { rv = (nsIFrame*) mPath[count - 1]; } - return nsnull; + return rv; } diff --git a/mozilla/layout/generic/nsBlockFrame.cpp b/mozilla/layout/generic/nsBlockFrame.cpp index 84fd53b081b..841c30aa686 100644 --- a/mozilla/layout/generic/nsBlockFrame.cpp +++ b/mozilla/layout/generic/nsBlockFrame.cpp @@ -1162,7 +1162,6 @@ nsBlockFrame::ReflowMappedChildren(nsIPresContext* aCX, PRBool result = PR_TRUE; nsIFrame* kidFrame; - nsIFrame* prevKidFrame = nsnull; for (kidFrame = mFirstChild; nsnull != kidFrame; ) { nsIContentPtr kid; @@ -1218,7 +1217,6 @@ nsBlockFrame::ReflowMappedChildren(nsIPresContext* aCX, } // Get the next child frame - prevKidFrame = kidFrame; kidFrame->GetNextSibling(kidFrame); } @@ -1255,7 +1253,7 @@ PRBool nsBlockFrame::MoreToReflow(nsIPresContext* aCX) // Get the next content object that we would like to reflow PRInt32 kidIndex = NextChildOffset(); nsIContentPtr kid = mContent->ChildAt(kidIndex); - if (nsnull != kid) { + if (kid.IsNotNull()) { // Resolve style for the kid nsIStyleContextPtr kidSC = aCX->ResolveStyleContextFor(kid, this); nsStyleDisplay* kidStyleDisplay = (nsStyleDisplay*) @@ -1318,7 +1316,7 @@ nsBlockFrame::ReflowAppendedChildren(nsIPresContext* aCX, for (;;) { // Get the next content object nsIContentPtr kid = mContent->ChildAt(kidIndex); - if (nsnull == kid) { + if (kid.IsNull()) { result = frComplete; break; } @@ -1340,7 +1338,6 @@ nsBlockFrame::ReflowAppendedChildren(nsIPresContext* aCX, } else if (nsnull == kidPrevInFlow) { // Create initial frame for the child nsIContentDelegate* kidDel; - nsresult fr; switch (kidDisplay->mDisplay) { case NS_STYLE_DISPLAY_BLOCK: case NS_STYLE_DISPLAY_LIST_ITEM: @@ -1369,7 +1366,7 @@ nsBlockFrame::ReflowAppendedChildren(nsIPresContext* aCX, default: NS_ASSERTION(nsnull == kidPrevInFlow, "bad prev in flow"); - fr = nsFrame::NewFrame(&kidFrame, kid, kidIndex, this); + nsFrame::NewFrame(&kidFrame, kid, kidIndex, this); break; } kidFrame->SetStyleContext(kidSC); diff --git a/mozilla/layout/generic/nsBlockReflowState.cpp b/mozilla/layout/generic/nsBlockReflowState.cpp index 84fd53b081b..841c30aa686 100644 --- a/mozilla/layout/generic/nsBlockReflowState.cpp +++ b/mozilla/layout/generic/nsBlockReflowState.cpp @@ -1162,7 +1162,6 @@ nsBlockFrame::ReflowMappedChildren(nsIPresContext* aCX, PRBool result = PR_TRUE; nsIFrame* kidFrame; - nsIFrame* prevKidFrame = nsnull; for (kidFrame = mFirstChild; nsnull != kidFrame; ) { nsIContentPtr kid; @@ -1218,7 +1217,6 @@ nsBlockFrame::ReflowMappedChildren(nsIPresContext* aCX, } // Get the next child frame - prevKidFrame = kidFrame; kidFrame->GetNextSibling(kidFrame); } @@ -1255,7 +1253,7 @@ PRBool nsBlockFrame::MoreToReflow(nsIPresContext* aCX) // Get the next content object that we would like to reflow PRInt32 kidIndex = NextChildOffset(); nsIContentPtr kid = mContent->ChildAt(kidIndex); - if (nsnull != kid) { + if (kid.IsNotNull()) { // Resolve style for the kid nsIStyleContextPtr kidSC = aCX->ResolveStyleContextFor(kid, this); nsStyleDisplay* kidStyleDisplay = (nsStyleDisplay*) @@ -1318,7 +1316,7 @@ nsBlockFrame::ReflowAppendedChildren(nsIPresContext* aCX, for (;;) { // Get the next content object nsIContentPtr kid = mContent->ChildAt(kidIndex); - if (nsnull == kid) { + if (kid.IsNull()) { result = frComplete; break; } @@ -1340,7 +1338,6 @@ nsBlockFrame::ReflowAppendedChildren(nsIPresContext* aCX, } else if (nsnull == kidPrevInFlow) { // Create initial frame for the child nsIContentDelegate* kidDel; - nsresult fr; switch (kidDisplay->mDisplay) { case NS_STYLE_DISPLAY_BLOCK: case NS_STYLE_DISPLAY_LIST_ITEM: @@ -1369,7 +1366,7 @@ nsBlockFrame::ReflowAppendedChildren(nsIPresContext* aCX, default: NS_ASSERTION(nsnull == kidPrevInFlow, "bad prev in flow"); - fr = nsFrame::NewFrame(&kidFrame, kid, kidIndex, this); + nsFrame::NewFrame(&kidFrame, kid, kidIndex, this); break; } kidFrame->SetStyleContext(kidSC); diff --git a/mozilla/layout/generic/nsBlockReflowState.h b/mozilla/layout/generic/nsBlockReflowState.h index 84fd53b081b..841c30aa686 100644 --- a/mozilla/layout/generic/nsBlockReflowState.h +++ b/mozilla/layout/generic/nsBlockReflowState.h @@ -1162,7 +1162,6 @@ nsBlockFrame::ReflowMappedChildren(nsIPresContext* aCX, PRBool result = PR_TRUE; nsIFrame* kidFrame; - nsIFrame* prevKidFrame = nsnull; for (kidFrame = mFirstChild; nsnull != kidFrame; ) { nsIContentPtr kid; @@ -1218,7 +1217,6 @@ nsBlockFrame::ReflowMappedChildren(nsIPresContext* aCX, } // Get the next child frame - prevKidFrame = kidFrame; kidFrame->GetNextSibling(kidFrame); } @@ -1255,7 +1253,7 @@ PRBool nsBlockFrame::MoreToReflow(nsIPresContext* aCX) // Get the next content object that we would like to reflow PRInt32 kidIndex = NextChildOffset(); nsIContentPtr kid = mContent->ChildAt(kidIndex); - if (nsnull != kid) { + if (kid.IsNotNull()) { // Resolve style for the kid nsIStyleContextPtr kidSC = aCX->ResolveStyleContextFor(kid, this); nsStyleDisplay* kidStyleDisplay = (nsStyleDisplay*) @@ -1318,7 +1316,7 @@ nsBlockFrame::ReflowAppendedChildren(nsIPresContext* aCX, for (;;) { // Get the next content object nsIContentPtr kid = mContent->ChildAt(kidIndex); - if (nsnull == kid) { + if (kid.IsNull()) { result = frComplete; break; } @@ -1340,7 +1338,6 @@ nsBlockFrame::ReflowAppendedChildren(nsIPresContext* aCX, } else if (nsnull == kidPrevInFlow) { // Create initial frame for the child nsIContentDelegate* kidDel; - nsresult fr; switch (kidDisplay->mDisplay) { case NS_STYLE_DISPLAY_BLOCK: case NS_STYLE_DISPLAY_LIST_ITEM: @@ -1369,7 +1366,7 @@ nsBlockFrame::ReflowAppendedChildren(nsIPresContext* aCX, default: NS_ASSERTION(nsnull == kidPrevInFlow, "bad prev in flow"); - fr = nsFrame::NewFrame(&kidFrame, kid, kidIndex, this); + nsFrame::NewFrame(&kidFrame, kid, kidIndex, this); break; } kidFrame->SetStyleContext(kidSC); diff --git a/mozilla/layout/html/base/src/nsBlockFrame.cpp b/mozilla/layout/html/base/src/nsBlockFrame.cpp index 84fd53b081b..841c30aa686 100644 --- a/mozilla/layout/html/base/src/nsBlockFrame.cpp +++ b/mozilla/layout/html/base/src/nsBlockFrame.cpp @@ -1162,7 +1162,6 @@ nsBlockFrame::ReflowMappedChildren(nsIPresContext* aCX, PRBool result = PR_TRUE; nsIFrame* kidFrame; - nsIFrame* prevKidFrame = nsnull; for (kidFrame = mFirstChild; nsnull != kidFrame; ) { nsIContentPtr kid; @@ -1218,7 +1217,6 @@ nsBlockFrame::ReflowMappedChildren(nsIPresContext* aCX, } // Get the next child frame - prevKidFrame = kidFrame; kidFrame->GetNextSibling(kidFrame); } @@ -1255,7 +1253,7 @@ PRBool nsBlockFrame::MoreToReflow(nsIPresContext* aCX) // Get the next content object that we would like to reflow PRInt32 kidIndex = NextChildOffset(); nsIContentPtr kid = mContent->ChildAt(kidIndex); - if (nsnull != kid) { + if (kid.IsNotNull()) { // Resolve style for the kid nsIStyleContextPtr kidSC = aCX->ResolveStyleContextFor(kid, this); nsStyleDisplay* kidStyleDisplay = (nsStyleDisplay*) @@ -1318,7 +1316,7 @@ nsBlockFrame::ReflowAppendedChildren(nsIPresContext* aCX, for (;;) { // Get the next content object nsIContentPtr kid = mContent->ChildAt(kidIndex); - if (nsnull == kid) { + if (kid.IsNull()) { result = frComplete; break; } @@ -1340,7 +1338,6 @@ nsBlockFrame::ReflowAppendedChildren(nsIPresContext* aCX, } else if (nsnull == kidPrevInFlow) { // Create initial frame for the child nsIContentDelegate* kidDel; - nsresult fr; switch (kidDisplay->mDisplay) { case NS_STYLE_DISPLAY_BLOCK: case NS_STYLE_DISPLAY_LIST_ITEM: @@ -1369,7 +1366,7 @@ nsBlockFrame::ReflowAppendedChildren(nsIPresContext* aCX, default: NS_ASSERTION(nsnull == kidPrevInFlow, "bad prev in flow"); - fr = nsFrame::NewFrame(&kidFrame, kid, kidIndex, this); + nsFrame::NewFrame(&kidFrame, kid, kidIndex, this); break; } kidFrame->SetStyleContext(kidSC); diff --git a/mozilla/layout/html/base/src/nsBlockReflowState.cpp b/mozilla/layout/html/base/src/nsBlockReflowState.cpp index 84fd53b081b..841c30aa686 100644 --- a/mozilla/layout/html/base/src/nsBlockReflowState.cpp +++ b/mozilla/layout/html/base/src/nsBlockReflowState.cpp @@ -1162,7 +1162,6 @@ nsBlockFrame::ReflowMappedChildren(nsIPresContext* aCX, PRBool result = PR_TRUE; nsIFrame* kidFrame; - nsIFrame* prevKidFrame = nsnull; for (kidFrame = mFirstChild; nsnull != kidFrame; ) { nsIContentPtr kid; @@ -1218,7 +1217,6 @@ nsBlockFrame::ReflowMappedChildren(nsIPresContext* aCX, } // Get the next child frame - prevKidFrame = kidFrame; kidFrame->GetNextSibling(kidFrame); } @@ -1255,7 +1253,7 @@ PRBool nsBlockFrame::MoreToReflow(nsIPresContext* aCX) // Get the next content object that we would like to reflow PRInt32 kidIndex = NextChildOffset(); nsIContentPtr kid = mContent->ChildAt(kidIndex); - if (nsnull != kid) { + if (kid.IsNotNull()) { // Resolve style for the kid nsIStyleContextPtr kidSC = aCX->ResolveStyleContextFor(kid, this); nsStyleDisplay* kidStyleDisplay = (nsStyleDisplay*) @@ -1318,7 +1316,7 @@ nsBlockFrame::ReflowAppendedChildren(nsIPresContext* aCX, for (;;) { // Get the next content object nsIContentPtr kid = mContent->ChildAt(kidIndex); - if (nsnull == kid) { + if (kid.IsNull()) { result = frComplete; break; } @@ -1340,7 +1338,6 @@ nsBlockFrame::ReflowAppendedChildren(nsIPresContext* aCX, } else if (nsnull == kidPrevInFlow) { // Create initial frame for the child nsIContentDelegate* kidDel; - nsresult fr; switch (kidDisplay->mDisplay) { case NS_STYLE_DISPLAY_BLOCK: case NS_STYLE_DISPLAY_LIST_ITEM: @@ -1369,7 +1366,7 @@ nsBlockFrame::ReflowAppendedChildren(nsIPresContext* aCX, default: NS_ASSERTION(nsnull == kidPrevInFlow, "bad prev in flow"); - fr = nsFrame::NewFrame(&kidFrame, kid, kidIndex, this); + nsFrame::NewFrame(&kidFrame, kid, kidIndex, this); break; } kidFrame->SetStyleContext(kidSC); diff --git a/mozilla/layout/html/base/src/nsBlockReflowState.h b/mozilla/layout/html/base/src/nsBlockReflowState.h index 84fd53b081b..841c30aa686 100644 --- a/mozilla/layout/html/base/src/nsBlockReflowState.h +++ b/mozilla/layout/html/base/src/nsBlockReflowState.h @@ -1162,7 +1162,6 @@ nsBlockFrame::ReflowMappedChildren(nsIPresContext* aCX, PRBool result = PR_TRUE; nsIFrame* kidFrame; - nsIFrame* prevKidFrame = nsnull; for (kidFrame = mFirstChild; nsnull != kidFrame; ) { nsIContentPtr kid; @@ -1218,7 +1217,6 @@ nsBlockFrame::ReflowMappedChildren(nsIPresContext* aCX, } // Get the next child frame - prevKidFrame = kidFrame; kidFrame->GetNextSibling(kidFrame); } @@ -1255,7 +1253,7 @@ PRBool nsBlockFrame::MoreToReflow(nsIPresContext* aCX) // Get the next content object that we would like to reflow PRInt32 kidIndex = NextChildOffset(); nsIContentPtr kid = mContent->ChildAt(kidIndex); - if (nsnull != kid) { + if (kid.IsNotNull()) { // Resolve style for the kid nsIStyleContextPtr kidSC = aCX->ResolveStyleContextFor(kid, this); nsStyleDisplay* kidStyleDisplay = (nsStyleDisplay*) @@ -1318,7 +1316,7 @@ nsBlockFrame::ReflowAppendedChildren(nsIPresContext* aCX, for (;;) { // Get the next content object nsIContentPtr kid = mContent->ChildAt(kidIndex); - if (nsnull == kid) { + if (kid.IsNull()) { result = frComplete; break; } @@ -1340,7 +1338,6 @@ nsBlockFrame::ReflowAppendedChildren(nsIPresContext* aCX, } else if (nsnull == kidPrevInFlow) { // Create initial frame for the child nsIContentDelegate* kidDel; - nsresult fr; switch (kidDisplay->mDisplay) { case NS_STYLE_DISPLAY_BLOCK: case NS_STYLE_DISPLAY_LIST_ITEM: @@ -1369,7 +1366,7 @@ nsBlockFrame::ReflowAppendedChildren(nsIPresContext* aCX, default: NS_ASSERTION(nsnull == kidPrevInFlow, "bad prev in flow"); - fr = nsFrame::NewFrame(&kidFrame, kid, kidIndex, this); + nsFrame::NewFrame(&kidFrame, kid, kidIndex, this); break; } kidFrame->SetStyleContext(kidSC); diff --git a/mozilla/layout/html/base/src/nsBodyFrame.cpp b/mozilla/layout/html/base/src/nsBodyFrame.cpp index 4dea2553c1f..35ae0d1e45c 100644 --- a/mozilla/layout/html/base/src/nsBodyFrame.cpp +++ b/mozilla/layout/html/base/src/nsBodyFrame.cpp @@ -220,7 +220,6 @@ NS_METHOD nsBodyFrame::VerifyTree() const NS_ASSERTION(mFirstContentOffset <= mLastContentOffset, "bad offsets"); // Verify child content offsets - PRInt32 offset = mFirstContentOffset; nsIFrame* child = mFirstChild; while (nsnull != child) { // Make sure that the child's tree is valid diff --git a/mozilla/layout/html/base/src/nsColumnFrame.cpp b/mozilla/layout/html/base/src/nsColumnFrame.cpp index c3ed081ea43..72f70cd81a3 100644 --- a/mozilla/layout/html/base/src/nsColumnFrame.cpp +++ b/mozilla/layout/html/base/src/nsColumnFrame.cpp @@ -648,8 +648,6 @@ ColumnFrame::ReflowUnmappedChildren(nsIPresContext* aPresContext, } } - PRBool originalLastContentIsComplete = mLastContentIsComplete; - // Place our children, one at a time, until we are out of children nsSize kidMaxElementSize; nsSize* pKidMaxElementSize = (nsnull != aMaxElementSize) ? &kidMaxElementSize : nsnull; @@ -661,7 +659,7 @@ ColumnFrame::ReflowUnmappedChildren(nsIPresContext* aPresContext, for (;;) { // Get the next content object nsIContentPtr kid = mContent->ChildAt(kidIndex); - if (nsnull == kid) { + if (kid.IsNull()) { result = frComplete; break; } diff --git a/mozilla/layout/html/base/src/nsDOMIterator.cpp b/mozilla/layout/html/base/src/nsDOMIterator.cpp index e1859075358..5edfdb89d57 100644 --- a/mozilla/layout/html/base/src/nsDOMIterator.cpp +++ b/mozilla/layout/html/base/src/nsDOMIterator.cpp @@ -19,7 +19,6 @@ #include "nsDOMIterator.h" #include "nsIDOMNode.h" -static NS_DEFINE_IID(kIContentIID, NS_ICONTENT_IID); static NS_DEFINE_IID(kIDOMNodeIID, NS_IDOMNODE_IID); nsDOMIterator::nsDOMIterator(nsIContent &aContent) : mContent(aContent) diff --git a/mozilla/layout/html/base/src/nsHRPart.cpp b/mozilla/layout/html/base/src/nsHRPart.cpp index dac2cb82754..29ee02c424e 100644 --- a/mozilla/layout/html/base/src/nsHRPart.cpp +++ b/mozilla/layout/html/base/src/nsHRPart.cpp @@ -182,7 +182,6 @@ NS_METHOD HRuleFrame::Paint(nsIPresContext& aPresContext, // When a rule is not shaded, then we use a uniform color and // draw half-circles on the end points. aRenderingContext.SetColor (colors[0]); - float t2p = 1.0f / p2t; nscoord diameter = height; if ((diameter > width) || (diameter < nscoord(p2t * 3))) { // The half-circles on the ends of the rule aren't going to diff --git a/mozilla/layout/html/base/src/nsTextContent.cpp b/mozilla/layout/html/base/src/nsTextContent.cpp index a0caa0f43f7..35c2b4f1e94 100644 --- a/mozilla/layout/html/base/src/nsTextContent.cpp +++ b/mozilla/layout/html/base/src/nsTextContent.cpp @@ -991,7 +991,6 @@ NS_METHOD TextFrame::JustifyReflow(nsIPresContext* aCX, nscoord aAvailableSpace) // space and compress down whitespace. Text* txt = (Text*) mContent; const PRUnichar* cp = txt->mText + mContentOffset; - const PRUnichar* cpStart = cp; const PRUnichar* end = cp + mContentLength; PRUint32* wp = wp0; PRUint32* wpend = wp0 + maxWords; diff --git a/mozilla/layout/html/forms/src/nsForm.cpp b/mozilla/layout/html/forms/src/nsForm.cpp index 583a7489e17..d894c5980a8 100644 --- a/mozilla/layout/html/forms/src/nsForm.cpp +++ b/mozilla/layout/html/forms/src/nsForm.cpp @@ -98,7 +98,7 @@ public: return rv; } - NS_DECL_ISUPPORTS; + NS_DECL_ISUPPORTS virtual void OnRadioChecked(nsIFormControl& aRadio); diff --git a/mozilla/layout/html/forms/src/nsInput.cpp b/mozilla/layout/html/forms/src/nsInput.cpp index a5e7661d1d7..71a6e5a22ed 100644 --- a/mozilla/layout/html/forms/src/nsInput.cpp +++ b/mozilla/layout/html/forms/src/nsInput.cpp @@ -30,7 +30,7 @@ #include "nsHTMLAtoms.h" #include "nsIView.h" #include "nsIViewManager.h" -#include "nscoord.h" +#include "nsCoord.h" #include "nsDebug.h" #include "nsIWidget.h" #include "nsHTMLForms.h" diff --git a/mozilla/layout/html/forms/src/nsInputButton.cpp b/mozilla/layout/html/forms/src/nsInputButton.cpp index fd99b91a33b..6acefade632 100644 --- a/mozilla/layout/html/forms/src/nsInputButton.cpp +++ b/mozilla/layout/html/forms/src/nsInputButton.cpp @@ -85,9 +85,9 @@ public: virtual void MouseClicked(nsIPresContext* aPresContext); - virtual const nsIID GetCID(); + virtual const nsIID& GetCID(); - virtual const nsIID GetIID(); + virtual const nsIID& GetIID(); nsInputButtonType GetButtonType() const; @@ -311,14 +311,14 @@ nsInputButtonFrame::PostCreateWidget(nsIPresContext* aPresContext, nsIView *aVie NS_RELEASE(button); } -const nsIID +const nsIID& nsInputButtonFrame::GetIID() { static NS_DEFINE_IID(kButtonIID, NS_IBUTTON_IID); return kButtonIID; } -const nsIID +const nsIID& nsInputButtonFrame::GetCID() { static NS_DEFINE_IID(kButtonCID, NS_BUTTON_CID); diff --git a/mozilla/layout/html/forms/src/nsInputCheckbox.cpp b/mozilla/layout/html/forms/src/nsInputCheckbox.cpp index 5a2b8b7224b..1f5e482f021 100644 --- a/mozilla/layout/html/forms/src/nsInputCheckbox.cpp +++ b/mozilla/layout/html/forms/src/nsInputCheckbox.cpp @@ -39,9 +39,9 @@ public: virtual void PostCreateWidget(nsIPresContext* aPresContext, nsIView *aView); - virtual const nsIID GetCID(); + virtual const nsIID& GetCID(); - virtual const nsIID GetIID(); + virtual const nsIID& GetIID(); virtual void MouseClicked(nsIPresContext* aPresContext); @@ -67,14 +67,14 @@ nsInputCheckboxFrame::~nsInputCheckboxFrame() } -const nsIID +const nsIID& nsInputCheckboxFrame::GetIID() { static NS_DEFINE_IID(kCheckboxIID, NS_ICHECKBUTTON_IID); return kCheckboxIID; } -const nsIID +const nsIID& nsInputCheckboxFrame::GetCID() { static NS_DEFINE_IID(kCheckboxCID, NS_CHECKBUTTON_CID); diff --git a/mozilla/layout/html/forms/src/nsInputFrame.cpp b/mozilla/layout/html/forms/src/nsInputFrame.cpp index 0344883f899..0147b5bd6d5 100644 --- a/mozilla/layout/html/forms/src/nsInputFrame.cpp +++ b/mozilla/layout/html/forms/src/nsInputFrame.cpp @@ -206,7 +206,7 @@ nsInputFrame::ResizeReflow(nsIPresContext* aPresContext, GetParentWithView(parWithView); parWithView->GetView(parView); - const nsIID id = GetCID(); + const nsIID& id = GetCID(); nsInputWidgetData* initData = GetWidgetInitData(); // needs to be deleted // initialize the view as hidden since we don't know the (x,y) until Paint result = view->Init(viewMan, boundBox, parView, &id, initData, nsnull, 0, nsnull, @@ -277,14 +277,14 @@ nsInputFrame::GetWidget(nsIView* aView, nsIWidget** aWidget) } } -const nsIID +const nsIID& nsInputFrame::GetIID() { static NS_DEFINE_IID(kButtonIID, NS_IBUTTON_IID); return kButtonIID; } -const nsIID +const nsIID& nsInputFrame::GetCID() { static NS_DEFINE_IID(kButtonCID, NS_BUTTON_CID); diff --git a/mozilla/layout/html/forms/src/nsInputFrame.h b/mozilla/layout/html/forms/src/nsInputFrame.h index d9b002f38ab..3d4125ed6ea 100644 --- a/mozilla/layout/html/forms/src/nsInputFrame.h +++ b/mozilla/layout/html/forms/src/nsInputFrame.h @@ -28,10 +28,10 @@ class nsIView; class nsIPresContext; struct nsInputWidgetData { - DWORD arg1; - DWORD arg2; - DWORD arg3; - DWORD arg4; + PRInt32 arg1; + PRInt32 arg2; + PRInt32 arg3; + PRInt32 arg4; }; /** @@ -124,13 +124,13 @@ public: * Get the class id of the widget associated with this frame * @return the class id */ - virtual const nsIID GetCID(); + virtual const nsIID& GetCID(); /** * Get the interface id of widget associated with this frame * @return the interface id */ - virtual const nsIID GetIID(); + virtual const nsIID& GetIID(); /** * Get the widget associated with this frame diff --git a/mozilla/layout/html/forms/src/nsInputRadio.cpp b/mozilla/layout/html/forms/src/nsInputRadio.cpp index 290c2023fd3..79ff71b50dc 100644 --- a/mozilla/layout/html/forms/src/nsInputRadio.cpp +++ b/mozilla/layout/html/forms/src/nsInputRadio.cpp @@ -41,9 +41,9 @@ public: virtual void PostCreateWidget(nsIPresContext* aPresContext, nsIView *aView); - virtual const nsIID GetCID(); + virtual const nsIID& GetCID(); - virtual const nsIID GetIID(); + virtual const nsIID& GetIID(); virtual void MouseClicked(nsIPresContext* aPresContext); @@ -69,14 +69,14 @@ nsInputRadioFrame::~nsInputRadioFrame() } -const nsIID +const nsIID& nsInputRadioFrame::GetIID() { static NS_DEFINE_IID(kRadioIID, NS_IRADIOBUTTON_IID); return kRadioIID; } -const nsIID +const nsIID& nsInputRadioFrame::GetCID() { static NS_DEFINE_IID(kRadioCID, NS_RADIOBUTTON_CID); diff --git a/mozilla/layout/html/forms/src/nsInputText.cpp b/mozilla/layout/html/forms/src/nsInputText.cpp index 3b3ebbd6e8f..9950e455a80 100644 --- a/mozilla/layout/html/forms/src/nsInputText.cpp +++ b/mozilla/layout/html/forms/src/nsInputText.cpp @@ -44,9 +44,9 @@ public: virtual void PostCreateWidget(nsIPresContext* aPresContext, nsIView *aView); - virtual const nsIID GetCID(); + virtual const nsIID& GetCID(); - virtual const nsIID GetIID(); + virtual const nsIID& GetIID(); protected: @@ -71,7 +71,7 @@ nsInputTextFrame::~nsInputTextFrame() { } -const nsIID +const nsIID& nsInputTextFrame::GetIID() { static NS_DEFINE_IID(kTextIID, NS_ITEXTWIDGET_IID); @@ -85,7 +85,7 @@ nsInputTextFrame::GetIID() } } -const nsIID +const nsIID& nsInputTextFrame::GetCID() { static NS_DEFINE_IID(kTextCID, NS_TEXTFIELD_CID); diff --git a/mozilla/layout/html/forms/src/nsSelect.cpp b/mozilla/layout/html/forms/src/nsSelect.cpp index 906fbd9426d..8f7b2a063d6 100644 --- a/mozilla/layout/html/forms/src/nsSelect.cpp +++ b/mozilla/layout/html/forms/src/nsSelect.cpp @@ -53,9 +53,9 @@ public: virtual void PostCreateWidget(nsIPresContext* aPresContext, nsIView *aView); - virtual const nsIID GetCID(); + virtual const nsIID& GetCID(); - virtual const nsIID GetIID(); + virtual const nsIID& GetIID(); PRBool IsComboBox(); @@ -153,7 +153,7 @@ nsSelectFrame::IsComboBox() return content->IsComboBox(); } -const nsIID +const nsIID& nsSelectFrame::GetIID() { if (IsComboBox()) { @@ -164,7 +164,7 @@ nsSelectFrame::GetIID() } } -const nsIID +const nsIID& nsSelectFrame::GetCID() { static NS_DEFINE_IID(kComboCID, NS_COMBOBOX_CID); diff --git a/mozilla/layout/html/style/src/nsCSSStyleSheet.cpp b/mozilla/layout/html/style/src/nsCSSStyleSheet.cpp index 472bf6e7372..b0fce35d38c 100644 --- a/mozilla/layout/html/style/src/nsCSSStyleSheet.cpp +++ b/mozilla/layout/html/style/src/nsCSSStyleSheet.cpp @@ -220,7 +220,7 @@ PRInt32 CSSStyleSheetImpl::RulesMatching(nsIPresContext* aPresContext, child = ((CSSStyleSheetImpl*)child)->mNext; } - PRInt32 count = ((nsnull != mRules) ? mRules->Count() : 0); + PRInt32 count = (mRules.IsNotNull() ? mRules->Count() : 0); for (PRInt32 index = 0; index < count; index++) { nsICSSStyleRulePtr rule = (nsICSSStyleRule*)mRules->ElementAt(index); @@ -272,12 +272,12 @@ void CSSStyleSheetImpl::AppendStyleSheet(nsICSSStyleSheet* aSheet) { NS_PRECONDITION(nsnull != aSheet, "null arg"); - if (nsnull == mFirstChild) { + if (mFirstChild.IsNull()) { mFirstChild.SetAddRef(aSheet); } else { nsICSSStyleSheet* child = mFirstChild; - while (nsnull != ((CSSStyleSheetImpl*)child)->mNext) { + while (((CSSStyleSheetImpl*)child)->mNext.IsNotNull()) { child = ((CSSStyleSheetImpl*)child)->mNext; } ((CSSStyleSheetImpl*)child)->mNext.SetAddRef(aSheet); @@ -289,7 +289,7 @@ void CSSStyleSheetImpl::PrependStyleRule(nsICSSStyleRule* aRule) NS_PRECONDITION(nsnull != aRule, "null arg"); //XXX replace this with a binary search? PRInt32 weight = aRule->GetWeight(); - if (nsnull == mRules) { + if (mRules.IsNull()) { if (NS_OK != NS_NewISupportsArray(mRules.AssignPtr())) return; } @@ -309,7 +309,7 @@ void CSSStyleSheetImpl::AppendStyleRule(nsICSSStyleRule* aRule) //XXX replace this with a binary search? PRInt32 weight = aRule->GetWeight(); - if (nsnull == mRules) { + if (mRules.IsNull()) { if (NS_OK != NS_NewISupportsArray(mRules.AssignPtr())) return; } @@ -343,7 +343,7 @@ void CSSStyleSheetImpl::List(FILE* out, PRInt32 aIndent) const child = ((CSSStyleSheetImpl*)child)->mNext; } - PRInt32 count = ((nsnull != mRules) ? mRules->Count() : 0); + PRInt32 count = (mRules.IsNotNull() ? mRules->Count() : 0); for (index = 0; index < count; index++) { nsICSSStyleRulePtr rule = (nsICSSStyleRule*)mRules->ElementAt(index); diff --git a/mozilla/layout/html/table/src/nsCellLayoutData.cpp b/mozilla/layout/html/table/src/nsCellLayoutData.cpp index 0bdc2434b9d..2e22a2327da 100644 --- a/mozilla/layout/html/table/src/nsCellLayoutData.cpp +++ b/mozilla/layout/html/table/src/nsCellLayoutData.cpp @@ -338,7 +338,7 @@ nsIStyleContext* nsCellLayoutData::FindHighestPrecedentBorder(nsVoidArray* aList style.SetAddRef(CompareCellBorders(style,aEdge, style2,aEdge)); } } - if ((style != NULL) && (GetMargin(style,aEdge) != 0)) + if (style.IsNotNull() && (GetMargin(style,aEdge) != 0)) result = style.AddRef(); } return result; @@ -358,7 +358,7 @@ nsStyleSpacing* nsCellLayoutData::FindInnerBorder( nsIStyleContext* aStyle, { nsIStyleContextPtr style; nsIStyleContextPtr altStyle = FindHighestPrecedentBorder(aList,opposite); - if (altStyle != nsnull) + if (altStyle.IsNotNull()) style.SetAddRef(CompareCellBorders(aStyle,aEdge,altStyle,opposite)); else style.SetAddRef(aStyle); @@ -421,7 +421,7 @@ nsStyleSpacing* nsCellLayoutData::FindOuterBorder( nsTableFrame* aTableFrame, // if the padding for the parent style is zero just // recursively call this routine PRInt32 padding = GetPadding(parentStyle,aEdge); - if ((parentStyle != NULL) && (padding == 0)) + if (parentStyle.IsNotNull() && (padding == 0)) { style = parentStyle; frame = parentFrame; diff --git a/mozilla/layout/html/table/src/nsTableFrame.cpp b/mozilla/layout/html/table/src/nsTableFrame.cpp index 9fc8d6a88ba..6a8b02b8b45 100644 --- a/mozilla/layout/html/table/src/nsTableFrame.cpp +++ b/mozilla/layout/html/table/src/nsTableFrame.cpp @@ -304,7 +304,7 @@ void nsTableFrame::ResetColumnLayoutData() // Check to see if cell the represents a top edge cell if (col == 0) - left == nsnull; + left = nsnull; else { cellData = cellMap->GetCellAt(row,col-1); @@ -603,7 +603,7 @@ nsIFrame::ReflowStatus nsTableFrame::ResizeReflowPass1(nsIPresContext* aPresCont */ for (;;) { nsIContentPtr kid = c->ChildAt(kidIndex); // kid: REFCNT++ - if (nsnull == kid) { + if (kid.IsNull()) { result = frComplete; break; } @@ -616,7 +616,7 @@ nsIFrame::ReflowStatus nsTableFrame::ResizeReflowPass1(nsIPresContext* aPresCont // Resolve style nsIStyleContextPtr kidStyleContext = aPresContext->ResolveStyleContextFor(kid, this); - NS_ASSERTION(nsnull != kidStyleContext, "null style context for kid"); + NS_ASSERTION(kidStyleContext.IsNotNull(), "null style context for kid"); // SEC: TODO: when content is appended or deleted, be sure to clear out the frame hierarchy!!!! @@ -1385,7 +1385,7 @@ nsTableFrame::ReflowUnmappedChildren(nsIPresContext* aPresContext, for (;;) { // Get the next content object nsIContentPtr kid = mContent->ChildAt(kidIndex); - if (nsnull == kid) { + if (kid.IsNull()) { result = frComplete; break; } @@ -1629,7 +1629,7 @@ PRBool nsTableFrame::AssignFixedColumnWidths(nsIPresContext* aPresContext, nsColLayoutData * colData = (nsColLayoutData *)(columnLayoutData->ElementAt(colIndex)); NS_ASSERTION(nsnull != colData, "bad column data"); nsTableColPtr col = colData->GetCol(); // col: ADDREF++ - NS_ASSERTION(nsnull != col, "bad col"); + NS_ASSERTION(col.IsNotNull(), "bad col"); // need to track min/max column width for setting min/max table widths PRInt32 minColWidth = 0; @@ -2223,7 +2223,7 @@ void nsTableFrame::ShrinkWrapChildren(nsIPresContext* aPresContext, nsTableContentPtr kid; kidFrame->GetContent((nsIContent*&)(kid.AssignRef())); // kid: REFCNT++ - NS_ASSERTION(nsnull != kid, "bad kid"); + NS_ASSERTION(kid.IsNotNull(), "bad kid"); if (kid->GetType() == nsITableContent::kTableRowGroupType) { /* Step 1: set the row height to the height of the tallest cell, @@ -2507,7 +2507,7 @@ PRBool nsTableFrame::SetCellLayoutData(nsCellLayoutData * aData, nsTableCell *aC for (PRInt32 i=0; iChildAt(i); - NS_ASSERTION(nsnull != tableKid, "bad kid"); + NS_ASSERTION(tableKid.IsNotNull(), "bad kid"); const int contentType = tableKid->GetType(); if (contentType == nsITableContent::kTableColGroupType) { @@ -2515,7 +2515,7 @@ PRBool nsTableFrame::SetCellLayoutData(nsCellLayoutData * aData, nsTableCell *aC for (PRInt32 j=0; jChildAt(j); - NS_ASSERTION(nsnull != col, "bad content"); + NS_ASSERTION(col.IsNotNull(), "bad content"); nsColLayoutData *colData = new nsColLayoutData(col); mColumnLayoutData->AppendElement((void *)colData); } diff --git a/mozilla/layout/html/table/src/nsTableOuterFrame.cpp b/mozilla/layout/html/table/src/nsTableOuterFrame.cpp index 60acd628377..ed0e4bd87c5 100644 --- a/mozilla/layout/html/table/src/nsTableOuterFrame.cpp +++ b/mozilla/layout/html/table/src/nsTableOuterFrame.cpp @@ -887,7 +887,7 @@ nsTableOuterFrame::ReflowChild( nsIFrame* aKidFrame, nsIStyleContextPtr captionStyleContext; aKidFrame->GetStyleContext(aPresContext, captionStyleContext.AssignRef()); - NS_ASSERTION(nsnull != captionStyleContext, "null style context for caption"); + NS_ASSERTION(captionStyleContext.IsNotNull(), "null style context for caption"); nsStyleText* captionStyle = (nsStyleText*)captionStyleContext->GetData(kStyleTextSID); NS_ASSERTION(nsnull != captionStyle, "null style molecule for caption"); @@ -942,7 +942,7 @@ void nsTableOuterFrame::CreateChildFrames(nsIPresContext* aPresContext) // Resolve style nsIStyleContextPtr kidStyleContext = aPresContext->ResolveStyleContextFor(mContent, this); - NS_ASSERTION(nsnull!=kidStyleContext, "bad style context for kid."); + NS_ASSERTION(kidStyleContext.IsNotNull(), "bad style context for kid."); mInnerTableFrame->SetStyleContext(kidStyleContext); mChildCount++; // Link child frame into the list of children @@ -956,7 +956,7 @@ void nsTableOuterFrame::CreateChildFrames(nsIPresContext* aPresContext) nsIFrame *lastTopCaption = nsnull; for (PRInt32 kidIndex=0; /* nada */ ;kidIndex++) { nsIContentPtr caption = mContent->ChildAt(kidIndex); // caption: REFCNT++ - if (nsnull == caption) { + if (caption.IsNull()) { break; } const PRInt32 contentType = ((nsTableContent *)(nsIContent*)caption)->GetType(); @@ -969,7 +969,7 @@ void nsTableOuterFrame::CreateChildFrames(nsIPresContext* aPresContext) // Resolve style nsIStyleContextPtr captionStyleContext = aPresContext->ResolveStyleContextFor(caption, this); - NS_ASSERTION(nsnull!=captionStyleContext, "bad style context for caption."); + NS_ASSERTION(captionStyleContext.IsNotNull(), "bad style context for caption."); nsStyleText* captionStyle = (nsStyleText*)captionStyleContext->GetData(kStyleTextSID); captionFrame->SetStyleContext(captionStyleContext); @@ -1055,7 +1055,7 @@ nsTableOuterFrame::ResizeReflowTopCaptionsPass2(nsIPresContext* aPresContext, nsIStyleContextPtr captionStyleContext; captionFrame->GetStyleContext(aPresContext, captionStyleContext.AssignRef()); - NS_ASSERTION(nsnull != captionStyleContext, "null style context for caption"); + NS_ASSERTION(captionStyleContext.IsNotNull(), "null style context for caption"); nsStyleText* captionStyle = (nsStyleText*)captionStyleContext->GetData(kStyleTextSID); NS_ASSERTION(nsnull != captionStyle, "null style molecule for caption"); diff --git a/mozilla/layout/html/table/src/nsTableRowGroupFrame.cpp b/mozilla/layout/html/table/src/nsTableRowGroupFrame.cpp index 411a05ed2a4..efc5c86d4af 100644 --- a/mozilla/layout/html/table/src/nsTableRowGroupFrame.cpp +++ b/mozilla/layout/html/table/src/nsTableRowGroupFrame.cpp @@ -714,7 +714,7 @@ nsTableRowGroupFrame::ReflowUnmappedChildren(nsIPresContext* aPresContext, for (;;) { // Get the next content object nsIContentPtr kid = mContent->ChildAt(kidIndex); - if (nsnull == kid) { + if (kid.IsNull()) { result = frComplete; break; } diff --git a/mozilla/layout/style/nsCSSStyleSheet.cpp b/mozilla/layout/style/nsCSSStyleSheet.cpp index 472bf6e7372..b0fce35d38c 100644 --- a/mozilla/layout/style/nsCSSStyleSheet.cpp +++ b/mozilla/layout/style/nsCSSStyleSheet.cpp @@ -220,7 +220,7 @@ PRInt32 CSSStyleSheetImpl::RulesMatching(nsIPresContext* aPresContext, child = ((CSSStyleSheetImpl*)child)->mNext; } - PRInt32 count = ((nsnull != mRules) ? mRules->Count() : 0); + PRInt32 count = (mRules.IsNotNull() ? mRules->Count() : 0); for (PRInt32 index = 0; index < count; index++) { nsICSSStyleRulePtr rule = (nsICSSStyleRule*)mRules->ElementAt(index); @@ -272,12 +272,12 @@ void CSSStyleSheetImpl::AppendStyleSheet(nsICSSStyleSheet* aSheet) { NS_PRECONDITION(nsnull != aSheet, "null arg"); - if (nsnull == mFirstChild) { + if (mFirstChild.IsNull()) { mFirstChild.SetAddRef(aSheet); } else { nsICSSStyleSheet* child = mFirstChild; - while (nsnull != ((CSSStyleSheetImpl*)child)->mNext) { + while (((CSSStyleSheetImpl*)child)->mNext.IsNotNull()) { child = ((CSSStyleSheetImpl*)child)->mNext; } ((CSSStyleSheetImpl*)child)->mNext.SetAddRef(aSheet); @@ -289,7 +289,7 @@ void CSSStyleSheetImpl::PrependStyleRule(nsICSSStyleRule* aRule) NS_PRECONDITION(nsnull != aRule, "null arg"); //XXX replace this with a binary search? PRInt32 weight = aRule->GetWeight(); - if (nsnull == mRules) { + if (mRules.IsNull()) { if (NS_OK != NS_NewISupportsArray(mRules.AssignPtr())) return; } @@ -309,7 +309,7 @@ void CSSStyleSheetImpl::AppendStyleRule(nsICSSStyleRule* aRule) //XXX replace this with a binary search? PRInt32 weight = aRule->GetWeight(); - if (nsnull == mRules) { + if (mRules.IsNull()) { if (NS_OK != NS_NewISupportsArray(mRules.AssignPtr())) return; } @@ -343,7 +343,7 @@ void CSSStyleSheetImpl::List(FILE* out, PRInt32 aIndent) const child = ((CSSStyleSheetImpl*)child)->mNext; } - PRInt32 count = ((nsnull != mRules) ? mRules->Count() : 0); + PRInt32 count = (mRules.IsNotNull() ? mRules->Count() : 0); for (index = 0; index < count; index++) { nsICSSStyleRulePtr rule = (nsICSSStyleRule*)mRules->ElementAt(index); diff --git a/mozilla/layout/tables/nsTableFrame.cpp b/mozilla/layout/tables/nsTableFrame.cpp index 9fc8d6a88ba..6a8b02b8b45 100644 --- a/mozilla/layout/tables/nsTableFrame.cpp +++ b/mozilla/layout/tables/nsTableFrame.cpp @@ -304,7 +304,7 @@ void nsTableFrame::ResetColumnLayoutData() // Check to see if cell the represents a top edge cell if (col == 0) - left == nsnull; + left = nsnull; else { cellData = cellMap->GetCellAt(row,col-1); @@ -603,7 +603,7 @@ nsIFrame::ReflowStatus nsTableFrame::ResizeReflowPass1(nsIPresContext* aPresCont */ for (;;) { nsIContentPtr kid = c->ChildAt(kidIndex); // kid: REFCNT++ - if (nsnull == kid) { + if (kid.IsNull()) { result = frComplete; break; } @@ -616,7 +616,7 @@ nsIFrame::ReflowStatus nsTableFrame::ResizeReflowPass1(nsIPresContext* aPresCont // Resolve style nsIStyleContextPtr kidStyleContext = aPresContext->ResolveStyleContextFor(kid, this); - NS_ASSERTION(nsnull != kidStyleContext, "null style context for kid"); + NS_ASSERTION(kidStyleContext.IsNotNull(), "null style context for kid"); // SEC: TODO: when content is appended or deleted, be sure to clear out the frame hierarchy!!!! @@ -1385,7 +1385,7 @@ nsTableFrame::ReflowUnmappedChildren(nsIPresContext* aPresContext, for (;;) { // Get the next content object nsIContentPtr kid = mContent->ChildAt(kidIndex); - if (nsnull == kid) { + if (kid.IsNull()) { result = frComplete; break; } @@ -1629,7 +1629,7 @@ PRBool nsTableFrame::AssignFixedColumnWidths(nsIPresContext* aPresContext, nsColLayoutData * colData = (nsColLayoutData *)(columnLayoutData->ElementAt(colIndex)); NS_ASSERTION(nsnull != colData, "bad column data"); nsTableColPtr col = colData->GetCol(); // col: ADDREF++ - NS_ASSERTION(nsnull != col, "bad col"); + NS_ASSERTION(col.IsNotNull(), "bad col"); // need to track min/max column width for setting min/max table widths PRInt32 minColWidth = 0; @@ -2223,7 +2223,7 @@ void nsTableFrame::ShrinkWrapChildren(nsIPresContext* aPresContext, nsTableContentPtr kid; kidFrame->GetContent((nsIContent*&)(kid.AssignRef())); // kid: REFCNT++ - NS_ASSERTION(nsnull != kid, "bad kid"); + NS_ASSERTION(kid.IsNotNull(), "bad kid"); if (kid->GetType() == nsITableContent::kTableRowGroupType) { /* Step 1: set the row height to the height of the tallest cell, @@ -2507,7 +2507,7 @@ PRBool nsTableFrame::SetCellLayoutData(nsCellLayoutData * aData, nsTableCell *aC for (PRInt32 i=0; iChildAt(i); - NS_ASSERTION(nsnull != tableKid, "bad kid"); + NS_ASSERTION(tableKid.IsNotNull(), "bad kid"); const int contentType = tableKid->GetType(); if (contentType == nsITableContent::kTableColGroupType) { @@ -2515,7 +2515,7 @@ PRBool nsTableFrame::SetCellLayoutData(nsCellLayoutData * aData, nsTableCell *aC for (PRInt32 j=0; jChildAt(j); - NS_ASSERTION(nsnull != col, "bad content"); + NS_ASSERTION(col.IsNotNull(), "bad content"); nsColLayoutData *colData = new nsColLayoutData(col); mColumnLayoutData->AppendElement((void *)colData); } diff --git a/mozilla/layout/tables/nsTableOuterFrame.cpp b/mozilla/layout/tables/nsTableOuterFrame.cpp index 60acd628377..ed0e4bd87c5 100644 --- a/mozilla/layout/tables/nsTableOuterFrame.cpp +++ b/mozilla/layout/tables/nsTableOuterFrame.cpp @@ -887,7 +887,7 @@ nsTableOuterFrame::ReflowChild( nsIFrame* aKidFrame, nsIStyleContextPtr captionStyleContext; aKidFrame->GetStyleContext(aPresContext, captionStyleContext.AssignRef()); - NS_ASSERTION(nsnull != captionStyleContext, "null style context for caption"); + NS_ASSERTION(captionStyleContext.IsNotNull(), "null style context for caption"); nsStyleText* captionStyle = (nsStyleText*)captionStyleContext->GetData(kStyleTextSID); NS_ASSERTION(nsnull != captionStyle, "null style molecule for caption"); @@ -942,7 +942,7 @@ void nsTableOuterFrame::CreateChildFrames(nsIPresContext* aPresContext) // Resolve style nsIStyleContextPtr kidStyleContext = aPresContext->ResolveStyleContextFor(mContent, this); - NS_ASSERTION(nsnull!=kidStyleContext, "bad style context for kid."); + NS_ASSERTION(kidStyleContext.IsNotNull(), "bad style context for kid."); mInnerTableFrame->SetStyleContext(kidStyleContext); mChildCount++; // Link child frame into the list of children @@ -956,7 +956,7 @@ void nsTableOuterFrame::CreateChildFrames(nsIPresContext* aPresContext) nsIFrame *lastTopCaption = nsnull; for (PRInt32 kidIndex=0; /* nada */ ;kidIndex++) { nsIContentPtr caption = mContent->ChildAt(kidIndex); // caption: REFCNT++ - if (nsnull == caption) { + if (caption.IsNull()) { break; } const PRInt32 contentType = ((nsTableContent *)(nsIContent*)caption)->GetType(); @@ -969,7 +969,7 @@ void nsTableOuterFrame::CreateChildFrames(nsIPresContext* aPresContext) // Resolve style nsIStyleContextPtr captionStyleContext = aPresContext->ResolveStyleContextFor(caption, this); - NS_ASSERTION(nsnull!=captionStyleContext, "bad style context for caption."); + NS_ASSERTION(captionStyleContext.IsNotNull(), "bad style context for caption."); nsStyleText* captionStyle = (nsStyleText*)captionStyleContext->GetData(kStyleTextSID); captionFrame->SetStyleContext(captionStyleContext); @@ -1055,7 +1055,7 @@ nsTableOuterFrame::ResizeReflowTopCaptionsPass2(nsIPresContext* aPresContext, nsIStyleContextPtr captionStyleContext; captionFrame->GetStyleContext(aPresContext, captionStyleContext.AssignRef()); - NS_ASSERTION(nsnull != captionStyleContext, "null style context for caption"); + NS_ASSERTION(captionStyleContext.IsNotNull(), "null style context for caption"); nsStyleText* captionStyle = (nsStyleText*)captionStyleContext->GetData(kStyleTextSID); NS_ASSERTION(nsnull != captionStyle, "null style molecule for caption"); diff --git a/mozilla/layout/tables/nsTableRowGroupFrame.cpp b/mozilla/layout/tables/nsTableRowGroupFrame.cpp index 411a05ed2a4..efc5c86d4af 100644 --- a/mozilla/layout/tables/nsTableRowGroupFrame.cpp +++ b/mozilla/layout/tables/nsTableRowGroupFrame.cpp @@ -714,7 +714,7 @@ nsTableRowGroupFrame::ReflowUnmappedChildren(nsIPresContext* aPresContext, for (;;) { // Get the next content object nsIContentPtr kid = mContent->ChildAt(kidIndex); - if (nsnull == kid) { + if (kid.IsNull()) { result = frComplete; break; }