summaryrefslogtreecommitdiff
path: root/sc/source/ui/view/output.cxx
diff options
context:
space:
mode:
authorKrisztian Pinter <pin.terminator@gmail.com>2015-06-14 16:34:56 +0200
committerJan Holesovsky <kendy@collabora.com>2015-07-10 15:44:31 +0000
commitdfd7ff70a758061f67d2fce0b09de0d5076ac42a (patch)
tree84b772ca0b10aeb505cf59056d0f1d9e32058fac /sc/source/ui/view/output.cxx
parent89cfc660dd748daa3f6eee81665e4cbe502653d4 (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/source/ui/view/output.cxx')
-rw-r--r--sc/source/ui/view/output.cxx56
1 files changed, 28 insertions, 28 deletions
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;
}