зеркало из https://github.com/mozilla/pjs.git
views are not refcounted; do not nsCOMPtr them! Bug 166804, r=timeless,
sr=roc
This commit is contained in:
Родитель
e1085080c4
Коммит
ed3f04a807
|
@ -962,10 +962,10 @@ NS_METHOD nsDOMEvent::GetPageX(PRInt32* aPageX)
|
|||
{
|
||||
nsresult ret = NS_OK;
|
||||
PRInt32 scrollX = 0;
|
||||
nsCOMPtr<nsIScrollableView> view;
|
||||
nsIScrollableView* view = nsnull;
|
||||
float p2t, t2p;
|
||||
|
||||
GetScrollInfo(getter_AddRefs(view), &p2t, &t2p);
|
||||
GetScrollInfo(&view, &p2t, &t2p);
|
||||
if(view) {
|
||||
nscoord xPos, yPos;
|
||||
ret = view->GetScrollPosition(xPos, yPos);
|
||||
|
@ -987,10 +987,10 @@ NS_METHOD nsDOMEvent::GetPageY(PRInt32* aPageY)
|
|||
{
|
||||
nsresult ret = NS_OK;
|
||||
PRInt32 scrollY = 0;
|
||||
nsCOMPtr<nsIScrollableView> view;
|
||||
nsIScrollableView* view = nsnull;
|
||||
float p2t, t2p;
|
||||
|
||||
GetScrollInfo(getter_AddRefs(view), &p2t, &t2p);
|
||||
GetScrollInfo(&view, &p2t, &t2p);
|
||||
if(view) {
|
||||
nscoord xPos, yPos;
|
||||
ret = view->GetScrollPosition(xPos, yPos);
|
||||
|
|
|
@ -299,7 +299,7 @@ nsScrollBoxFrame::CreateScrollingView(nsIPresContext* aPresContext)
|
|||
|
||||
// Get the nsIScrollableView interface
|
||||
nsIScrollableView* scrollingView;
|
||||
view->QueryInterface(NS_GET_IID(nsIScrollableView), (void**)&scrollingView);
|
||||
CallQueryInterface(view, &scrollingView);
|
||||
|
||||
scrollingView->SetScrollPreference(nsScrollPreference_kNeverScroll);
|
||||
|
||||
|
@ -439,7 +439,7 @@ nsScrollBoxFrame::DoLayout(nsBoxLayoutState& aState)
|
|||
nsIScrollableView* scrollingView;
|
||||
nsIView* view;
|
||||
GetView(presContext, &view);
|
||||
if (NS_SUCCEEDED(view->QueryInterface(NS_GET_IID(nsIScrollableView), (void**)&scrollingView))) {
|
||||
if (NS_SUCCEEDED(CallQueryInterface(view, &scrollingView))) {
|
||||
scrollingView->ComputeScrollOffsets(PR_TRUE);
|
||||
}
|
||||
|
||||
|
@ -516,7 +516,8 @@ nsScrollBoxFrame::DoLayout(nsBoxLayoutState& aState)
|
|||
if (!view)
|
||||
return NS_OK; // don't freak out if we have no view
|
||||
|
||||
nsCOMPtr<nsIScrollableView> scrollingView(do_QueryInterface(view));
|
||||
nsIScrollableView* scrollingView;
|
||||
CallQueryInterface(view, &scrollingView);
|
||||
if (scrollingView) {
|
||||
nscoord x = 0;
|
||||
nscoord y = 0;
|
||||
|
@ -735,7 +736,7 @@ nsScrollBoxFrame::SaveState(nsIPresContext* aPresContext,
|
|||
|
||||
PRInt32 x,y;
|
||||
nsIScrollableView* scrollingView;
|
||||
res = view->QueryInterface(NS_GET_IID(nsIScrollableView), (void**)&scrollingView);
|
||||
res = CallQueryInterface(view, &scrollingView);
|
||||
NS_ENSURE_SUCCESS(res, res);
|
||||
scrollingView->GetScrollPosition(x,y);
|
||||
|
||||
|
@ -832,7 +833,8 @@ nsScrollBoxFrame::RestoreState(nsIPresContext* aPresContext,
|
|||
if (!view)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
nsCOMPtr<nsIScrollableView> scrollingView(do_QueryInterface(view));
|
||||
nsIScrollableView* scrollingView;
|
||||
CallQueryInterface(view, &scrollingView);
|
||||
if (scrollingView)
|
||||
scrollingView->GetScrollPosition(mLastPos.x, mLastPos.y);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче