diff options
author | Krisztian Pinter <pin.terminator@gmail.com> | 2015-06-14 16:34:56 +0200 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2015-07-10 15:44:31 +0000 |
commit | dfd7ff70a758061f67d2fce0b09de0d5076ac42a (patch) | |
tree | 84b772ca0b10aeb505cf59056d0f1d9e32058fac /sc | |
parent | 89cfc660dd748daa3f6eee81665e4cbe502653d4 (diff) |
calc mapmode: Add explicit RenderContext passing
Change-Id: I52d9c84bc6658348c249870088c38512ae169a34
Reviewed-on: https://gerrit.libreoffice.org/16277
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/inc/output.hxx | 2 | ||||
-rw-r--r-- | sc/source/ui/view/gridwin4.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/view/output.cxx | 56 | ||||
-rw-r--r-- | sc/source/ui/view/printfun.cxx | 4 |
4 files changed, 32 insertions, 32 deletions
diff --git a/sc/source/ui/inc/output.hxx b/sc/source/ui/inc/output.hxx index a7b96f787cb8..d577efafb1cc 100644 --- a/sc/source/ui/inc/output.hxx +++ b/sc/source/ui/inc/output.hxx @@ -304,7 +304,7 @@ public: Rectangle LayoutStrings(bool bPixelToLogic = false, bool bPaint = true, const ScAddress &rAddress = ScAddress()); void DrawDocumentBackground(); - void DrawBackground(); + void DrawBackground(vcl::RenderContext& rRenderContext); void DrawShadow(); void DrawExtraShadow(bool bLeft, bool bTop, bool bRight, bool bBottom); void DrawFrame(); diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx index 9a0dfd6d68e7..4432653a92e0 100644 --- a/sc/source/ui/view/gridwin4.cxx +++ b/sc/source/ui/view/gridwin4.cxx @@ -725,7 +725,7 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableI MapMode aPrevMapMode = pContentDev->GetMapMode(); pContentDev->SetMapMode(MAP_PIXEL); - aOutputData.DrawBackground(); + aOutputData.DrawBackground(*pContentDev); pContentDev->SetMapMode(aPrevMapMode); diff --git a/sc/source/ui/view/output.cxx b/sc/source/ui/view/output.cxx index a2cc3261293d..388b0e8f84af 100644 --- a/sc/source/ui/view/output.cxx +++ b/sc/source/ui/view/output.cxx @@ -789,7 +789,7 @@ namespace { static const double lclCornerRectTransparency = 40.0; -void drawDataBars( const ScDataBarInfo* pOldDataBarInfo, vcl::RenderContext* pDev, const Rectangle& rRect) +void drawDataBars(vcl::RenderContext& rRenderContext, const ScDataBarInfo* pOldDataBarInfo, const Rectangle& rRect) { long nPosZero = 0; Rectangle aPaintRect = rRect; @@ -825,7 +825,7 @@ void drawDataBars( const ScDataBarInfo* pOldDataBarInfo, vcl::RenderContext* pDe if(pOldDataBarInfo->mbGradient) { - pDev->SetLineColor(pOldDataBarInfo->maColor); + rRenderContext.SetLineColor(pOldDataBarInfo->maColor); Gradient aGradient(GradientStyle_LINEAR, pOldDataBarInfo->maColor, COL_TRANSPARENT); if(pOldDataBarInfo->mnLength < 0) @@ -833,14 +833,14 @@ void drawDataBars( const ScDataBarInfo* pOldDataBarInfo, vcl::RenderContext* pDe else aGradient.SetAngle(900); - pDev->DrawGradient(aPaintRect, aGradient); + rRenderContext.DrawGradient(aPaintRect, aGradient); - pDev->SetLineColor(); + rRenderContext.SetLineColor(); } else { - pDev->SetFillColor(pOldDataBarInfo->maColor); - pDev->DrawRect(aPaintRect); + rRenderContext.SetFillColor(pOldDataBarInfo->maColor); + rRenderContext.DrawRect(aPaintRect); } //draw axis @@ -852,11 +852,11 @@ void drawDataBars( const ScDataBarInfo* pOldDataBarInfo, vcl::RenderContext* pDe aLineInfo.SetDashCount( 4 ); aLineInfo.SetDistance( 3 ); aLineInfo.SetDashLen( 3 ); - pDev->SetFillColor(pOldDataBarInfo->maAxisColor); - pDev->SetLineColor(pOldDataBarInfo->maAxisColor); - pDev->DrawLine(aPoint1, aPoint2, aLineInfo); - pDev->SetLineColor(); - pDev->SetFillColor(); + rRenderContext.SetFillColor(pOldDataBarInfo->maAxisColor); + rRenderContext.SetLineColor(pOldDataBarInfo->maAxisColor); + rRenderContext.DrawLine(aPoint1, aPoint2, aLineInfo); + rRenderContext.SetLineColor(); + rRenderContext.SetFillColor(); } } @@ -865,18 +865,18 @@ BitmapEx& getIcon( ScIconSetType eType, sal_Int32 nIndex ) return ScIconSetFormat::getBitmap( eType, nIndex ); } -void drawIconSets( const ScIconSetInfo* pOldIconSetInfo, vcl::RenderContext* pDev, const Rectangle& rRect ) +void drawIconSets(vcl::RenderContext& rRenderContext, const ScIconSetInfo* pOldIconSetInfo, const Rectangle& rRect) { //long nSize = 16; ScIconSetType eType = pOldIconSetInfo->eIconSetType; sal_Int32 nIndex = pOldIconSetInfo->nIconIndex; BitmapEx& rIcon = getIcon( eType, nIndex ); long aOrigSize = std::max<long>(0,std::min(rRect.GetSize().getWidth() - 4, rRect.GetSize().getHeight() -4)); - pDev->DrawBitmapEx( Point( rRect.Left() +2, rRect.Top() + 2 ), Size(aOrigSize, aOrigSize), rIcon ); + rRenderContext.DrawBitmapEx( Point( rRect.Left() +2, rRect.Top() + 2 ), Size(aOrigSize, aOrigSize), rIcon ); } -void drawCells(const Color* pColor, const SvxBrushItem* pBackground, const Color*& pOldColor, const SvxBrushItem*& pOldBackground, - Rectangle& rRect, long nPosX, long nSignedOneX, vcl::RenderContext* pDev, const ScDataBarInfo* pDataBarInfo, const ScDataBarInfo*& pOldDataBarInfo, +void drawCells(vcl::RenderContext& rRenderContext, const Color* pColor, const SvxBrushItem* pBackground, const Color*& pOldColor, const SvxBrushItem*& pOldBackground, + Rectangle& rRect, long nPosX, long nSignedOneX, const ScDataBarInfo* pDataBarInfo, const ScDataBarInfo*& pOldDataBarInfo, const ScIconSetInfo* pIconSetInfo, const ScIconSetInfo*& pOldIconSetInfo) { @@ -888,13 +888,13 @@ void drawCells(const Color* pColor, const SvxBrushItem* pBackground, const Color rRect.Right() = nPosX-nSignedOneX; if( !pOldColor->GetTransparency() ) { - pDev->SetFillColor( *pOldColor ); - pDev->DrawRect( rRect ); + rRenderContext.SetFillColor( *pOldColor ); + rRenderContext.DrawRect( rRect ); } if( pOldDataBarInfo ) - drawDataBars( pOldDataBarInfo, pDev, rRect ); + drawDataBars(rRenderContext, pOldDataBarInfo, rRect ); if( pOldIconSetInfo ) - drawIconSets( pOldIconSetInfo, pDev, rRect ); + drawIconSets(rRenderContext, pOldIconSetInfo, rRect ); rRect.Left() = nPosX - nSignedOneX; } @@ -907,14 +907,14 @@ void drawCells(const Color* pColor, const SvxBrushItem* pBackground, const Color Color aBackCol = pOldBackground->GetColor(); if ( !aBackCol.GetTransparency() ) //! partial transparency? { - pDev->SetFillColor( aBackCol ); - pDev->DrawRect( rRect ); + rRenderContext.SetFillColor( aBackCol ); + rRenderContext.DrawRect( rRect ); } } if( pOldDataBarInfo ) - drawDataBars( pOldDataBarInfo, pDev, rRect ); + drawDataBars(rRenderContext, pOldDataBarInfo, rRect ); if( pOldIconSetInfo ) - drawIconSets( pOldIconSetInfo, pDev, rRect ); + drawIconSets(rRenderContext, pOldIconSetInfo, rRect ); rRect.Left() = nPosX - nSignedOneX; } @@ -952,12 +952,12 @@ void drawCells(const Color* pColor, const SvxBrushItem* pBackground, const Color } -void ScOutputData::DrawBackground() +void ScOutputData::DrawBackground(vcl::RenderContext& rRenderContext) { FindRotated(); //! from the outside? Rectangle aRect; - Size aOnePixel = mpDev->PixelToLogic(Size(1,1)); + Size aOnePixel = rRenderContext.PixelToLogic(Size(1,1)); long nOneX = aOnePixel.Width(); long nOneY = aOnePixel.Height(); @@ -967,7 +967,7 @@ void ScOutputData::DrawBackground() long nLayoutSign = bLayoutRTL ? -1 : 1; long nSignedOneX = nOneX * nLayoutSign; - mpDev->SetLineColor(); + rRenderContext.SetLineColor(); bool bShowProt = mbSyntaxMode && mpDoc->IsTabProtected(nTab); bool bDoAll = bShowProt || bPagebreakMode || bSolidBackground; @@ -1055,7 +1055,7 @@ void ScOutputData::DrawBackground() const Color* pColor = pInfo->pColorScale.get(); const ScDataBarInfo* pDataBarInfo = pInfo->pDataBar.get(); const ScIconSetInfo* pIconSetInfo = pInfo->pIconSet.get(); - drawCells( pColor, pBackground, pOldColor, pOldBackground, aRect, nPosX, nSignedOneX, mpDev, pDataBarInfo, pOldDataBarInfo, pIconSetInfo, pOldIconSetInfo ); + drawCells(rRenderContext, pColor, pBackground, pOldColor, pOldBackground, aRect, nPosX, nSignedOneX, pDataBarInfo, pOldDataBarInfo, pIconSetInfo, pOldIconSetInfo); // extend for all merged cells nMergedCells = 1; @@ -1071,7 +1071,7 @@ void ScOutputData::DrawBackground() nPosX += pRowInfo[0].pCellInfo[nX+nOldMerged+nMerged].nWidth * nLayoutSign; } } - drawCells( NULL, NULL, pOldColor, pOldBackground, aRect, nPosX, nSignedOneX, mpDev, NULL, pOldDataBarInfo, NULL, pOldIconSetInfo ); + drawCells(rRenderContext, NULL, NULL, pOldColor, pOldBackground, aRect, nPosX, nSignedOneX, NULL, pOldDataBarInfo, NULL, pOldIconSetInfo); nArrY += nSkip; } diff --git a/sc/source/ui/view/printfun.cxx b/sc/source/ui/view/printfun.cxx index 8849b5e82f5e..9c13269ef2d7 100644 --- a/sc/source/ui/view/printfun.cxx +++ b/sc/source/ui/view/printfun.cxx @@ -548,7 +548,7 @@ void ScPrintFunc::DrawToDev( ScDocument* pDoc, OutputDevice* pDev, double /* nPr if (!bMetaFile && pViewData) pDev->SetMapMode(aMode); - aOutputData.DrawBackground(); + aOutputData.DrawBackground(*pDev); aOutputData.DrawShadow(); aOutputData.DrawFrame(); aOutputData.DrawStrings(); @@ -1604,7 +1604,7 @@ void ScPrintFunc::PrintArea( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, } if( aTableParam.bCellContent ) - aOutputData.DrawBackground(); + aOutputData.DrawBackground(*pDev); pDev->SetClipRegion(vcl::Region(Rectangle( aPos, Size(aOutputData.GetScrW(), aOutputData.GetScrH())))); |