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
parent 85d65d8110
commit 1fadcdc94d
6 changed files with 56 additions and 0 deletions
+15
View File
@@ -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();
}
+10
View File
@@ -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;
+3
View File
@@ -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;
+10
View File
@@ -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;