change debug code.

This commit is contained in:
ftang%netscape.com 1999-12-01 00:35:31 +00:00
parent 077d073a06
commit 55be244e29
5 changed files with 30 additions and 23 deletions

View File

@ -23,6 +23,7 @@
#include "IMECommitTxn.h"
#include "nsEditor.h"
// #define DEBUG_IME
nsIAtom *IMECommitTxn::gIMECommitTxnName = nsnull;
nsresult IMECommitTxn::ClassInit()
@ -56,7 +57,7 @@ NS_IMETHODIMP IMECommitTxn::Init(void)
NS_IMETHODIMP IMECommitTxn::Do(void)
{
#if defined(DEBUG_tague) || defined(DEBUG_ftang)
#ifdef DEBUG_IME
printf("Do IME Commit");
#endif
@ -65,7 +66,7 @@ NS_IMETHODIMP IMECommitTxn::Do(void)
NS_IMETHODIMP IMECommitTxn::Undo(void)
{
#if defined(DEBUG_TAGUE) || defined(DEBUG_ftang)
#ifdef DEBUG_IME
printf("Undo IME Commit");
#endif
@ -74,7 +75,7 @@ NS_IMETHODIMP IMECommitTxn::Undo(void)
NS_IMETHODIMP IMECommitTxn::Merge(PRBool *aDidMerge, nsITransaction *aTransaction)
{
#if defined(DEBUG_TAGUE) || defined(DEBUG_ftang)
#ifdef DEBUG_IME
printf("Merge IME Commit");
#endif

View File

@ -28,6 +28,8 @@
#include "nsIPresShell.h"
#include "EditAggregateTxn.h"
#include "nsLayoutCID.h"
// #define DEBUG_IMETXN
static NS_DEFINE_IID(kRangeCID, NS_RANGE_CID);
static NS_DEFINE_IID(kIDOMSelectionIID, NS_IDOMSELECTION_IID);
@ -83,7 +85,7 @@ NS_IMETHODIMP IMETextTxn::Init(nsIDOMCharacterData *aElement,
NS_IMETHODIMP IMETextTxn::Do(void)
{
#if defined(DEBUG_tague) || defined(DEBUG_ftang)
#ifdef DEBUG_IMETXN
printf("Do IME Text element = %p replace = %d len = %d\n", mElement.get(), mReplaceLength, mStringToInsert.Length());
#endif
@ -106,7 +108,7 @@ NS_IMETHODIMP IMETextTxn::Do(void)
NS_IMETHODIMP IMETextTxn::Undo(void)
{
#if defined(DEBUG_tague) || defined(DEBUG_ftang)
#ifdef DEBUG_IMETXN
printf("Undo IME Text element = %p\n", mElement.get());
#endif
@ -136,7 +138,7 @@ NS_IMETHODIMP IMETextTxn::Merge(PRBool *aDidMerge, nsITransaction *aTransaction)
return NS_ERROR_NULL_POINTER;
nsresult result;
#if defined(DEBUG_tague) || defined(DEBUG_ftang)
#ifdef DEBUG_IMETXN
printf("Merge IME Text element = %p\n", mElement.get());
#endif
@ -170,7 +172,7 @@ NS_IMETHODIMP IMETextTxn::Merge(PRBool *aDidMerge, nsITransaction *aTransaction)
otherTxn->GetData(mStringToInsert,&newTextRangeList);
mRangeList = do_QueryInterface(newTextRangeList);
*aDidMerge = PR_TRUE;
#if defined(DEBUG_tague) || defined(DEBUG_ftang)
#ifdef DEBUG_IMETXN
printf("IMETextTxn assimilated IMETextTxn:%p\n", aTransaction);
#endif
NS_RELEASE(otherTxn);
@ -278,7 +280,7 @@ NS_IMETHODIMP IMETextTxn::CollapseTextSelection(void)
nsIPrivateTextRange* textRange;
#if defined(DEBUG_tague) || defined(DEBUG_ftang)
#ifdef DEBUG_IMETXN
PRUint16 listlen,start,stop,type;
nsIPrivateTextRange* rangePtr;
result = mRangeList->GetLength(&listlen);

View File

@ -63,6 +63,7 @@ static NS_DEFINE_IID(kCDataFlavorCID, NS_DATAFLAVOR_CID);
static NS_DEFINE_IID(kContentIteratorCID, NS_CONTENTITERATOR_CID);
static NS_DEFINE_IID(kCXIFConverterCID, NS_XIFFORMATCONVERTER_CID);
//#define DEBUG_IME
/*
@ -615,7 +616,7 @@ nsTextEditorTextListener::QueryInterface(REFNSIID aIID, void** aInstancePtr)
nsresult
nsTextEditorTextListener::HandleEvent(nsIDOMEvent* aEvent)
{
#if defined(DEBUG_ftang)
#ifdef DEBUG_IME
printf("nsTextEditorTextListener::HandleEvent\n");
#endif
return NS_OK;
@ -626,7 +627,7 @@ nsTextEditorTextListener::HandleEvent(nsIDOMEvent* aEvent)
nsresult
nsTextEditorTextListener::HandleText(nsIDOMEvent* aTextEvent)
{
#if defined(DEBUG_ftang)
#ifdef DEBUG_IME
printf("nsTextEditorTextListener::HandleText\n");
#endif
nsAutoString composedText;
@ -869,7 +870,7 @@ NS_IMPL_RELEASE(nsTextEditorCompositionListener)
nsresult
nsTextEditorCompositionListener::HandleEvent(nsIDOMEvent* aEvent)
{
#if defined(DEBUG_ftang)
#ifdef DEBUG_IME
printf("nsTextEditorCompositionListener::HandleEvent\n");
#endif
return NS_OK;
@ -887,7 +888,7 @@ void nsTextEditorCompositionListener::SetEditor(nsIEditor *aEditor)
nsresult
nsTextEditorCompositionListener::HandleStartComposition(nsIDOMEvent* aCompositionEvent)
{
#if defined(DEBUG_ftang)
#ifdef DEBUG_IME
printf("nsTextEditorCompositionListener::HandleStartComposition\n");
#endif
nsCOMPtr<nsIPrivateCompositionEvent> pCompositionEvent = do_QueryInterface(aCompositionEvent);
@ -904,7 +905,7 @@ nsTextEditorCompositionListener::HandleStartComposition(nsIDOMEvent* aCompositio
nsresult
nsTextEditorCompositionListener::HandleEndComposition(nsIDOMEvent* aCompositionEvent)
{
#if defined(DEBUG_ftang)
#ifdef DEBUG_IME
printf("nsTextEditorCompositionListener::HandleEndComposition\n");
#endif
return mEditor->EndComposition();

View File

@ -28,6 +28,8 @@
#include "nsIPresShell.h"
#include "EditAggregateTxn.h"
#include "nsLayoutCID.h"
// #define DEBUG_IMETXN
static NS_DEFINE_IID(kRangeCID, NS_RANGE_CID);
static NS_DEFINE_IID(kIDOMSelectionIID, NS_IDOMSELECTION_IID);
@ -83,7 +85,7 @@ NS_IMETHODIMP IMETextTxn::Init(nsIDOMCharacterData *aElement,
NS_IMETHODIMP IMETextTxn::Do(void)
{
#if defined(DEBUG_tague) || defined(DEBUG_ftang)
#ifdef DEBUG_IMETXN
printf("Do IME Text element = %p replace = %d len = %d\n", mElement.get(), mReplaceLength, mStringToInsert.Length());
#endif
@ -106,7 +108,7 @@ NS_IMETHODIMP IMETextTxn::Do(void)
NS_IMETHODIMP IMETextTxn::Undo(void)
{
#if defined(DEBUG_tague) || defined(DEBUG_ftang)
#ifdef DEBUG_IMETXN
printf("Undo IME Text element = %p\n", mElement.get());
#endif
@ -136,7 +138,7 @@ NS_IMETHODIMP IMETextTxn::Merge(PRBool *aDidMerge, nsITransaction *aTransaction)
return NS_ERROR_NULL_POINTER;
nsresult result;
#if defined(DEBUG_tague) || defined(DEBUG_ftang)
#ifdef DEBUG_IMETXN
printf("Merge IME Text element = %p\n", mElement.get());
#endif
@ -170,7 +172,7 @@ NS_IMETHODIMP IMETextTxn::Merge(PRBool *aDidMerge, nsITransaction *aTransaction)
otherTxn->GetData(mStringToInsert,&newTextRangeList);
mRangeList = do_QueryInterface(newTextRangeList);
*aDidMerge = PR_TRUE;
#if defined(DEBUG_tague) || defined(DEBUG_ftang)
#ifdef DEBUG_IMETXN
printf("IMETextTxn assimilated IMETextTxn:%p\n", aTransaction);
#endif
NS_RELEASE(otherTxn);
@ -278,7 +280,7 @@ NS_IMETHODIMP IMETextTxn::CollapseTextSelection(void)
nsIPrivateTextRange* textRange;
#if defined(DEBUG_tague) || defined(DEBUG_ftang)
#ifdef DEBUG_IMETXN
PRUint16 listlen,start,stop,type;
nsIPrivateTextRange* rangePtr;
result = mRangeList->GetLength(&listlen);

View File

@ -63,6 +63,7 @@ static NS_DEFINE_IID(kCDataFlavorCID, NS_DATAFLAVOR_CID);
static NS_DEFINE_IID(kContentIteratorCID, NS_CONTENTITERATOR_CID);
static NS_DEFINE_IID(kCXIFConverterCID, NS_XIFFORMATCONVERTER_CID);
//#define DEBUG_IME
/*
@ -615,7 +616,7 @@ nsTextEditorTextListener::QueryInterface(REFNSIID aIID, void** aInstancePtr)
nsresult
nsTextEditorTextListener::HandleEvent(nsIDOMEvent* aEvent)
{
#if defined(DEBUG_ftang)
#ifdef DEBUG_IME
printf("nsTextEditorTextListener::HandleEvent\n");
#endif
return NS_OK;
@ -626,7 +627,7 @@ nsTextEditorTextListener::HandleEvent(nsIDOMEvent* aEvent)
nsresult
nsTextEditorTextListener::HandleText(nsIDOMEvent* aTextEvent)
{
#if defined(DEBUG_ftang)
#ifdef DEBUG_IME
printf("nsTextEditorTextListener::HandleText\n");
#endif
nsAutoString composedText;
@ -869,7 +870,7 @@ NS_IMPL_RELEASE(nsTextEditorCompositionListener)
nsresult
nsTextEditorCompositionListener::HandleEvent(nsIDOMEvent* aEvent)
{
#if defined(DEBUG_ftang)
#ifdef DEBUG_IME
printf("nsTextEditorCompositionListener::HandleEvent\n");
#endif
return NS_OK;
@ -887,7 +888,7 @@ void nsTextEditorCompositionListener::SetEditor(nsIEditor *aEditor)
nsresult
nsTextEditorCompositionListener::HandleStartComposition(nsIDOMEvent* aCompositionEvent)
{
#if defined(DEBUG_ftang)
#ifdef DEBUG_IME
printf("nsTextEditorCompositionListener::HandleStartComposition\n");
#endif
nsCOMPtr<nsIPrivateCompositionEvent> pCompositionEvent = do_QueryInterface(aCompositionEvent);
@ -904,7 +905,7 @@ nsTextEditorCompositionListener::HandleStartComposition(nsIDOMEvent* aCompositio
nsresult
nsTextEditorCompositionListener::HandleEndComposition(nsIDOMEvent* aCompositionEvent)
{
#if defined(DEBUG_ftang)
#ifdef DEBUG_IME
printf("nsTextEditorCompositionListener::HandleEndComposition\n");
#endif
return mEditor->EndComposition();