diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-07-19 09:50:11 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-07-19 11:31:51 +0200 |
commit | 836c40904f4424a5b7ae708171a7aab53141761a (patch) | |
tree | 5f84c7b9d57aface755ef6f4b11ccc1deb1da9c6 /canvas | |
parent | 4959b71cbc91dbe2c454d1d7bf2092c01c4f0cae (diff) |
loplugin:referencecasting in canvas..chart2
Change-Id: I3a3671b5c44d1a7e5ca320d3d76dd5d902382cbc
Reviewed-on: https://gerrit.libreoffice.org/75935
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'canvas')
-rw-r--r-- | canvas/source/opengl/ogl_spritedevicehelper.cxx | 4 | ||||
-rw-r--r-- | canvas/source/simplecanvas/simplecanvasimpl.cxx | 5 | ||||
-rw-r--r-- | canvas/source/vcl/devicehelper.cxx | 2 | ||||
-rw-r--r-- | canvas/workben/canvasdemo.cxx | 18 |
4 files changed, 11 insertions, 18 deletions
diff --git a/canvas/source/opengl/ogl_spritedevicehelper.cxx b/canvas/source/opengl/ogl_spritedevicehelper.cxx index 304414bfeea1..285afa973574 100644 --- a/canvas/source/opengl/ogl_spritedevicehelper.cxx +++ b/canvas/source/opengl/ogl_spritedevicehelper.cxx @@ -361,9 +361,7 @@ namespace oglcanvas uno::Reference<rendering::XColorSpace> SpriteDeviceHelper::getColorSpace() const { // always the same - return uno::Reference<rendering::XColorSpace>( - ::canvas::tools::getStdColorSpace(), - uno::UNO_QUERY); + return ::canvas::tools::getStdColorSpace(); } void SpriteDeviceHelper::notifySizeUpdate( const awt::Rectangle& rBounds ) diff --git a/canvas/source/simplecanvas/simplecanvasimpl.cxx b/canvas/source/simplecanvas/simplecanvasimpl.cxx index 9e209b5cf3e5..724e4dbb5372 100644 --- a/canvas/source/simplecanvas/simplecanvasimpl.cxx +++ b/canvas/source/simplecanvas/simplecanvasimpl.cxx @@ -72,9 +72,8 @@ namespace uno::Sequence< uno::Sequence< geometry::RealPoint2D > > sequenceSequence( 1 ); sequenceSequence[0] = rectSequence; - uno::Reference< rendering::XPolyPolygon2D > xRes( - xDevice->createCompatibleLinePolyPolygon( sequenceSequence ), - uno::UNO_QUERY ); + uno::Reference< rendering::XPolyPolygon2D > xRes = + xDevice->createCompatibleLinePolyPolygon( sequenceSequence ); if( xRes.is() ) xRes->setClosed( 0, true ); return xRes; diff --git a/canvas/source/vcl/devicehelper.cxx b/canvas/source/vcl/devicehelper.cxx index d5961df2b777..904b565af80e 100644 --- a/canvas/source/vcl/devicehelper.cxx +++ b/canvas/source/vcl/devicehelper.cxx @@ -182,7 +182,7 @@ namespace vclcanvas { uno::Reference<rendering::XColorSpace> operator()() { - uno::Reference< rendering::XColorSpace > xColorSpace( canvas::tools::getStdColorSpace(), uno::UNO_QUERY ); + uno::Reference< rendering::XColorSpace > xColorSpace = canvas::tools::getStdColorSpace(); assert( xColorSpace.is() ); return xColorSpace; } diff --git a/canvas/workben/canvasdemo.cxx b/canvas/workben/canvasdemo.cxx index 788d76e3dfcf..f94e259e0fc4 100644 --- a/canvas/workben/canvasdemo.cxx +++ b/canvas/workben/canvasdemo.cxx @@ -170,11 +170,10 @@ class DemoRenderer aPolys[0] = aPoints; xPoly = mxDevice->createCompatibleLinePolyPolygon( aPolys ); xPoly->setClosed( 0, true ); - uno::Reference< rendering::XPolyPolygon2D> xPP( xPoly, uno::UNO_QUERY ); rendering::RenderState aRenderState( maRenderState ); aRenderState.DeviceColor = aColor; - mxCanvas->drawPolyPolygon( xPP, maViewState, aRenderState ); + mxCanvas->drawPolyPolygon( xPoly, maViewState, aRenderState ); } void translate( double x, double y) @@ -250,7 +249,6 @@ class DemoRenderer xPoly = mxDevice->createCompatibleLinePolyPolygon( aPolys ); xPoly->setClosed( 0, false ); - uno::Reference< rendering::XPolyPolygon2D> xPP( xPoly, uno::UNO_QUERY ); rendering::RenderState aRenderState( maRenderState ); aRenderState.DeviceColor = maColorRed; @@ -263,9 +261,9 @@ class DemoRenderer aStrokeAttrs.JoinType = rendering::PathJoinType::MITER; //fprintf( stderr, "FIXME: stroking a tools::PolyPolygon doesn't show up\n" ); //yes it does - mxCanvas->strokePolyPolygon( xPP, maViewState, aRenderState, aStrokeAttrs ); + mxCanvas->strokePolyPolygon( xPoly, maViewState, aRenderState, aStrokeAttrs ); // FIXME: do this instead: - //mxCanvas->drawPolyPolygon( xPP, maViewState, aRenderState ); + //mxCanvas->drawPolyPolygon( xPoly, maViewState, aRenderState ); } void drawTitle( OString aTitle ) @@ -410,7 +408,6 @@ class DemoRenderer xPoly->setClosed( 0, true ); //uno::Reference< rendering::XBezierPolyPolygon2D> xPP( xPoly, uno::UNO_QUERY ); //compiles, but totally screws up. I think it is interpreting the bezier as a line - uno::Reference< rendering::XPolyPolygon2D> xPP( xPoly, uno::UNO_QUERY ); rendering::StrokeAttributes aStrokeAttrs; aStrokeAttrs.StrokeWidth = 4.0; @@ -418,9 +415,9 @@ class DemoRenderer aStrokeAttrs.StartCapType = rendering::PathCapType::BUTT; aStrokeAttrs.EndCapType = rendering::PathCapType::BUTT; aStrokeAttrs.JoinType = rendering::PathJoinType::MITER; - mxCanvas->strokePolyPolygon( xPP, maViewState, maRenderState, aStrokeAttrs ); + mxCanvas->strokePolyPolygon( xPoly, maViewState, maRenderState, aStrokeAttrs ); //you can't draw a BezierPolyPolygon2D with this, even though it is derived from it - //mxCanvas->drawPolyPolygon( xPP, maViewState, maRenderState ); + //mxCanvas->drawPolyPolygon( xPoly, maViewState, maRenderState ); maRenderState = maOldRenderState; // pop } @@ -502,9 +499,8 @@ class DemoRenderer xPoly->setClosed( 0, true ); rendering::RenderState aRenderState( maRenderState ); aRenderState.DeviceColor = maColorRed; - uno::Reference< rendering::XPolyPolygon2D> xPP( xPoly, uno::UNO_QUERY ); - mxCanvas->drawPolyPolygon( xPP, maViewState, aRenderState); - mxCanvas->fillPolyPolygon( xPP, + mxCanvas->drawPolyPolygon( xPoly, maViewState, aRenderState); + mxCanvas->fillPolyPolygon( xPoly, maViewState, aRenderState ); } |