Back out 6d605438199c (bug 758589) for bug 759243

This commit is contained in:
Phil Ringnalda 2012-05-28 22:44:57 -07:00
parent 7daac61b87
commit a99daa8529

View File

@ -1093,11 +1093,10 @@ nsTypedSelection::ToString(PRUnichar **aReturn)
return NS_ERROR_NULL_POINTER;
}
// We need Flush_Style here to make sure frames have been created for
// the selected content. Use mFrameSelection->GetShell() which returns
// null if the Selection has been disconnected (the shell is Destroyed).
nsCOMPtr<nsIPresShell> shell =
mFrameSelection ? mFrameSelection->GetShell() : nsnull;
if (!shell) {
// the selected content.
nsCOMPtr<nsIPresShell> shell;
nsresult rv = GetPresShell(getter_AddRefs(shell));
if (NS_FAILED(rv) || !shell) {
*aReturn = ToNewUnicode(EmptyString());
return NS_OK;
}