зеркало из https://github.com/mozilla/pjs.git
Fix compiler warnings. Make -pedantic build again.
This commit is contained in:
Родитель
2c53b41852
Коммит
a2c461d17b
|
@ -145,7 +145,7 @@ public:
|
|||
PRInt32 Count() { return mAttributes.Count(); };
|
||||
nsXULAttribute* ElementAt(PRInt32 i) { return (nsXULAttribute*)mAttributes.ElementAt(i); };
|
||||
void AppendElement(nsXULAttribute* aElement) { mAttributes.AppendElement((void*)aElement); };
|
||||
void RemoveElementAt(PRInt32 index) { mAttributes.RemoveElementAt(index); };
|
||||
void RemoveElementAt(PRInt32 aIndex) { mAttributes.RemoveElementAt(aIndex); };
|
||||
|
||||
// Style Helpers
|
||||
nsresult GetClasses(nsVoidArray& aArray) const;
|
||||
|
|
|
@ -338,9 +338,9 @@ RDFElementImpl::RDFElementImpl(PRInt32 aNameSpaceID, nsIAtom* aTag)
|
|||
mListenerManager(nsnull),
|
||||
mAttributes(nsnull),
|
||||
mContentsMustBeGenerated(PR_FALSE),
|
||||
mInnerXULElement(nsnull),
|
||||
mBroadcastListeners(nsnull),
|
||||
mBroadcaster(nsnull)
|
||||
mBroadcaster(nsnull),
|
||||
mInnerXULElement(nsnull)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
NS_ADDREF(aTag);
|
||||
|
@ -573,9 +573,9 @@ RDFElementImpl::GetChildNodes(nsIDOMNodeList** aChildNodes)
|
|||
|
||||
PRInt32 count;
|
||||
if (NS_SUCCEEDED(rv = ChildCount(count))) {
|
||||
for (PRInt32 index = 0; index < count; ++index) {
|
||||
for (PRInt32 i = 0; i < count; ++i) {
|
||||
nsCOMPtr<nsIContent> child;
|
||||
rv = ChildAt(index, *getter_AddRefs(child));
|
||||
rv = ChildAt(i, *getter_AddRefs(child));
|
||||
NS_ASSERTION(NS_SUCCEEDED(rv), "unable to get child");
|
||||
if (NS_FAILED(rv))
|
||||
break;
|
||||
|
@ -1207,7 +1207,7 @@ RDFElementImpl::GetScriptObject(nsIScriptContext* aContext, void** aScriptObject
|
|||
|
||||
char buf[64];
|
||||
char* p = buf;
|
||||
if (tag.Length() >= sizeof(buf))
|
||||
if (tag.Length() >= PRInt32(sizeof buf))
|
||||
p = new char[tag.Length() + 1];
|
||||
|
||||
aContext->AddNamedReference((void*) &mScriptObject, mScriptObject, buf);
|
||||
|
@ -1378,7 +1378,7 @@ RDFElementImpl::SetDocument(nsIDocument* aDocument, PRBool aDeep)
|
|||
|
||||
char buf[64];
|
||||
char* p = buf;
|
||||
if (tag.Length() >= sizeof(buf))
|
||||
if (tag.Length() >= PRInt32(sizeof buf))
|
||||
p = new char[tag.Length() + 1];
|
||||
|
||||
context->AddNamedReference((void*) &mScriptObject, mScriptObject, buf);
|
||||
|
@ -1595,9 +1595,9 @@ RDFElementImpl::RemoveChildAt(PRInt32 aIndex, PRBool aNotify)
|
|||
nsIContent* oldKid = (nsIContent *)mChildren->ElementAt(aIndex);
|
||||
if (nsnull != oldKid ) {
|
||||
nsIDocument* doc = mDocument;
|
||||
PRBool rv = mChildren->RemoveElementAt(aIndex);
|
||||
PRBool removeOk = mChildren->RemoveElementAt(aIndex);
|
||||
//nsRange::OwnerChildRemoved(this, aIndex, oldKid);
|
||||
if (aNotify) {
|
||||
if (aNotify && removeOk) {
|
||||
if (nsnull != doc) {
|
||||
doc->ContentRemoved(NS_STATIC_CAST(nsIStyledContent*, this), oldKid, aIndex);
|
||||
}
|
||||
|
@ -1739,17 +1739,16 @@ RDFElementImpl::SetAttribute(PRInt32 aNameSpaceID,
|
|||
// to unhook the old one.
|
||||
|
||||
nsXULAttribute* attr;
|
||||
PRBool successful = PR_FALSE;
|
||||
PRInt32 index = 0;
|
||||
PRInt32 i = 0;
|
||||
PRInt32 count = mAttributes->Count();
|
||||
while (index < count) {
|
||||
attr = mAttributes->ElementAt(index);
|
||||
while (i < count) {
|
||||
attr = mAttributes->ElementAt(i);
|
||||
if ((aNameSpaceID == attr->mNameSpaceID) && (aName == attr->mName))
|
||||
break;
|
||||
index++;
|
||||
i++;
|
||||
}
|
||||
|
||||
if (index < count) {
|
||||
if (i < count) {
|
||||
attr->mValue = aValue;
|
||||
}
|
||||
else { // didn't find it
|
||||
|
@ -1798,7 +1797,7 @@ RDFElementImpl::SetAttribute(PRInt32 aNameSpaceID,
|
|||
if (mBroadcastListeners != nsnull)
|
||||
{
|
||||
count = mBroadcastListeners->Count();
|
||||
for (PRInt32 i = 0; i < count; i++) {
|
||||
for (i = 0; i < count; i++) {
|
||||
XULBroadcastListener* xulListener = (XULBroadcastListener*)mBroadcastListeners->ElementAt(i);
|
||||
nsString aString;
|
||||
aName->ToString(aString);
|
||||
|
@ -1927,9 +1926,9 @@ done:
|
|||
|
||||
if (nsnull != mAttributes) {
|
||||
PRInt32 count = mAttributes->Count();
|
||||
PRInt32 index;
|
||||
for (index = 0; index < count; index++) {
|
||||
const nsXULAttribute* attr = (const nsXULAttribute*)mAttributes->ElementAt(index);
|
||||
PRInt32 i;
|
||||
for (i = 0; i < count; i++) {
|
||||
const nsXULAttribute* attr = (const nsXULAttribute*)mAttributes->ElementAt(i);
|
||||
if (((attr->mNameSpaceID == aNameSpaceID) ||
|
||||
(aNameSpaceID == kNameSpaceID_Unknown) ||
|
||||
(aNameSpaceID == kNameSpaceID_None)) &&
|
||||
|
@ -1995,11 +1994,11 @@ RDFElementImpl::UnsetAttribute(PRInt32 aNameSpaceID, nsIAtom* aName, PRBool aNot
|
|||
PRBool successful = PR_FALSE;
|
||||
if (nsnull != mAttributes) {
|
||||
PRInt32 count = mAttributes->Count();
|
||||
PRInt32 index;
|
||||
for (index = 0; index < count; index++) {
|
||||
nsXULAttribute* attr = (nsXULAttribute*)mAttributes->ElementAt(index);
|
||||
PRInt32 i;
|
||||
for (i = 0; i < count; i++) {
|
||||
nsXULAttribute* attr = (nsXULAttribute*)mAttributes->ElementAt(i);
|
||||
if ((attr->mNameSpaceID == aNameSpaceID) && (attr->mName == aName)) {
|
||||
mAttributes->RemoveElementAt(index);
|
||||
mAttributes->RemoveElementAt(i);
|
||||
NS_RELEASE(attr);
|
||||
successful = PR_TRUE;
|
||||
break;
|
||||
|
|
|
@ -1156,7 +1156,7 @@ RDFGenericBuilderImpl::FindWidgetRootElement(nsIContent* aElement,
|
|||
if (NS_FAILED(rv = element->GetTag(*getter_AddRefs(tag))))
|
||||
return rv;
|
||||
|
||||
if (tag.get() == rootAtom) {
|
||||
if (tag == rootAtom) {
|
||||
*aWidgetElement = element;
|
||||
NS_ADDREF(*aWidgetElement);
|
||||
return NS_OK;
|
||||
|
@ -1199,7 +1199,7 @@ RDFGenericBuilderImpl::IsItemOrFolder(nsIContent* aElement)
|
|||
if (NS_FAILED(rv = aElement->GetTag(*getter_AddRefs(tag))))
|
||||
return PR_FALSE;
|
||||
|
||||
if (tag.get() != itemAtom && tag.get() != folderAtom)
|
||||
if (tag != itemAtom && tag != folderAtom)
|
||||
return PR_FALSE;
|
||||
|
||||
return PR_TRUE;
|
||||
|
@ -1231,7 +1231,7 @@ RDFGenericBuilderImpl::IsWidgetInsertionRootElement(nsIContent* element)
|
|||
return PR_FALSE;
|
||||
}
|
||||
|
||||
if (elementTag.get() != rootAtom)
|
||||
if (elementTag != rootAtom)
|
||||
return PR_FALSE; // not the place to insert a child
|
||||
|
||||
return PR_TRUE;
|
||||
|
@ -1266,7 +1266,7 @@ RDFGenericBuilderImpl::IsContainmentProperty(nsIContent* aElement, nsIRDFResourc
|
|||
PRInt32 nameSpaceID;
|
||||
if (NS_FAILED(rv = element->GetNameSpaceID(nameSpaceID))) {
|
||||
NS_ERROR("unable to get element namespace");
|
||||
PR_FALSE;
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
if (nameSpaceID != kNameSpaceID_HTML) {
|
||||
|
@ -1327,7 +1327,7 @@ RDFGenericBuilderImpl::IsContainer(nsIContent* aElement, nsIRDFResource* aResour
|
|||
|
||||
while (1) {
|
||||
PRBool hasMore;
|
||||
nsresult rv = arcs->HasMoreElements(&hasMore);
|
||||
rv = arcs->HasMoreElements(&hasMore);
|
||||
NS_ASSERTION(NS_SUCCEEDED(rv), "severe error advancing cursor");
|
||||
if (NS_FAILED(rv))
|
||||
return PR_FALSE;
|
||||
|
@ -1382,11 +1382,11 @@ RDFGenericBuilderImpl::IsOpen(nsIContent* aElement)
|
|||
}
|
||||
|
||||
// The insertion root is _always_ open.
|
||||
if (tag.get() == insertionAtom)
|
||||
if (tag == insertionAtom)
|
||||
return PR_TRUE;
|
||||
|
||||
// If it's not a widget folder item, then it's not open.
|
||||
if (tag.get() != folderAtom)
|
||||
if (tag != folderAtom)
|
||||
return PR_FALSE;
|
||||
|
||||
nsAutoString value;
|
||||
|
@ -1531,7 +1531,7 @@ RDFGenericBuilderImpl::CloseWidgetItem(nsIContent* aElement)
|
|||
if (NS_FAILED(rv = aElement->GetTag(*getter_AddRefs(tag))))
|
||||
return rv; // XXX fatal
|
||||
|
||||
if (tag.get() == parentAtom) {
|
||||
if (tag == parentAtom) {
|
||||
parentNode = dont_QueryInterface(aElement);
|
||||
rv = NS_OK;
|
||||
}
|
||||
|
|
|
@ -338,9 +338,9 @@ RDFElementImpl::RDFElementImpl(PRInt32 aNameSpaceID, nsIAtom* aTag)
|
|||
mListenerManager(nsnull),
|
||||
mAttributes(nsnull),
|
||||
mContentsMustBeGenerated(PR_FALSE),
|
||||
mInnerXULElement(nsnull),
|
||||
mBroadcastListeners(nsnull),
|
||||
mBroadcaster(nsnull)
|
||||
mBroadcaster(nsnull),
|
||||
mInnerXULElement(nsnull)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
NS_ADDREF(aTag);
|
||||
|
@ -573,9 +573,9 @@ RDFElementImpl::GetChildNodes(nsIDOMNodeList** aChildNodes)
|
|||
|
||||
PRInt32 count;
|
||||
if (NS_SUCCEEDED(rv = ChildCount(count))) {
|
||||
for (PRInt32 index = 0; index < count; ++index) {
|
||||
for (PRInt32 i = 0; i < count; ++i) {
|
||||
nsCOMPtr<nsIContent> child;
|
||||
rv = ChildAt(index, *getter_AddRefs(child));
|
||||
rv = ChildAt(i, *getter_AddRefs(child));
|
||||
NS_ASSERTION(NS_SUCCEEDED(rv), "unable to get child");
|
||||
if (NS_FAILED(rv))
|
||||
break;
|
||||
|
@ -1207,7 +1207,7 @@ RDFElementImpl::GetScriptObject(nsIScriptContext* aContext, void** aScriptObject
|
|||
|
||||
char buf[64];
|
||||
char* p = buf;
|
||||
if (tag.Length() >= sizeof(buf))
|
||||
if (tag.Length() >= PRInt32(sizeof buf))
|
||||
p = new char[tag.Length() + 1];
|
||||
|
||||
aContext->AddNamedReference((void*) &mScriptObject, mScriptObject, buf);
|
||||
|
@ -1378,7 +1378,7 @@ RDFElementImpl::SetDocument(nsIDocument* aDocument, PRBool aDeep)
|
|||
|
||||
char buf[64];
|
||||
char* p = buf;
|
||||
if (tag.Length() >= sizeof(buf))
|
||||
if (tag.Length() >= PRInt32(sizeof buf))
|
||||
p = new char[tag.Length() + 1];
|
||||
|
||||
context->AddNamedReference((void*) &mScriptObject, mScriptObject, buf);
|
||||
|
@ -1595,9 +1595,9 @@ RDFElementImpl::RemoveChildAt(PRInt32 aIndex, PRBool aNotify)
|
|||
nsIContent* oldKid = (nsIContent *)mChildren->ElementAt(aIndex);
|
||||
if (nsnull != oldKid ) {
|
||||
nsIDocument* doc = mDocument;
|
||||
PRBool rv = mChildren->RemoveElementAt(aIndex);
|
||||
PRBool removeOk = mChildren->RemoveElementAt(aIndex);
|
||||
//nsRange::OwnerChildRemoved(this, aIndex, oldKid);
|
||||
if (aNotify) {
|
||||
if (aNotify && removeOk) {
|
||||
if (nsnull != doc) {
|
||||
doc->ContentRemoved(NS_STATIC_CAST(nsIStyledContent*, this), oldKid, aIndex);
|
||||
}
|
||||
|
@ -1739,17 +1739,16 @@ RDFElementImpl::SetAttribute(PRInt32 aNameSpaceID,
|
|||
// to unhook the old one.
|
||||
|
||||
nsXULAttribute* attr;
|
||||
PRBool successful = PR_FALSE;
|
||||
PRInt32 index = 0;
|
||||
PRInt32 i = 0;
|
||||
PRInt32 count = mAttributes->Count();
|
||||
while (index < count) {
|
||||
attr = mAttributes->ElementAt(index);
|
||||
while (i < count) {
|
||||
attr = mAttributes->ElementAt(i);
|
||||
if ((aNameSpaceID == attr->mNameSpaceID) && (aName == attr->mName))
|
||||
break;
|
||||
index++;
|
||||
i++;
|
||||
}
|
||||
|
||||
if (index < count) {
|
||||
if (i < count) {
|
||||
attr->mValue = aValue;
|
||||
}
|
||||
else { // didn't find it
|
||||
|
@ -1798,7 +1797,7 @@ RDFElementImpl::SetAttribute(PRInt32 aNameSpaceID,
|
|||
if (mBroadcastListeners != nsnull)
|
||||
{
|
||||
count = mBroadcastListeners->Count();
|
||||
for (PRInt32 i = 0; i < count; i++) {
|
||||
for (i = 0; i < count; i++) {
|
||||
XULBroadcastListener* xulListener = (XULBroadcastListener*)mBroadcastListeners->ElementAt(i);
|
||||
nsString aString;
|
||||
aName->ToString(aString);
|
||||
|
@ -1927,9 +1926,9 @@ done:
|
|||
|
||||
if (nsnull != mAttributes) {
|
||||
PRInt32 count = mAttributes->Count();
|
||||
PRInt32 index;
|
||||
for (index = 0; index < count; index++) {
|
||||
const nsXULAttribute* attr = (const nsXULAttribute*)mAttributes->ElementAt(index);
|
||||
PRInt32 i;
|
||||
for (i = 0; i < count; i++) {
|
||||
const nsXULAttribute* attr = (const nsXULAttribute*)mAttributes->ElementAt(i);
|
||||
if (((attr->mNameSpaceID == aNameSpaceID) ||
|
||||
(aNameSpaceID == kNameSpaceID_Unknown) ||
|
||||
(aNameSpaceID == kNameSpaceID_None)) &&
|
||||
|
@ -1995,11 +1994,11 @@ RDFElementImpl::UnsetAttribute(PRInt32 aNameSpaceID, nsIAtom* aName, PRBool aNot
|
|||
PRBool successful = PR_FALSE;
|
||||
if (nsnull != mAttributes) {
|
||||
PRInt32 count = mAttributes->Count();
|
||||
PRInt32 index;
|
||||
for (index = 0; index < count; index++) {
|
||||
nsXULAttribute* attr = (nsXULAttribute*)mAttributes->ElementAt(index);
|
||||
PRInt32 i;
|
||||
for (i = 0; i < count; i++) {
|
||||
nsXULAttribute* attr = (nsXULAttribute*)mAttributes->ElementAt(i);
|
||||
if ((attr->mNameSpaceID == aNameSpaceID) && (attr->mName == aName)) {
|
||||
mAttributes->RemoveElementAt(index);
|
||||
mAttributes->RemoveElementAt(i);
|
||||
NS_RELEASE(attr);
|
||||
successful = PR_TRUE;
|
||||
break;
|
||||
|
|
|
@ -1156,7 +1156,7 @@ RDFGenericBuilderImpl::FindWidgetRootElement(nsIContent* aElement,
|
|||
if (NS_FAILED(rv = element->GetTag(*getter_AddRefs(tag))))
|
||||
return rv;
|
||||
|
||||
if (tag.get() == rootAtom) {
|
||||
if (tag == rootAtom) {
|
||||
*aWidgetElement = element;
|
||||
NS_ADDREF(*aWidgetElement);
|
||||
return NS_OK;
|
||||
|
@ -1199,7 +1199,7 @@ RDFGenericBuilderImpl::IsItemOrFolder(nsIContent* aElement)
|
|||
if (NS_FAILED(rv = aElement->GetTag(*getter_AddRefs(tag))))
|
||||
return PR_FALSE;
|
||||
|
||||
if (tag.get() != itemAtom && tag.get() != folderAtom)
|
||||
if (tag != itemAtom && tag != folderAtom)
|
||||
return PR_FALSE;
|
||||
|
||||
return PR_TRUE;
|
||||
|
@ -1231,7 +1231,7 @@ RDFGenericBuilderImpl::IsWidgetInsertionRootElement(nsIContent* element)
|
|||
return PR_FALSE;
|
||||
}
|
||||
|
||||
if (elementTag.get() != rootAtom)
|
||||
if (elementTag != rootAtom)
|
||||
return PR_FALSE; // not the place to insert a child
|
||||
|
||||
return PR_TRUE;
|
||||
|
@ -1266,7 +1266,7 @@ RDFGenericBuilderImpl::IsContainmentProperty(nsIContent* aElement, nsIRDFResourc
|
|||
PRInt32 nameSpaceID;
|
||||
if (NS_FAILED(rv = element->GetNameSpaceID(nameSpaceID))) {
|
||||
NS_ERROR("unable to get element namespace");
|
||||
PR_FALSE;
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
if (nameSpaceID != kNameSpaceID_HTML) {
|
||||
|
@ -1327,7 +1327,7 @@ RDFGenericBuilderImpl::IsContainer(nsIContent* aElement, nsIRDFResource* aResour
|
|||
|
||||
while (1) {
|
||||
PRBool hasMore;
|
||||
nsresult rv = arcs->HasMoreElements(&hasMore);
|
||||
rv = arcs->HasMoreElements(&hasMore);
|
||||
NS_ASSERTION(NS_SUCCEEDED(rv), "severe error advancing cursor");
|
||||
if (NS_FAILED(rv))
|
||||
return PR_FALSE;
|
||||
|
@ -1382,11 +1382,11 @@ RDFGenericBuilderImpl::IsOpen(nsIContent* aElement)
|
|||
}
|
||||
|
||||
// The insertion root is _always_ open.
|
||||
if (tag.get() == insertionAtom)
|
||||
if (tag == insertionAtom)
|
||||
return PR_TRUE;
|
||||
|
||||
// If it's not a widget folder item, then it's not open.
|
||||
if (tag.get() != folderAtom)
|
||||
if (tag != folderAtom)
|
||||
return PR_FALSE;
|
||||
|
||||
nsAutoString value;
|
||||
|
@ -1531,7 +1531,7 @@ RDFGenericBuilderImpl::CloseWidgetItem(nsIContent* aElement)
|
|||
if (NS_FAILED(rv = aElement->GetTag(*getter_AddRefs(tag))))
|
||||
return rv; // XXX fatal
|
||||
|
||||
if (tag.get() == parentAtom) {
|
||||
if (tag == parentAtom) {
|
||||
parentNode = dont_QueryInterface(aElement);
|
||||
rv = NS_OK;
|
||||
}
|
||||
|
|
|
@ -53,16 +53,6 @@
|
|||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
DEFINE_RDF_VOCAB(NC_NAMESPACE_URI, NC, child);
|
||||
DEFINE_RDF_VOCAB(NC_NAMESPACE_URI, NC, Columns);
|
||||
DEFINE_RDF_VOCAB(NC_NAMESPACE_URI, NC, Column);
|
||||
DEFINE_RDF_VOCAB(NC_NAMESPACE_URI, NC, Folder);
|
||||
DEFINE_RDF_VOCAB(NC_NAMESPACE_URI, NC, Title);
|
||||
|
||||
DEFINE_RDF_VOCAB(RDF_NAMESPACE_URI, RDF, child);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
static NS_DEFINE_IID(kIContentIID, NS_ICONTENT_IID);
|
||||
static NS_DEFINE_IID(kIDocumentIID, NS_IDOCUMENT_IID);
|
||||
static NS_DEFINE_IID(kINameSpaceManagerIID, NS_INAMESPACEMANAGER_IID);
|
||||
|
|
|
@ -54,16 +54,6 @@
|
|||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
DEFINE_RDF_VOCAB(NC_NAMESPACE_URI, NC, child);
|
||||
DEFINE_RDF_VOCAB(NC_NAMESPACE_URI, NC, Columns);
|
||||
DEFINE_RDF_VOCAB(NC_NAMESPACE_URI, NC, Column);
|
||||
DEFINE_RDF_VOCAB(NC_NAMESPACE_URI, NC, Folder);
|
||||
DEFINE_RDF_VOCAB(NC_NAMESPACE_URI, NC, Title);
|
||||
|
||||
DEFINE_RDF_VOCAB(RDF_NAMESPACE_URI, RDF, child);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
static NS_DEFINE_IID(kIContentIID, NS_ICONTENT_IID);
|
||||
static NS_DEFINE_IID(kIDocumentIID, NS_IDOCUMENT_IID);
|
||||
static NS_DEFINE_IID(kINameSpaceManagerIID, NS_INAMESPACEMANAGER_IID);
|
||||
|
|
|
@ -1013,13 +1013,13 @@ RDFTreeBuilderImpl::OnRemoveChild(nsIDOMNode* aParent, nsIDOMNode* aOldChild)
|
|||
// If we get here, then they're trying to manipulate the DOM in
|
||||
// some way that doesn't translate into a sensible update to the RDF
|
||||
// graph. So, just whack the change into the content model
|
||||
PRInt32 index;
|
||||
rv = parent->IndexOf(child, index);
|
||||
PRInt32 i;
|
||||
rv = parent->IndexOf(child, i);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
NS_ASSERTION(index >= 0, "child was already removed");
|
||||
if (index >= 0) {
|
||||
rv = parent->RemoveChildAt(index, PR_TRUE);
|
||||
NS_ASSERTION(i >= 0, "child was already removed");
|
||||
if (i >= 0) {
|
||||
rv = parent->RemoveChildAt(i, PR_TRUE);
|
||||
NS_ASSERTION(NS_SUCCEEDED(rv), "error removing child from parent");
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
}
|
||||
|
|
|
@ -145,7 +145,7 @@ public:
|
|||
PRInt32 Count() { return mAttributes.Count(); };
|
||||
nsXULAttribute* ElementAt(PRInt32 i) { return (nsXULAttribute*)mAttributes.ElementAt(i); };
|
||||
void AppendElement(nsXULAttribute* aElement) { mAttributes.AppendElement((void*)aElement); };
|
||||
void RemoveElementAt(PRInt32 index) { mAttributes.RemoveElementAt(index); };
|
||||
void RemoveElementAt(PRInt32 aIndex) { mAttributes.RemoveElementAt(aIndex); };
|
||||
|
||||
// Style Helpers
|
||||
nsresult GetClasses(nsVoidArray& aArray) const;
|
||||
|
|
|
@ -338,9 +338,9 @@ RDFElementImpl::RDFElementImpl(PRInt32 aNameSpaceID, nsIAtom* aTag)
|
|||
mListenerManager(nsnull),
|
||||
mAttributes(nsnull),
|
||||
mContentsMustBeGenerated(PR_FALSE),
|
||||
mInnerXULElement(nsnull),
|
||||
mBroadcastListeners(nsnull),
|
||||
mBroadcaster(nsnull)
|
||||
mBroadcaster(nsnull),
|
||||
mInnerXULElement(nsnull)
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
NS_ADDREF(aTag);
|
||||
|
@ -573,9 +573,9 @@ RDFElementImpl::GetChildNodes(nsIDOMNodeList** aChildNodes)
|
|||
|
||||
PRInt32 count;
|
||||
if (NS_SUCCEEDED(rv = ChildCount(count))) {
|
||||
for (PRInt32 index = 0; index < count; ++index) {
|
||||
for (PRInt32 i = 0; i < count; ++i) {
|
||||
nsCOMPtr<nsIContent> child;
|
||||
rv = ChildAt(index, *getter_AddRefs(child));
|
||||
rv = ChildAt(i, *getter_AddRefs(child));
|
||||
NS_ASSERTION(NS_SUCCEEDED(rv), "unable to get child");
|
||||
if (NS_FAILED(rv))
|
||||
break;
|
||||
|
@ -1207,7 +1207,7 @@ RDFElementImpl::GetScriptObject(nsIScriptContext* aContext, void** aScriptObject
|
|||
|
||||
char buf[64];
|
||||
char* p = buf;
|
||||
if (tag.Length() >= sizeof(buf))
|
||||
if (tag.Length() >= PRInt32(sizeof buf))
|
||||
p = new char[tag.Length() + 1];
|
||||
|
||||
aContext->AddNamedReference((void*) &mScriptObject, mScriptObject, buf);
|
||||
|
@ -1378,7 +1378,7 @@ RDFElementImpl::SetDocument(nsIDocument* aDocument, PRBool aDeep)
|
|||
|
||||
char buf[64];
|
||||
char* p = buf;
|
||||
if (tag.Length() >= sizeof(buf))
|
||||
if (tag.Length() >= PRInt32(sizeof buf))
|
||||
p = new char[tag.Length() + 1];
|
||||
|
||||
context->AddNamedReference((void*) &mScriptObject, mScriptObject, buf);
|
||||
|
@ -1595,9 +1595,9 @@ RDFElementImpl::RemoveChildAt(PRInt32 aIndex, PRBool aNotify)
|
|||
nsIContent* oldKid = (nsIContent *)mChildren->ElementAt(aIndex);
|
||||
if (nsnull != oldKid ) {
|
||||
nsIDocument* doc = mDocument;
|
||||
PRBool rv = mChildren->RemoveElementAt(aIndex);
|
||||
PRBool removeOk = mChildren->RemoveElementAt(aIndex);
|
||||
//nsRange::OwnerChildRemoved(this, aIndex, oldKid);
|
||||
if (aNotify) {
|
||||
if (aNotify && removeOk) {
|
||||
if (nsnull != doc) {
|
||||
doc->ContentRemoved(NS_STATIC_CAST(nsIStyledContent*, this), oldKid, aIndex);
|
||||
}
|
||||
|
@ -1739,17 +1739,16 @@ RDFElementImpl::SetAttribute(PRInt32 aNameSpaceID,
|
|||
// to unhook the old one.
|
||||
|
||||
nsXULAttribute* attr;
|
||||
PRBool successful = PR_FALSE;
|
||||
PRInt32 index = 0;
|
||||
PRInt32 i = 0;
|
||||
PRInt32 count = mAttributes->Count();
|
||||
while (index < count) {
|
||||
attr = mAttributes->ElementAt(index);
|
||||
while (i < count) {
|
||||
attr = mAttributes->ElementAt(i);
|
||||
if ((aNameSpaceID == attr->mNameSpaceID) && (aName == attr->mName))
|
||||
break;
|
||||
index++;
|
||||
i++;
|
||||
}
|
||||
|
||||
if (index < count) {
|
||||
if (i < count) {
|
||||
attr->mValue = aValue;
|
||||
}
|
||||
else { // didn't find it
|
||||
|
@ -1798,7 +1797,7 @@ RDFElementImpl::SetAttribute(PRInt32 aNameSpaceID,
|
|||
if (mBroadcastListeners != nsnull)
|
||||
{
|
||||
count = mBroadcastListeners->Count();
|
||||
for (PRInt32 i = 0; i < count; i++) {
|
||||
for (i = 0; i < count; i++) {
|
||||
XULBroadcastListener* xulListener = (XULBroadcastListener*)mBroadcastListeners->ElementAt(i);
|
||||
nsString aString;
|
||||
aName->ToString(aString);
|
||||
|
@ -1927,9 +1926,9 @@ done:
|
|||
|
||||
if (nsnull != mAttributes) {
|
||||
PRInt32 count = mAttributes->Count();
|
||||
PRInt32 index;
|
||||
for (index = 0; index < count; index++) {
|
||||
const nsXULAttribute* attr = (const nsXULAttribute*)mAttributes->ElementAt(index);
|
||||
PRInt32 i;
|
||||
for (i = 0; i < count; i++) {
|
||||
const nsXULAttribute* attr = (const nsXULAttribute*)mAttributes->ElementAt(i);
|
||||
if (((attr->mNameSpaceID == aNameSpaceID) ||
|
||||
(aNameSpaceID == kNameSpaceID_Unknown) ||
|
||||
(aNameSpaceID == kNameSpaceID_None)) &&
|
||||
|
@ -1995,11 +1994,11 @@ RDFElementImpl::UnsetAttribute(PRInt32 aNameSpaceID, nsIAtom* aName, PRBool aNot
|
|||
PRBool successful = PR_FALSE;
|
||||
if (nsnull != mAttributes) {
|
||||
PRInt32 count = mAttributes->Count();
|
||||
PRInt32 index;
|
||||
for (index = 0; index < count; index++) {
|
||||
nsXULAttribute* attr = (nsXULAttribute*)mAttributes->ElementAt(index);
|
||||
PRInt32 i;
|
||||
for (i = 0; i < count; i++) {
|
||||
nsXULAttribute* attr = (nsXULAttribute*)mAttributes->ElementAt(i);
|
||||
if ((attr->mNameSpaceID == aNameSpaceID) && (attr->mName == aName)) {
|
||||
mAttributes->RemoveElementAt(index);
|
||||
mAttributes->RemoveElementAt(i);
|
||||
NS_RELEASE(attr);
|
||||
successful = PR_TRUE;
|
||||
break;
|
||||
|
|
|
@ -1156,7 +1156,7 @@ RDFGenericBuilderImpl::FindWidgetRootElement(nsIContent* aElement,
|
|||
if (NS_FAILED(rv = element->GetTag(*getter_AddRefs(tag))))
|
||||
return rv;
|
||||
|
||||
if (tag.get() == rootAtom) {
|
||||
if (tag == rootAtom) {
|
||||
*aWidgetElement = element;
|
||||
NS_ADDREF(*aWidgetElement);
|
||||
return NS_OK;
|
||||
|
@ -1199,7 +1199,7 @@ RDFGenericBuilderImpl::IsItemOrFolder(nsIContent* aElement)
|
|||
if (NS_FAILED(rv = aElement->GetTag(*getter_AddRefs(tag))))
|
||||
return PR_FALSE;
|
||||
|
||||
if (tag.get() != itemAtom && tag.get() != folderAtom)
|
||||
if (tag != itemAtom && tag != folderAtom)
|
||||
return PR_FALSE;
|
||||
|
||||
return PR_TRUE;
|
||||
|
@ -1231,7 +1231,7 @@ RDFGenericBuilderImpl::IsWidgetInsertionRootElement(nsIContent* element)
|
|||
return PR_FALSE;
|
||||
}
|
||||
|
||||
if (elementTag.get() != rootAtom)
|
||||
if (elementTag != rootAtom)
|
||||
return PR_FALSE; // not the place to insert a child
|
||||
|
||||
return PR_TRUE;
|
||||
|
@ -1266,7 +1266,7 @@ RDFGenericBuilderImpl::IsContainmentProperty(nsIContent* aElement, nsIRDFResourc
|
|||
PRInt32 nameSpaceID;
|
||||
if (NS_FAILED(rv = element->GetNameSpaceID(nameSpaceID))) {
|
||||
NS_ERROR("unable to get element namespace");
|
||||
PR_FALSE;
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
if (nameSpaceID != kNameSpaceID_HTML) {
|
||||
|
@ -1327,7 +1327,7 @@ RDFGenericBuilderImpl::IsContainer(nsIContent* aElement, nsIRDFResource* aResour
|
|||
|
||||
while (1) {
|
||||
PRBool hasMore;
|
||||
nsresult rv = arcs->HasMoreElements(&hasMore);
|
||||
rv = arcs->HasMoreElements(&hasMore);
|
||||
NS_ASSERTION(NS_SUCCEEDED(rv), "severe error advancing cursor");
|
||||
if (NS_FAILED(rv))
|
||||
return PR_FALSE;
|
||||
|
@ -1382,11 +1382,11 @@ RDFGenericBuilderImpl::IsOpen(nsIContent* aElement)
|
|||
}
|
||||
|
||||
// The insertion root is _always_ open.
|
||||
if (tag.get() == insertionAtom)
|
||||
if (tag == insertionAtom)
|
||||
return PR_TRUE;
|
||||
|
||||
// If it's not a widget folder item, then it's not open.
|
||||
if (tag.get() != folderAtom)
|
||||
if (tag != folderAtom)
|
||||
return PR_FALSE;
|
||||
|
||||
nsAutoString value;
|
||||
|
@ -1531,7 +1531,7 @@ RDFGenericBuilderImpl::CloseWidgetItem(nsIContent* aElement)
|
|||
if (NS_FAILED(rv = aElement->GetTag(*getter_AddRefs(tag))))
|
||||
return rv; // XXX fatal
|
||||
|
||||
if (tag.get() == parentAtom) {
|
||||
if (tag == parentAtom) {
|
||||
parentNode = dont_QueryInterface(aElement);
|
||||
rv = NS_OK;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче