Simpler fix for bugs 307809 and 314502. b=352449 r+sr=bzbarsky

This commit is contained in:
dbaron%dbaron.org 2006-09-13 06:53:15 +00:00
Родитель 28164580ef
Коммит 7bd45c49a1
3 изменённых файлов: 5 добавлений и 23 удалений

Просмотреть файл

@ -1466,7 +1466,7 @@ nsGrid::GetScrolledBox(nsIBox* aChild)
if (scrollFrame) { if (scrollFrame) {
nsIFrame* scrolledFrame = scrollFrame->GetScrolledFrame(); nsIFrame* scrolledFrame = scrollFrame->GetScrolledFrame();
NS_ASSERTION(scrolledFrame,"Error no scroll frame!!"); NS_ASSERTION(scrolledFrame,"Error no scroll frame!!");
return scrolledFrame->IsBoxFrame() ? scrolledFrame : nsnull; return scrolledFrame;
} }
return aChild; return aChild;

Просмотреть файл

@ -206,11 +206,7 @@ nsGridRowGroupLayout::DirtyRows(nsIBox* aBox, nsBoxLayoutState& aState)
// walk into other monuments // walk into other monuments
nsCOMPtr<nsIBoxLayout> layout; nsCOMPtr<nsIBoxLayout> layout;
// deepChild might be null if child is a scrollframe around a non-box. deepChild->GetLayoutManager(getter_AddRefs(layout));
// But in that case there's nothing to do here, really.
if (deepChild) {
deepChild->GetLayoutManager(getter_AddRefs(layout));
}
if (layout) { if (layout) {
nsCOMPtr<nsIGridPart> monument( do_QueryInterface(layout) ); nsCOMPtr<nsIGridPart> monument( do_QueryInterface(layout) );
if (monument) if (monument)
@ -240,12 +236,7 @@ nsGridRowGroupLayout::CountRowsColumns(nsIBox* aBox, PRInt32& aRowCount, PRInt32
nsIBox* deepChild = nsGrid::GetScrolledBox(child); nsIBox* deepChild = nsGrid::GetScrolledBox(child);
nsCOMPtr<nsIBoxLayout> layout; nsCOMPtr<nsIBoxLayout> layout;
// deepChild might be null if child is a scrollframe around a non-box. deepChild->GetLayoutManager(getter_AddRefs(layout));
// But in that case I guess we can count this as a single grid row. Or
// something.
if (deepChild) {
deepChild->GetLayoutManager(getter_AddRefs(layout));
}
if (layout) { if (layout) {
nsCOMPtr<nsIGridPart> monument( do_QueryInterface(layout) ); nsCOMPtr<nsIGridPart> monument( do_QueryInterface(layout) );
if (monument) { if (monument) {
@ -299,11 +290,7 @@ nsGridRowGroupLayout::BuildRows(nsIBox* aBox, nsGridRow* aRows, PRInt32* aCount)
nsIBox* deepChild = nsGrid::GetScrolledBox(child); nsIBox* deepChild = nsGrid::GetScrolledBox(child);
nsCOMPtr<nsIBoxLayout> layout; nsCOMPtr<nsIBoxLayout> layout;
// deepChild might be null if child is a scrollframe around a non-box. deepChild->GetLayoutManager(getter_AddRefs(layout));
// But in that case there's nothing special that needs doing there.
if (deepChild) {
deepChild->GetLayoutManager(getter_AddRefs(layout));
}
if (layout) { if (layout) {
nsCOMPtr<nsIGridPart> monument( do_QueryInterface(layout) ); nsCOMPtr<nsIGridPart> monument( do_QueryInterface(layout) );
if (monument) { if (monument) {

Просмотреть файл

@ -135,12 +135,7 @@ nsGridRowLayout::GetGrid(nsIBox* aBox, nsGrid** aList, PRInt32* aIndex, nsGridRo
nsIBox* childBox = nsGrid::GetScrolledBox(child); nsIBox* childBox = nsGrid::GetScrolledBox(child);
nsCOMPtr<nsIBoxLayout> layout; nsCOMPtr<nsIBoxLayout> layout;
// childBox might be null if child is a scrollframe around a non-box. But childBox->GetLayoutManager(getter_AddRefs(layout));
// in that case I guess we can count this as a single grid row. Or
// something.
if (childBox) {
childBox->GetLayoutManager(getter_AddRefs(layout));
}
// find our requester // find our requester
nsCOMPtr<nsIGridPart> gridRow = do_QueryInterface(layout, &rv); nsCOMPtr<nsIGridPart> gridRow = do_QueryInterface(layout, &rv);