diff options
-rw-r--r-- | sc/source/ui/inc/gridmerg.hxx | 4 | ||||
-rw-r--r-- | sc/source/ui/inc/output.hxx | 4 | ||||
-rw-r--r-- | sc/source/ui/view/gridmerg.cxx | 12 | ||||
-rw-r--r-- | sc/source/ui/view/gridwin4.cxx | 6 | ||||
-rw-r--r-- | sc/source/ui/view/hdrcont.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/view/output.cxx | 61 |
6 files changed, 59 insertions, 32 deletions
diff --git a/sc/source/ui/inc/gridmerg.hxx b/sc/source/ui/inc/gridmerg.hxx index f98d76fd8982..accbf91df174 100644 --- a/sc/source/ui/inc/gridmerg.hxx +++ b/sc/source/ui/inc/gridmerg.hxx @@ -42,8 +42,8 @@ public: ScGridMerger( OutputDevice* pOutDev, long nOnePixelX, long nOnePixelY ); ~ScGridMerger(); - void AddHorLine( long nX1, long nX2, long nY ); - void AddVerLine( long nX, long nY1, long nY2 ); + void AddHorLine( const Point& rStart, const Point& rEnd ); + void AddVerLine( const Point& rStart, const Point& rEnd ); void Flush(); }; diff --git a/sc/source/ui/inc/output.hxx b/sc/source/ui/inc/output.hxx index ffb0e1504fa0..ed665b64c0d9 100644 --- a/sc/source/ui/inc/output.hxx +++ b/sc/source/ui/inc/output.hxx @@ -296,10 +296,10 @@ public: void SetSnapPixel( bool bSet = true ); - void DrawGrid( bool bGrid, bool bPage ); + void DrawGrid( bool bGrid, bool bPage, const MapMode& rPaintMapMode ); void DrawStrings( bool bPixelToLogic = false ); void DrawDocumentBackground(); - void DrawBackground(); + void DrawBackground(const MapMode& rPaintMapMode); void DrawShadow(); void DrawExtraShadow(bool bLeft, bool bTop, bool bRight, bool bBottom); void DrawFrame(); diff --git a/sc/source/ui/view/gridmerg.cxx b/sc/source/ui/view/gridmerg.cxx index da28778fb27e..a75510c2e313 100644 --- a/sc/source/ui/view/gridmerg.cxx +++ b/sc/source/ui/view/gridmerg.cxx @@ -86,7 +86,7 @@ void ScGridMerger::AddLine( long nStart, long nEnd, long nPos ) } } -void ScGridMerger::AddHorLine( long nX1, long nX2, long nY ) +void ScGridMerger::AddHorLine( const Point& rStart, const Point& rEnd ) { if ( bOptimize ) { @@ -95,13 +95,13 @@ void ScGridMerger::AddHorLine( long nX1, long nX2, long nY ) Flush(); bVertical = false; } - AddLine( nX1, nX2, nY ); + AddLine( rStart.X(), rEnd.X(), rStart.Y() ); } else - pDev->DrawLine( Point( nX1, nY ), Point( nX2, nY ) ); + pDev->DrawLine( rStart, rEnd ); } -void ScGridMerger::AddVerLine( long nX, long nY1, long nY2 ) +void ScGridMerger::AddVerLine( const Point& rStart, const Point& rEnd ) { if ( bOptimize ) { @@ -110,10 +110,10 @@ void ScGridMerger::AddVerLine( long nX, long nY1, long nY2 ) Flush(); bVertical = true; } - AddLine( nY1, nY2, nX ); + AddLine( rStart.Y(), rEnd.Y(), rStart.X() ); } else - pDev->DrawLine( Point( nX, nY1 ), Point( nX, nY2 ) ); + pDev->DrawLine( rStart, rEnd ); } void ScGridMerger::Flush() diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx index cb7358b134f4..38dc775629e6 100644 --- a/sc/source/ui/view/gridwin4.cxx +++ b/sc/source/ui/view/gridwin4.cxx @@ -747,12 +747,12 @@ void ScGridWindow::Draw( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, ScUpdateMod aOutputData.DrawDocumentBackground(); if ( bGridFirst && ( bGrid || bPage ) ) - aOutputData.DrawGrid( bGrid, bPage ); + aOutputData.DrawGrid( bGrid, bPage, maPaintMapMode ); - aOutputData.DrawBackground(); + aOutputData.DrawBackground(maPaintMapMode); if ( !bGridFirst && ( bGrid || bPage ) ) - aOutputData.DrawGrid( bGrid, bPage ); + aOutputData.DrawGrid( bGrid, bPage, maPaintMapMode ); if ( bPageMode ) { diff --git a/sc/source/ui/view/hdrcont.cxx b/sc/source/ui/view/hdrcont.cxx index 40997f2da53e..3630ede0d032 100644 --- a/sc/source/ui/view/hdrcont.cxx +++ b/sc/source/ui/view/hdrcont.cxx @@ -498,9 +498,9 @@ void ScHeaderControl::Paint( const Rectangle& rRect ) if ( nPass == ( bNextToMark ? SC_HDRPAINT_SEL_BOTTOM : SC_HDRPAINT_BOTTOM ) ) { if (bVertical) - aGrid.AddHorLine( aScrPos.X(), aEndPos.X(), aEndPos.Y() ); + aGrid.AddHorLine( aScrPos, aEndPos ); else - aGrid.AddVerLine( aEndPos.X(), aScrPos.Y(), aEndPos.Y() ); + aGrid.AddVerLine( aScrPos, aEndPos ); // thick bottom for hidden rows // (drawn directly, without aGrid) diff --git a/sc/source/ui/view/output.cxx b/sc/source/ui/view/output.cxx index 6b19602ec53a..3b7549c77eb6 100644 --- a/sc/source/ui/view/output.cxx +++ b/sc/source/ui/view/output.cxx @@ -307,7 +307,7 @@ void ScOutputData::SetSyntaxMode( bool bNewMode ) } } -void ScOutputData::DrawGrid( bool bGrid, bool bPage ) +void ScOutputData::DrawGrid( bool bGrid, bool bPage, const MapMode& rPaintMapMode ) { SCCOL nX; SCROW nY; @@ -327,7 +327,7 @@ void ScOutputData::DrawGrid( bool bGrid, bool bPage ) //! um den einen Pixel sieht das Metafile (oder die Druck-Ausgabe) anders aus //! als die Bildschirmdarstellung, aber wenigstens passen Druck und Metafile zusammen - Size aOnePixel = mpDev->PixelToLogic(Size(1,1)); + Size aOnePixel = mpDev->PixelToLogic(Size(1,1), rPaintMapMode); long nOneX = aOnePixel.Width(); long nOneY = aOnePixel.Height(); if (bMetaFile) @@ -442,14 +442,26 @@ void ScOutputData::DrawGrid( bool bGrid, bool bPage ) if (pThisRowInfo->bChanged && !bHOver) { - aGrid.AddVerLine( nPosX-nSignedOneX, nPosY, nNextY-nOneY ); + const Point aStart = mpDev->LogicToPixel( + Point( nPosX-nSignedOneX, nPosY ), + rPaintMapMode ); + const Point aEnd = mpDev->LogicToPixel( + Point( nPosX-nSignedOneX, nNextY-nOneY ), + rPaintMapMode ); + aGrid.AddVerLine( aStart, aEnd ); } nPosY = nNextY; } } else { - aGrid.AddVerLine( nPosX-nSignedOneX, nScrY, nScrY+nScrH-nOneY ); + const Point aStart = mpDev->LogicToPixel( + Point( nPosX-nSignedOneX, nScrY ), + rPaintMapMode ); + const Point aEnd = mpDev->LogicToPixel( + Point( nPosX-nSignedOneX, nScrY+nScrH-nOneY ), + rPaintMapMode ); + aGrid.AddVerLine( aStart, aEnd ); } } } @@ -537,7 +549,13 @@ void ScOutputData::DrawGrid( bool bGrid, bool bPage ) } if (!bVOver) { - aGrid.AddHorLine( nPosX, nNextX-nSignedOneX, nPosY-nOneY ); + const Point rStart = mpDev->LogicToPixel( + Point( nPosX, nPosY-nOneY ), + rPaintMapMode ); + const Point rEnd = mpDev->LogicToPixel( + Point( nPosX, nPosY-nOneY ), + rPaintMapMode ); + aGrid.AddHorLine( rStart, rEnd ); } } nPosX = nNextX; @@ -545,7 +563,13 @@ void ScOutputData::DrawGrid( bool bGrid, bool bPage ) } else { - aGrid.AddHorLine( nScrX, nScrX+nScrW-nOneX, nPosY-nOneY ); + const Point rStart = mpDev->LogicToPixel( + Point( nScrX, nPosY-nOneY ), + rPaintMapMode ); + const Point rEnd = mpDev->LogicToPixel( + Point( nScrX+nScrW-nOneX, nPosY-nOneY ), + rPaintMapMode ); + aGrid.AddHorLine( rStart, rEnd ); } } } @@ -869,7 +893,7 @@ void drawIconSets( const ScIconSetInfo* pOldIconSetInfo, OutputDevice* pDev, con } void drawCells(const Color* pColor, const SvxBrushItem* pBackground, const Color*& pOldColor, const SvxBrushItem*& pOldBackground, - Rectangle& rRect, long nPosX, long nSignedOneX, OutputDevice* pDev, const ScDataBarInfo* pDataBarInfo, const ScDataBarInfo*& pOldDataBarInfo, + Rectangle& rRect, long nPosX, long nSignedOneX, OutputDevice* pDev, const MapMode& rPaintMapMode, const ScDataBarInfo* pDataBarInfo, const ScDataBarInfo*& pOldDataBarInfo, const ScIconSetInfo* pIconSetInfo, const ScIconSetInfo*& pOldIconSetInfo) { @@ -879,15 +903,16 @@ void drawCells(const Color* pColor, const SvxBrushItem* pBackground, const Color if (pOldColor && (pBackground || pOldColor != pColor || pOldDataBarInfo || pDataBarInfo || pIconSetInfo || pOldIconSetInfo)) { rRect.Right() = nPosX-nSignedOneX; + const Rectangle aPixRect = pDev->LogicToPixel( rRect, rPaintMapMode ); if( !pOldColor->GetTransparency() ) { pDev->SetFillColor( *pOldColor ); - pDev->DrawRect( rRect ); + pDev->DrawRect( aPixRect ); } if( pOldDataBarInfo ) - drawDataBars( pOldDataBarInfo, pDev, rRect ); + drawDataBars( pOldDataBarInfo, pDev, aPixRect ); if( pOldIconSetInfo ) - drawIconSets( pOldIconSetInfo, pDev, rRect ); + drawIconSets( pOldIconSetInfo, pDev, aPixRect ); rRect.Left() = nPosX - nSignedOneX; } @@ -895,19 +920,21 @@ void drawCells(const Color* pColor, const SvxBrushItem* pBackground, const Color if ( pOldBackground && (pColor ||pBackground != pOldBackground || pOldDataBarInfo || pDataBarInfo || pIconSetInfo || pOldIconSetInfo) ) { rRect.Right() = nPosX-nSignedOneX; + const Rectangle aPixRect = pDev->LogicToPixel( rRect, rPaintMapMode ); + if (pOldBackground) // ==0 if hidden { Color aBackCol = pOldBackground->GetColor(); if ( !aBackCol.GetTransparency() ) //! partial transparency? { pDev->SetFillColor( aBackCol ); - pDev->DrawRect( rRect ); + pDev->DrawRect( aPixRect ); } } if( pOldDataBarInfo ) - drawDataBars( pOldDataBarInfo, pDev, rRect ); + drawDataBars( pOldDataBarInfo, pDev, aPixRect ); if( pOldIconSetInfo ) - drawIconSets( pOldIconSetInfo, pDev, rRect ); + drawIconSets( pOldIconSetInfo, pDev, aPixRect ); rRect.Left() = nPosX - nSignedOneX; } @@ -945,12 +972,12 @@ void drawCells(const Color* pColor, const SvxBrushItem* pBackground, const Color } -void ScOutputData::DrawBackground() +void ScOutputData::DrawBackground(const MapMode& rPaintMapMode) { FindRotated(); //! from the outside? Rectangle aRect; - Size aOnePixel = mpDev->PixelToLogic(Size(1,1)); + Size aOnePixel = mpDev->PixelToLogic(Size(1,1), rPaintMapMode); long nOneX = aOnePixel.Width(); long nOneY = aOnePixel.Height(); @@ -1044,11 +1071,11 @@ void ScOutputData::DrawBackground() pColor = pInfo->pColorScale; const ScDataBarInfo* pDataBarInfo = pInfo->pDataBar; const ScIconSetInfo* pIconSetInfo = pInfo->pIconSet; - drawCells( pColor, pBackground, pOldColor, pOldBackground, aRect, nPosX, nSignedOneX, mpDev, pDataBarInfo, pOldDataBarInfo, pIconSetInfo, pOldIconSetInfo ); + drawCells( pColor, pBackground, pOldColor, pOldBackground, aRect, nPosX, nSignedOneX, mpDev, rPaintMapMode, pDataBarInfo, pOldDataBarInfo, pIconSetInfo, pOldIconSetInfo ); nPosX += pRowInfo[0].pCellInfo[nX+1].nWidth * nLayoutSign; } - drawCells( NULL, NULL, pOldColor, pOldBackground, aRect, nPosX, nSignedOneX, mpDev, NULL, pOldDataBarInfo, NULL, pOldIconSetInfo ); + drawCells( NULL, NULL, pOldColor, pOldBackground, aRect, nPosX, nSignedOneX, mpDev, rPaintMapMode, NULL, pOldDataBarInfo, NULL, pOldIconSetInfo ); nArrY += nSkip; } |