diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2015-05-14 09:31:19 +0900 |
---|---|---|
committer | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2015-05-14 10:00:15 +0900 |
commit | 9fd81f773c7a53a071762deb1140425a8804b339 (patch) | |
tree | 480eb3ec6b47b36ce45349310a268e0a4b19a0e4 /cui | |
parent | 75594b02cfeaa7cf76e4a335352c9e38e6d8b5e0 (diff) |
refactor SvxCropExample to use RenderContext
Change-Id: I06e8702ecea2db2529eda538128d6a1693971185
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/inc/grfpage.hxx | 2 | ||||
-rw-r--r-- | cui/source/tabpages/grfpage.cxx | 28 |
2 files changed, 15 insertions, 15 deletions
diff --git a/cui/source/inc/grfpage.hxx b/cui/source/inc/grfpage.hxx index ae50b065641c..47fb0e9425a7 100644 --- a/cui/source/inc/grfpage.hxx +++ b/cui/source/inc/grfpage.hxx @@ -35,7 +35,7 @@ class SvxCropExample : public vcl::Window public: SvxCropExample( vcl::Window* pPar, WinBits nStyle ); - virtual void Paint( vcl::RenderContext& /*rRenderContext*/, const Rectangle& rRect ) SAL_OVERRIDE; + virtual void Paint(vcl::RenderContext& rRenderContext, const Rectangle& rRect) SAL_OVERRIDE; virtual void Resize() SAL_OVERRIDE; virtual Size GetOptimalSize() const SAL_OVERRIDE; diff --git a/cui/source/tabpages/grfpage.cxx b/cui/source/tabpages/grfpage.cxx index eab3807e488f..4e4095a60e93 100644 --- a/cui/source/tabpages/grfpage.cxx +++ b/cui/source/tabpages/grfpage.cxx @@ -799,29 +799,29 @@ VCL_BUILDER_DECL_FACTORY(SvxCropExample) rRet = VclPtr<SvxCropExample>::Create(pParent, nWinStyle); } -void SvxCropExample::Paint( vcl::RenderContext& /*rRenderContext*/, const Rectangle& ) +void SvxCropExample::Paint(vcl::RenderContext& rRenderContext, const Rectangle&) { - Size aWinSize( PixelToLogic(GetOutputSizePixel() )); - SetLineColor(); - SetFillColor( GetSettings().GetStyleSettings().GetWindowColor() ); - SetRasterOp( ROP_OVERPAINT ); - DrawRect( Rectangle( Point(), aWinSize ) ); + Size aWinSize(rRenderContext.PixelToLogic(rRenderContext.GetOutputSizePixel())); + rRenderContext.SetLineColor(); + rRenderContext.SetFillColor(rRenderContext.GetSettings().GetStyleSettings().GetWindowColor()); + rRenderContext.SetRasterOp(ROP_OVERPAINT); + rRenderContext.DrawRect(Rectangle(Point(), aWinSize)); - SetLineColor( Color( COL_WHITE ) ); + rRenderContext.SetLineColor(Color(COL_WHITE)); Rectangle aRect(Point((aWinSize.Width() - aFrameSize.Width())/2, (aWinSize.Height() - aFrameSize.Height())/2), - aFrameSize ); - aGrf.Draw( this, aRect.TopLeft(), aRect.GetSize() ); + aFrameSize); + aGrf.Draw(&rRenderContext, aRect.TopLeft(), aRect.GetSize()); - Size aSz( 2, 0 ); - aSz = PixelToLogic( aSz ); - SetFillColor( Color( COL_TRANSPARENT ) ); - SetRasterOp( ROP_INVERT ); + Size aSz(2, 0); + aSz = rRenderContext.PixelToLogic(aSz); + rRenderContext.SetFillColor(Color(COL_TRANSPARENT)); + rRenderContext.SetRasterOp(ROP_INVERT); aRect.Left() += aTopLeft.Y(); aRect.Top() += aTopLeft.X(); aRect.Right() -= aBottomRight.Y(); aRect.Bottom() -= aBottomRight.X(); - DrawRect( aRect ); + rRenderContext.DrawRect(aRect); } void SvxCropExample::Resize() |