Index: cairo_canvashelper.cxx
===================================================================
RCS file: /cvs/gsl/canvas/source/cairo/cairo_canvashelper.cxx,v
retrieving revision 1.7.20.4
diff -u -p -r1.7.20.4 cairo_canvashelper.cxx
--- canvas/source/cairo/cairo_canvashelper.cxx	26 Jul 2007 13:48:19 -0000	1.7.20.4
+++ canvas/source/cairo/cairo_canvashelper.cxx	27 Aug 2007 14:34:37 -0000
@@ -110,12 +110,18 @@ namespace cairocanvas
 		}
     }
 
-    void CanvasHelper::init( const ::basegfx::B2ISize& /*rSize*/,
+    void CanvasHelper::init( const ::basegfx::B2ISize& rSize,
                              SpriteCanvas&             rDevice )
     {
+        maSize = rSize;
         mpDevice = &rDevice;
     }
 
+    void CanvasHelper::setSize( const ::basegfx::B2ISize& rSize )
+    {
+        maSize = rSize;
+    }
+
     void CanvasHelper::setSurface( Surface* pSurface, bool bHasAlpha, SurfaceProvider* pSurfaceProvider )
     {
         mbHaveAlpha = bHasAlpha;
@@ -251,8 +257,7 @@ namespace cairocanvas
             cairo_set_operator( mpCairo, CAIRO_OPERATOR_SOURCE );
             cairo_set_source_rgba( mpCairo, 0, 0, 0, 0 );
             
-			const ::basegfx::B2ISize& rSize( mpDevice->getSizePixel() );
-			cairo_rectangle( mpCairo, 0, 0, rSize.getX(), rSize.getY() );
+			cairo_rectangle( mpCairo, 0, 0, maSize.getX(), maSize.getY() );
             cairo_fill( mpCairo );
 
             cairo_restore( mpCairo );
@@ -1157,11 +1162,9 @@ namespace cairocanvas
                 geometry::IntegerSize2D aBitmapSize = rSize;
 
 		if( mpCairo ) {
-			const ::basegfx::B2ISize& aSize = mpDevice->getSizePixel();
-
 			cairo_save( mpCairo );
 
-			cairo_rectangle( mpCairo, 0, 0, aSize.getX(), aSize.getY() );
+			cairo_rectangle( mpCairo, 0, 0, maSize.getX(), maSize.getY() );
 			cairo_clip( mpCairo );
 
 			useStates( viewState, renderState, true );
@@ -1219,8 +1222,8 @@ namespace cairocanvas
 
 				// in case the bitmap doesn't have alpha and covers whole area
 				// we try to change surface to plain rgb
-				OSL_TRACE ("chance to change surface to rgb, %f, %f, %f x %f (%d x %d)", x, y, width, height, aSize.getX(), aSize.getY() );
-				if( x <= 0 && y <= 0 && x + width >= aSize.getX() && y + height >= aSize.getY() )
+				OSL_TRACE ("chance to change surface to rgb, %f, %f, %f x %f (%d x %d)", x, y, width, height, maSize.getX(), maSize.getY() );
+				if( x <= 0 && y <= 0 && x + width >= maSize.getX() && y + height >= maSize.getY() )
 				{
 					OSL_TRACE ("trying to change surface to rgb");
 					if( mpSurfaceProvider ) {
@@ -1318,7 +1321,7 @@ namespace cairocanvas
         if( !mpDevice )
             geometry::IntegerSize2D(1, 1); // we're disposed
 
-        return ::basegfx::unotools::integerSize2DFromB2ISize( mpDevice->getSizePixel() );
+        return ::basegfx::unotools::integerSize2DFromB2ISize( maSize );
     }
 
     uno::Reference< rendering::XBitmap > CanvasHelper::getScaledBitmap( const geometry::RealSize2D&	newSize, 
@@ -1448,11 +1451,9 @@ namespace cairocanvas
 		OSL_TRACE("CanvasHelper::repaint");
 
 		if( mpCairo ) {
-			const ::basegfx::B2ISize& aSize = mpDevice->getSizePixel();
-
 			cairo_save( mpCairo );
 
-			cairo_rectangle( mpCairo, 0, 0, aSize.getX(), aSize.getY() );
+			cairo_rectangle( mpCairo, 0, 0, maSize.getX(), maSize.getY() );
 			cairo_clip( mpCairo );
 
 			useStates( viewState, renderState, true );
Index: cairo_canvashelper.hxx
===================================================================
RCS file: /cvs/gsl/canvas/source/cairo/cairo_canvashelper.hxx,v
retrieving revision 1.4
diff -u -p -r1.4 cairo_canvashelper.hxx
--- canvas/source/cairo/cairo_canvashelper.hxx	17 Jul 2007 14:20:45 -0000	1.4
+++ canvas/source/cairo/cairo_canvashelper.hxx	27 Aug 2007 14:34:37 -0000
@@ -99,6 +99,7 @@ namespace cairocanvas
         void init( const ::basegfx::B2ISize& rSizePixel,
                    SpriteCanvas&             rDevice );
 
+        void setSize( const ::basegfx::B2ISize& rSize );
 	void setSurface( ::cairo::Surface* pSurface, bool bHasAlpha, SurfaceProvider* pSurfaceProvider = NULL );
 
         // CanvasHelper functionality
@@ -323,6 +324,7 @@ namespace cairocanvas
 		::cairo::Cairo* mpCairo;
 		::cairo::Surface* mpSurface;
 		SurfaceProvider* mpSurfaceProvider;
+        ::basegfx::B2ISize maSize;
     };
 
     void doPolyPolygonImplementation( ::basegfx::B2DPolyPolygon aPolyPolygon,
Index: cairo_spritecanvas.cxx
===================================================================
RCS file: /cvs/gsl/canvas/source/cairo/cairo_spritecanvas.cxx,v
retrieving revision 1.5
diff -u -p -r1.5 cairo_spritecanvas.cxx
--- canvas/source/cairo/cairo_spritecanvas.cxx	17 Jul 2007 14:21:38 -0000	1.5
+++ canvas/source/cairo/cairo_spritecanvas.cxx	27 Aug 2007 14:34:37 -0000
@@ -221,7 +221,7 @@ namespace cairocanvas
         return maDeviceHelper.getSizePixel();
     }
 
-    void SpriteCanvas::setSizePixel( const ::basegfx::B2ISize& /*rSize*/ )
+    void SpriteCanvas::setSizePixel( const ::basegfx::B2ISize& rSize )
     {
 		if( mpBackgroundSurface )
 		{
@@ -235,6 +235,7 @@ namespace cairocanvas
 		}
 		mpBackgroundCairo = mpBackgroundSurface->getCairo();
 
+		maCanvasHelper.setSize( rSize );
 		maCanvasHelper.setSurface( mpBackgroundSurface, false );
     }
 
