fix IME assertion problem . r=jfrancis

This commit is contained in:
ftang%netscape.com 1999-10-26 20:04:47 +00:00
Родитель a6dc57d532
Коммит 1486d36542
3 изменённых файлов: 13 добавлений и 5 удалений

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

@ -52,7 +52,7 @@ NS_IMETHODIMP IMECommitTxn::Init(void)
NS_IMETHODIMP IMECommitTxn::Do(void)
{
#ifdef DEBUG_tague
#if defined(DEBUG_tague) || defined(DEBUG_ftang)
printf("Do IME Commit");
#endif
@ -61,7 +61,7 @@ NS_IMETHODIMP IMECommitTxn::Do(void)
NS_IMETHODIMP IMECommitTxn::Undo(void)
{
#ifdef DEBUG_TAGUE
#if defined(DEBUG_TAGUE) || defined(DEBUG_ftang)
printf("Undo IME Commit");
#endif
@ -70,7 +70,7 @@ NS_IMETHODIMP IMECommitTxn::Undo(void)
NS_IMETHODIMP IMECommitTxn::Merge(PRBool *aDidMerge, nsITransaction *aTransaction)
{
#ifdef DEBUG_TAGUE
#if defined(DEBUG_TAGUE) || defined(DEBUG_ftang)
printf("Merge IME Commit");
#endif

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

@ -3792,16 +3792,20 @@ nsHTMLEditor::DebugUnitTests(PRInt32 *outNumTests, PRInt32 *outNumTestsFailed)
NS_IMETHODIMP
nsHTMLEditor::SetCompositionString(const nsString& aCompositionString, nsIPrivateTextRangeList* aTextRangeList,nsTextEventReply* aReply)
{
NS_ASSERTION(aTextRangeList, "null ptr");
if(nsnull == aTextRangeList)
return NS_ERROR_NULL_POINTER;
nsCOMPtr<nsICaret> caretP;
nsCOMPtr<nsIDOMSelection> selection;
nsresult result = GetSelection(getter_AddRefs(selection));
if (NS_FAILED(result)) return result;
mIMETextRangeList = aTextRangeList;
nsAutoPlaceHolderBatch batch(this, gIMETxnName);
result = InsertText(aCompositionString);
mIMEBufferLength = aCompositionString.Length();
if (!mPresShellWeak) return NS_ERROR_NOT_INITIALIZED;

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

@ -3792,16 +3792,20 @@ nsHTMLEditor::DebugUnitTests(PRInt32 *outNumTests, PRInt32 *outNumTestsFailed)
NS_IMETHODIMP
nsHTMLEditor::SetCompositionString(const nsString& aCompositionString, nsIPrivateTextRangeList* aTextRangeList,nsTextEventReply* aReply)
{
NS_ASSERTION(aTextRangeList, "null ptr");
if(nsnull == aTextRangeList)
return NS_ERROR_NULL_POINTER;
nsCOMPtr<nsICaret> caretP;
nsCOMPtr<nsIDOMSelection> selection;
nsresult result = GetSelection(getter_AddRefs(selection));
if (NS_FAILED(result)) return result;
mIMETextRangeList = aTextRangeList;
nsAutoPlaceHolderBatch batch(this, gIMETxnName);
result = InsertText(aCompositionString);
mIMEBufferLength = aCompositionString.Length();
if (!mPresShellWeak) return NS_ERROR_NOT_INITIALIZED;