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
Родитель 96799ab633
Коммит 8fd31a2323
4 изменённых файлов: 32 добавлений и 8 удалений

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

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

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

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

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

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

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

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