summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvo Hinkelmann <ihi@openoffice.org>2008-06-09 14:03:59 +0000
committerIvo Hinkelmann <ihi@openoffice.org>2008-06-09 14:03:59 +0000
commit08a8fb1acd407bab34aa3bb829c00d238f549518 (patch)
tree52d72025f00a0d9fc0bcc70645ac310b7636ce75
parent332aff7f945de304fda3f7305e09652b5fb1526c (diff)
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
-rw-r--r--canvas/source/tools/surface.cxx34
1 files changed, 22 insertions, 12 deletions
diff --git a/canvas/source/tools/surface.cxx b/canvas/source/tools/surface.cxx
index 307bf0b84ece..1dd902d7c3ad 100644
--- a/canvas/source/tools/surface.cxx
+++ b/canvas/source/tools/surface.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: surface.cxx,v $
- * $Revision: 1.5 $
+ * $Revision: 1.6 $
*
* This file is part of OpenOffice.org.
*
@@ -82,7 +82,9 @@ namespace canvas
basegfx::B2DRectangle Surface::getUVCoords() const
{
::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 ph( aPageSize.getY() );
@@ -258,7 +260,9 @@ namespace canvas
if(aSize.getX() <= 0 || aSize.getY() <= 0)
return true;
- ::basegfx::B2IPoint aDestOffset(mpFragment->getPos());
+ ::basegfx::B2IPoint aDestOffset;
+ if( mpFragment )
+ mpFragment->getPos();
// convert size to normalized device coordinates
const ::basegfx::B2DRectangle& rUV(
@@ -468,18 +472,24 @@ namespace canvas
if(!(mpFragment))
{
mpFragment = mpPageManager->allocateSpace(maSize);
- mpFragment->setColorBuffer(mpColorBuffer);
- mpFragment->setSourceOffset(maSourceOffset);
+ if( mpFragment )
+ {
+ mpFragment->setColorBuffer(mpColorBuffer);
+ mpFragment->setSourceOffset(maSourceOffset);
+ }
}
- // now we need to 'select' the fragment, which will in turn
- // pull informations from the image on demand.
- // in case this fragment is still not located on any of the
- // available pages ['naked'], we force the page manager to
- // do it now, no way to defer this any longer...
- if(!(mpFragment->select(mbIsDirty)))
- mpPageManager->nakedFragment(mpFragment);
+ if( mpFragment )
+ {
+ // now we need to 'select' the fragment, which will in turn
+ // pull informations from the image on demand.
+ // in case this fragment is still not located on any of the
+ // available pages ['naked'], we force the page manager to
+ // do it now, no way to defer this any longer...
+ if(!(mpFragment->select(mbIsDirty)))
+ mpPageManager->nakedFragment(mpFragment);
+ }
mbIsDirty=false;
}