Bug 407127 - Part 1: Refactor the editor so that it only touches mPresShellWeak in GetPresShell, to make removing it easier; r=roc

This commit is contained in:
Ehsan Akhgari
2011-03-11 00:40:30 -05:00
parent ab83b36adc
commit 66819365ab
8 changed files with 50 additions and 31 deletions

View File

@@ -311,7 +311,8 @@ nsHTMLEditor::HideGrabber()
NS_ENSURE_TRUE(mGrabber, NS_ERROR_NULL_POINTER);
// get the presshell's document observer interface.
nsCOMPtr<nsIPresShell> ps = do_QueryReferent(mPresShellWeak);
nsCOMPtr<nsIPresShell> ps;
GetPresShell(getter_AddRefs(ps));
// We allow the pres shell to be null; when it is, we presume there
// are no document observers to notify, but we still want to
// UnbindFromTree.
@@ -427,7 +428,8 @@ nsresult
nsHTMLEditor::EndMoving()
{
if (mPositioningShadow) {
nsCOMPtr<nsIPresShell> ps = do_QueryReferent(mPresShellWeak);
nsCOMPtr<nsIPresShell> ps;
GetPresShell(getter_AddRefs(ps));
NS_ENSURE_TRUE(ps, NS_ERROR_NOT_INITIALIZED);
nsCOMPtr<nsIDOMNode> parentNode;