From a99daa852916d2a46d8b739e249f04a70440dc0b Mon Sep 17 00:00:00 2001 From: Phil Ringnalda Date: Mon, 28 May 2012 22:44:57 -0700 Subject: [PATCH] Back out 6d605438199c (bug 758589) for bug 759243 --- layout/generic/nsSelection.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/layout/generic/nsSelection.cpp b/layout/generic/nsSelection.cpp index 2ed10d46de5..8998c7a9fa0 100644 --- a/layout/generic/nsSelection.cpp +++ b/layout/generic/nsSelection.cpp @@ -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 shell = - mFrameSelection ? mFrameSelection->GetShell() : nsnull; - if (!shell) { + // the selected content. + nsCOMPtr shell; + nsresult rv = GetPresShell(getter_AddRefs(shell)); + if (NS_FAILED(rv) || !shell) { *aReturn = ToNewUnicode(EmptyString()); return NS_OK; }