diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2024-11-08 13:55:25 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2024-11-08 17:33:10 +0100 |
commit | 3f691b4a160b2ed1bb503c5b52e925bfa974e1e5 (patch) | |
tree | e38732ba18c3f6d9d55b9a8e9a5f5d6d269d8d37 /cppcanvas | |
parent | 39b15dc8f0adec9e856a39cf319c7c8ae6750043 (diff) |
loplugin:reftotemp in cppcanvas..cui
Change-Id: I6c9ded2252462bcdeee6520bb7b7fa1752aa583b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176276
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
Diffstat (limited to 'cppcanvas')
-rw-r--r-- | cppcanvas/source/mtfrenderer/cachedprimitivebase.cxx | 6 | ||||
-rw-r--r-- | cppcanvas/source/mtfrenderer/implrenderer.cxx | 12 | ||||
-rw-r--r-- | cppcanvas/source/mtfrenderer/mtftools.cxx | 10 | ||||
-rw-r--r-- | cppcanvas/source/mtfrenderer/textaction.cxx | 74 | ||||
-rw-r--r-- | cppcanvas/source/mtfrenderer/textlineshelper.cxx | 14 |
5 files changed, 58 insertions, 58 deletions
diff --git a/cppcanvas/source/mtfrenderer/cachedprimitivebase.cxx b/cppcanvas/source/mtfrenderer/cachedprimitivebase.cxx index e5664cabfc1d..99f4f95ecc9a 100644 --- a/cppcanvas/source/mtfrenderer/cachedprimitivebase.cxx +++ b/cppcanvas/source/mtfrenderer/cachedprimitivebase.cxx @@ -46,11 +46,11 @@ namespace cppcanvas::internal SAL_INFO( "cppcanvas.emf", "::cppcanvas::internal::CachedPrimitiveBase::render()" ); SAL_INFO( "cppcanvas.emf", "::cppcanvas::internal::CachedPrimitiveBase: 0x" << std::hex << this ); - const rendering::ViewState& rViewState( mpCanvas->getViewState() ); + const rendering::ViewState aViewState( mpCanvas->getViewState() ); ::basegfx::B2DHomMatrix aTotalTransform; ::canvas::tools::getViewStateTransform( aTotalTransform, - rViewState ); + aViewState ); aTotalTransform *= rTransformation; // can we use the cached primitive? For that, it must be @@ -61,7 +61,7 @@ namespace cppcanvas::internal (!mbOnlyRedrawWithSameTransform || maLastTransformation == aTotalTransform) ) { - if( mxCachedPrimitive->redraw( rViewState ) == + if( mxCachedPrimitive->redraw( aViewState ) == rendering::RepaintResult::REDRAWN ) { // cached repaint succeeded, done. diff --git a/cppcanvas/source/mtfrenderer/implrenderer.cxx b/cppcanvas/source/mtfrenderer/implrenderer.cxx index 4a81fb325682..4a041ee5de5a 100644 --- a/cppcanvas/source/mtfrenderer/implrenderer.cxx +++ b/cppcanvas/source/mtfrenderer/implrenderer.cxx @@ -1588,13 +1588,13 @@ namespace cppcanvas::internal rVDev.Push(); rVDev.SetMapMode( rSubstitute.GetPrefMapMode() ); - const ::Point& rPos( rVDev.LogicToPixel( pAct->GetPoint() ) ); - const ::Size& rSize( rVDev.LogicToPixel( pAct->GetSize() ) ); + const ::Point aPos( rVDev.LogicToPixel( pAct->GetPoint() ) ); + const ::Size aSize( rVDev.LogicToPixel( pAct->GetSize() ) ); - rStates.getState().transform.translate( rPos.X(), - rPos.Y() ); - rStates.getState().transform.scale( static_cast<double>(rSize.Width()) / aMtfSizePix.Width(), - static_cast<double>(rSize.Height()) / aMtfSizePix.Height() ); + rStates.getState().transform.translate( aPos.X(), + aPos.Y() ); + rStates.getState().transform.scale( static_cast<double>(aSize.Width()) / aMtfSizePix.Width(), + static_cast<double>(aSize.Height()) / aMtfSizePix.Height() ); createActions( const_cast<GDIMetaFile&>(pAct->GetSubstitute()), rFactoryParms, diff --git a/cppcanvas/source/mtfrenderer/mtftools.cxx b/cppcanvas/source/mtfrenderer/mtftools.cxx index b02f35547fc7..dce2973bebca 100644 --- a/cppcanvas/source/mtfrenderer/mtftools.cxx +++ b/cppcanvas/source/mtfrenderer/mtftools.cxx @@ -51,7 +51,7 @@ namespace cppcanvas::tools ::Size getBaselineOffset( const ::cppcanvas::internal::OutDevState& outdevState, const VirtualDevice& rVDev ) { - const ::FontMetric& aMetric = rVDev.GetFontMetric(); + const ::FontMetric aMetric = rVDev.GetFontMetric(); // calc offset for text output, the XCanvas always renders // baseline offset. @@ -99,12 +99,12 @@ namespace cppcanvas::tools calcLogic2PixelLinearTransform(o_rMatrix, rVDev); // translate according to curr map mode/pref map mode offset - const ::Point aEmptyPoint; - const ::Point& rTranslatedPoint( + const ::Point aEmptyPoint; + const ::Point aTranslatedPoint( rVDev.LogicToPixel( aEmptyPoint )); - o_rMatrix.translate(rTranslatedPoint.X(), - rTranslatedPoint.Y()); + o_rMatrix.translate(aTranslatedPoint.X(), + aTranslatedPoint.Y()); return o_rMatrix; } diff --git a/cppcanvas/source/mtfrenderer/textaction.cxx b/cppcanvas/source/mtfrenderer/textaction.cxx index 8b5d1168b262..120f8b48f0bb 100644 --- a/cppcanvas/source/mtfrenderer/textaction.cxx +++ b/cppcanvas/source/mtfrenderer/textaction.cxx @@ -438,17 +438,17 @@ namespace cppcanvas::internal ENSURE_OR_THROW( io_rTextLayout.is(), "createSubsetLayout(): Invalid input layout" ); - const rendering::StringContext& rOrigContext( io_rTextLayout->getText() ); + const rendering::StringContext aOrigContext( io_rTextLayout->getText() ); if( rSubset.mnSubsetBegin == 0 && - rSubset.mnSubsetEnd == rOrigContext.Length ) + rSubset.mnSubsetEnd == aOrigContext.Length ) { // full range, no need for subsetting return; } uno::Reference< rendering::XTextLayout > xTextLayout( - createSubsetLayout( rOrigContext, rSubset, io_rTextLayout ) ); + createSubsetLayout( aOrigContext, rSubset, io_rTextLayout ) ); if( xTextLayout.is() ) { @@ -899,27 +899,27 @@ namespace cppcanvas::internal bool EffectTextAction::operator()( const rendering::RenderState& rRenderState, const ::Color& rTextFillColor, bool /*bNormalText*/ ) const { - const rendering::ViewState& rViewState( mpCanvas->getViewState() ); - const uno::Reference< rendering::XCanvas >& rCanvas( mpCanvas->getUNOCanvas() ); + const rendering::ViewState aViewState( mpCanvas->getViewState() ); + const uno::Reference< rendering::XCanvas > aCanvas( mpCanvas->getUNOCanvas() ); //rhbz#1589029 non-transparent text fill background support if (rTextFillColor != COL_AUTO) { rendering::RenderState aLocalState( rRenderState ); aLocalState.DeviceColor = vcl::unotools::colorToDoubleSequence( - rTextFillColor, rCanvas->getDevice()->getDeviceColorSpace()); - auto xTextBounds = queryTextBounds(rCanvas); + rTextFillColor, aCanvas->getDevice()->getDeviceColorSpace()); + auto xTextBounds = queryTextBounds(aCanvas); // background of text - rCanvas->fillPolyPolygon(xTextBounds, rViewState, aLocalState); + aCanvas->fillPolyPolygon(xTextBounds, aViewState, aLocalState); } // under/over lines - rCanvas->fillPolyPolygon( mxTextLines, - rViewState, + aCanvas->fillPolyPolygon( mxTextLines, + aViewState, rRenderState ); - rCanvas->drawText( maStringContext, mxFont, - rViewState, + aCanvas->drawText( maStringContext, mxFont, + aViewState, rRenderState, maTextDirection ); @@ -1197,9 +1197,9 @@ namespace cppcanvas::internal sal_Int32 TextArrayAction::getActionCount() const { - const rendering::StringContext& rOrigContext( mxTextLayout->getText() ); + const rendering::StringContext aOrigContext( mxTextLayout->getText() ); - return rOrigContext.Length; + return aOrigContext.Length; } @@ -1367,25 +1367,25 @@ namespace cppcanvas::internal bool EffectTextArrayAction::operator()( const rendering::RenderState& rRenderState, const ::Color& rTextFillColor, bool bNormalText) const { - const rendering::ViewState& rViewState( mpCanvas->getViewState() ); - const uno::Reference< rendering::XCanvas >& rCanvas( mpCanvas->getUNOCanvas() ); + const rendering::ViewState aViewState( mpCanvas->getViewState() ); + const uno::Reference< rendering::XCanvas > aCanvas( mpCanvas->getUNOCanvas() ); //rhbz#1589029 non-transparent text fill background support if (rTextFillColor != COL_AUTO) { rendering::RenderState aLocalState(rRenderState); aLocalState.DeviceColor = vcl::unotools::colorToDoubleSequence( - rTextFillColor, rCanvas->getDevice()->getDeviceColorSpace()); - auto xTextBounds = queryTextBounds(rCanvas); + rTextFillColor, aCanvas->getDevice()->getDeviceColorSpace()); + auto xTextBounds = queryTextBounds(aCanvas); // background of text - rCanvas->fillPolyPolygon(xTextBounds, rViewState, aLocalState); + aCanvas->fillPolyPolygon(xTextBounds, aViewState, aLocalState); } // under/over lines maTextLinesHelper.render(rRenderState, bNormalText); - rCanvas->drawTextLayout( mxTextLayout, - rViewState, + aCanvas->drawTextLayout( mxTextLayout, + aViewState, rRenderState ); return true; @@ -1491,7 +1491,7 @@ namespace cppcanvas::internal // =================================== uno::Reference< rendering::XCanvas > xCanvas( mpCanvas->getUNOCanvas() ); - const rendering::ViewState& rViewState( mpCanvas->getViewState() ); + const rendering::ViewState aViewState( mpCanvas->getViewState() ); TextLinesHelper aHelper = maTextLinesHelper; aHelper.init(nMaxPos - nMinPos, maTextLineInfo); @@ -1504,7 +1504,7 @@ namespace cppcanvas::internal EffectTextArrayRenderHelper( xCanvas, xTextLayout, aHelper, - rViewState ), + aViewState ), aLocalState, xCanvas, maShadowColor, @@ -1576,9 +1576,9 @@ namespace cppcanvas::internal sal_Int32 EffectTextArrayAction::getActionCount() const { - const rendering::StringContext& rOrigContext( mxTextLayout->getText() ); + const rendering::StringContext aOrigContext( mxTextLayout->getText() ); - return rOrigContext.Length; + return aOrigContext.Length; } @@ -1766,15 +1766,15 @@ namespace cppcanvas::internal bool OutlineAction::operator()( const rendering::RenderState& rRenderState, const ::Color& /*rTextFillColor*/, bool /*bNormalText*/ ) const { - const rendering::ViewState& rViewState( mpCanvas->getViewState() ); - const uno::Reference< rendering::XCanvas >& rCanvas( mpCanvas->getUNOCanvas() ); + const rendering::ViewState aViewState( mpCanvas->getViewState() ); + const uno::Reference< rendering::XCanvas > xCanvas( mpCanvas->getUNOCanvas() ); if (mxBackgroundFillPoly.is()) { rendering::RenderState aLocalState( rRenderState ); aLocalState.DeviceColor = vcl::unotools::colorToDoubleSequence( - maBackgroundFillColor, rCanvas->getDevice()->getDeviceColorSpace()); - rCanvas->fillPolyPolygon(mxBackgroundFillPoly, rViewState, aLocalState); + maBackgroundFillColor, xCanvas->getDevice()->getDeviceColorSpace()); + xCanvas->fillPolyPolygon(mxBackgroundFillPoly, aViewState, aLocalState); } rendering::StrokeAttributes aStrokeAttributes; @@ -1791,23 +1791,23 @@ namespace cppcanvas::internal // TODO(P1): implement caching // background of text - rCanvas->fillPolyPolygon( mxTextPoly, - rViewState, + xCanvas->fillPolyPolygon( mxTextPoly, + aViewState, aLocalState ); // border line of text - rCanvas->strokePolyPolygon( mxTextPoly, - rViewState, + xCanvas->strokePolyPolygon( mxTextPoly, + aViewState, rRenderState, aStrokeAttributes ); // underlines/strikethrough - background - rCanvas->fillPolyPolygon( mxTextLines, - rViewState, + xCanvas->fillPolyPolygon( mxTextLines, + aViewState, aLocalState ); // underlines/strikethrough - border - rCanvas->strokePolyPolygon( mxTextLines, - rViewState, + xCanvas->strokePolyPolygon( mxTextLines, + aViewState, rRenderState, aStrokeAttributes ); diff --git a/cppcanvas/source/mtfrenderer/textlineshelper.cxx b/cppcanvas/source/mtfrenderer/textlineshelper.cxx index 125c3385afec..21e4083e3d74 100644 --- a/cppcanvas/source/mtfrenderer/textlineshelper.cxx +++ b/cppcanvas/source/mtfrenderer/textlineshelper.cxx @@ -84,8 +84,8 @@ void TextLinesHelper::init(double nLineWidth, const tools::TextLineInfo& rLineIn void TextLinesHelper::render(const rendering::RenderState& rRenderState, bool bNormalText) const { - const rendering::ViewState& rViewState(mpCanvas->getViewState()); - const uno::Reference<rendering::XCanvas>& xCanvas(mpCanvas->getUNOCanvas()); + const rendering::ViewState aViewState(mpCanvas->getViewState()); + const uno::Reference<rendering::XCanvas> xCanvas(mpCanvas->getUNOCanvas()); rendering::StrokeAttributes aStrokeAttributes; aStrokeAttributes.JoinType = rendering::PathJoinType::ROUND; @@ -98,10 +98,10 @@ void TextLinesHelper::render(const rendering::RenderState& rRenderState, bool bN if (mbOverlineWaveline) { aStrokeAttributes.StrokeWidth = mbOverlineWavelineBold ? 2.0 : 1.0; - xCanvas->strokePolyPolygon(mxOverline, rViewState, aLocalState, aStrokeAttributes); + xCanvas->strokePolyPolygon(mxOverline, aViewState, aLocalState, aStrokeAttributes); } else - xCanvas->fillPolyPolygon(mxOverline, rViewState, aLocalState); + xCanvas->fillPolyPolygon(mxOverline, aViewState, aLocalState); } if (mxUnderline.is()) @@ -112,14 +112,14 @@ void TextLinesHelper::render(const rendering::RenderState& rRenderState, bool bN if (mbUnderlineWaveline) { aStrokeAttributes.StrokeWidth = mbUnderlineWavelineBold ? 2.0 : 1.0; - xCanvas->strokePolyPolygon(mxUnderline, rViewState, aLocalState, aStrokeAttributes); + xCanvas->strokePolyPolygon(mxUnderline, aViewState, aLocalState, aStrokeAttributes); } else - xCanvas->fillPolyPolygon(mxUnderline, rViewState, aLocalState); + xCanvas->fillPolyPolygon(mxUnderline, aViewState, aLocalState); } if (mxStrikeout.is()) - xCanvas->fillPolyPolygon(mxStrikeout, rViewState, rRenderState); + xCanvas->fillPolyPolygon(mxStrikeout, aViewState, rRenderState); } } /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ |