Better debug prints: tell which tag we're creating

This commit is contained in:
akkana%netscape.com 1999-09-10 22:34:18 +00:00
parent 96799ab633
commit 8fd31a2323
4 changed files with 32 additions and 8 deletions

View File

@ -65,8 +65,14 @@ CreateElementTxn::~CreateElementTxn()
NS_IMETHODIMP CreateElementTxn::Do(void) NS_IMETHODIMP CreateElementTxn::Do(void)
{ {
if (gNoisy) { printf("Do Create Element parent = %p, offset = %d\n", if (gNoisy)
mParent.get(), mOffsetInParent); } {
char* nodename = mTag.ToNewCString();
printf("Do Create Element parent = %p <%s>, offset = %d\n",
mParent.get(), nodename, mOffsetInParent);
nsAllocator::Free(nodename);
}
NS_ASSERTION(mEditor && mParent, "bad state"); NS_ASSERTION(mEditor && mParent, "bad state");
if (!mEditor || !mParent) return NS_ERROR_NOT_INITIALIZED; if (!mEditor || !mParent) return NS_ERROR_NOT_INITIALIZED;
nsresult result; nsresult result;

View File

@ -61,9 +61,15 @@ NS_IMETHODIMP InsertElementTxn::Do(void)
{ {
nsCOMPtr<nsIContent>nodeAsContent = do_QueryInterface(mNode); nsCOMPtr<nsIContent>nodeAsContent = do_QueryInterface(mNode);
nsCOMPtr<nsIContent>parentAsContent = do_QueryInterface(mParent); nsCOMPtr<nsIContent>parentAsContent = do_QueryInterface(mParent);
printf("%p Do Insert Element of %p into parent %p at offset %d\n", nsString namestr;
this, nodeAsContent.get(), parentAsContent.get(), mOffset); mNode->GetNodeName(namestr);
char* nodename = namestr.ToNewCString();
printf("%p Do Insert Element of %p <%s> into parent %p at offset %d\n",
this, nodeAsContent.get(), nodename,
parentAsContent.get(), mOffset);
nsAllocator::Free(nodename);
} }
if (!mNode || !mParent) return NS_ERROR_NOT_INITIALIZED; if (!mNode || !mParent) return NS_ERROR_NOT_INITIALIZED;
nsresult result; nsresult result;

View File

@ -65,8 +65,14 @@ CreateElementTxn::~CreateElementTxn()
NS_IMETHODIMP CreateElementTxn::Do(void) NS_IMETHODIMP CreateElementTxn::Do(void)
{ {
if (gNoisy) { printf("Do Create Element parent = %p, offset = %d\n", if (gNoisy)
mParent.get(), mOffsetInParent); } {
char* nodename = mTag.ToNewCString();
printf("Do Create Element parent = %p <%s>, offset = %d\n",
mParent.get(), nodename, mOffsetInParent);
nsAllocator::Free(nodename);
}
NS_ASSERTION(mEditor && mParent, "bad state"); NS_ASSERTION(mEditor && mParent, "bad state");
if (!mEditor || !mParent) return NS_ERROR_NOT_INITIALIZED; if (!mEditor || !mParent) return NS_ERROR_NOT_INITIALIZED;
nsresult result; nsresult result;

View File

@ -61,9 +61,15 @@ NS_IMETHODIMP InsertElementTxn::Do(void)
{ {
nsCOMPtr<nsIContent>nodeAsContent = do_QueryInterface(mNode); nsCOMPtr<nsIContent>nodeAsContent = do_QueryInterface(mNode);
nsCOMPtr<nsIContent>parentAsContent = do_QueryInterface(mParent); nsCOMPtr<nsIContent>parentAsContent = do_QueryInterface(mParent);
printf("%p Do Insert Element of %p into parent %p at offset %d\n", nsString namestr;
this, nodeAsContent.get(), parentAsContent.get(), mOffset); mNode->GetNodeName(namestr);
char* nodename = namestr.ToNewCString();
printf("%p Do Insert Element of %p <%s> into parent %p at offset %d\n",
this, nodeAsContent.get(), nodename,
parentAsContent.get(), mOffset);
nsAllocator::Free(nodename);
} }
if (!mNode || !mParent) return NS_ERROR_NOT_INITIALIZED; if (!mNode || !mParent) return NS_ERROR_NOT_INITIALIZED;
nsresult result; nsresult result;