INTEGRATION: CWS impress141 (1.5.8); FILE MERGED

2008/04/28 16:03:20 cl 1.5.8.1: #155614# fix possible null pointer access
This commit is contained in:
Ivo Hinkelmann
2008-06-09 14:03:59 +00:00
parent 332aff7f94
commit 08a8fb1acd

View File

@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite * OpenOffice.org - a multi-platform office productivity suite
* *
* $RCSfile: surface.cxx,v $ * $RCSfile: surface.cxx,v $
* $Revision: 1.5 $ * $Revision: 1.6 $
* *
* This file is part of OpenOffice.org. * This file is part of OpenOffice.org.
* *
@@ -82,7 +82,9 @@ namespace canvas
basegfx::B2DRectangle Surface::getUVCoords() const basegfx::B2DRectangle Surface::getUVCoords() const
{ {
::basegfx::B2ISize aPageSize(mpPageManager->getPageSize()); ::basegfx::B2ISize aPageSize(mpPageManager->getPageSize());
::basegfx::B2IPoint aDestOffset(mpFragment->getPos()); ::basegfx::B2IPoint aDestOffset;
if( mpFragment )
aDestOffset = mpFragment->getPos();
const double pw( aPageSize.getX() ); const double pw( aPageSize.getX() );
const double ph( aPageSize.getY() ); const double ph( aPageSize.getY() );
@@ -258,7 +260,9 @@ namespace canvas
if(aSize.getX() <= 0 || aSize.getY() <= 0) if(aSize.getX() <= 0 || aSize.getY() <= 0)
return true; return true;
::basegfx::B2IPoint aDestOffset(mpFragment->getPos()); ::basegfx::B2IPoint aDestOffset;
if( mpFragment )
mpFragment->getPos();
// convert size to normalized device coordinates // convert size to normalized device coordinates
const ::basegfx::B2DRectangle& rUV( const ::basegfx::B2DRectangle& rUV(
@@ -468,18 +472,24 @@ namespace canvas
if(!(mpFragment)) if(!(mpFragment))
{ {
mpFragment = mpPageManager->allocateSpace(maSize); mpFragment = mpPageManager->allocateSpace(maSize);
mpFragment->setColorBuffer(mpColorBuffer); if( mpFragment )
mpFragment->setSourceOffset(maSourceOffset); {
mpFragment->setColorBuffer(mpColorBuffer);
mpFragment->setSourceOffset(maSourceOffset);
}
} }
// now we need to 'select' the fragment, which will in turn if( mpFragment )
// pull informations from the image on demand. {
// in case this fragment is still not located on any of the // now we need to 'select' the fragment, which will in turn
// available pages ['naked'], we force the page manager to // pull informations from the image on demand.
// do it now, no way to defer this any longer... // in case this fragment is still not located on any of the
if(!(mpFragment->select(mbIsDirty))) // available pages ['naked'], we force the page manager to
mpPageManager->nakedFragment(mpFragment); // do it now, no way to defer this any longer...
if(!(mpFragment->select(mbIsDirty)))
mpPageManager->nakedFragment(mpFragment);
}
mbIsDirty=false; mbIsDirty=false;
} }