diff options
-rw-r--r-- | sc/source/ui/inc/gridwin.hxx | 3 | ||||
-rw-r--r-- | sc/source/ui/unoobj/docuno.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/view/gridwin4.cxx | 41 |
3 files changed, 32 insertions, 14 deletions
diff --git a/sc/source/ui/inc/gridwin.hxx b/sc/source/ui/inc/gridwin.hxx index 17b02f8d5a3a..dede1497db5f 100644 --- a/sc/source/ui/inc/gridwin.hxx +++ b/sc/source/ui/inc/gridwin.hxx @@ -360,7 +360,8 @@ public: using Window::Draw; void Draw( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, - ScUpdateMode eMode = SC_UPDATE_ALL ); + ScUpdateMode eMode = SC_UPDATE_ALL, + OutputDevice* pOutDev = 0 ); void CreateAnchorHandle(SdrHdlList& rHdl, const ScAddress& rAddress); diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx index 57a80b552c34..00993eb57839 100644 --- a/sc/source/ui/unoobj/docuno.cxx +++ b/sc/source/ui/unoobj/docuno.cxx @@ -466,7 +466,7 @@ Size ScModelObj::getDocumentSize() // TODO: not sure what we want to do here, maybe just return the size for a certain // default minimum number of cells, e.g. 100x100 and more if more cells have // content? - return Size(); + return Size( 3200, 3200 ); } uno::Any SAL_CALL ScModelObj::queryInterface( const uno::Type& rType ) diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx index fa697ee5fbdd..020fb4ed6835 100644 --- a/sc/source/ui/view/gridwin4.cxx +++ b/sc/source/ui/view/gridwin4.cxx @@ -376,9 +376,14 @@ void ScGridWindow::Paint( const Rectangle& rRect ) } // Draw ---------------------------------------------------------------- - -void ScGridWindow::Draw( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, ScUpdateMode eMode ) +void ScGridWindow::Draw( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, ScUpdateMode eMode, + OutputDevice* pOutDev ) { + if ( !pOutDev ) + { + pOutDev = this; + } + ScModule* pScMod = SC_MOD(); bool bTextWysiwyg = pScMod->GetInputOptions().GetTextWysiwyg(); @@ -470,7 +475,7 @@ void ScGridWindow::Draw( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, ScUpdateMod Fraction aZoomX = pViewData->GetZoomX(); Fraction aZoomY = pViewData->GetZoomY(); - ScOutputData aOutputData( this, OUTTYPE_WINDOW, aTabInfo, &rDoc, nTab, + ScOutputData aOutputData( pOutDev, OUTTYPE_WINDOW, aTabInfo, &rDoc, nTab, nScrX, nScrY, nX1, nY1, nX2, nY2, nPPTX, nPPTY, &aZoomX, &aZoomY ); @@ -585,7 +590,9 @@ void ScGridWindow::Draw( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, ScUpdateMod aDrawingRectLogic = PixelToLogic(aDrawingRectPixel, aDrawMode); } - OutputDevice* pContentDev = this; // device for document content, used by overlay manager + // device for document content, used by overlay manager + // We usually paint to ourselves, but allow other devices for tiled rendering. + OutputDevice* pContentDev = pOutDev; SdrPaintWindow* pTargetPaintWindow = 0; // #i74769# work with SdrPaintWindow directly { @@ -602,7 +609,7 @@ void ScGridWindow::Draw( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, ScUpdateMod { // #i74769# Use new BeginDrawLayers() interface Region aDrawingRegion(aDrawingRectLogic); - pTargetPaintWindow = pDrawView->BeginDrawLayers(this, aDrawingRegion); + pTargetPaintWindow = pDrawView->BeginDrawLayers(pOutDev, aDrawingRegion); OSL_ENSURE(pTargetPaintWindow, "BeginDrawLayers: Got no SdrPaintWindow (!)"); // #i74769# get target device from SdrPaintWindow, this may be the prerender @@ -875,13 +882,23 @@ void ScGridWindow::PaintTile( VirtualDevice& rDevice, int nTilePosX, int nTilePosY, long nTileWidth, long nTileHeight ) { - (void) rDevice; - (void) nOutputWidth; - (void) nOutputHeight; - (void) nTilePosX; - (void) nTilePosY; - (void) nTileWidth; - (void) nTileHeight; + rDevice.SetOutputSizePixel( Size( nOutputWidth, nOutputHeight ) ); + // setup the output device to draw the tile + MapMode aMapMode( rDevice.GetMapMode() ); + aMapMode.SetMapUnit( MAP_TWIP ); + aMapMode.SetOrigin( Point( -nTilePosX, -nTilePosY ) ); + + // Scaling. Must convert from pixels to twips. We know + // that VirtualDevises use a DPI of 96. + Fraction scaleX = Fraction( nOutputWidth, 96 ) * Fraction(1440L) / + Fraction( nTileWidth); + Fraction scaleY = Fraction( nOutputHeight, 96 ) * Fraction(1440L) / + Fraction( nTileHeight); + aMapMode.SetScaleX( scaleX ); + aMapMode.SetScaleY( scaleY ); + rDevice.SetMapMode( aMapMode ); + + Draw( 0, 0, 3, 3, SC_UPDATE_ALL, &rDevice ); } void ScGridWindow::CheckNeedsRepaint() |