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,10 +472,15 @@ namespace canvas
if(!(mpFragment)) if(!(mpFragment))
{ {
mpFragment = mpPageManager->allocateSpace(maSize); mpFragment = mpPageManager->allocateSpace(maSize);
if( mpFragment )
{
mpFragment->setColorBuffer(mpColorBuffer); mpFragment->setColorBuffer(mpColorBuffer);
mpFragment->setSourceOffset(maSourceOffset); mpFragment->setSourceOffset(maSourceOffset);
} }
}
if( mpFragment )
{
// now we need to 'select' the fragment, which will in turn // now we need to 'select' the fragment, which will in turn
// pull informations from the image on demand. // pull informations from the image on demand.
// in case this fragment is still not located on any of the // in case this fragment is still not located on any of the
@@ -480,6 +489,7 @@ namespace canvas
if(!(mpFragment->select(mbIsDirty))) if(!(mpFragment->select(mbIsDirty)))
mpPageManager->nakedFragment(mpFragment); mpPageManager->nakedFragment(mpFragment);
}
mbIsDirty=false; mbIsDirty=false;
} }