зеркало из https://github.com/mozilla/pjs.git
Fix crashing in SetView.
This commit is contained in:
Родитель
19cf97e623
Коммит
3c891c6a8d
|
@ -416,6 +416,10 @@ NS_IMETHODIMP nsOutlinerBodyFrame::SetView(nsIOutlinerView * aView)
|
|||
{
|
||||
// First clear out the old view.
|
||||
nsCOMPtr<nsIBoxObject> box(do_QueryInterface(mOutlinerBoxObject));
|
||||
if (!box)
|
||||
return NS_OK; // Just ignore the call. An initial reflow when it comes in
|
||||
// will retrieve the view from the box object.
|
||||
|
||||
nsAutoString view; view.AssignWithConversion("view");
|
||||
|
||||
if (mView) {
|
||||
|
|
|
@ -160,11 +160,14 @@ NS_IMETHODIMP nsOutlinerBoxObject::SetView(nsIOutlinerView * aView)
|
|||
nsIOutlinerBoxObject* body = GetOutlinerBody();
|
||||
if (body)
|
||||
return body->SetView(aView);
|
||||
else {
|
||||
nsCOMPtr<nsISupports> suppView(do_QueryInterface(aView));
|
||||
|
||||
nsCOMPtr<nsISupports> suppView(do_QueryInterface(aView));
|
||||
if (suppView)
|
||||
SetPropertyAsSupports(NS_LITERAL_STRING("view").get(), suppView);
|
||||
return NS_OK;
|
||||
}
|
||||
else
|
||||
RemoveProperty(NS_LITERAL_STRING("view").get());
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsOutlinerBoxObject::GetFocused(PRBool* aFocused)
|
||||
|
|
|
@ -416,6 +416,10 @@ NS_IMETHODIMP nsOutlinerBodyFrame::SetView(nsIOutlinerView * aView)
|
|||
{
|
||||
// First clear out the old view.
|
||||
nsCOMPtr<nsIBoxObject> box(do_QueryInterface(mOutlinerBoxObject));
|
||||
if (!box)
|
||||
return NS_OK; // Just ignore the call. An initial reflow when it comes in
|
||||
// will retrieve the view from the box object.
|
||||
|
||||
nsAutoString view; view.AssignWithConversion("view");
|
||||
|
||||
if (mView) {
|
||||
|
|
|
@ -160,11 +160,14 @@ NS_IMETHODIMP nsOutlinerBoxObject::SetView(nsIOutlinerView * aView)
|
|||
nsIOutlinerBoxObject* body = GetOutlinerBody();
|
||||
if (body)
|
||||
return body->SetView(aView);
|
||||
else {
|
||||
nsCOMPtr<nsISupports> suppView(do_QueryInterface(aView));
|
||||
|
||||
nsCOMPtr<nsISupports> suppView(do_QueryInterface(aView));
|
||||
if (suppView)
|
||||
SetPropertyAsSupports(NS_LITERAL_STRING("view").get(), suppView);
|
||||
return NS_OK;
|
||||
}
|
||||
else
|
||||
RemoveProperty(NS_LITERAL_STRING("view").get());
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsOutlinerBoxObject::GetFocused(PRBool* aFocused)
|
||||
|
|
Загрузка…
Ссылка в новой задаче