mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 14:22:01 +00:00
Fix for bug #56159 (Crash when sending after copy/paste with Spell Check enabled)
mozilla/editor/base/nsEditorShell.cpp - Make sure mSpellChecker is zeroed in Shutdown() just in case something went wrong. mozilla/editor/txtsvc/src/nsTextServicesDocument.cpp - Added checks to prevent iterating over a collapsed selection in FistSelectedBlock() and LastSelectedBlock(). r=brade@netscape.com sr,a=sfraser@netscape.com
This commit is contained in:
parent
203701d99a
commit
44e24f1173
@ -315,6 +315,10 @@ nsEditorShell::Shutdown()
|
||||
editor->PreDestroy();
|
||||
}
|
||||
|
||||
// Make sure we blow the spellchecker away, just in
|
||||
// case it hasn't been destroyed already.
|
||||
mSpellChecker = nsnull;
|
||||
|
||||
if (mDocShell)
|
||||
mDocShell->SetParentURIContentListener(nsnull);
|
||||
|
||||
|
@ -315,6 +315,10 @@ nsEditorShell::Shutdown()
|
||||
editor->PreDestroy();
|
||||
}
|
||||
|
||||
// Make sure we blow the spellchecker away, just in
|
||||
// case it hasn't been destroyed already.
|
||||
mSpellChecker = nsnull;
|
||||
|
||||
if (mDocShell)
|
||||
mDocShell->SetParentURIContentListener(nsnull);
|
||||
|
||||
|
@ -716,6 +716,23 @@ nsTextServicesDocument::FirstSelectedBlock(TSDBlockSelectionStatus *aSelStatus,
|
||||
return result;
|
||||
}
|
||||
|
||||
result = range->GetCollapsed(&isCollapsed);
|
||||
|
||||
if (NS_FAILED(result))
|
||||
{
|
||||
UNLOCK_DOC(this);
|
||||
return result;
|
||||
}
|
||||
|
||||
if (isCollapsed)
|
||||
{
|
||||
// If we get here, the range is collapsed because there is nothing before
|
||||
// the caret! Just return NS_OK;
|
||||
|
||||
UNLOCK_DOC(this);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
result = CreateContentIterator(range, getter_AddRefs(iter));
|
||||
|
||||
if (NS_FAILED(result))
|
||||
@ -1223,6 +1240,23 @@ nsTextServicesDocument::LastSelectedBlock(TSDBlockSelectionStatus *aSelStatus, P
|
||||
return result;
|
||||
}
|
||||
|
||||
result = range->GetCollapsed(&isCollapsed);
|
||||
|
||||
if (NS_FAILED(result))
|
||||
{
|
||||
UNLOCK_DOC(this);
|
||||
return result;
|
||||
}
|
||||
|
||||
if (isCollapsed)
|
||||
{
|
||||
// If we get here, the range is collapsed because there is nothing after
|
||||
// the caret! Just return NS_OK;
|
||||
|
||||
UNLOCK_DOC(this);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
result = CreateContentIterator(range, getter_AddRefs(iter));
|
||||
|
||||
if (NS_FAILED(result))
|
||||
|
@ -716,6 +716,23 @@ nsTextServicesDocument::FirstSelectedBlock(TSDBlockSelectionStatus *aSelStatus,
|
||||
return result;
|
||||
}
|
||||
|
||||
result = range->GetCollapsed(&isCollapsed);
|
||||
|
||||
if (NS_FAILED(result))
|
||||
{
|
||||
UNLOCK_DOC(this);
|
||||
return result;
|
||||
}
|
||||
|
||||
if (isCollapsed)
|
||||
{
|
||||
// If we get here, the range is collapsed because there is nothing before
|
||||
// the caret! Just return NS_OK;
|
||||
|
||||
UNLOCK_DOC(this);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
result = CreateContentIterator(range, getter_AddRefs(iter));
|
||||
|
||||
if (NS_FAILED(result))
|
||||
@ -1223,6 +1240,23 @@ nsTextServicesDocument::LastSelectedBlock(TSDBlockSelectionStatus *aSelStatus, P
|
||||
return result;
|
||||
}
|
||||
|
||||
result = range->GetCollapsed(&isCollapsed);
|
||||
|
||||
if (NS_FAILED(result))
|
||||
{
|
||||
UNLOCK_DOC(this);
|
||||
return result;
|
||||
}
|
||||
|
||||
if (isCollapsed)
|
||||
{
|
||||
// If we get here, the range is collapsed because there is nothing after
|
||||
// the caret! Just return NS_OK;
|
||||
|
||||
UNLOCK_DOC(this);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
result = CreateContentIterator(range, getter_AddRefs(iter));
|
||||
|
||||
if (NS_FAILED(result))
|
||||
|
Loading…
Reference in New Issue
Block a user