diff options
-rw-r--r-- | sc/source/core/data/fillinfo.cxx | 12 | ||||
-rw-r--r-- | sc/source/ui/view/gridwin4.cxx | 20 |
2 files changed, 15 insertions, 17 deletions
diff --git a/sc/source/core/data/fillinfo.cxx b/sc/source/core/data/fillinfo.cxx index a6b7b90f62a0..4313856c6349 100644 --- a/sc/source/core/data/fillinfo.cxx +++ b/sc/source/core/data/fillinfo.cxx @@ -278,7 +278,7 @@ void ScDocument::FillInfo( RowInfo* pThisRowInfo = &pRowInfo[nArrRow]; pThisRowInfo->pCellInfo = NULL; // wird unten belegt - sal_uInt16 nHeight = (sal_uInt16) ( nDocHeight * fRowScale ); + sal_uInt16 nHeight = nDocHeight; if (!nHeight) nHeight = 1; @@ -393,11 +393,7 @@ void ScDocument::FillInfo( { if (!ColHidden(nX, nTab)) { - sal_uInt16 nThisWidth = (sal_uInt16) (GetColWidth( nX, nTab ) * fColScale); - if (!nThisWidth) - nThisWidth = 1; - - pRowInfo[0].pCellInfo[nArrCol].nWidth = nThisWidth; + pRowInfo[0].pCellInfo[nArrCol].nWidth = GetColWidth( nX, nTab ); } } } @@ -418,9 +414,7 @@ void ScDocument::FillInfo( // TODO: Optimize this loop. if (!ColHidden(nX, nTab)) { - sal_uInt16 nThisWidth = (sal_uInt16) (GetColWidth( nX, nTab ) * fColScale); - if (!nThisWidth) - nThisWidth = 1; + int nThisWidth = GetColWidth( nX, nTab ); pRowInfo[0].pCellInfo[nArrCol].nWidth = nThisWidth; //! dies sollte reichen diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx index 7422258fd331..961370a6de99 100644 --- a/sc/source/ui/view/gridwin4.cxx +++ b/sc/source/ui/view/gridwin4.cxx @@ -940,21 +940,25 @@ void ScGridWindow::PaintTile( VirtualDevice& rDevice, int nTilePosX, int nTilePosY, long nTileWidth, long nTileHeight ) { + // Scaling. Must convert from pixels to TWIPs. We know + // that VirtualDevices use a DPI of 96. We might as well do this + // calculation now, rather than after another dimension conversion, + // to minimise errors. + Fraction scaleX = Fraction( nOutputWidth, 96 ) * Fraction(1440L) / + Fraction( nTileWidth); + Fraction scaleY = Fraction( nOutputHeight, 96 ) * Fraction(1440L) / + Fraction( 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 ); + + maPaintMapMode = aMapMode; +// rDevice.SetMapMode( aMapMode ); ScTabViewShell* pTabViewSh = pViewData->GetViewShell(); SdrView* pDrawView = pTabViewSh->GetScDrawView(); |