зеркало из https://github.com/mozilla/gecko-dev.git
fix IME assertion problem . r=jfrancis
This commit is contained in:
Родитель
a6dc57d532
Коммит
1486d36542
|
@ -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;
|
||||
|
|
Загрузка…
Ссылка в новой задаче