add debugging code. fix remove last uncomited IMEText. r=jfrancis

This commit is contained in:
ftang%netscape.com 1999-10-27 22:56:36 +00:00
Родитель 6ce991ee21
Коммит 7acdbdeec7
6 изменённых файлов: 56 добавлений и 0 удалений

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

@ -731,6 +731,9 @@ nsTextEditorTextListener::QueryInterface(REFNSIID aIID, void** aInstancePtr)
nsresult
nsTextEditorTextListener::HandleEvent(nsIDOMEvent* aEvent)
{
#if defined(DEBUG_ftang)
printf("nsTextEditorTextListener::HandleEvent\n");
#endif
return NS_OK;
}
@ -739,6 +742,9 @@ nsTextEditorTextListener::HandleEvent(nsIDOMEvent* aEvent)
nsresult
nsTextEditorTextListener::HandleText(nsIDOMEvent* aTextEvent)
{
#if defined(DEBUG_ftang)
printf("nsTextEditorTextListener::HandleText\n");
#endif
nsAutoString composedText;
nsresult result = NS_OK;
nsCOMPtr<nsIPrivateTextEvent> textEvent;
@ -975,6 +981,9 @@ NS_IMPL_RELEASE(nsTextEditorCompositionListener)
nsresult
nsTextEditorCompositionListener::HandleEvent(nsIDOMEvent* aEvent)
{
#if defined(DEBUG_ftang)
printf("nsTextEditorCompositionListener::HandleEvent\n");
#endif
return NS_OK;
}
@ -990,6 +999,9 @@ void nsTextEditorCompositionListener::SetEditor(nsIEditor *aEditor)
nsresult
nsTextEditorCompositionListener::HandleStartComposition(nsIDOMEvent* aCompositionEvent)
{
#if defined(DEBUG_ftang)
printf("nsTextEditorCompositionListener::HandleStartComposition\n");
#endif
nsCOMPtr<nsIPrivateCompositionEvent> pCompositionEvent = do_QueryInterface(aCompositionEvent);
nsTextEventReply* eventReply;
@ -1004,6 +1016,9 @@ nsTextEditorCompositionListener::HandleStartComposition(nsIDOMEvent* aCompositio
nsresult
nsTextEditorCompositionListener::HandleEndComposition(nsIDOMEvent* aCompositionEvent)
{
#if defined(DEBUG_ftang)
printf("nsTextEditorCompositionListener::HandleEndComposition\n");
#endif
return mEditor->EndComposition();
}

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

@ -78,6 +78,9 @@ nsHTMLEditRules::WillDoAction(nsIDOMSelection *aSelection,
{
if (!aInfo || !aCancel || !aHandled)
return NS_ERROR_NULL_POINTER;
#if defined(DEBUG_ftang)
printf("nsHTMLEditRules::WillDoAction action = %d\n", aInfo->action);
#endif
*aCancel = PR_FALSE;
*aHandled = PR_FALSE;
@ -271,6 +274,13 @@ nsHTMLEditRules::WillInsertText(nsIDOMSelection *aSelection,
nsString theString(*inString); // copy instring for now
PRInt32 pos = theString.FindCharInSet(specialChars);
if(0 == theString.Length()) {
// special case for IME. We need this to remove the last
// unconverted text.
PRBool bCancel;
nsString partialString;
res = DoTextInsertion(aSelection, &bCancel, &partialString, typeInState);
}
while (theString.Length())
{
PRBool bCancel;

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

@ -127,6 +127,9 @@ nsTextEditRules::WillDoAction(nsIDOMSelection *aSelection,
{
// null selection is legal
if (!aInfo || !aCancel || !aHandled) { return NS_ERROR_NULL_POINTER; }
#if defined(DEBUG_ftang)
printf("nsTextEditRules::WillDoAction action= %d", aInfo->action);
#endif
*aCancel = PR_FALSE;
*aHandled = PR_FALSE;

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

@ -78,6 +78,9 @@ nsHTMLEditRules::WillDoAction(nsIDOMSelection *aSelection,
{
if (!aInfo || !aCancel || !aHandled)
return NS_ERROR_NULL_POINTER;
#if defined(DEBUG_ftang)
printf("nsHTMLEditRules::WillDoAction action = %d\n", aInfo->action);
#endif
*aCancel = PR_FALSE;
*aHandled = PR_FALSE;
@ -271,6 +274,13 @@ nsHTMLEditRules::WillInsertText(nsIDOMSelection *aSelection,
nsString theString(*inString); // copy instring for now
PRInt32 pos = theString.FindCharInSet(specialChars);
if(0 == theString.Length()) {
// special case for IME. We need this to remove the last
// unconverted text.
PRBool bCancel;
nsString partialString;
res = DoTextInsertion(aSelection, &bCancel, &partialString, typeInState);
}
while (theString.Length())
{
PRBool bCancel;

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

@ -731,6 +731,9 @@ nsTextEditorTextListener::QueryInterface(REFNSIID aIID, void** aInstancePtr)
nsresult
nsTextEditorTextListener::HandleEvent(nsIDOMEvent* aEvent)
{
#if defined(DEBUG_ftang)
printf("nsTextEditorTextListener::HandleEvent\n");
#endif
return NS_OK;
}
@ -739,6 +742,9 @@ nsTextEditorTextListener::HandleEvent(nsIDOMEvent* aEvent)
nsresult
nsTextEditorTextListener::HandleText(nsIDOMEvent* aTextEvent)
{
#if defined(DEBUG_ftang)
printf("nsTextEditorTextListener::HandleText\n");
#endif
nsAutoString composedText;
nsresult result = NS_OK;
nsCOMPtr<nsIPrivateTextEvent> textEvent;
@ -975,6 +981,9 @@ NS_IMPL_RELEASE(nsTextEditorCompositionListener)
nsresult
nsTextEditorCompositionListener::HandleEvent(nsIDOMEvent* aEvent)
{
#if defined(DEBUG_ftang)
printf("nsTextEditorCompositionListener::HandleEvent\n");
#endif
return NS_OK;
}
@ -990,6 +999,9 @@ void nsTextEditorCompositionListener::SetEditor(nsIEditor *aEditor)
nsresult
nsTextEditorCompositionListener::HandleStartComposition(nsIDOMEvent* aCompositionEvent)
{
#if defined(DEBUG_ftang)
printf("nsTextEditorCompositionListener::HandleStartComposition\n");
#endif
nsCOMPtr<nsIPrivateCompositionEvent> pCompositionEvent = do_QueryInterface(aCompositionEvent);
nsTextEventReply* eventReply;
@ -1004,6 +1016,9 @@ nsTextEditorCompositionListener::HandleStartComposition(nsIDOMEvent* aCompositio
nsresult
nsTextEditorCompositionListener::HandleEndComposition(nsIDOMEvent* aCompositionEvent)
{
#if defined(DEBUG_ftang)
printf("nsTextEditorCompositionListener::HandleEndComposition\n");
#endif
return mEditor->EndComposition();
}

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

@ -127,6 +127,9 @@ nsTextEditRules::WillDoAction(nsIDOMSelection *aSelection,
{
// null selection is legal
if (!aInfo || !aCancel || !aHandled) { return NS_ERROR_NULL_POINTER; }
#if defined(DEBUG_ftang)
printf("nsTextEditRules::WillDoAction action= %d", aInfo->action);
#endif
*aCancel = PR_FALSE;
*aHandled = PR_FALSE;