From 07d7e57d8529593dc63cc15eb716a2bd367aae1e Mon Sep 17 00:00:00 2001 From: "zuperdee%penguinpowered.com" Date: Sun, 18 Jul 1999 02:26:34 +0000 Subject: [PATCH] Fixing the Motif part of bug #9828. git-svn-id: svn://10.0.0.236/trunk@39970 18797224-902f-48f8-a5cc-f745e15eee43 --- .../gfx/src/motif/nsRenderingContextMotif.cpp | 42 +++++++++++-------- 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/mozilla/gfx/src/motif/nsRenderingContextMotif.cpp b/mozilla/gfx/src/motif/nsRenderingContextMotif.cpp index 3cbfb868101..77e054ec758 100644 --- a/mozilla/gfx/src/motif/nsRenderingContextMotif.cpp +++ b/mozilla/gfx/src/motif/nsRenderingContextMotif.cpp @@ -301,19 +301,22 @@ NS_IMETHODIMP nsRenderingContextMotif :: PushState(void) GraphicsState * state = new GraphicsState(); // Push into this state object, add to vector - state->mMatrix = mTMatrix; + if(state) { + state->mMatrix = mTMatrix; - mStateCache->AppendElement(state); + mStateCache->AppendElement(state); - if (nsnull == mTMatrix) - mTMatrix = new nsTransform2D(); - else - mTMatrix = new nsTransform2D(mTMatrix); + if (nsnull == mTMatrix) + mTMatrix = new nsTransform2D(); + else + mTMatrix = new nsTransform2D(mTMatrix); - PRBool clipState; - GetClipRect(state->mLocalClip, clipState); + PRBool clipState; + GetClipRect(state->mLocalClip, clipState); - state->mClipRegion = mRegion; + state->mClipRegion = mRegion; + } + else state = NS_ERROR_OUT_OF_MEMORY; if (nsnull != state->mClipRegion) { mRegion = ::XCreateRegion(); @@ -843,20 +846,23 @@ NS_IMETHODIMP nsRenderingContextMotif :: CreateDrawingSurface(nsRect *aBounds, P nsDrawingSurfaceMotif * surface = new nsDrawingSurfaceMotif(); - surface->drawable = p ; - surface->display = mRenderingSurface->display; - surface->gc = mRenderingSurface->gc; - surface->visual = mRenderingSurface->visual; - surface->depth = mRenderingSurface->depth; + if(surface) { + surface->drawable = p ; + surface->display = mRenderingSurface->display; + surface->gc = mRenderingSurface->gc; + surface->visual = mRenderingSurface->visual; + surface->depth = mRenderingSurface->depth; #ifdef MITSHM - surface->shmInfo = mRenderingSurface->shmInfo; - surface->shmImage = mRenderingSurface->shmImage; - mRenderingSurface->shmInfo.shmaddr = nsnull; - mRenderingSurface->shmImage = nsnull; + surface->shmInfo = mRenderingSurface->shmInfo; + surface->shmImage = mRenderingSurface->shmImage; + mRenderingSurface->shmInfo.shmaddr = nsnull; + mRenderingSurface->shmImage = nsnull; #endif + } + else surface = NS_ERROR_OUT_OF_MEMORY; aSurface = (nsDrawingSurface)surface;