Changed nsIFrame member functions to return a nsresult
git-svn-id: svn://10.0.0.236/trunk@346 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -34,7 +34,7 @@ LengthOf(nsIFrame* aChildList)
|
||||
PRInt32 result = 0;
|
||||
|
||||
while (nsnull != aChildList) {
|
||||
aChildList = aChildList->GetNextSibling();
|
||||
aChildList->GetNextSibling(aChildList);
|
||||
result++;
|
||||
}
|
||||
|
||||
@@ -104,6 +104,8 @@ public:
|
||||
// Allow public access to protected member functions
|
||||
void PushChildren(nsIFrame* aFromChild, nsIFrame* aPrevSibling, PRBool aLastIsComplete);
|
||||
PRBool DeleteChildsNextInFlow(nsIFrame* aChild);
|
||||
|
||||
PRInt32 ChildCount() {return mChildCount;}
|
||||
};
|
||||
|
||||
SimpleContainer::SimpleContainer(nsIContent* aContent, PRInt32 aIndexInParent)
|
||||
@@ -190,42 +192,52 @@ TestChildEnumeration()
|
||||
|
||||
// Test indexing of child frames. nsnull should be returned for index
|
||||
// values that are out of range
|
||||
if (nsnull != f->ChildAt(-1)) {
|
||||
nsIFrame* child;
|
||||
f->ChildAt(-1, child);
|
||||
if (nsnull != child) {
|
||||
printf("ChildEnumeration: child index failed for index < 0\n");
|
||||
return PR_FALSE;
|
||||
}
|
||||
if (c1 != f->ChildAt(0)) {
|
||||
f->ChildAt(0, child);
|
||||
if (c1 != child) {
|
||||
printf("ChildEnumeration: wrong child at index: %d\n", 0);
|
||||
return PR_FALSE;
|
||||
}
|
||||
if (c2 != f->ChildAt(1)) {
|
||||
f->ChildAt(1, child);
|
||||
if (c2 != child) {
|
||||
printf("ChildEnumeration: wrong child at index: %d\n", 1);
|
||||
return PR_FALSE;
|
||||
}
|
||||
if (c3 != f->ChildAt(2)) {
|
||||
f->ChildAt(2, child);
|
||||
if (c3 != child) {
|
||||
printf("ChildEnumeration: wrong child at index: %d\n", 2);
|
||||
return PR_FALSE;
|
||||
}
|
||||
if (nsnull != f->ChildAt(3)) {
|
||||
f->ChildAt(3, child);
|
||||
if (nsnull != child) {
|
||||
printf("ChildEnumeration: child index failed for index >= child countn");
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
// Test first and last child member functions
|
||||
if (f->FirstChild() != c1) {
|
||||
f->FirstChild(child);
|
||||
if (child != c1) {
|
||||
printf("ChildEnumeration: wrong first child\n");
|
||||
return PR_FALSE;
|
||||
}
|
||||
if (f->LastChild() != c3) {
|
||||
f->LastChild(child);
|
||||
if (child != c3) {
|
||||
printf("ChildEnumeration: wrong last child\n");
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
#if 0
|
||||
// Test IndexOf()
|
||||
if ((f->IndexOf(c1) != 0) || (f->IndexOf(c2) != 1) || (f->IndexOf(c3) != 2)) {
|
||||
printf("ChildEnumeration: index of failed\n");
|
||||
return PR_FALSE;
|
||||
}
|
||||
#endif
|
||||
|
||||
return PR_TRUE;
|
||||
}
|
||||
@@ -233,6 +245,7 @@ TestChildEnumeration()
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
|
||||
#if 0
|
||||
// Test the push children method
|
||||
//
|
||||
// This tests the following:
|
||||
@@ -625,6 +638,7 @@ TestDeleteChildsNext()
|
||||
|
||||
return PR_TRUE;
|
||||
}
|
||||
#endif
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
@@ -646,6 +660,7 @@ int main(int argc, char** argv)
|
||||
return -1;
|
||||
}
|
||||
|
||||
#if 0
|
||||
// Test the push children method
|
||||
if (!TestPushChildren()) {
|
||||
return -1;
|
||||
@@ -655,6 +670,7 @@ int main(int argc, char** argv)
|
||||
if (!TestDeleteChildsNext()) {
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
|
||||
// Test being used as a pseudo frame
|
||||
if (!TestAsPseudo()) {
|
||||
|
||||
Reference in New Issue
Block a user