Bug 107703. Fixes some of the crashes in DOM inspector. r=timeless, sr=hewitt

This commit is contained in:
aaronl%netscape.com 2001-11-01 07:28:10 +00:00
Родитель a9e8deaf11
Коммит 11b1c41d38
2 изменённых файлов: 8 добавлений и 8 удалений

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

@ -87,12 +87,12 @@ inFlasher::RepaintElement(nsIDOMElement* aElement)
nsCOMPtr<nsIPresContext> pcontext;
presShell->GetPresContext(getter_AddRefs(pcontext));
nsIFrame* parentWithView;
nsIFrame* parentWithView = nsnull;
frame->GetParentWithView(pcontext, &parentWithView);
if (parentWithView) {
nsIView* view;
parentWithView->GetView(pcontext, &view);
if (view) {
nsIView* view = nsnull;
nsresult rv= parentWithView->GetView(pcontext, &view);
if (NS_SUCCEEDED(rv) && view) {
nsCOMPtr<nsIViewManager> viewManager;
view->GetViewManager(*getter_AddRefs(viewManager));
if (viewManager) {

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

@ -123,7 +123,7 @@ nsIFrame*
inLayoutUtils::GetFrameFor(nsIDOMElement* aElement, nsIPresShell* aShell)
{
nsCOMPtr<nsIContent> content = do_QueryInterface(aElement);
nsIFrame* frame;
nsIFrame* frame = nsnull;
aShell->GetPrimaryFrameFor(content, &frame);
return frame;
@ -250,7 +250,7 @@ inLayoutUtils::GetScreenOrigin(nsIDOMElement* aElement)
presShell->GetPresContext(getter_AddRefs(presContext));
if (presContext) {
nsIFrame* frame;
nsIFrame* frame = nsnull;
nsresult rv = presShell->GetPrimaryFrameFor(content, &frame);
PRInt32 offsetX = 0;
@ -259,9 +259,9 @@ inLayoutUtils::GetScreenOrigin(nsIDOMElement* aElement)
while (frame) {
// Look for a widget so we can get screen coordinates
nsIView* view;
nsIView* view = nsnull;
rv = frame->GetView(presContext, &view);
if (view) {
if (NS_SUCCEEDED(rv) && view) {
rv = view->GetWidget(*getter_AddRefs(widget));
if (widget)
break;