From a1329a49b0d74b09e8242a57697e1a41b9686233 Mon Sep 17 00:00:00 2001 From: "dcone%netscape.com" Date: Fri, 11 Dec 1998 16:05:54 +0000 Subject: [PATCH] Fixed it so that a control handle is not made unless a valid windowptr is passed in. This is needed for the printer port. git-svn-id: svn://10.0.0.236/trunk@16249 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/widget/src/mac/nsMacControl.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/mozilla/widget/src/mac/nsMacControl.cpp b/mozilla/widget/src/mac/nsMacControl.cpp index 6750c0884e2..3c7abc9478b 100644 --- a/mozilla/widget/src/mac/nsMacControl.cpp +++ b/mozilla/widget/src/mac/nsMacControl.cpp @@ -38,10 +38,10 @@ nsMacControl::nsMacControl() : nsWindow() mLastHilite = 0; } -//------------------------------------------------------------------------- -// -// -//------------------------------------------------------------------------- +/**------------------------------------------------------------------------- + * See documentation in nsMacControl.h + * @update -- 12/10/98 dwc + */ NS_IMETHODIMP nsMacControl::Create(nsIWidget *aParent, const nsRect &aRect, EVENT_CALLBACK aHandleEventFunction, @@ -59,8 +59,9 @@ NS_IMETHODIMP nsMacControl::Create(nsIWidget *aParent, ctlRect.x = ctlRect.y = 0; Rect macRect; nsRectToMacRect(ctlRect, macRect); - mControl = ::NewControl(mWindowPtr, &macRect, "\p", true, 0, 0, 1, mControlType, nil); - + if(nsnull != mWindowPtr){ + mControl = ::NewControl(mWindowPtr, &macRect, "\p", true, 0, 0, 1, mControlType, nil); + } mLastBounds = ctlRect; return NS_OK;