зеркало из https://github.com/mozilla/gecko-dev.git
Fix for bug #40392: Crash on exit from composer due to spellchecker init failure
Modified First/LastSelectedBlock() to check if a range is collapsed before trying to iterate over it. editor/txtsvc/src/nsTextServicesDocument.cpp r=jfrancis@netscape.com a=beppe@netscape.com
This commit is contained in:
Родитель
82849412ce
Коммит
2e76a9364c
|
@ -968,6 +968,23 @@ nsTextServicesDocument::FirstSelectedBlock(TSDBlockSelectionStatus *aSelStatus,
|
|||
return result;
|
||||
}
|
||||
|
||||
result = range->GetIsCollapsed(&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 current selection! Just return NS_OK;
|
||||
|
||||
UNLOCK_DOC(this);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
result = CreateContentIterator(range, getter_AddRefs(iter));
|
||||
|
||||
if (NS_FAILED(result))
|
||||
|
@ -1458,6 +1475,23 @@ nsTextServicesDocument::LastSelectedBlock(TSDBlockSelectionStatus *aSelStatus, P
|
|||
return result;
|
||||
}
|
||||
|
||||
result = range->GetIsCollapsed(&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 current selection! Just return NS_OK;
|
||||
|
||||
UNLOCK_DOC(this);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
result = CreateContentIterator(range, getter_AddRefs(iter));
|
||||
|
||||
if (NS_FAILED(result))
|
||||
|
|
|
@ -968,6 +968,23 @@ nsTextServicesDocument::FirstSelectedBlock(TSDBlockSelectionStatus *aSelStatus,
|
|||
return result;
|
||||
}
|
||||
|
||||
result = range->GetIsCollapsed(&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 current selection! Just return NS_OK;
|
||||
|
||||
UNLOCK_DOC(this);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
result = CreateContentIterator(range, getter_AddRefs(iter));
|
||||
|
||||
if (NS_FAILED(result))
|
||||
|
@ -1458,6 +1475,23 @@ nsTextServicesDocument::LastSelectedBlock(TSDBlockSelectionStatus *aSelStatus, P
|
|||
return result;
|
||||
}
|
||||
|
||||
result = range->GetIsCollapsed(&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 current selection! Just return NS_OK;
|
||||
|
||||
UNLOCK_DOC(this);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
result = CreateContentIterator(range, getter_AddRefs(iter));
|
||||
|
||||
if (NS_FAILED(result))
|
||||
|
|
Загрузка…
Ссылка в новой задаче