Sun Forte 7FCS builds crash in layout/ when compiled with -xO3 or higher

bug=164368 r=roc+moz@cs.cmu.edu sr=sfraser@netscape.com
patch by Roland.Mainz@informatik.med.uni-giessen.de
This commit is contained in:
pete.zha%sun.com 2002-09-17 02:49:30 +00:00
Родитель 17cdd21ed4
Коммит ea38f8803d
3 изменённых файлов: 38 добавлений и 44 удалений

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

@ -505,11 +505,11 @@ nsContainerFrame::SyncFrameViewAfterReflow(nsIPresContext* aPresContext,
PRUint32 aFlags)
{
if (aView) {
nsIViewManager *vm;
nsFrameState kidState;
nsSize frameSize;
nsCOMPtr<nsIViewManager> vm;
nsFrameState kidState;
nsSize frameSize;
aView->GetViewManager(vm);
aView->GetViewManager(*getter_AddRefs(vm));
aFrame->GetFrameState(&kidState);
aFrame->GetSize(frameSize);
@ -581,11 +581,10 @@ nsContainerFrame::SyncFrameViewAfterReflow(nsIPresContext* aPresContext,
}
else if (NS_STYLE_VISIBILITY_HIDDEN == vis->mVisible) {
// If it has a widget, hide the view because the widget can't deal with it
nsIWidget* widget = nsnull;
aView->GetWidget(widget);
nsCOMPtr<nsIWidget> widget;
aView->GetWidget(*getter_AddRefs(widget));
if (widget) {
viewIsVisible = PR_FALSE;
NS_RELEASE(widget);
}
else {
// If it's a scroll frame or a list control frame which is derived from the scrollframe,
@ -593,8 +592,8 @@ nsContainerFrame::SyncFrameViewAfterReflow(nsIPresContext* aPresContext,
// child elements can't override their parent's visibility, but
// it's not practical to leave it visible in all cases because
// the scrollbars will be showing
nsIAtom* frameType;
aFrame->GetFrameType(&frameType);
nsCOMPtr<nsIAtom> frameType;
aFrame->GetFrameType(getter_AddRefs(frameType));
if (frameType == nsLayoutAtoms::scrollFrame || frameType == nsLayoutAtoms::listControlFrame) {
viewIsVisible = PR_FALSE;
@ -616,7 +615,6 @@ nsContainerFrame::SyncFrameViewAfterReflow(nsIPresContext* aPresContext,
viewIsVisible = PR_FALSE;
}
}
NS_IF_RELEASE(frameType);
}
}
@ -739,8 +737,6 @@ nsContainerFrame::SyncFrameViewAfterReflow(nsIPresContext* aPresContext,
if (viewIsVisible) {
vm->SetViewContentTransparency(aView, viewHasTransparentContent);
}
NS_RELEASE(vm);
}
}

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

@ -505,11 +505,11 @@ nsContainerFrame::SyncFrameViewAfterReflow(nsIPresContext* aPresContext,
PRUint32 aFlags)
{
if (aView) {
nsIViewManager *vm;
nsFrameState kidState;
nsSize frameSize;
nsCOMPtr<nsIViewManager> vm;
nsFrameState kidState;
nsSize frameSize;
aView->GetViewManager(vm);
aView->GetViewManager(*getter_AddRefs(vm));
aFrame->GetFrameState(&kidState);
aFrame->GetSize(frameSize);
@ -581,11 +581,10 @@ nsContainerFrame::SyncFrameViewAfterReflow(nsIPresContext* aPresContext,
}
else if (NS_STYLE_VISIBILITY_HIDDEN == vis->mVisible) {
// If it has a widget, hide the view because the widget can't deal with it
nsIWidget* widget = nsnull;
aView->GetWidget(widget);
nsCOMPtr<nsIWidget> widget;
aView->GetWidget(*getter_AddRefs(widget));
if (widget) {
viewIsVisible = PR_FALSE;
NS_RELEASE(widget);
}
else {
// If it's a scroll frame or a list control frame which is derived from the scrollframe,
@ -593,8 +592,8 @@ nsContainerFrame::SyncFrameViewAfterReflow(nsIPresContext* aPresContext,
// child elements can't override their parent's visibility, but
// it's not practical to leave it visible in all cases because
// the scrollbars will be showing
nsIAtom* frameType;
aFrame->GetFrameType(&frameType);
nsCOMPtr<nsIAtom> frameType;
aFrame->GetFrameType(getter_AddRefs(frameType));
if (frameType == nsLayoutAtoms::scrollFrame || frameType == nsLayoutAtoms::listControlFrame) {
viewIsVisible = PR_FALSE;
@ -616,7 +615,6 @@ nsContainerFrame::SyncFrameViewAfterReflow(nsIPresContext* aPresContext,
viewIsVisible = PR_FALSE;
}
}
NS_IF_RELEASE(frameType);
}
}
@ -739,8 +737,6 @@ nsContainerFrame::SyncFrameViewAfterReflow(nsIPresContext* aPresContext,
if (viewIsVisible) {
vm->SetViewContentTransparency(aView, viewHasTransparentContent);
}
NS_RELEASE(vm);
}
}

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

@ -665,28 +665,30 @@ nsBox::GetBorder(nsMargin& aMargin)
if (disp->mAppearance && gTheme) {
// Go to the theme for the border.
nsSize size;
nsCOMPtr<nsIDocument> doc;
nsCOMPtr<nsIContent> content;
frame->GetContent(getter_AddRefs(content));
content->GetDocument(*getter_AddRefs(doc));
nsCOMPtr<nsIPresShell> shell;
if (doc) {
doc->GetShellAt(0, getter_AddRefs(shell));
nsCOMPtr<nsIPresContext> context;
shell->GetPresContext(getter_AddRefs(context));
if (gTheme->ThemeSupportsWidget(context, disp->mAppearance)) {
nsCOMPtr<nsIDeviceContext> dc;
context->GetDeviceContext(getter_AddRefs(dc));
nsMargin margin(0,0,0,0);
gTheme->GetWidgetBorder(dc, frame,
disp->mAppearance, &margin);
float p2t;
context->GetScaledPixelsToTwips(&p2t);
aMargin.top = NSIntPixelsToTwips(margin.top, p2t);
aMargin.right = NSIntPixelsToTwips(margin.right, p2t);
aMargin.bottom = NSIntPixelsToTwips(margin.bottom, p2t);
aMargin.left = NSIntPixelsToTwips(margin.left, p2t);
return NS_OK;
if (content) {
nsCOMPtr<nsIDocument> doc;
content->GetDocument(*getter_AddRefs(doc));
if (doc) {
nsCOMPtr<nsIPresShell> shell;
doc->GetShellAt(0, getter_AddRefs(shell));
nsCOMPtr<nsIPresContext> context;
shell->GetPresContext(getter_AddRefs(context));
if (gTheme->ThemeSupportsWidget(context, disp->mAppearance)) {
nsCOMPtr<nsIDeviceContext> dc;
context->GetDeviceContext(getter_AddRefs(dc));
nsMargin margin(0,0,0,0);
gTheme->GetWidgetBorder(dc, frame,
disp->mAppearance, &margin);
float p2t;
context->GetScaledPixelsToTwips(&p2t);
aMargin.top = NSIntPixelsToTwips(margin.top, p2t);
aMargin.right = NSIntPixelsToTwips(margin.right, p2t);
aMargin.bottom = NSIntPixelsToTwips(margin.bottom, p2t);
aMargin.left = NSIntPixelsToTwips(margin.left, p2t);
return NS_OK;
}
}
}
}