From 8fd31a232389de56f40c3b15434943161742d59b Mon Sep 17 00:00:00 2001 From: "akkana%netscape.com" Date: Fri, 10 Sep 1999 22:34:18 +0000 Subject: [PATCH] Better debug prints: tell which tag we're creating --- editor/base/CreateElementTxn.cpp | 10 ++++++++-- editor/base/InsertElementTxn.cpp | 10 ++++++++-- editor/libeditor/base/CreateElementTxn.cpp | 10 ++++++++-- editor/libeditor/base/InsertElementTxn.cpp | 10 ++++++++-- 4 files changed, 32 insertions(+), 8 deletions(-) diff --git a/editor/base/CreateElementTxn.cpp b/editor/base/CreateElementTxn.cpp index 02d6cd204338..10fef19224a2 100644 --- a/editor/base/CreateElementTxn.cpp +++ b/editor/base/CreateElementTxn.cpp @@ -65,8 +65,14 @@ CreateElementTxn::~CreateElementTxn() NS_IMETHODIMP CreateElementTxn::Do(void) { - if (gNoisy) { printf("Do Create Element parent = %p, offset = %d\n", - mParent.get(), mOffsetInParent); } + if (gNoisy) + { + 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"); if (!mEditor || !mParent) return NS_ERROR_NOT_INITIALIZED; nsresult result; diff --git a/editor/base/InsertElementTxn.cpp b/editor/base/InsertElementTxn.cpp index d107dfc95b22..a16f58f6f1d5 100644 --- a/editor/base/InsertElementTxn.cpp +++ b/editor/base/InsertElementTxn.cpp @@ -61,9 +61,15 @@ NS_IMETHODIMP InsertElementTxn::Do(void) { nsCOMPtrnodeAsContent = do_QueryInterface(mNode); nsCOMPtrparentAsContent = do_QueryInterface(mParent); - printf("%p Do Insert Element of %p into parent %p at offset %d\n", - this, nodeAsContent.get(), parentAsContent.get(), mOffset); + nsString namestr; + 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; nsresult result; diff --git a/editor/libeditor/base/CreateElementTxn.cpp b/editor/libeditor/base/CreateElementTxn.cpp index 02d6cd204338..10fef19224a2 100644 --- a/editor/libeditor/base/CreateElementTxn.cpp +++ b/editor/libeditor/base/CreateElementTxn.cpp @@ -65,8 +65,14 @@ CreateElementTxn::~CreateElementTxn() NS_IMETHODIMP CreateElementTxn::Do(void) { - if (gNoisy) { printf("Do Create Element parent = %p, offset = %d\n", - mParent.get(), mOffsetInParent); } + if (gNoisy) + { + 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"); if (!mEditor || !mParent) return NS_ERROR_NOT_INITIALIZED; nsresult result; diff --git a/editor/libeditor/base/InsertElementTxn.cpp b/editor/libeditor/base/InsertElementTxn.cpp index d107dfc95b22..a16f58f6f1d5 100644 --- a/editor/libeditor/base/InsertElementTxn.cpp +++ b/editor/libeditor/base/InsertElementTxn.cpp @@ -61,9 +61,15 @@ NS_IMETHODIMP InsertElementTxn::Do(void) { nsCOMPtrnodeAsContent = do_QueryInterface(mNode); nsCOMPtrparentAsContent = do_QueryInterface(mParent); - printf("%p Do Insert Element of %p into parent %p at offset %d\n", - this, nodeAsContent.get(), parentAsContent.get(), mOffset); + nsString namestr; + 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; nsresult result;