Fix porting bugs - made it compile on IRIX

This commit is contained in:
kipp 1998-04-26 02:59:29 +00:00
Родитель 6621a09942
Коммит 86764b175c
33 изменённых файлов: 106 добавлений и 126 удалений

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

@ -220,7 +220,7 @@ PRInt32 CSSStyleSheetImpl::RulesMatching(nsIPresContext* aPresContext,
child = ((CSSStyleSheetImpl*)child)->mNext; 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++) { for (PRInt32 index = 0; index < count; index++) {
nsICSSStyleRulePtr rule = (nsICSSStyleRule*)mRules->ElementAt(index); nsICSSStyleRulePtr rule = (nsICSSStyleRule*)mRules->ElementAt(index);
@ -272,12 +272,12 @@ void CSSStyleSheetImpl::AppendStyleSheet(nsICSSStyleSheet* aSheet)
{ {
NS_PRECONDITION(nsnull != aSheet, "null arg"); NS_PRECONDITION(nsnull != aSheet, "null arg");
if (nsnull == mFirstChild) { if (mFirstChild.IsNull()) {
mFirstChild.SetAddRef(aSheet); mFirstChild.SetAddRef(aSheet);
} }
else { else {
nsICSSStyleSheet* child = mFirstChild; nsICSSStyleSheet* child = mFirstChild;
while (nsnull != ((CSSStyleSheetImpl*)child)->mNext) { while (((CSSStyleSheetImpl*)child)->mNext.IsNotNull()) {
child = ((CSSStyleSheetImpl*)child)->mNext; child = ((CSSStyleSheetImpl*)child)->mNext;
} }
((CSSStyleSheetImpl*)child)->mNext.SetAddRef(aSheet); ((CSSStyleSheetImpl*)child)->mNext.SetAddRef(aSheet);
@ -289,7 +289,7 @@ void CSSStyleSheetImpl::PrependStyleRule(nsICSSStyleRule* aRule)
NS_PRECONDITION(nsnull != aRule, "null arg"); NS_PRECONDITION(nsnull != aRule, "null arg");
//XXX replace this with a binary search? //XXX replace this with a binary search?
PRInt32 weight = aRule->GetWeight(); PRInt32 weight = aRule->GetWeight();
if (nsnull == mRules) { if (mRules.IsNull()) {
if (NS_OK != NS_NewISupportsArray(mRules.AssignPtr())) if (NS_OK != NS_NewISupportsArray(mRules.AssignPtr()))
return; return;
} }
@ -309,7 +309,7 @@ void CSSStyleSheetImpl::AppendStyleRule(nsICSSStyleRule* aRule)
//XXX replace this with a binary search? //XXX replace this with a binary search?
PRInt32 weight = aRule->GetWeight(); PRInt32 weight = aRule->GetWeight();
if (nsnull == mRules) { if (mRules.IsNull()) {
if (NS_OK != NS_NewISupportsArray(mRules.AssignPtr())) if (NS_OK != NS_NewISupportsArray(mRules.AssignPtr()))
return; return;
} }
@ -343,7 +343,7 @@ void CSSStyleSheetImpl::List(FILE* out, PRInt32 aIndent) const
child = ((CSSStyleSheetImpl*)child)->mNext; child = ((CSSStyleSheetImpl*)child)->mNext;
} }
PRInt32 count = ((nsnull != mRules) ? mRules->Count() : 0); PRInt32 count = (mRules.IsNotNull() ? mRules->Count() : 0);
for (index = 0; index < count; index++) { for (index = 0; index < count; index++) {
nsICSSStyleRulePtr rule = (nsICSSStyleRule*)mRules->ElementAt(index); nsICSSStyleRulePtr rule = (nsICSSStyleRule*)mRules->ElementAt(index);

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

@ -36,6 +36,7 @@
static NS_DEFINE_IID(kIPresContextIID, NS_IPRESCONTEXT_IID); static NS_DEFINE_IID(kIPresContextIID, NS_IPRESCONTEXT_IID);
#if 0
// XXX this code needs to move far away from here // XXX this code needs to move far away from here
static nsIImageManager* gImageManager = nsnull; static nsIImageManager* gImageManager = nsnull;
static void InitImageLibrary() static void InitImageLibrary()
@ -50,8 +51,9 @@ static void InitImageLibrary()
printf("can't initialize image library\n"); printf("can't initialize image library\n");
} }
// XXX end code with no home... // XXX end code with no home...
#endif
class ImageLoader : nsIImageRequestObserver { class ImageLoader : public nsIImageRequestObserver {
public: public:
ImageLoader(nsPresContext* aCX, nsIImageGroup* aGroup, nsIFrame* aFrame); ImageLoader(nsPresContext* aCX, nsIImageGroup* aGroup, nsIFrame* aFrame);
~ImageLoader(); ~ImageLoader();

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

@ -36,6 +36,7 @@
static NS_DEFINE_IID(kIPresContextIID, NS_IPRESCONTEXT_IID); static NS_DEFINE_IID(kIPresContextIID, NS_IPRESCONTEXT_IID);
#if 0
// XXX this code needs to move far away from here // XXX this code needs to move far away from here
static nsIImageManager* gImageManager = nsnull; static nsIImageManager* gImageManager = nsnull;
static void InitImageLibrary() static void InitImageLibrary()
@ -50,8 +51,9 @@ static void InitImageLibrary()
printf("can't initialize image library\n"); printf("can't initialize image library\n");
} }
// XXX end code with no home... // XXX end code with no home...
#endif
class ImageLoader : nsIImageRequestObserver { class ImageLoader : public nsIImageRequestObserver {
public: public:
ImageLoader(nsPresContext* aCX, nsIImageGroup* aGroup, nsIFrame* aFrame); ImageLoader(nsPresContext* aCX, nsIImageGroup* aGroup, nsIFrame* aFrame);
~ImageLoader(); ~ImageLoader();

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

@ -237,5 +237,5 @@ nsIFrame* nsReflowCommand::GetNext() const
if (count > 0) { if (count > 0) {
rv = (nsIFrame*) mPath[count - 1]; rv = (nsIFrame*) mPath[count - 1];
} }
return nsnull; return rv;
} }

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

@ -1162,7 +1162,6 @@ nsBlockFrame::ReflowMappedChildren(nsIPresContext* aCX,
PRBool result = PR_TRUE; PRBool result = PR_TRUE;
nsIFrame* kidFrame; nsIFrame* kidFrame;
nsIFrame* prevKidFrame = nsnull;
for (kidFrame = mFirstChild; nsnull != kidFrame; ) { for (kidFrame = mFirstChild; nsnull != kidFrame; ) {
nsIContentPtr kid; nsIContentPtr kid;
@ -1218,7 +1217,6 @@ nsBlockFrame::ReflowMappedChildren(nsIPresContext* aCX,
} }
// Get the next child frame // Get the next child frame
prevKidFrame = kidFrame;
kidFrame->GetNextSibling(kidFrame); kidFrame->GetNextSibling(kidFrame);
} }
@ -1255,7 +1253,7 @@ PRBool nsBlockFrame::MoreToReflow(nsIPresContext* aCX)
// Get the next content object that we would like to reflow // Get the next content object that we would like to reflow
PRInt32 kidIndex = NextChildOffset(); PRInt32 kidIndex = NextChildOffset();
nsIContentPtr kid = mContent->ChildAt(kidIndex); nsIContentPtr kid = mContent->ChildAt(kidIndex);
if (nsnull != kid) { if (kid.IsNotNull()) {
// Resolve style for the kid // Resolve style for the kid
nsIStyleContextPtr kidSC = aCX->ResolveStyleContextFor(kid, this); nsIStyleContextPtr kidSC = aCX->ResolveStyleContextFor(kid, this);
nsStyleDisplay* kidStyleDisplay = (nsStyleDisplay*) nsStyleDisplay* kidStyleDisplay = (nsStyleDisplay*)
@ -1318,7 +1316,7 @@ nsBlockFrame::ReflowAppendedChildren(nsIPresContext* aCX,
for (;;) { for (;;) {
// Get the next content object // Get the next content object
nsIContentPtr kid = mContent->ChildAt(kidIndex); nsIContentPtr kid = mContent->ChildAt(kidIndex);
if (nsnull == kid) { if (kid.IsNull()) {
result = frComplete; result = frComplete;
break; break;
} }
@ -1340,7 +1338,6 @@ nsBlockFrame::ReflowAppendedChildren(nsIPresContext* aCX,
} else if (nsnull == kidPrevInFlow) { } else if (nsnull == kidPrevInFlow) {
// Create initial frame for the child // Create initial frame for the child
nsIContentDelegate* kidDel; nsIContentDelegate* kidDel;
nsresult fr;
switch (kidDisplay->mDisplay) { switch (kidDisplay->mDisplay) {
case NS_STYLE_DISPLAY_BLOCK: case NS_STYLE_DISPLAY_BLOCK:
case NS_STYLE_DISPLAY_LIST_ITEM: case NS_STYLE_DISPLAY_LIST_ITEM:
@ -1369,7 +1366,7 @@ nsBlockFrame::ReflowAppendedChildren(nsIPresContext* aCX,
default: default:
NS_ASSERTION(nsnull == kidPrevInFlow, "bad prev in flow"); NS_ASSERTION(nsnull == kidPrevInFlow, "bad prev in flow");
fr = nsFrame::NewFrame(&kidFrame, kid, kidIndex, this); nsFrame::NewFrame(&kidFrame, kid, kidIndex, this);
break; break;
} }
kidFrame->SetStyleContext(kidSC); kidFrame->SetStyleContext(kidSC);

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

@ -1162,7 +1162,6 @@ nsBlockFrame::ReflowMappedChildren(nsIPresContext* aCX,
PRBool result = PR_TRUE; PRBool result = PR_TRUE;
nsIFrame* kidFrame; nsIFrame* kidFrame;
nsIFrame* prevKidFrame = nsnull;
for (kidFrame = mFirstChild; nsnull != kidFrame; ) { for (kidFrame = mFirstChild; nsnull != kidFrame; ) {
nsIContentPtr kid; nsIContentPtr kid;
@ -1218,7 +1217,6 @@ nsBlockFrame::ReflowMappedChildren(nsIPresContext* aCX,
} }
// Get the next child frame // Get the next child frame
prevKidFrame = kidFrame;
kidFrame->GetNextSibling(kidFrame); kidFrame->GetNextSibling(kidFrame);
} }
@ -1255,7 +1253,7 @@ PRBool nsBlockFrame::MoreToReflow(nsIPresContext* aCX)
// Get the next content object that we would like to reflow // Get the next content object that we would like to reflow
PRInt32 kidIndex = NextChildOffset(); PRInt32 kidIndex = NextChildOffset();
nsIContentPtr kid = mContent->ChildAt(kidIndex); nsIContentPtr kid = mContent->ChildAt(kidIndex);
if (nsnull != kid) { if (kid.IsNotNull()) {
// Resolve style for the kid // Resolve style for the kid
nsIStyleContextPtr kidSC = aCX->ResolveStyleContextFor(kid, this); nsIStyleContextPtr kidSC = aCX->ResolveStyleContextFor(kid, this);
nsStyleDisplay* kidStyleDisplay = (nsStyleDisplay*) nsStyleDisplay* kidStyleDisplay = (nsStyleDisplay*)
@ -1318,7 +1316,7 @@ nsBlockFrame::ReflowAppendedChildren(nsIPresContext* aCX,
for (;;) { for (;;) {
// Get the next content object // Get the next content object
nsIContentPtr kid = mContent->ChildAt(kidIndex); nsIContentPtr kid = mContent->ChildAt(kidIndex);
if (nsnull == kid) { if (kid.IsNull()) {
result = frComplete; result = frComplete;
break; break;
} }
@ -1340,7 +1338,6 @@ nsBlockFrame::ReflowAppendedChildren(nsIPresContext* aCX,
} else if (nsnull == kidPrevInFlow) { } else if (nsnull == kidPrevInFlow) {
// Create initial frame for the child // Create initial frame for the child
nsIContentDelegate* kidDel; nsIContentDelegate* kidDel;
nsresult fr;
switch (kidDisplay->mDisplay) { switch (kidDisplay->mDisplay) {
case NS_STYLE_DISPLAY_BLOCK: case NS_STYLE_DISPLAY_BLOCK:
case NS_STYLE_DISPLAY_LIST_ITEM: case NS_STYLE_DISPLAY_LIST_ITEM:
@ -1369,7 +1366,7 @@ nsBlockFrame::ReflowAppendedChildren(nsIPresContext* aCX,
default: default:
NS_ASSERTION(nsnull == kidPrevInFlow, "bad prev in flow"); NS_ASSERTION(nsnull == kidPrevInFlow, "bad prev in flow");
fr = nsFrame::NewFrame(&kidFrame, kid, kidIndex, this); nsFrame::NewFrame(&kidFrame, kid, kidIndex, this);
break; break;
} }
kidFrame->SetStyleContext(kidSC); kidFrame->SetStyleContext(kidSC);

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

@ -1162,7 +1162,6 @@ nsBlockFrame::ReflowMappedChildren(nsIPresContext* aCX,
PRBool result = PR_TRUE; PRBool result = PR_TRUE;
nsIFrame* kidFrame; nsIFrame* kidFrame;
nsIFrame* prevKidFrame = nsnull;
for (kidFrame = mFirstChild; nsnull != kidFrame; ) { for (kidFrame = mFirstChild; nsnull != kidFrame; ) {
nsIContentPtr kid; nsIContentPtr kid;
@ -1218,7 +1217,6 @@ nsBlockFrame::ReflowMappedChildren(nsIPresContext* aCX,
} }
// Get the next child frame // Get the next child frame
prevKidFrame = kidFrame;
kidFrame->GetNextSibling(kidFrame); kidFrame->GetNextSibling(kidFrame);
} }
@ -1255,7 +1253,7 @@ PRBool nsBlockFrame::MoreToReflow(nsIPresContext* aCX)
// Get the next content object that we would like to reflow // Get the next content object that we would like to reflow
PRInt32 kidIndex = NextChildOffset(); PRInt32 kidIndex = NextChildOffset();
nsIContentPtr kid = mContent->ChildAt(kidIndex); nsIContentPtr kid = mContent->ChildAt(kidIndex);
if (nsnull != kid) { if (kid.IsNotNull()) {
// Resolve style for the kid // Resolve style for the kid
nsIStyleContextPtr kidSC = aCX->ResolveStyleContextFor(kid, this); nsIStyleContextPtr kidSC = aCX->ResolveStyleContextFor(kid, this);
nsStyleDisplay* kidStyleDisplay = (nsStyleDisplay*) nsStyleDisplay* kidStyleDisplay = (nsStyleDisplay*)
@ -1318,7 +1316,7 @@ nsBlockFrame::ReflowAppendedChildren(nsIPresContext* aCX,
for (;;) { for (;;) {
// Get the next content object // Get the next content object
nsIContentPtr kid = mContent->ChildAt(kidIndex); nsIContentPtr kid = mContent->ChildAt(kidIndex);
if (nsnull == kid) { if (kid.IsNull()) {
result = frComplete; result = frComplete;
break; break;
} }
@ -1340,7 +1338,6 @@ nsBlockFrame::ReflowAppendedChildren(nsIPresContext* aCX,
} else if (nsnull == kidPrevInFlow) { } else if (nsnull == kidPrevInFlow) {
// Create initial frame for the child // Create initial frame for the child
nsIContentDelegate* kidDel; nsIContentDelegate* kidDel;
nsresult fr;
switch (kidDisplay->mDisplay) { switch (kidDisplay->mDisplay) {
case NS_STYLE_DISPLAY_BLOCK: case NS_STYLE_DISPLAY_BLOCK:
case NS_STYLE_DISPLAY_LIST_ITEM: case NS_STYLE_DISPLAY_LIST_ITEM:
@ -1369,7 +1366,7 @@ nsBlockFrame::ReflowAppendedChildren(nsIPresContext* aCX,
default: default:
NS_ASSERTION(nsnull == kidPrevInFlow, "bad prev in flow"); NS_ASSERTION(nsnull == kidPrevInFlow, "bad prev in flow");
fr = nsFrame::NewFrame(&kidFrame, kid, kidIndex, this); nsFrame::NewFrame(&kidFrame, kid, kidIndex, this);
break; break;
} }
kidFrame->SetStyleContext(kidSC); kidFrame->SetStyleContext(kidSC);

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

@ -1162,7 +1162,6 @@ nsBlockFrame::ReflowMappedChildren(nsIPresContext* aCX,
PRBool result = PR_TRUE; PRBool result = PR_TRUE;
nsIFrame* kidFrame; nsIFrame* kidFrame;
nsIFrame* prevKidFrame = nsnull;
for (kidFrame = mFirstChild; nsnull != kidFrame; ) { for (kidFrame = mFirstChild; nsnull != kidFrame; ) {
nsIContentPtr kid; nsIContentPtr kid;
@ -1218,7 +1217,6 @@ nsBlockFrame::ReflowMappedChildren(nsIPresContext* aCX,
} }
// Get the next child frame // Get the next child frame
prevKidFrame = kidFrame;
kidFrame->GetNextSibling(kidFrame); kidFrame->GetNextSibling(kidFrame);
} }
@ -1255,7 +1253,7 @@ PRBool nsBlockFrame::MoreToReflow(nsIPresContext* aCX)
// Get the next content object that we would like to reflow // Get the next content object that we would like to reflow
PRInt32 kidIndex = NextChildOffset(); PRInt32 kidIndex = NextChildOffset();
nsIContentPtr kid = mContent->ChildAt(kidIndex); nsIContentPtr kid = mContent->ChildAt(kidIndex);
if (nsnull != kid) { if (kid.IsNotNull()) {
// Resolve style for the kid // Resolve style for the kid
nsIStyleContextPtr kidSC = aCX->ResolveStyleContextFor(kid, this); nsIStyleContextPtr kidSC = aCX->ResolveStyleContextFor(kid, this);
nsStyleDisplay* kidStyleDisplay = (nsStyleDisplay*) nsStyleDisplay* kidStyleDisplay = (nsStyleDisplay*)
@ -1318,7 +1316,7 @@ nsBlockFrame::ReflowAppendedChildren(nsIPresContext* aCX,
for (;;) { for (;;) {
// Get the next content object // Get the next content object
nsIContentPtr kid = mContent->ChildAt(kidIndex); nsIContentPtr kid = mContent->ChildAt(kidIndex);
if (nsnull == kid) { if (kid.IsNull()) {
result = frComplete; result = frComplete;
break; break;
} }
@ -1340,7 +1338,6 @@ nsBlockFrame::ReflowAppendedChildren(nsIPresContext* aCX,
} else if (nsnull == kidPrevInFlow) { } else if (nsnull == kidPrevInFlow) {
// Create initial frame for the child // Create initial frame for the child
nsIContentDelegate* kidDel; nsIContentDelegate* kidDel;
nsresult fr;
switch (kidDisplay->mDisplay) { switch (kidDisplay->mDisplay) {
case NS_STYLE_DISPLAY_BLOCK: case NS_STYLE_DISPLAY_BLOCK:
case NS_STYLE_DISPLAY_LIST_ITEM: case NS_STYLE_DISPLAY_LIST_ITEM:
@ -1369,7 +1366,7 @@ nsBlockFrame::ReflowAppendedChildren(nsIPresContext* aCX,
default: default:
NS_ASSERTION(nsnull == kidPrevInFlow, "bad prev in flow"); NS_ASSERTION(nsnull == kidPrevInFlow, "bad prev in flow");
fr = nsFrame::NewFrame(&kidFrame, kid, kidIndex, this); nsFrame::NewFrame(&kidFrame, kid, kidIndex, this);
break; break;
} }
kidFrame->SetStyleContext(kidSC); kidFrame->SetStyleContext(kidSC);

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

@ -1162,7 +1162,6 @@ nsBlockFrame::ReflowMappedChildren(nsIPresContext* aCX,
PRBool result = PR_TRUE; PRBool result = PR_TRUE;
nsIFrame* kidFrame; nsIFrame* kidFrame;
nsIFrame* prevKidFrame = nsnull;
for (kidFrame = mFirstChild; nsnull != kidFrame; ) { for (kidFrame = mFirstChild; nsnull != kidFrame; ) {
nsIContentPtr kid; nsIContentPtr kid;
@ -1218,7 +1217,6 @@ nsBlockFrame::ReflowMappedChildren(nsIPresContext* aCX,
} }
// Get the next child frame // Get the next child frame
prevKidFrame = kidFrame;
kidFrame->GetNextSibling(kidFrame); kidFrame->GetNextSibling(kidFrame);
} }
@ -1255,7 +1253,7 @@ PRBool nsBlockFrame::MoreToReflow(nsIPresContext* aCX)
// Get the next content object that we would like to reflow // Get the next content object that we would like to reflow
PRInt32 kidIndex = NextChildOffset(); PRInt32 kidIndex = NextChildOffset();
nsIContentPtr kid = mContent->ChildAt(kidIndex); nsIContentPtr kid = mContent->ChildAt(kidIndex);
if (nsnull != kid) { if (kid.IsNotNull()) {
// Resolve style for the kid // Resolve style for the kid
nsIStyleContextPtr kidSC = aCX->ResolveStyleContextFor(kid, this); nsIStyleContextPtr kidSC = aCX->ResolveStyleContextFor(kid, this);
nsStyleDisplay* kidStyleDisplay = (nsStyleDisplay*) nsStyleDisplay* kidStyleDisplay = (nsStyleDisplay*)
@ -1318,7 +1316,7 @@ nsBlockFrame::ReflowAppendedChildren(nsIPresContext* aCX,
for (;;) { for (;;) {
// Get the next content object // Get the next content object
nsIContentPtr kid = mContent->ChildAt(kidIndex); nsIContentPtr kid = mContent->ChildAt(kidIndex);
if (nsnull == kid) { if (kid.IsNull()) {
result = frComplete; result = frComplete;
break; break;
} }
@ -1340,7 +1338,6 @@ nsBlockFrame::ReflowAppendedChildren(nsIPresContext* aCX,
} else if (nsnull == kidPrevInFlow) { } else if (nsnull == kidPrevInFlow) {
// Create initial frame for the child // Create initial frame for the child
nsIContentDelegate* kidDel; nsIContentDelegate* kidDel;
nsresult fr;
switch (kidDisplay->mDisplay) { switch (kidDisplay->mDisplay) {
case NS_STYLE_DISPLAY_BLOCK: case NS_STYLE_DISPLAY_BLOCK:
case NS_STYLE_DISPLAY_LIST_ITEM: case NS_STYLE_DISPLAY_LIST_ITEM:
@ -1369,7 +1366,7 @@ nsBlockFrame::ReflowAppendedChildren(nsIPresContext* aCX,
default: default:
NS_ASSERTION(nsnull == kidPrevInFlow, "bad prev in flow"); NS_ASSERTION(nsnull == kidPrevInFlow, "bad prev in flow");
fr = nsFrame::NewFrame(&kidFrame, kid, kidIndex, this); nsFrame::NewFrame(&kidFrame, kid, kidIndex, this);
break; break;
} }
kidFrame->SetStyleContext(kidSC); kidFrame->SetStyleContext(kidSC);

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

@ -1162,7 +1162,6 @@ nsBlockFrame::ReflowMappedChildren(nsIPresContext* aCX,
PRBool result = PR_TRUE; PRBool result = PR_TRUE;
nsIFrame* kidFrame; nsIFrame* kidFrame;
nsIFrame* prevKidFrame = nsnull;
for (kidFrame = mFirstChild; nsnull != kidFrame; ) { for (kidFrame = mFirstChild; nsnull != kidFrame; ) {
nsIContentPtr kid; nsIContentPtr kid;
@ -1218,7 +1217,6 @@ nsBlockFrame::ReflowMappedChildren(nsIPresContext* aCX,
} }
// Get the next child frame // Get the next child frame
prevKidFrame = kidFrame;
kidFrame->GetNextSibling(kidFrame); kidFrame->GetNextSibling(kidFrame);
} }
@ -1255,7 +1253,7 @@ PRBool nsBlockFrame::MoreToReflow(nsIPresContext* aCX)
// Get the next content object that we would like to reflow // Get the next content object that we would like to reflow
PRInt32 kidIndex = NextChildOffset(); PRInt32 kidIndex = NextChildOffset();
nsIContentPtr kid = mContent->ChildAt(kidIndex); nsIContentPtr kid = mContent->ChildAt(kidIndex);
if (nsnull != kid) { if (kid.IsNotNull()) {
// Resolve style for the kid // Resolve style for the kid
nsIStyleContextPtr kidSC = aCX->ResolveStyleContextFor(kid, this); nsIStyleContextPtr kidSC = aCX->ResolveStyleContextFor(kid, this);
nsStyleDisplay* kidStyleDisplay = (nsStyleDisplay*) nsStyleDisplay* kidStyleDisplay = (nsStyleDisplay*)
@ -1318,7 +1316,7 @@ nsBlockFrame::ReflowAppendedChildren(nsIPresContext* aCX,
for (;;) { for (;;) {
// Get the next content object // Get the next content object
nsIContentPtr kid = mContent->ChildAt(kidIndex); nsIContentPtr kid = mContent->ChildAt(kidIndex);
if (nsnull == kid) { if (kid.IsNull()) {
result = frComplete; result = frComplete;
break; break;
} }
@ -1340,7 +1338,6 @@ nsBlockFrame::ReflowAppendedChildren(nsIPresContext* aCX,
} else if (nsnull == kidPrevInFlow) { } else if (nsnull == kidPrevInFlow) {
// Create initial frame for the child // Create initial frame for the child
nsIContentDelegate* kidDel; nsIContentDelegate* kidDel;
nsresult fr;
switch (kidDisplay->mDisplay) { switch (kidDisplay->mDisplay) {
case NS_STYLE_DISPLAY_BLOCK: case NS_STYLE_DISPLAY_BLOCK:
case NS_STYLE_DISPLAY_LIST_ITEM: case NS_STYLE_DISPLAY_LIST_ITEM:
@ -1369,7 +1366,7 @@ nsBlockFrame::ReflowAppendedChildren(nsIPresContext* aCX,
default: default:
NS_ASSERTION(nsnull == kidPrevInFlow, "bad prev in flow"); NS_ASSERTION(nsnull == kidPrevInFlow, "bad prev in flow");
fr = nsFrame::NewFrame(&kidFrame, kid, kidIndex, this); nsFrame::NewFrame(&kidFrame, kid, kidIndex, this);
break; break;
} }
kidFrame->SetStyleContext(kidSC); kidFrame->SetStyleContext(kidSC);

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

@ -220,7 +220,6 @@ NS_METHOD nsBodyFrame::VerifyTree() const
NS_ASSERTION(mFirstContentOffset <= mLastContentOffset, "bad offsets"); NS_ASSERTION(mFirstContentOffset <= mLastContentOffset, "bad offsets");
// Verify child content offsets // Verify child content offsets
PRInt32 offset = mFirstContentOffset;
nsIFrame* child = mFirstChild; nsIFrame* child = mFirstChild;
while (nsnull != child) { while (nsnull != child) {
// Make sure that the child's tree is valid // Make sure that the child's tree is valid

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

@ -648,8 +648,6 @@ ColumnFrame::ReflowUnmappedChildren(nsIPresContext* aPresContext,
} }
} }
PRBool originalLastContentIsComplete = mLastContentIsComplete;
// Place our children, one at a time, until we are out of children // Place our children, one at a time, until we are out of children
nsSize kidMaxElementSize; nsSize kidMaxElementSize;
nsSize* pKidMaxElementSize = (nsnull != aMaxElementSize) ? &kidMaxElementSize : nsnull; nsSize* pKidMaxElementSize = (nsnull != aMaxElementSize) ? &kidMaxElementSize : nsnull;
@ -661,7 +659,7 @@ ColumnFrame::ReflowUnmappedChildren(nsIPresContext* aPresContext,
for (;;) { for (;;) {
// Get the next content object // Get the next content object
nsIContentPtr kid = mContent->ChildAt(kidIndex); nsIContentPtr kid = mContent->ChildAt(kidIndex);
if (nsnull == kid) { if (kid.IsNull()) {
result = frComplete; result = frComplete;
break; break;
} }

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

@ -19,7 +19,6 @@
#include "nsDOMIterator.h" #include "nsDOMIterator.h"
#include "nsIDOMNode.h" #include "nsIDOMNode.h"
static NS_DEFINE_IID(kIContentIID, NS_ICONTENT_IID);
static NS_DEFINE_IID(kIDOMNodeIID, NS_IDOMNODE_IID); static NS_DEFINE_IID(kIDOMNodeIID, NS_IDOMNODE_IID);
nsDOMIterator::nsDOMIterator(nsIContent &aContent) : mContent(aContent) nsDOMIterator::nsDOMIterator(nsIContent &aContent) : mContent(aContent)

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

@ -182,7 +182,6 @@ NS_METHOD HRuleFrame::Paint(nsIPresContext& aPresContext,
// When a rule is not shaded, then we use a uniform color and // When a rule is not shaded, then we use a uniform color and
// draw half-circles on the end points. // draw half-circles on the end points.
aRenderingContext.SetColor (colors[0]); aRenderingContext.SetColor (colors[0]);
float t2p = 1.0f / p2t;
nscoord diameter = height; nscoord diameter = height;
if ((diameter > width) || (diameter < nscoord(p2t * 3))) { if ((diameter > width) || (diameter < nscoord(p2t * 3))) {
// The half-circles on the ends of the rule aren't going to // The half-circles on the ends of the rule aren't going to

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

@ -991,7 +991,6 @@ NS_METHOD TextFrame::JustifyReflow(nsIPresContext* aCX, nscoord aAvailableSpace)
// space and compress down whitespace. // space and compress down whitespace.
Text* txt = (Text*) mContent; Text* txt = (Text*) mContent;
const PRUnichar* cp = txt->mText + mContentOffset; const PRUnichar* cp = txt->mText + mContentOffset;
const PRUnichar* cpStart = cp;
const PRUnichar* end = cp + mContentLength; const PRUnichar* end = cp + mContentLength;
PRUint32* wp = wp0; PRUint32* wp = wp0;
PRUint32* wpend = wp0 + maxWords; PRUint32* wpend = wp0 + maxWords;

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

@ -98,7 +98,7 @@ public:
return rv; return rv;
} }
NS_DECL_ISUPPORTS; NS_DECL_ISUPPORTS
virtual void OnRadioChecked(nsIFormControl& aRadio); virtual void OnRadioChecked(nsIFormControl& aRadio);

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

@ -30,7 +30,7 @@
#include "nsHTMLAtoms.h" #include "nsHTMLAtoms.h"
#include "nsIView.h" #include "nsIView.h"
#include "nsIViewManager.h" #include "nsIViewManager.h"
#include "nscoord.h" #include "nsCoord.h"
#include "nsDebug.h" #include "nsDebug.h"
#include "nsIWidget.h" #include "nsIWidget.h"
#include "nsHTMLForms.h" #include "nsHTMLForms.h"

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

@ -85,9 +85,9 @@ public:
virtual void MouseClicked(nsIPresContext* aPresContext); virtual void MouseClicked(nsIPresContext* aPresContext);
virtual const nsIID GetCID(); virtual const nsIID& GetCID();
virtual const nsIID GetIID(); virtual const nsIID& GetIID();
nsInputButtonType GetButtonType() const; nsInputButtonType GetButtonType() const;
@ -311,14 +311,14 @@ nsInputButtonFrame::PostCreateWidget(nsIPresContext* aPresContext, nsIView *aVie
NS_RELEASE(button); NS_RELEASE(button);
} }
const nsIID const nsIID&
nsInputButtonFrame::GetIID() nsInputButtonFrame::GetIID()
{ {
static NS_DEFINE_IID(kButtonIID, NS_IBUTTON_IID); static NS_DEFINE_IID(kButtonIID, NS_IBUTTON_IID);
return kButtonIID; return kButtonIID;
} }
const nsIID const nsIID&
nsInputButtonFrame::GetCID() nsInputButtonFrame::GetCID()
{ {
static NS_DEFINE_IID(kButtonCID, NS_BUTTON_CID); static NS_DEFINE_IID(kButtonCID, NS_BUTTON_CID);

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

@ -39,9 +39,9 @@ public:
virtual void PostCreateWidget(nsIPresContext* aPresContext, nsIView *aView); 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); virtual void MouseClicked(nsIPresContext* aPresContext);
@ -67,14 +67,14 @@ nsInputCheckboxFrame::~nsInputCheckboxFrame()
} }
const nsIID const nsIID&
nsInputCheckboxFrame::GetIID() nsInputCheckboxFrame::GetIID()
{ {
static NS_DEFINE_IID(kCheckboxIID, NS_ICHECKBUTTON_IID); static NS_DEFINE_IID(kCheckboxIID, NS_ICHECKBUTTON_IID);
return kCheckboxIID; return kCheckboxIID;
} }
const nsIID const nsIID&
nsInputCheckboxFrame::GetCID() nsInputCheckboxFrame::GetCID()
{ {
static NS_DEFINE_IID(kCheckboxCID, NS_CHECKBUTTON_CID); static NS_DEFINE_IID(kCheckboxCID, NS_CHECKBUTTON_CID);

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

@ -206,7 +206,7 @@ nsInputFrame::ResizeReflow(nsIPresContext* aPresContext,
GetParentWithView(parWithView); GetParentWithView(parWithView);
parWithView->GetView(parView); parWithView->GetView(parView);
const nsIID id = GetCID(); const nsIID& id = GetCID();
nsInputWidgetData* initData = GetWidgetInitData(); // needs to be deleted nsInputWidgetData* initData = GetWidgetInitData(); // needs to be deleted
// initialize the view as hidden since we don't know the (x,y) until Paint // 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, 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() nsInputFrame::GetIID()
{ {
static NS_DEFINE_IID(kButtonIID, NS_IBUTTON_IID); static NS_DEFINE_IID(kButtonIID, NS_IBUTTON_IID);
return kButtonIID; return kButtonIID;
} }
const nsIID const nsIID&
nsInputFrame::GetCID() nsInputFrame::GetCID()
{ {
static NS_DEFINE_IID(kButtonCID, NS_BUTTON_CID); static NS_DEFINE_IID(kButtonCID, NS_BUTTON_CID);

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

@ -28,10 +28,10 @@ class nsIView;
class nsIPresContext; class nsIPresContext;
struct nsInputWidgetData { struct nsInputWidgetData {
DWORD arg1; PRInt32 arg1;
DWORD arg2; PRInt32 arg2;
DWORD arg3; PRInt32 arg3;
DWORD arg4; PRInt32 arg4;
}; };
/** /**
@ -124,13 +124,13 @@ public:
* Get the class id of the widget associated with this frame * Get the class id of the widget associated with this frame
* @return the class id * @return the class id
*/ */
virtual const nsIID GetCID(); virtual const nsIID& GetCID();
/** /**
* Get the interface id of widget associated with this frame * Get the interface id of widget associated with this frame
* @return the interface id * @return the interface id
*/ */
virtual const nsIID GetIID(); virtual const nsIID& GetIID();
/** /**
* Get the widget associated with this frame * Get the widget associated with this frame

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

@ -41,9 +41,9 @@ public:
virtual void PostCreateWidget(nsIPresContext* aPresContext, nsIView *aView); 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); virtual void MouseClicked(nsIPresContext* aPresContext);
@ -69,14 +69,14 @@ nsInputRadioFrame::~nsInputRadioFrame()
} }
const nsIID const nsIID&
nsInputRadioFrame::GetIID() nsInputRadioFrame::GetIID()
{ {
static NS_DEFINE_IID(kRadioIID, NS_IRADIOBUTTON_IID); static NS_DEFINE_IID(kRadioIID, NS_IRADIOBUTTON_IID);
return kRadioIID; return kRadioIID;
} }
const nsIID const nsIID&
nsInputRadioFrame::GetCID() nsInputRadioFrame::GetCID()
{ {
static NS_DEFINE_IID(kRadioCID, NS_RADIOBUTTON_CID); static NS_DEFINE_IID(kRadioCID, NS_RADIOBUTTON_CID);

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

@ -44,9 +44,9 @@ public:
virtual void PostCreateWidget(nsIPresContext* aPresContext, nsIView *aView); virtual void PostCreateWidget(nsIPresContext* aPresContext, nsIView *aView);
virtual const nsIID GetCID(); virtual const nsIID& GetCID();
virtual const nsIID GetIID(); virtual const nsIID& GetIID();
protected: protected:
@ -71,7 +71,7 @@ nsInputTextFrame::~nsInputTextFrame()
{ {
} }
const nsIID const nsIID&
nsInputTextFrame::GetIID() nsInputTextFrame::GetIID()
{ {
static NS_DEFINE_IID(kTextIID, NS_ITEXTWIDGET_IID); static NS_DEFINE_IID(kTextIID, NS_ITEXTWIDGET_IID);
@ -85,7 +85,7 @@ nsInputTextFrame::GetIID()
} }
} }
const nsIID const nsIID&
nsInputTextFrame::GetCID() nsInputTextFrame::GetCID()
{ {
static NS_DEFINE_IID(kTextCID, NS_TEXTFIELD_CID); static NS_DEFINE_IID(kTextCID, NS_TEXTFIELD_CID);

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

@ -53,9 +53,9 @@ public:
virtual void PostCreateWidget(nsIPresContext* aPresContext, nsIView *aView); 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(); PRBool IsComboBox();
@ -153,7 +153,7 @@ nsSelectFrame::IsComboBox()
return content->IsComboBox(); return content->IsComboBox();
} }
const nsIID const nsIID&
nsSelectFrame::GetIID() nsSelectFrame::GetIID()
{ {
if (IsComboBox()) { if (IsComboBox()) {
@ -164,7 +164,7 @@ nsSelectFrame::GetIID()
} }
} }
const nsIID const nsIID&
nsSelectFrame::GetCID() nsSelectFrame::GetCID()
{ {
static NS_DEFINE_IID(kComboCID, NS_COMBOBOX_CID); static NS_DEFINE_IID(kComboCID, NS_COMBOBOX_CID);

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

@ -220,7 +220,7 @@ PRInt32 CSSStyleSheetImpl::RulesMatching(nsIPresContext* aPresContext,
child = ((CSSStyleSheetImpl*)child)->mNext; 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++) { for (PRInt32 index = 0; index < count; index++) {
nsICSSStyleRulePtr rule = (nsICSSStyleRule*)mRules->ElementAt(index); nsICSSStyleRulePtr rule = (nsICSSStyleRule*)mRules->ElementAt(index);
@ -272,12 +272,12 @@ void CSSStyleSheetImpl::AppendStyleSheet(nsICSSStyleSheet* aSheet)
{ {
NS_PRECONDITION(nsnull != aSheet, "null arg"); NS_PRECONDITION(nsnull != aSheet, "null arg");
if (nsnull == mFirstChild) { if (mFirstChild.IsNull()) {
mFirstChild.SetAddRef(aSheet); mFirstChild.SetAddRef(aSheet);
} }
else { else {
nsICSSStyleSheet* child = mFirstChild; nsICSSStyleSheet* child = mFirstChild;
while (nsnull != ((CSSStyleSheetImpl*)child)->mNext) { while (((CSSStyleSheetImpl*)child)->mNext.IsNotNull()) {
child = ((CSSStyleSheetImpl*)child)->mNext; child = ((CSSStyleSheetImpl*)child)->mNext;
} }
((CSSStyleSheetImpl*)child)->mNext.SetAddRef(aSheet); ((CSSStyleSheetImpl*)child)->mNext.SetAddRef(aSheet);
@ -289,7 +289,7 @@ void CSSStyleSheetImpl::PrependStyleRule(nsICSSStyleRule* aRule)
NS_PRECONDITION(nsnull != aRule, "null arg"); NS_PRECONDITION(nsnull != aRule, "null arg");
//XXX replace this with a binary search? //XXX replace this with a binary search?
PRInt32 weight = aRule->GetWeight(); PRInt32 weight = aRule->GetWeight();
if (nsnull == mRules) { if (mRules.IsNull()) {
if (NS_OK != NS_NewISupportsArray(mRules.AssignPtr())) if (NS_OK != NS_NewISupportsArray(mRules.AssignPtr()))
return; return;
} }
@ -309,7 +309,7 @@ void CSSStyleSheetImpl::AppendStyleRule(nsICSSStyleRule* aRule)
//XXX replace this with a binary search? //XXX replace this with a binary search?
PRInt32 weight = aRule->GetWeight(); PRInt32 weight = aRule->GetWeight();
if (nsnull == mRules) { if (mRules.IsNull()) {
if (NS_OK != NS_NewISupportsArray(mRules.AssignPtr())) if (NS_OK != NS_NewISupportsArray(mRules.AssignPtr()))
return; return;
} }
@ -343,7 +343,7 @@ void CSSStyleSheetImpl::List(FILE* out, PRInt32 aIndent) const
child = ((CSSStyleSheetImpl*)child)->mNext; child = ((CSSStyleSheetImpl*)child)->mNext;
} }
PRInt32 count = ((nsnull != mRules) ? mRules->Count() : 0); PRInt32 count = (mRules.IsNotNull() ? mRules->Count() : 0);
for (index = 0; index < count; index++) { for (index = 0; index < count; index++) {
nsICSSStyleRulePtr rule = (nsICSSStyleRule*)mRules->ElementAt(index); nsICSSStyleRulePtr rule = (nsICSSStyleRule*)mRules->ElementAt(index);

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

@ -338,7 +338,7 @@ nsIStyleContext* nsCellLayoutData::FindHighestPrecedentBorder(nsVoidArray* aList
style.SetAddRef(CompareCellBorders(style,aEdge, style2,aEdge)); style.SetAddRef(CompareCellBorders(style,aEdge, style2,aEdge));
} }
} }
if ((style != NULL) && (GetMargin(style,aEdge) != 0)) if (style.IsNotNull() && (GetMargin(style,aEdge) != 0))
result = style.AddRef(); result = style.AddRef();
} }
return result; return result;
@ -358,7 +358,7 @@ nsStyleSpacing* nsCellLayoutData::FindInnerBorder( nsIStyleContext* aStyle,
{ {
nsIStyleContextPtr style; nsIStyleContextPtr style;
nsIStyleContextPtr altStyle = FindHighestPrecedentBorder(aList,opposite); nsIStyleContextPtr altStyle = FindHighestPrecedentBorder(aList,opposite);
if (altStyle != nsnull) if (altStyle.IsNotNull())
style.SetAddRef(CompareCellBorders(aStyle,aEdge,altStyle,opposite)); style.SetAddRef(CompareCellBorders(aStyle,aEdge,altStyle,opposite));
else else
style.SetAddRef(aStyle); style.SetAddRef(aStyle);
@ -421,7 +421,7 @@ nsStyleSpacing* nsCellLayoutData::FindOuterBorder( nsTableFrame* aTableFrame,
// if the padding for the parent style is zero just // if the padding for the parent style is zero just
// recursively call this routine // recursively call this routine
PRInt32 padding = GetPadding(parentStyle,aEdge); PRInt32 padding = GetPadding(parentStyle,aEdge);
if ((parentStyle != NULL) && (padding == 0)) if (parentStyle.IsNotNull() && (padding == 0))
{ {
style = parentStyle; style = parentStyle;
frame = parentFrame; frame = parentFrame;

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

@ -304,7 +304,7 @@ void nsTableFrame::ResetColumnLayoutData()
// Check to see if cell the represents a top edge cell // Check to see if cell the represents a top edge cell
if (col == 0) if (col == 0)
left == nsnull; left = nsnull;
else else
{ {
cellData = cellMap->GetCellAt(row,col-1); cellData = cellMap->GetCellAt(row,col-1);
@ -603,7 +603,7 @@ nsIFrame::ReflowStatus nsTableFrame::ResizeReflowPass1(nsIPresContext* aPresCont
*/ */
for (;;) { for (;;) {
nsIContentPtr kid = c->ChildAt(kidIndex); // kid: REFCNT++ nsIContentPtr kid = c->ChildAt(kidIndex); // kid: REFCNT++
if (nsnull == kid) { if (kid.IsNull()) {
result = frComplete; result = frComplete;
break; break;
} }
@ -616,7 +616,7 @@ nsIFrame::ReflowStatus nsTableFrame::ResizeReflowPass1(nsIPresContext* aPresCont
// Resolve style // Resolve style
nsIStyleContextPtr kidStyleContext = nsIStyleContextPtr kidStyleContext =
aPresContext->ResolveStyleContextFor(kid, this); 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!!!! // 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 (;;) { for (;;) {
// Get the next content object // Get the next content object
nsIContentPtr kid = mContent->ChildAt(kidIndex); nsIContentPtr kid = mContent->ChildAt(kidIndex);
if (nsnull == kid) { if (kid.IsNull()) {
result = frComplete; result = frComplete;
break; break;
} }
@ -1629,7 +1629,7 @@ PRBool nsTableFrame::AssignFixedColumnWidths(nsIPresContext* aPresContext,
nsColLayoutData * colData = (nsColLayoutData *)(columnLayoutData->ElementAt(colIndex)); nsColLayoutData * colData = (nsColLayoutData *)(columnLayoutData->ElementAt(colIndex));
NS_ASSERTION(nsnull != colData, "bad column data"); NS_ASSERTION(nsnull != colData, "bad column data");
nsTableColPtr col = colData->GetCol(); // col: ADDREF++ 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 // need to track min/max column width for setting min/max table widths
PRInt32 minColWidth = 0; PRInt32 minColWidth = 0;
@ -2223,7 +2223,7 @@ void nsTableFrame::ShrinkWrapChildren(nsIPresContext* aPresContext,
nsTableContentPtr kid; nsTableContentPtr kid;
kidFrame->GetContent((nsIContent*&)(kid.AssignRef())); // kid: REFCNT++ kidFrame->GetContent((nsIContent*&)(kid.AssignRef())); // kid: REFCNT++
NS_ASSERTION(nsnull != kid, "bad kid"); NS_ASSERTION(kid.IsNotNull(), "bad kid");
if (kid->GetType() == nsITableContent::kTableRowGroupType) if (kid->GetType() == nsITableContent::kTableRowGroupType)
{ {
/* Step 1: set the row height to the height of the tallest cell, /* 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; i<tableKidCount; i++) for (PRInt32 i=0; i<tableKidCount; i++)
{ {
nsTableContentPtr tableKid = (nsTableContent *)tablePart->ChildAt(i); nsTableContentPtr tableKid = (nsTableContent *)tablePart->ChildAt(i);
NS_ASSERTION(nsnull != tableKid, "bad kid"); NS_ASSERTION(tableKid.IsNotNull(), "bad kid");
const int contentType = tableKid->GetType(); const int contentType = tableKid->GetType();
if (contentType == nsITableContent::kTableColGroupType) if (contentType == nsITableContent::kTableColGroupType)
{ {
@ -2515,7 +2515,7 @@ PRBool nsTableFrame::SetCellLayoutData(nsCellLayoutData * aData, nsTableCell *aC
for (PRInt32 j=0; j<colsInGroup; j++) for (PRInt32 j=0; j<colsInGroup; j++)
{ {
nsTableColPtr col = (nsTableCol *)tableKid->ChildAt(j); nsTableColPtr col = (nsTableCol *)tableKid->ChildAt(j);
NS_ASSERTION(nsnull != col, "bad content"); NS_ASSERTION(col.IsNotNull(), "bad content");
nsColLayoutData *colData = new nsColLayoutData(col); nsColLayoutData *colData = new nsColLayoutData(col);
mColumnLayoutData->AppendElement((void *)colData); mColumnLayoutData->AppendElement((void *)colData);
} }

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

@ -887,7 +887,7 @@ nsTableOuterFrame::ReflowChild( nsIFrame* aKidFrame,
nsIStyleContextPtr captionStyleContext; nsIStyleContextPtr captionStyleContext;
aKidFrame->GetStyleContext(aPresContext, captionStyleContext.AssignRef()); 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* captionStyle =
(nsStyleText*)captionStyleContext->GetData(kStyleTextSID); (nsStyleText*)captionStyleContext->GetData(kStyleTextSID);
NS_ASSERTION(nsnull != captionStyle, "null style molecule for caption"); NS_ASSERTION(nsnull != captionStyle, "null style molecule for caption");
@ -942,7 +942,7 @@ void nsTableOuterFrame::CreateChildFrames(nsIPresContext* aPresContext)
// Resolve style // Resolve style
nsIStyleContextPtr kidStyleContext = nsIStyleContextPtr kidStyleContext =
aPresContext->ResolveStyleContextFor(mContent, this); 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); mInnerTableFrame->SetStyleContext(kidStyleContext);
mChildCount++; mChildCount++;
// Link child frame into the list of children // Link child frame into the list of children
@ -956,7 +956,7 @@ void nsTableOuterFrame::CreateChildFrames(nsIPresContext* aPresContext)
nsIFrame *lastTopCaption = nsnull; nsIFrame *lastTopCaption = nsnull;
for (PRInt32 kidIndex=0; /* nada */ ;kidIndex++) { for (PRInt32 kidIndex=0; /* nada */ ;kidIndex++) {
nsIContentPtr caption = mContent->ChildAt(kidIndex); // caption: REFCNT++ nsIContentPtr caption = mContent->ChildAt(kidIndex); // caption: REFCNT++
if (nsnull == caption) { if (caption.IsNull()) {
break; break;
} }
const PRInt32 contentType = ((nsTableContent *)(nsIContent*)caption)->GetType(); const PRInt32 contentType = ((nsTableContent *)(nsIContent*)caption)->GetType();
@ -969,7 +969,7 @@ void nsTableOuterFrame::CreateChildFrames(nsIPresContext* aPresContext)
// Resolve style // Resolve style
nsIStyleContextPtr captionStyleContext = nsIStyleContextPtr captionStyleContext =
aPresContext->ResolveStyleContextFor(caption, this); 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* captionStyle =
(nsStyleText*)captionStyleContext->GetData(kStyleTextSID); (nsStyleText*)captionStyleContext->GetData(kStyleTextSID);
captionFrame->SetStyleContext(captionStyleContext); captionFrame->SetStyleContext(captionStyleContext);
@ -1055,7 +1055,7 @@ nsTableOuterFrame::ResizeReflowTopCaptionsPass2(nsIPresContext* aPresContext,
nsIStyleContextPtr captionStyleContext; nsIStyleContextPtr captionStyleContext;
captionFrame->GetStyleContext(aPresContext, captionStyleContext.AssignRef()); 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* captionStyle =
(nsStyleText*)captionStyleContext->GetData(kStyleTextSID); (nsStyleText*)captionStyleContext->GetData(kStyleTextSID);
NS_ASSERTION(nsnull != captionStyle, "null style molecule for caption"); NS_ASSERTION(nsnull != captionStyle, "null style molecule for caption");

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

@ -714,7 +714,7 @@ nsTableRowGroupFrame::ReflowUnmappedChildren(nsIPresContext* aPresContext,
for (;;) { for (;;) {
// Get the next content object // Get the next content object
nsIContentPtr kid = mContent->ChildAt(kidIndex); nsIContentPtr kid = mContent->ChildAt(kidIndex);
if (nsnull == kid) { if (kid.IsNull()) {
result = frComplete; result = frComplete;
break; break;
} }

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

@ -220,7 +220,7 @@ PRInt32 CSSStyleSheetImpl::RulesMatching(nsIPresContext* aPresContext,
child = ((CSSStyleSheetImpl*)child)->mNext; 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++) { for (PRInt32 index = 0; index < count; index++) {
nsICSSStyleRulePtr rule = (nsICSSStyleRule*)mRules->ElementAt(index); nsICSSStyleRulePtr rule = (nsICSSStyleRule*)mRules->ElementAt(index);
@ -272,12 +272,12 @@ void CSSStyleSheetImpl::AppendStyleSheet(nsICSSStyleSheet* aSheet)
{ {
NS_PRECONDITION(nsnull != aSheet, "null arg"); NS_PRECONDITION(nsnull != aSheet, "null arg");
if (nsnull == mFirstChild) { if (mFirstChild.IsNull()) {
mFirstChild.SetAddRef(aSheet); mFirstChild.SetAddRef(aSheet);
} }
else { else {
nsICSSStyleSheet* child = mFirstChild; nsICSSStyleSheet* child = mFirstChild;
while (nsnull != ((CSSStyleSheetImpl*)child)->mNext) { while (((CSSStyleSheetImpl*)child)->mNext.IsNotNull()) {
child = ((CSSStyleSheetImpl*)child)->mNext; child = ((CSSStyleSheetImpl*)child)->mNext;
} }
((CSSStyleSheetImpl*)child)->mNext.SetAddRef(aSheet); ((CSSStyleSheetImpl*)child)->mNext.SetAddRef(aSheet);
@ -289,7 +289,7 @@ void CSSStyleSheetImpl::PrependStyleRule(nsICSSStyleRule* aRule)
NS_PRECONDITION(nsnull != aRule, "null arg"); NS_PRECONDITION(nsnull != aRule, "null arg");
//XXX replace this with a binary search? //XXX replace this with a binary search?
PRInt32 weight = aRule->GetWeight(); PRInt32 weight = aRule->GetWeight();
if (nsnull == mRules) { if (mRules.IsNull()) {
if (NS_OK != NS_NewISupportsArray(mRules.AssignPtr())) if (NS_OK != NS_NewISupportsArray(mRules.AssignPtr()))
return; return;
} }
@ -309,7 +309,7 @@ void CSSStyleSheetImpl::AppendStyleRule(nsICSSStyleRule* aRule)
//XXX replace this with a binary search? //XXX replace this with a binary search?
PRInt32 weight = aRule->GetWeight(); PRInt32 weight = aRule->GetWeight();
if (nsnull == mRules) { if (mRules.IsNull()) {
if (NS_OK != NS_NewISupportsArray(mRules.AssignPtr())) if (NS_OK != NS_NewISupportsArray(mRules.AssignPtr()))
return; return;
} }
@ -343,7 +343,7 @@ void CSSStyleSheetImpl::List(FILE* out, PRInt32 aIndent) const
child = ((CSSStyleSheetImpl*)child)->mNext; child = ((CSSStyleSheetImpl*)child)->mNext;
} }
PRInt32 count = ((nsnull != mRules) ? mRules->Count() : 0); PRInt32 count = (mRules.IsNotNull() ? mRules->Count() : 0);
for (index = 0; index < count; index++) { for (index = 0; index < count; index++) {
nsICSSStyleRulePtr rule = (nsICSSStyleRule*)mRules->ElementAt(index); nsICSSStyleRulePtr rule = (nsICSSStyleRule*)mRules->ElementAt(index);

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

@ -304,7 +304,7 @@ void nsTableFrame::ResetColumnLayoutData()
// Check to see if cell the represents a top edge cell // Check to see if cell the represents a top edge cell
if (col == 0) if (col == 0)
left == nsnull; left = nsnull;
else else
{ {
cellData = cellMap->GetCellAt(row,col-1); cellData = cellMap->GetCellAt(row,col-1);
@ -603,7 +603,7 @@ nsIFrame::ReflowStatus nsTableFrame::ResizeReflowPass1(nsIPresContext* aPresCont
*/ */
for (;;) { for (;;) {
nsIContentPtr kid = c->ChildAt(kidIndex); // kid: REFCNT++ nsIContentPtr kid = c->ChildAt(kidIndex); // kid: REFCNT++
if (nsnull == kid) { if (kid.IsNull()) {
result = frComplete; result = frComplete;
break; break;
} }
@ -616,7 +616,7 @@ nsIFrame::ReflowStatus nsTableFrame::ResizeReflowPass1(nsIPresContext* aPresCont
// Resolve style // Resolve style
nsIStyleContextPtr kidStyleContext = nsIStyleContextPtr kidStyleContext =
aPresContext->ResolveStyleContextFor(kid, this); 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!!!! // 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 (;;) { for (;;) {
// Get the next content object // Get the next content object
nsIContentPtr kid = mContent->ChildAt(kidIndex); nsIContentPtr kid = mContent->ChildAt(kidIndex);
if (nsnull == kid) { if (kid.IsNull()) {
result = frComplete; result = frComplete;
break; break;
} }
@ -1629,7 +1629,7 @@ PRBool nsTableFrame::AssignFixedColumnWidths(nsIPresContext* aPresContext,
nsColLayoutData * colData = (nsColLayoutData *)(columnLayoutData->ElementAt(colIndex)); nsColLayoutData * colData = (nsColLayoutData *)(columnLayoutData->ElementAt(colIndex));
NS_ASSERTION(nsnull != colData, "bad column data"); NS_ASSERTION(nsnull != colData, "bad column data");
nsTableColPtr col = colData->GetCol(); // col: ADDREF++ 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 // need to track min/max column width for setting min/max table widths
PRInt32 minColWidth = 0; PRInt32 minColWidth = 0;
@ -2223,7 +2223,7 @@ void nsTableFrame::ShrinkWrapChildren(nsIPresContext* aPresContext,
nsTableContentPtr kid; nsTableContentPtr kid;
kidFrame->GetContent((nsIContent*&)(kid.AssignRef())); // kid: REFCNT++ kidFrame->GetContent((nsIContent*&)(kid.AssignRef())); // kid: REFCNT++
NS_ASSERTION(nsnull != kid, "bad kid"); NS_ASSERTION(kid.IsNotNull(), "bad kid");
if (kid->GetType() == nsITableContent::kTableRowGroupType) if (kid->GetType() == nsITableContent::kTableRowGroupType)
{ {
/* Step 1: set the row height to the height of the tallest cell, /* 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; i<tableKidCount; i++) for (PRInt32 i=0; i<tableKidCount; i++)
{ {
nsTableContentPtr tableKid = (nsTableContent *)tablePart->ChildAt(i); nsTableContentPtr tableKid = (nsTableContent *)tablePart->ChildAt(i);
NS_ASSERTION(nsnull != tableKid, "bad kid"); NS_ASSERTION(tableKid.IsNotNull(), "bad kid");
const int contentType = tableKid->GetType(); const int contentType = tableKid->GetType();
if (contentType == nsITableContent::kTableColGroupType) if (contentType == nsITableContent::kTableColGroupType)
{ {
@ -2515,7 +2515,7 @@ PRBool nsTableFrame::SetCellLayoutData(nsCellLayoutData * aData, nsTableCell *aC
for (PRInt32 j=0; j<colsInGroup; j++) for (PRInt32 j=0; j<colsInGroup; j++)
{ {
nsTableColPtr col = (nsTableCol *)tableKid->ChildAt(j); nsTableColPtr col = (nsTableCol *)tableKid->ChildAt(j);
NS_ASSERTION(nsnull != col, "bad content"); NS_ASSERTION(col.IsNotNull(), "bad content");
nsColLayoutData *colData = new nsColLayoutData(col); nsColLayoutData *colData = new nsColLayoutData(col);
mColumnLayoutData->AppendElement((void *)colData); mColumnLayoutData->AppendElement((void *)colData);
} }

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

@ -887,7 +887,7 @@ nsTableOuterFrame::ReflowChild( nsIFrame* aKidFrame,
nsIStyleContextPtr captionStyleContext; nsIStyleContextPtr captionStyleContext;
aKidFrame->GetStyleContext(aPresContext, captionStyleContext.AssignRef()); 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* captionStyle =
(nsStyleText*)captionStyleContext->GetData(kStyleTextSID); (nsStyleText*)captionStyleContext->GetData(kStyleTextSID);
NS_ASSERTION(nsnull != captionStyle, "null style molecule for caption"); NS_ASSERTION(nsnull != captionStyle, "null style molecule for caption");
@ -942,7 +942,7 @@ void nsTableOuterFrame::CreateChildFrames(nsIPresContext* aPresContext)
// Resolve style // Resolve style
nsIStyleContextPtr kidStyleContext = nsIStyleContextPtr kidStyleContext =
aPresContext->ResolveStyleContextFor(mContent, this); 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); mInnerTableFrame->SetStyleContext(kidStyleContext);
mChildCount++; mChildCount++;
// Link child frame into the list of children // Link child frame into the list of children
@ -956,7 +956,7 @@ void nsTableOuterFrame::CreateChildFrames(nsIPresContext* aPresContext)
nsIFrame *lastTopCaption = nsnull; nsIFrame *lastTopCaption = nsnull;
for (PRInt32 kidIndex=0; /* nada */ ;kidIndex++) { for (PRInt32 kidIndex=0; /* nada */ ;kidIndex++) {
nsIContentPtr caption = mContent->ChildAt(kidIndex); // caption: REFCNT++ nsIContentPtr caption = mContent->ChildAt(kidIndex); // caption: REFCNT++
if (nsnull == caption) { if (caption.IsNull()) {
break; break;
} }
const PRInt32 contentType = ((nsTableContent *)(nsIContent*)caption)->GetType(); const PRInt32 contentType = ((nsTableContent *)(nsIContent*)caption)->GetType();
@ -969,7 +969,7 @@ void nsTableOuterFrame::CreateChildFrames(nsIPresContext* aPresContext)
// Resolve style // Resolve style
nsIStyleContextPtr captionStyleContext = nsIStyleContextPtr captionStyleContext =
aPresContext->ResolveStyleContextFor(caption, this); 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* captionStyle =
(nsStyleText*)captionStyleContext->GetData(kStyleTextSID); (nsStyleText*)captionStyleContext->GetData(kStyleTextSID);
captionFrame->SetStyleContext(captionStyleContext); captionFrame->SetStyleContext(captionStyleContext);
@ -1055,7 +1055,7 @@ nsTableOuterFrame::ResizeReflowTopCaptionsPass2(nsIPresContext* aPresContext,
nsIStyleContextPtr captionStyleContext; nsIStyleContextPtr captionStyleContext;
captionFrame->GetStyleContext(aPresContext, captionStyleContext.AssignRef()); 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* captionStyle =
(nsStyleText*)captionStyleContext->GetData(kStyleTextSID); (nsStyleText*)captionStyleContext->GetData(kStyleTextSID);
NS_ASSERTION(nsnull != captionStyle, "null style molecule for caption"); NS_ASSERTION(nsnull != captionStyle, "null style molecule for caption");

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

@ -714,7 +714,7 @@ nsTableRowGroupFrame::ReflowUnmappedChildren(nsIPresContext* aPresContext,
for (;;) { for (;;) {
// Get the next content object // Get the next content object
nsIContentPtr kid = mContent->ChildAt(kidIndex); nsIContentPtr kid = mContent->ChildAt(kidIndex);
if (nsnull == kid) { if (kid.IsNull()) {
result = frComplete; result = frComplete;
break; break;
} }