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;
}
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);

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

@ -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();

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

@ -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();

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

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

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

@ -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);

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

@ -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);

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

@ -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);

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

@ -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);

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

@ -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);

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

@ -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);

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

@ -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

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

@ -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;
}

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

@ -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)

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

@ -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

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

@ -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;

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

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

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

@ -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"

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

@ -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);

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

@ -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);

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

@ -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);

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

@ -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

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

@ -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);

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

@ -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);

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

@ -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);

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

@ -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);

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

@ -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;

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

@ -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; i<tableKidCount; i++)
{
nsTableContentPtr tableKid = (nsTableContent *)tablePart->ChildAt(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; j<colsInGroup; j++)
{
nsTableColPtr col = (nsTableCol *)tableKid->ChildAt(j);
NS_ASSERTION(nsnull != col, "bad content");
NS_ASSERTION(col.IsNotNull(), "bad content");
nsColLayoutData *colData = new nsColLayoutData(col);
mColumnLayoutData->AppendElement((void *)colData);
}

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

@ -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");

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

@ -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;
}

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

@ -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);

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

@ -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; i<tableKidCount; i++)
{
nsTableContentPtr tableKid = (nsTableContent *)tablePart->ChildAt(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; j<colsInGroup; j++)
{
nsTableColPtr col = (nsTableCol *)tableKid->ChildAt(j);
NS_ASSERTION(nsnull != col, "bad content");
NS_ASSERTION(col.IsNotNull(), "bad content");
nsColLayoutData *colData = new nsColLayoutData(col);
mColumnLayoutData->AppendElement((void *)colData);
}

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

@ -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");

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

@ -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;
}