summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2015-05-14 09:27:21 +0900
committerTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2015-05-14 09:58:15 +0900
commit65856fe567669dd5b200cf5669d4e55c6e701bc4 (patch)
tree1f247a6cc6c99103d6bf958d454b05f733147d92
parent0b08ae6df427ee7f86531bb54cab97ddbf04ca7f (diff)
refactor GraphicPreviewWindow to use RenderContext
Change-Id: I3471ca2c51782f6537d2bbc2fabc791c5f63d66c
-rw-r--r--cui/source/dialogs/cuigrfflt.cxx24
1 files changed, 11 insertions, 13 deletions
diff --git a/cui/source/dialogs/cuigrfflt.cxx b/cui/source/dialogs/cuigrfflt.cxx
index 43b9493d6e27..59e8fd2ccb37 100644
--- a/cui/source/dialogs/cuigrfflt.cxx
+++ b/cui/source/dialogs/cuigrfflt.cxx
@@ -57,27 +57,25 @@ void GraphicPreviewWindow::Paint(vcl::RenderContext& rRenderContext, const Recta
{
Control::Paint(rRenderContext, rRect);
- const Size aOutputSize( GetOutputSizePixel() );
+ const Size aOutputSize(rRenderContext.GetOutputSizePixel());
- if( maPreview.IsAnimated() )
+ if (maPreview.IsAnimated())
{
- const Size aGraphicSize( LogicToPixel( maPreview.GetPrefSize(), maPreview.GetPrefMapMode() ) );
- const Point aGraphicPosition( ( aOutputSize.Width() - aGraphicSize.Width() ) >> 1,
- ( aOutputSize.Height() - aGraphicSize.Height() ) >> 1 );
- maPreview.StartAnimation( this, aGraphicPosition, aGraphicSize );
+ const Size aGraphicSize(rRenderContext.LogicToPixel(maPreview.GetPrefSize(), maPreview.GetPrefMapMode()));
+ const Point aGraphicPosition((aOutputSize.Width() - aGraphicSize.Width() ) >> 1,
+ (aOutputSize.Height() - aGraphicSize.Height() ) >> 1);
+ maPreview.StartAnimation(&rRenderContext, aGraphicPosition, aGraphicSize);
}
else
{
- const Size aGraphicSize( maPreview.GetSizePixel() );
- const Point aGraphicPosition( ( aOutputSize.Width() - aGraphicSize.Width() ) >> 1,
- ( aOutputSize.Height() - aGraphicSize.Height() ) >> 1 );
- maPreview.Draw( this, aGraphicPosition, aGraphicSize );
+ const Size aGraphicSize(maPreview.GetSizePixel());
+ const Point aGraphicPosition((aOutputSize.Width() - aGraphicSize.Width()) >> 1,
+ (aOutputSize.Height() - aGraphicSize.Height()) >> 1);
+ maPreview.Draw(&rRenderContext, aGraphicPosition, aGraphicSize);
}
}
-
-
-void GraphicPreviewWindow::SetPreview( const Graphic& rGraphic )
+void GraphicPreviewWindow::SetPreview(const Graphic& rGraphic)
{
maPreview = rGraphic;
Invalidate();