mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-03 23:30:46 +00:00
Bug 537828 crash [@ nsAString_internal::Assign(nsAString_internal const&)] r=Olli
This commit is contained in:
parent
e2c4cb671f
commit
57f0951668
@ -2613,15 +2613,17 @@ NS_IMETHODIMP nsEditor::InsertTextImpl(const nsAString& aStringToInsert,
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP nsEditor::InsertTextIntoTextNodeImpl(const nsAString& aStringToInsert,
|
||||
nsIDOMCharacterData *aTextNode,
|
||||
PRInt32 aOffset, PRBool suppressIME)
|
||||
nsresult nsEditor::InsertTextIntoTextNodeImpl(const nsAString& aStringToInsert,
|
||||
nsIDOMCharacterData *aTextNode,
|
||||
PRInt32 aOffset,
|
||||
PRBool aSuppressIME)
|
||||
{
|
||||
nsRefPtr<EditTxn> txn;
|
||||
nsresult result = NS_OK;
|
||||
// suppressIME s used when editor must insert text, yet this text is not
|
||||
PRBool isIMETransaction = PR_FALSE;
|
||||
// aSuppressIME is used when editor must insert text, yet this text is not
|
||||
// part of current ime operation. example: adjusting whitespace around an ime insertion.
|
||||
if (mIMETextRangeList && mInIMEMode && !suppressIME)
|
||||
if (mIMETextRangeList && mInIMEMode && !aSuppressIME)
|
||||
{
|
||||
if (!mIMETextNode)
|
||||
{
|
||||
@ -2669,6 +2671,7 @@ NS_IMETHODIMP nsEditor::InsertTextIntoTextNodeImpl(const nsAString& aStringToIns
|
||||
nsRefPtr<IMETextTxn> imeTxn;
|
||||
result = CreateTxnForIMEText(aStringToInsert, getter_AddRefs(imeTxn));
|
||||
txn = imeTxn;
|
||||
isIMETransaction = PR_TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -2705,7 +2708,7 @@ NS_IMETHODIMP nsEditor::InsertTextIntoTextNodeImpl(const nsAString& aStringToIns
|
||||
// savvy to having multiple ime txns inside them.
|
||||
|
||||
// delete empty ime text node if there is one
|
||||
if (mInIMEMode && mIMETextNode)
|
||||
if (isIMETransaction)
|
||||
{
|
||||
PRUint32 len;
|
||||
mIMETextNode->GetLength(&len);
|
||||
|
@ -165,9 +165,10 @@ public:
|
||||
nsCOMPtr<nsIDOMNode> *aInOutNode,
|
||||
PRInt32 *aInOutOffset,
|
||||
nsIDOMDocument *aDoc);
|
||||
NS_IMETHOD InsertTextIntoTextNodeImpl(const nsAString& aStringToInsert,
|
||||
nsIDOMCharacterData *aTextNode,
|
||||
PRInt32 aOffset, PRBool suppressIME=PR_FALSE);
|
||||
nsresult InsertTextIntoTextNodeImpl(const nsAString& aStringToInsert,
|
||||
nsIDOMCharacterData *aTextNode,
|
||||
PRInt32 aOffset,
|
||||
PRBool aSuppressIME = PR_FALSE);
|
||||
NS_IMETHOD DeleteSelectionImpl(EDirection aAction);
|
||||
NS_IMETHOD DeleteSelectionAndCreateNode(const nsAString& aTag,
|
||||
nsIDOMNode ** aNewNode);
|
||||
|
Loading…
x
Reference in New Issue
Block a user