slideshow/source/engine/activities/activitiesfactory.cxx | 8 - slideshow/source/engine/animationfactory.cxx | 20 +-- slideshow/source/engine/animationnodes/animationbasenode.cxx | 4 slideshow/source/engine/shapes/appletshape.cxx | 12 - slideshow/source/engine/shapes/backgroundshape.cxx | 4 slideshow/source/engine/shapes/drawshape.cxx | 16 +- slideshow/source/engine/shapes/drawshapesubsetting.cxx | 12 - slideshow/source/engine/shapes/mediashape.cxx | 8 - slideshow/source/engine/shapes/shapeimporter.cxx | 2 slideshow/source/engine/shapes/viewappletshape.cxx | 28 ++-- slideshow/source/engine/shapes/viewbackgroundshape.cxx | 18 +- slideshow/source/engine/shapes/viewmediashape.cxx | 26 ++-- slideshow/source/engine/shapes/viewshape.cxx | 28 ++-- slideshow/source/engine/slide/slideimpl.cxx | 70 +++++------ slideshow/source/engine/slideshowimpl.cxx | 6 slideshow/source/engine/slideview.cxx | 22 +-- slideshow/source/engine/smilfunctionparser.cxx | 12 - slideshow/source/engine/transitions/combtransition.cxx | 24 +-- slideshow/source/engine/transitions/slidechangebase.cxx | 6 slideshow/source/inc/tools.hxx | 4 20 files changed, 165 insertions(+), 165 deletions(-)
New commits: commit 96ccb9f0689ce9740cf3c0a76a3a1e2c07f53b77 Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Tue Nov 12 12:18:50 2024 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Tue Nov 12 16:06:44 2024 +0100 loplugin:reftotemp in slideshow Change-Id: If01cb31a8dd9a81d62bb7100731d28d33591f76a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176475 Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> Tested-by: Jenkins diff --git a/slideshow/source/engine/activities/activitiesfactory.cxx b/slideshow/source/engine/activities/activitiesfactory.cxx index 90388e84bc9f..c7a882620e06 100644 --- a/slideshow/source/engine/activities/activitiesfactory.cxx +++ b/slideshow/source/engine/activities/activitiesfactory.cxx @@ -680,15 +680,15 @@ AnimationActivitySharedPtr createActivity( rParms.mbAutoReverse ); // is a formula given? - const OUString& rFormulaString( xNode->getFormula() ); - if( !rFormulaString.isEmpty() ) + const OUString aFormulaString( xNode->getFormula() ); + if( !aFormulaString.isEmpty() ) { // yep, parse and pass to ActivityParameters try { aActivityParms.mpFormula = SmilFunctionParser::parseSmilFunction( - rFormulaString, + aFormulaString, calcRelativeShapeBounds( rParms.maSlideBounds, rParms.mpShape->getBounds() ) ); @@ -701,7 +701,7 @@ AnimationActivitySharedPtr createActivity( } // are key times given? - const uno::Sequence< double >& aKeyTimes( xNode->getKeyTimes() ); + const uno::Sequence< double > aKeyTimes( xNode->getKeyTimes() ); if( aKeyTimes.hasElements() ) { // yes, convert them from Sequence< double > diff --git a/slideshow/source/engine/animationfactory.cxx b/slideshow/source/engine/animationfactory.cxx index 081984144cc6..c7641b2690b6 100644 --- a/slideshow/source/engine/animationfactory.cxx +++ b/slideshow/source/engine/animationfactory.cxx @@ -871,10 +871,10 @@ namespace slideshow::internal template< typename ValueType > ValueType getDefault( const AnimatableShapeSharedPtr& rShape, const OUString& rPropertyName ) { - const uno::Any& rAny( getShapeDefault( rShape, + const uno::Any aAny( getShapeDefault( rShape, rPropertyName ) ); - if( !rAny.hasValue() ) + if( !aAny.hasValue() ) { SAL_WARN("slideshow", "getDefault(): cannot get shape property " << rPropertyName ); return ValueType(); @@ -883,7 +883,7 @@ namespace slideshow::internal { ValueType aValue = ValueType(); - if( !(rAny >>= aValue) ) + if( !(aAny >>= aValue) ) { SAL_WARN("slideshow", "getDefault(): cannot extract shape property " << rPropertyName); return ValueType(); @@ -896,10 +896,10 @@ namespace slideshow::internal template<> RGBColor getDefault< RGBColor >( const AnimatableShapeSharedPtr& rShape, const OUString& rPropertyName ) { - const uno::Any& rAny( getShapeDefault( rShape, + const uno::Any aAny( getShapeDefault( rShape, rPropertyName ) ); - if( !rAny.hasValue() ) + if( !aAny.hasValue() ) { SAL_WARN("slideshow", "getDefault(): cannot get shape color property " << rPropertyName); return RGBColor(); @@ -908,7 +908,7 @@ namespace slideshow::internal { sal_Int32 nValue = 0; - if( !(rAny >>= nValue) ) + if( !(aAny >>= nValue) ) { SAL_INFO("slideshow", "getDefault(): cannot extract shape color property " << rPropertyName); return RGBColor(); @@ -1320,7 +1320,7 @@ namespace slideshow::internal sal_Int16 nTransformType, int nFlags ) { - const ::basegfx::B2DRectangle& rBounds( rShape->getBounds() ); + const ::basegfx::B2DRectangle aBounds( rShape->getBounds() ); switch( nTransformType ) { @@ -1334,8 +1334,8 @@ namespace slideshow::internal // Theoretically, our AttrLayer is way down the stack, and // we only have to consider _that_ value, not the one from // the top of the stack as returned by Shape::getBounds() - basegfx::B2DSize(rBounds.getRange().getX(), rBounds.getRange().getY()), - basegfx::B2DSize(rBounds.getRange().getX(), rBounds.getRange().getY()), + basegfx::B2DSize(aBounds.getRange().getX(), aBounds.getRange().getY()), + basegfx::B2DSize(aBounds.getRange().getX(), aBounds.getRange().getY()), &ShapeAttributeLayer::getWidth, &ShapeAttributeLayer::getHeight, &ShapeAttributeLayer::setSize ); @@ -1350,7 +1350,7 @@ namespace slideshow::internal // Theoretically, our AttrLayer is way down the stack, and // we only have to consider _that_ value, not the one from // the top of the stack as returned by Shape::getBounds() - rBounds.getCenter(), + aBounds.getCenter(), basegfx::B2DSize(rSlideSize.getX(), rSlideSize.getY()), &ShapeAttributeLayer::getPosX, &ShapeAttributeLayer::getPosY, diff --git a/slideshow/source/engine/animationnodes/animationbasenode.cxx b/slideshow/source/engine/animationnodes/animationbasenode.cxx index 935fd27e1cb5..7d2f67203904 100644 --- a/slideshow/source/engine/animationnodes/animationbasenode.cxx +++ b/slideshow/source/engine/animationnodes/animationbasenode.cxx @@ -131,7 +131,7 @@ AnimationBaseNode::AnimationBaseNode( mpShape->getTreeNodeSupplier().getNumberOfTreeNodes( DocTreeNode::NodeType::LogicalParagraph) > aTarget.Paragraph ) { - const DocTreeNode& rTreeNode( + const DocTreeNode aTreeNode( mpShape->getTreeNodeSupplier().getTreeNode( aTarget.Paragraph, DocTreeNode::NodeType::LogicalParagraph ) ); @@ -143,7 +143,7 @@ AnimationBaseNode::AnimationBaseNode( // the Slide class must be changed). mpShapeSubset = std::make_shared<ShapeSubset>( mpShape, - rTreeNode, + aTreeNode, mpSubsetManager ); // Override NodeContext, and flag this node as diff --git a/slideshow/source/engine/shapes/appletshape.cxx b/slideshow/source/engine/shapes/appletshape.cxx index 9402a7f1194f..6bc61b806d6d 100644 --- a/slideshow/source/engine/shapes/appletshape.cxx +++ b/slideshow/source/engine/shapes/appletshape.cxx @@ -126,12 +126,12 @@ namespace slideshow::internal void AppletShape::implViewChanged( const UnoViewSharedPtr& rView ) { - const ::basegfx::B2DRectangle& rBounds = getBounds(); + const ::basegfx::B2DRectangle aBounds = getBounds(); // determine ViewAppletShape that needs update for( const auto& pViewAppletShape : maViewAppletShapes ) { if( pViewAppletShape->getViewLayer()->isOnView( rView ) ) - pViewAppletShape->resize( rBounds ); + pViewAppletShape->resize( aBounds ); } } @@ -139,9 +139,9 @@ namespace slideshow::internal void AppletShape::implViewsChanged() { // resize all ViewShapes - const ::basegfx::B2DRectangle& rBounds = getBounds(); + const ::basegfx::B2DRectangle aBounds = getBounds(); for( const auto& pViewAppletShape : maViewAppletShapes ) - pViewAppletShape->resize( rBounds ); + pViewAppletShape->resize( aBounds ); } @@ -240,9 +240,9 @@ namespace slideshow::internal bool AppletShape::implStartIntrinsicAnimation() { - const ::basegfx::B2DRectangle& rBounds = getBounds(); + const ::basegfx::B2DRectangle aBounds = getBounds(); for( const auto& pViewAppletShape : maViewAppletShapes ) - pViewAppletShape->startApplet( rBounds ); + pViewAppletShape->startApplet( aBounds ); mbIsPlaying = true; diff --git a/slideshow/source/engine/shapes/backgroundshape.cxx b/slideshow/source/engine/shapes/backgroundshape.cxx index 4afb48189e28..33c5b89bcb0a 100644 --- a/slideshow/source/engine/shapes/backgroundshape.cxx +++ b/slideshow/source/engine/shapes/backgroundshape.cxx @@ -259,9 +259,9 @@ namespace slideshow::internal SAL_INFO( "slideshow", "::presentation::internal::BackgroundShape: 0x" << std::hex << this ); // gcc again... - const ::basegfx::B2DRectangle& rCurrBounds( BackgroundShape::getBounds() ); + const ::basegfx::B2DRectangle aCurrBounds( BackgroundShape::getBounds() ); - if( rCurrBounds.getRange().equalZero() ) + if( aCurrBounds.getRange().equalZero() ) { // zero-sized shapes are effectively invisible, // thus, we save us the rendering... diff --git a/slideshow/source/engine/shapes/drawshape.cxx b/slideshow/source/engine/shapes/drawshape.cxx index 3b08dae0ff18..2f882c017da4 100644 --- a/slideshow/source/engine/shapes/drawshape.cxx +++ b/slideshow/source/engine/shapes/drawshape.cxx @@ -1011,14 +1011,14 @@ namespace slideshow::internal // increase capacity to same size as the container for // shape-relative hyperlink regions to avoid reallocation aTranslatedRegions.reserve( maHyperlinkRegions.size() ); - const basegfx::B2DPoint& rOffset(getBounds().getMinimum()); + const basegfx::B2DPoint aOffset(getBounds().getMinimum()); for( const auto& cp : maHyperlinkRegions ) { basegfx::B2DRange const& relRegion( cp.first ); aTranslatedRegions.emplace_back( basegfx::B2DRange( - relRegion.getMinimum() + rOffset, - relRegion.getMaximum() + rOffset), + relRegion.getMinimum() + aOffset, + relRegion.getMaximum() + aOffset), cp.second ); } @@ -1204,13 +1204,13 @@ namespace slideshow::internal // persistent subset, containing all text/only the // background respectively. From _that_ object, // generate the temporary character subset shapes. - const ShapeAttributeLayerSharedPtr& rAttrLayer( + const ShapeAttributeLayerSharedPtr xAttrLayer( rShape->getTopmostAttributeLayer() ); - if( rAttrLayer && - rAttrLayer->isVisibilityValid() && - rAttrLayer->getVisibility() != isVisible() ) + if( xAttrLayer && + xAttrLayer->isVisibilityValid() && + xAttrLayer->getVisibility() != isVisible() ) { - const bool bVisibility( rAttrLayer->getVisibility() ); + const bool bVisibility( xAttrLayer->getVisibility() ); // visibilities differ - adjust ours, then if( mpAttributeLayer ) diff --git a/slideshow/source/engine/shapes/drawshapesubsetting.cxx b/slideshow/source/engine/shapes/drawshapesubsetting.cxx index 13ea0300fa63..746e7f786888 100644 --- a/slideshow/source/engine/shapes/drawshapesubsetting.cxx +++ b/slideshow/source/engine/shapes/drawshapesubsetting.cxx @@ -329,10 +329,10 @@ namespace slideshow::internal // subset shape already created for this DocTreeNode? SubsetEntry aEntry; - const DocTreeNode& rEffectiveSubset( rShape->getSubsetNode() ); + const DocTreeNode aEffectiveSubset( rShape->getSubsetNode() ); - aEntry.mnStartActionIndex = rEffectiveSubset.getStartIndex(); - aEntry.mnEndActionIndex = rEffectiveSubset.getEndIndex(); + aEntry.mnStartActionIndex = aEffectiveSubset.getStartIndex(); + aEntry.mnEndActionIndex = aEffectiveSubset.getEndIndex(); ShapeSet::const_iterator aIter; if( (aIter=maSubsetShapes.find( aEntry )) != maSubsetShapes.end() ) @@ -361,10 +361,10 @@ namespace slideshow::internal // lookup subset shape SubsetEntry aEntry; - const DocTreeNode& rEffectiveSubset( rShape->getSubsetNode() ); + const DocTreeNode aEffectiveSubset( rShape->getSubsetNode() ); - aEntry.mnStartActionIndex = rEffectiveSubset.getStartIndex(); - aEntry.mnEndActionIndex = rEffectiveSubset.getEndIndex(); + aEntry.mnStartActionIndex = aEffectiveSubset.getStartIndex(); + aEntry.mnEndActionIndex = aEffectiveSubset.getEndIndex(); ShapeSet::iterator aIter; if( (aIter=maSubsetShapes.find( aEntry )) == maSubsetShapes.end() ) diff --git a/slideshow/source/engine/shapes/mediashape.cxx b/slideshow/source/engine/shapes/mediashape.cxx index d45dc7ec7b03..5a22682e63f4 100644 --- a/slideshow/source/engine/shapes/mediashape.cxx +++ b/slideshow/source/engine/shapes/mediashape.cxx @@ -106,20 +106,20 @@ namespace slideshow::internal void MediaShape::implViewChanged( const UnoViewSharedPtr& rView ) { - const ::basegfx::B2DRectangle& rBounds = getBounds(); + const ::basegfx::B2DRectangle aBounds = getBounds(); // determine ViewMediaShape that needs update for( const auto& pViewMediaShape : maViewMediaShapes ) if( pViewMediaShape->getViewLayer()->isOnView( rView ) ) - pViewMediaShape->resize( rBounds ); + pViewMediaShape->resize( aBounds ); } void MediaShape::implViewsChanged() { - const ::basegfx::B2DRectangle& rBounds = getBounds(); + const ::basegfx::B2DRectangle aBounds = getBounds(); // resize all ViewShapes for( const auto& pViewMediaShape : maViewMediaShapes ) - pViewMediaShape->resize( rBounds ); + pViewMediaShape->resize( aBounds ); } diff --git a/slideshow/source/engine/shapes/shapeimporter.cxx b/slideshow/source/engine/shapes/shapeimporter.cxx index a968aefadf4e..f3cea68d3f76 100644 --- a/slideshow/source/engine/shapes/shapeimporter.cxx +++ b/slideshow/source/engine/shapes/shapeimporter.cxx @@ -379,7 +379,7 @@ bool ShapeImporter::isSkip( if(xLayer.is()) { OUString layerName; - const uno::Any& a(xLayer->getPropertyValue(u"Name"_ustr) ); + const uno::Any a(xLayer->getPropertyValue(u"Name"_ustr) ); bool const bRet = (a >>= layerName); if(bRet) { diff --git a/slideshow/source/engine/shapes/viewappletshape.cxx b/slideshow/source/engine/shapes/viewappletshape.cxx index a3878ed53b36..faf7d7719184 100644 --- a/slideshow/source/engine/shapes/viewappletshape.cxx +++ b/slideshow/source/engine/shapes/viewappletshape.cxx @@ -168,22 +168,22 @@ namespace slideshow::internal ::canvas::tools::calcTransformedRectBounds( aTmpRange, rBounds, mpViewLayer->getTransformation() ); - const ::basegfx::B2IRange& rPixelBounds( + const ::basegfx::B2IRange aPixelBounds( ::basegfx::unotools::b2ISurroundingRangeFromB2DRange( aTmpRange )); uno::Reference< awt::XWindow > xSurroundingWindow( mxFrame->getContainerWindow() ); if( xSurroundingWindow.is() ) - xSurroundingWindow->setPosSize( rPixelBounds.getMinX(), - rPixelBounds.getMinY(), - static_cast<sal_Int32>(rPixelBounds.getWidth()), - static_cast<sal_Int32>(rPixelBounds.getHeight()), + xSurroundingWindow->setPosSize( aPixelBounds.getMinX(), + aPixelBounds.getMinY(), + static_cast<sal_Int32>(aPixelBounds.getWidth()), + static_cast<sal_Int32>(aPixelBounds.getHeight()), awt::PosSize::POSSIZE ); uno::Reference< awt::XWindow > xAppletWindow( mxFrame->getComponentWindow() ); if( xAppletWindow.is() ) xAppletWindow->setPosSize( 0, 0, - static_cast<sal_Int32>(rPixelBounds.getWidth()), - static_cast<sal_Int32>(rPixelBounds.getHeight()), + static_cast<sal_Int32>(aPixelBounds.getWidth()), + static_cast<sal_Int32>(aPixelBounds.getHeight()), awt::PosSize::POSSIZE ); } } @@ -234,22 +234,22 @@ namespace slideshow::internal ::canvas::tools::calcTransformedRectBounds( aTmpRange, rBounds, mpViewLayer->getTransformation() ); - const ::basegfx::B2IRange& rPixelBounds( + const ::basegfx::B2IRange aPixelBounds( ::basegfx::unotools::b2ISurroundingRangeFromB2DRange( aTmpRange )); uno::Reference< awt::XWindow > xFrameWindow( mxFrame->getContainerWindow() ); if( xFrameWindow.is() ) - xFrameWindow->setPosSize( rPixelBounds.getMinX(), - rPixelBounds.getMinY(), - static_cast<sal_Int32>(rPixelBounds.getWidth()), - static_cast<sal_Int32>(rPixelBounds.getHeight()), + xFrameWindow->setPosSize( aPixelBounds.getMinX(), + aPixelBounds.getMinY(), + static_cast<sal_Int32>(aPixelBounds.getWidth()), + static_cast<sal_Int32>(aPixelBounds.getHeight()), awt::PosSize::POSSIZE ); uno::Reference< awt::XWindow > xAppletWindow( mxFrame->getComponentWindow() ); if( xAppletWindow.is() ) xAppletWindow->setPosSize( 0, 0, - static_cast<sal_Int32>(rPixelBounds.getWidth()), - static_cast<sal_Int32>(rPixelBounds.getHeight()), + static_cast<sal_Int32>(aPixelBounds.getWidth()), + static_cast<sal_Int32>(aPixelBounds.getHeight()), awt::PosSize::POSSIZE ); return true; diff --git a/slideshow/source/engine/shapes/viewbackgroundshape.cxx b/slideshow/source/engine/shapes/viewbackgroundshape.cxx index c522928a7b37..f961eabb7107 100644 --- a/slideshow/source/engine/shapes/viewbackgroundshape.cxx +++ b/slideshow/source/engine/shapes/viewbackgroundshape.cxx @@ -51,12 +51,12 @@ namespace slideshow::internal ENSURE_OR_RETURN_FALSE( rMtf, "ViewBackgroundShape::prefetch(): no valid metafile!" ); - const ::basegfx::B2DHomMatrix& rCanvasTransform( + const ::basegfx::B2DHomMatrix aCanvasTransform( mpViewLayer->getTransformation() ); if( !mxBitmap.is() || rMtf != mpLastMtf || - rCanvasTransform != maLastTransformation ) + aCanvasTransform != maLastTransformation ) { // buffered bitmap is invalid, re-create @@ -64,7 +64,7 @@ namespace slideshow::internal ::basegfx::B2DRectangle aTmpRect; ::canvas::tools::calcTransformedRectBounds( aTmpRect, maBounds, - rCanvasTransform ); + aCanvasTransform ); // determine pixel size of bitmap (choose it one pixel // larger, as polygon rendering takes one pixel more @@ -93,7 +93,7 @@ namespace slideshow::internal // apply linear part of destination canvas transformation (linear means in this context: // transformation without any translational components) - ::basegfx::B2DHomMatrix aLinearTransform( rCanvasTransform ); + ::basegfx::B2DHomMatrix aLinearTransform( aCanvasTransform ); aLinearTransform.set( 0, 2, 0.0 ); aLinearTransform.set( 1, 2, 0.0 ); pBitmapCanvas->setTransformation( aLinearTransform ); @@ -118,7 +118,7 @@ namespace slideshow::internal } mpLastMtf = rMtf; - maLastTransformation = rCanvasTransform; + maLastTransformation = aCanvasTransform; return mxBitmap.is(); } @@ -144,9 +144,9 @@ namespace slideshow::internal { SAL_INFO( "slideshow", "::presentation::internal::ViewBackgroundShape::draw()" ); - const ::cppcanvas::CanvasSharedPtr& rDestinationCanvas( mpViewLayer->getCanvas() ); + const ::cppcanvas::CanvasSharedPtr xDestinationCanvas( mpViewLayer->getCanvas() ); - if( !prefetch( rDestinationCanvas, rMtf ) ) + if( !prefetch( xDestinationCanvas, rMtf ) ) return false; ENSURE_OR_RETURN_FALSE( mxBitmap.is(), @@ -171,8 +171,8 @@ namespace slideshow::internal try { - rDestinationCanvas->getUNOCanvas()->drawBitmap( mxBitmap, - rDestinationCanvas->getViewState(), + xDestinationCanvas->getUNOCanvas()->drawBitmap( mxBitmap, + xDestinationCanvas->getViewState(), aRenderState ); } catch( uno::Exception& ) diff --git a/slideshow/source/engine/shapes/viewmediashape.cxx b/slideshow/source/engine/shapes/viewmediashape.cxx index b31d392d8550..bf683d17a341 100644 --- a/slideshow/source/engine/shapes/viewmediashape.cxx +++ b/slideshow/source/engine/shapes/viewmediashape.cxx @@ -232,12 +232,12 @@ namespace slideshow::internal ::canvas::tools::calcTransformedRectBounds( aTmpRange, rNewBounds, mpViewLayer->getTransformation() ); - const ::basegfx::B2IRange& rRangePix( + const ::basegfx::B2IRange aRangePix( ::basegfx::unotools::b2ISurroundingRangeFromB2DRange( aTmpRange )); - mxPlayerWindow->setEnable( !rRangePix.isEmpty() ); + mxPlayerWindow->setEnable( !aRangePix.isEmpty() ); - if( rRangePix.isEmpty() ) + if( aRangePix.isEmpty() ) return true; awt::Rectangle aCanvasArea; @@ -245,10 +245,10 @@ namespace slideshow::internal if (xUnoView) aCanvasArea = xUnoView->getUnoView()->getCanvasArea(); - const Point aPosPixel( rRangePix.getMinX() + maWindowOffset.X + aCanvasArea.X, - rRangePix.getMinY() + maWindowOffset.Y + aCanvasArea.Y ); - const Size aSizePixel( rRangePix.getMaxX() - rRangePix.getMinX(), - rRangePix.getMaxY() - rRangePix.getMinY() ); + const Point aPosPixel( aRangePix.getMinX() + maWindowOffset.X + aCanvasArea.X, + aRangePix.getMinY() + maWindowOffset.Y + aCanvasArea.Y ); + const Size aSizePixel( aRangePix.getMaxX() - aRangePix.getMinX(), + aRangePix.getMaxY() - aRangePix.getMinY() ); if( mpMediaWindow ) { @@ -426,15 +426,15 @@ namespace slideshow::internal ::canvas::tools::calcTransformedRectBounds( aTmpRange, rBounds, mpViewLayer->getTransformation() ); - const ::basegfx::B2IRange& rRangePix( + const ::basegfx::B2IRange aRangePix( ::basegfx::unotools::b2ISurroundingRangeFromB2DRange( aTmpRange )); - if( !rRangePix.isEmpty() ) + if( !aRangePix.isEmpty() ) { - awt::Rectangle aAWTRect( rRangePix.getMinX(), - rRangePix.getMinY(), - rRangePix.getMaxX() - rRangePix.getMinX(), - rRangePix.getMaxY() - rRangePix.getMinY() ); + awt::Rectangle aAWTRect( aRangePix.getMinX(), + aRangePix.getMinY(), + aRangePix.getMaxX() - aRangePix.getMinX(), + aRangePix.getMaxY() - aRangePix.getMinY() ); { mpMediaWindow.disposeAndClear(); mpMediaWindow = VclPtr<SystemChildWindow>::Create( pWindow, WB_CLIPCHILDREN ); diff --git a/slideshow/source/engine/shapes/viewshape.cxx b/slideshow/source/engine/shapes/viewshape.cxx index 8c1ea9523061..836e0bd97928 100644 --- a/slideshow/source/engine/shapes/viewshape.cxx +++ b/slideshow/source/engine/shapes/viewshape.cxx @@ -317,22 +317,22 @@ namespace slideshow::internal aShapeTransformation.translate( rOrigBounds.getMinX(), rOrigBounds.getMinY() ); - const ::basegfx::B2DHomMatrix& rCanvasTransform( + const ::basegfx::B2DHomMatrix aCanvasTransform( rViewLayer->getSpriteTransformation() ); // area actually needed for the sprite - const ::basegfx::B2DRectangle& rSpriteBoundsPixel( + const ::basegfx::B2DRectangle aSpriteBoundsPixel( calcUpdateAreaPixel( rUnitBounds, aShapeTransformation, - rCanvasTransform, + aCanvasTransform, pAttr ) ); // actual area for the shape (without subsetting, but // including char scaling) - const ::basegfx::B2DRectangle& rShapeBoundsPixel( + const ::basegfx::B2DRectangle aShapeBoundsPixel( calcUpdateAreaPixel( ::basegfx::B2DRectangle(0.0,0.0,1.0,1.0), aShapeTransformation, - rCanvasTransform, + aCanvasTransform, pAttr ) ); // nominal area for the shape (without subsetting, without @@ -340,8 +340,8 @@ namespace slideshow::internal // contained in rSpriteBoundsPixel, this is _without_ any // translational component. ::basegfx::B2DRectangle aLogShapeBounds; - const ::basegfx::B2DRectangle& rNominalShapeBoundsPixel( - shapeArea2AreaPixel( rCanvasTransform, + const ::basegfx::B2DRectangle aNominalShapeBoundsPixel( + shapeArea2AreaPixel( aCanvasTransform, ::canvas::tools::calcTransformedRectBounds( aLogShapeBounds, ::basegfx::B2DRectangle(0.0,0.0,1.0,1.0), @@ -349,7 +349,7 @@ namespace slideshow::internal // create (or resize) sprite with sprite's pixel size, if // not done already - auto aRange = rSpriteBoundsPixel.getRange(); + auto aRange = aSpriteBoundsPixel.getRange(); basegfx::B2DSize rSpriteSizePixel(aRange.getX(), aRange.getY()); if( !mpSprite ) { @@ -381,14 +381,14 @@ namespace slideshow::internal // the appropriate output position within the virtual // rShapeBoundsPixel area. ::basegfx::B2DPoint aSpritePosPixel( rBounds.getCenter() ); - aSpritePosPixel *= rCanvasTransform; - aSpritePosPixel -= rShapeBoundsPixel.getCenter() - rSpriteBoundsPixel.getMinimum(); + aSpritePosPixel *= aCanvasTransform; + aSpritePosPixel -= aShapeBoundsPixel.getCenter() - aSpriteBoundsPixel.getMinimum(); // the difference between rShapeBoundsPixel and // rSpriteBoundsPixel upper, left corner is: the offset we // have to move sprite output to the right, top (to make // the desired subset content visible at all) - auto aDifference = rSpriteBoundsPixel.getMinimum() - rNominalShapeBoundsPixel.getMinimum(); + auto aDifference = aSpriteBoundsPixel.getMinimum() - aNominalShapeBoundsPixel.getMinimum(); const basegfx::B2DSize rSpriteCorrectionOffset(aDifference.getX(), aDifference.getY()); // offset added top, left for anti-aliasing (otherwise, @@ -796,15 +796,15 @@ namespace slideshow::internal ENSURE_OR_THROW( mpViewLayer->getCanvas(), "ViewShape::getAntialiasingBorder(): Invalid ViewLayer canvas" ); - const ::basegfx::B2DHomMatrix& rViewTransform( + const ::basegfx::B2DHomMatrix aViewTransform( mpViewLayer->getTransformation() ); // TODO(F1): As a quick shortcut (did not want to invert // whole matrix here), taking only scale components of // view transformation matrix. This will be wrong when // e.g. shearing is involved. - const double nXBorder( ::cppcanvas::Canvas::ANTIALIASING_EXTRA_SIZE / rViewTransform.get(0,0) ); - const double nYBorder( ::cppcanvas::Canvas::ANTIALIASING_EXTRA_SIZE / rViewTransform.get(1,1) ); + const double nXBorder( ::cppcanvas::Canvas::ANTIALIASING_EXTRA_SIZE / aViewTransform.get(0,0) ); + const double nYBorder( ::cppcanvas::Canvas::ANTIALIASING_EXTRA_SIZE / aViewTransform.get(1,1) ); return ::basegfx::B2DSize( nXBorder, nYBorder ); diff --git a/slideshow/source/engine/slide/slideimpl.cxx b/slideshow/source/engine/slide/slideimpl.cxx index 230aab96c132..6b7d92e78648 100644 --- a/slideshow/source/engine/slide/slideimpl.cxx +++ b/slideshow/source/engine/slide/slideimpl.cxx @@ -370,8 +370,8 @@ void LOKSlideRenderer::renderBackgroundImpl(VirtualDevice& rDevice) std::string sSlideHash = GetInterfaceHash(mxDrawPage); aJsonWriter.put("slideHash", sSlideHash); - ShapeSharedPtr const& rBGShape(mpMPShapesFunctor->importBackgroundShape()); - mpLayerManager->addShape(rBGShape); + ShapeSharedPtr const xBGShape(mpMPShapesFunctor->importBackgroundShape()); + mpLayerManager->addShape(xBGShape); // render and collect bitmap renderLayerBitmapImpl(rDevice); @@ -390,7 +390,7 @@ void LOKSlideRenderer::renderBackgroundImpl(VirtualDevice& rDevice) // clean up rDevice.Erase(); - mpLayerManager->removeShape(rBGShape); + mpLayerManager->removeShape(xBGShape); mbBackgroundRenderingDone = true; } @@ -431,18 +431,18 @@ void LOKSlideRenderer::renderMasterPageImpl(VirtualDevice& rDevice) bool bDoRendering = false; while (!mpMPShapesFunctor->isImportDone()) { - ShapeSharedPtr const& rShape(mpMPShapesFunctor->importShape()); - if (!rShape) + ShapeSharedPtr const pShape(mpMPShapesFunctor->importShape()); + if (!pShape) continue; - uno::Reference<drawing::XShape> xShape = rShape->getXShape(); + uno::Reference<drawing::XShape> xShape = pShape->getXShape(); if (xShape.is()) { OUString sShapeType = xShape->getShapeType(); OUString sPlaceholderType = getPlaceholderType(sShapeType); if (sPlaceholderType.isEmpty()) { - mpLayerManager->addShape(rShape); + mpLayerManager->addShape(pShape); bDoRendering = true; } else @@ -482,11 +482,11 @@ void LOKSlideRenderer::renderTextFieldsImpl(VirtualDevice& rDevice) { while( !mpTFShapesFunctor->isImportDone() ) { - ShapeSharedPtr const& rShape(mpTFShapesFunctor->importShape()); - if (!rShape) + ShapeSharedPtr const pShape(mpTFShapesFunctor->importShape()); + if (!pShape) continue; - uno::Reference<drawing::XShape> xShape = rShape->getXShape(); + uno::Reference<drawing::XShape> xShape = pShape->getXShape(); if (xShape.is()) { OUString sShapeType = xShape->getShapeType(); @@ -498,7 +498,7 @@ void LOKSlideRenderer::renderTextFieldsImpl(VirtualDevice& rDevice) (!mbIsFooterVisible && sPlaceholderType == "Footer")) continue; - mpLayerManager->addShape(rShape); + mpLayerManager->addShape(pShape); // render and collect bitmap renderLayerBitmapImpl(rDevice); @@ -521,7 +521,7 @@ void LOKSlideRenderer::renderTextFieldsImpl(VirtualDevice& rDevice) // clean up rDevice.Erase(); - mpLayerManager->removeShape(rShape); + mpLayerManager->removeShape(pShape); return; } } @@ -579,26 +579,26 @@ void LOKSlideRenderer::renderDrawPageImpl(VirtualDevice& rDevice) std::shared_ptr<ShapeImporter> pMasterShapeImporter = std::make_shared<ShapeImporter>(mxMasterPage, mxDrawPage, mxDrawPagesSupplier, mrContext, 0, true); - ShapeSharedPtr const& rBGShape(pMasterShapeImporter->importBackgroundShape()); - if (rBGShape) + ShapeSharedPtr const pBGShape(pMasterShapeImporter->importBackgroundShape()); + if (pBGShape) { bDoRendering = true; - mpLayerManager->addShape(rBGShape); + mpLayerManager->addShape(pBGShape); } while (!pMasterShapeImporter->isImportDone()) { - ShapeSharedPtr const& rShape(pMasterShapeImporter->importShape()); - if (!rShape) + ShapeSharedPtr const pShape(pMasterShapeImporter->importShape()); + if (!pShape) continue; - rShape->setIsForeground(false); + pShape->setIsForeground(false); - uno::Reference<drawing::XShape> xShape = rShape->getXShape(); + uno::Reference<drawing::XShape> xShape = pShape->getXShape(); if (xShape.is()) { - mpLayerManager->addShape(rShape); + mpLayerManager->addShape(pShape); bDoRendering = true; } } @@ -608,27 +608,27 @@ void LOKSlideRenderer::renderDrawPageImpl(VirtualDevice& rDevice) while (!mpShapesFunctor->isImportDone()) { - ShapeSharedPtr const& rShape(mpShapesFunctor->importShape()); - if (rShape) + ShapeSharedPtr const pShape(mpShapesFunctor->importShape()); + if (pShape) { - std::string sShapeId = GetInterfaceHash(rShape->getXShape()); - const auto& rIter = maAnimatedShapeVisibilityMap.find(sShapeId); - bool bIsAnimated = rIter != maAnimatedShapeVisibilityMap.end(); + std::string sShapeId = GetInterfaceHash(pShape->getXShape()); + const auto aIter = maAnimatedShapeVisibilityMap.find(sShapeId); + bool bIsAnimated = aIter != maAnimatedShapeVisibilityMap.end(); if (!bIsAnimated) { - mpLayerManager->addShape(rShape); + mpLayerManager->addShape(pShape); bDoRendering = true; } else { if (bDoRendering) { - mpDPLastAnimatedShape = rShape; + mpDPLastAnimatedShape = pShape; renderLayerImpl(rDevice, aJsonWriter); } else { - renderAnimatedShapeImpl(rDevice, rShape, aJsonWriter); + renderAnimatedShapeImpl(rDevice, pShape, aJsonWriter); } msLastJsonMessage = aJsonWriter.finishAndGetAsOString(); maJsonMsgList.push_back(msLastJsonMessage); @@ -1797,12 +1797,12 @@ bool SlideImpl::loadShapes() while( !aMPShapesFunctor.isImportDone() ) { - ShapeSharedPtr const& rShape( + ShapeSharedPtr const pShape( aMPShapesFunctor.importShape() ); - if( rShape ) + if( pShape ) { - rShape->setIsForeground(false); - mpLayerManager->addShape( rShape ); + pShape->setIsForeground(false); + mpLayerManager->addShape( pShape ); } } addPolygons(aMPShapesFunctor.getPolygons()); @@ -1842,10 +1842,10 @@ bool SlideImpl::loadShapes() while( !aShapesFunctor.isImportDone() ) { - ShapeSharedPtr const& rShape( + ShapeSharedPtr const pShape( aShapesFunctor.importShape() ); - if( rShape ) - mpLayerManager->addShape( rShape ); + if( pShape ) + mpLayerManager->addShape( pShape ); } addPolygons(aShapesFunctor.getPolygons()); } diff --git a/slideshow/source/engine/slideshowimpl.cxx b/slideshow/source/engine/slideshowimpl.cxx index e9df84afe339..f0e91d0bec15 100644 --- a/slideshow/source/engine/slideshowimpl.cxx +++ b/slideshow/source/engine/slideshowimpl.cxx @@ -1111,11 +1111,11 @@ sal_Bool SlideShowImpl::createLOKSlideRenderer( if (!mpCurrentSlide) return false; - const Size& rDeviceSize = mpCurrentSlide->createLOKSlideRenderer(nViewWidth, nViewHeight, + const Size aDeviceSize = mpCurrentSlide->createLOKSlideRenderer(nViewWidth, nViewHeight, bRenderBackground, bRenderMasterPage); - nViewWidth = rDeviceSize.getWidth(); - nViewHeight = rDeviceSize.getHeight(); + nViewWidth = aDeviceSize.getWidth(); + nViewHeight = aDeviceSize.getHeight(); return (nViewWidth > 0 && nViewHeight > 0); } diff --git a/slideshow/source/engine/slideview.cxx b/slideshow/source/engine/slideview.cxx index dd6a28423f36..3e6d0b6ab624 100644 --- a/slideshow/source/engine/slideview.cxx +++ b/slideshow/source/engine/slideview.cxx @@ -451,10 +451,10 @@ public: maUserSize.getWidth(), maUserSize.getHeight()) ); - basegfx::B2IRange const& rNewLayerPixel( + basegfx::B2IRange const aNewLayerPixel( getLayerBoundsPixel(maLayerBounds, maTransformation) ); - if( rNewLayerPixel != maLayerBoundsPixel ) + if( aNewLayerPixel != maLayerBoundsPixel ) { // re-gen sprite with new size mpOutputCanvas.reset(); @@ -543,9 +543,9 @@ private: cppcanvas::CanvasSharedPtr pCanvas=getCanvas()->clone(); // clear whole canvas - const basegfx::B2I64Tuple& rSpriteSize(maLayerBoundsPixel.getRange()); + const basegfx::B2I64Tuple aSpriteSize(maLayerBoundsPixel.getRange()); clearRect(pCanvas, - basegfx::B2IRange(0,0,rSpriteSize.getX(),rSpriteSize.getY())); + basegfx::B2IRange(0,0,aSpriteSize.getX(),aSpriteSize.getY())); } virtual void clearAll() const override @@ -557,9 +557,9 @@ private: pCanvas->setClip(); // clear whole canvas - const basegfx::B2I64Tuple& rSpriteSize(maLayerBoundsPixel.getRange()); + const basegfx::B2I64Tuple aSpriteSize(maLayerBoundsPixel.getRange()); clearRect(pCanvas, - basegfx::B2IRange(0,0,rSpriteSize.getX(),rSpriteSize.getY())); + basegfx::B2IRange(0,0,aSpriteSize.getX(),aSpriteSize.getY())); } virtual bool isOnView(ViewSharedPtr const& rView) const override @@ -584,10 +584,10 @@ private: if( maLayerBoundsPixel.isEmpty() ) maLayerBoundsPixel = basegfx::B2IRange(0,0,1,1); - const basegfx::B2I64Tuple& rSpriteSize(maLayerBoundsPixel.getRange()); + const basegfx::B2I64Tuple aSpriteSize(maLayerBoundsPixel.getRange()); mpSprite = mpSpriteCanvas->createCustomSprite( - basegfx::B2DSize(sal::static_int_cast<sal_Int32>(rSpriteSize.getX()), - sal::static_int_cast<sal_Int32>(rSpriteSize.getY())) ); + basegfx::B2DSize(sal::static_int_cast<sal_Int32>(aSpriteSize.getX()), + sal::static_int_cast<sal_Int32>(aSpriteSize.getY())) ); mpSprite->setPriority( maSpriteContainer.getLayerPriority().getMinimum() ); @@ -1139,7 +1139,7 @@ void SlideView::pruneLayers( bool bWithViewLayerUpdate ) const { ViewLayerVector aValidLayers; - const basegfx::B2DHomMatrix& rCurrTransform( + const basegfx::B2DHomMatrix aCurrTransform( getTransformation() ); // check all layers for validity, and retain only the live ones @@ -1152,7 +1152,7 @@ void SlideView::pruneLayers( bool bWithViewLayerUpdate ) const aValidLayers.push_back( xCurrLayer ); if( bWithViewLayerUpdate ) - xCurrLayer->updateView( rCurrTransform, + xCurrLayer->updateView( aCurrTransform, maUserSize ); } } diff --git a/slideshow/source/engine/smilfunctionparser.cxx b/slideshow/source/engine/smilfunctionparser.cxx index 5d8fce43b197..13a3d65bf893 100644 --- a/slideshow/source/engine/smilfunctionparser.cxx +++ b/slideshow/source/engine/smilfunctionparser.cxx @@ -527,11 +527,11 @@ namespace slideshow::internal // TODO(Q1): Check if a combination of the RTL_UNICODETOTEXT_FLAGS_* // gives better conversion robustness here (we might want to map space // etc. to ASCII space here) - const OString& rAsciiSmilValue( + const OString aAsciiSmilValue( OUStringToOString( rSmilValue, RTL_TEXTENCODING_ASCII_US ) ); - StringIteratorT aStart( rAsciiSmilValue.getStr() ); - StringIteratorT aEnd( rAsciiSmilValue.getStr()+rAsciiSmilValue.getLength() ); + StringIteratorT aStart( aAsciiSmilValue.getStr() ); + StringIteratorT aEnd( aAsciiSmilValue.getStr()+aAsciiSmilValue.getLength() ); // static parser context, because the actual // Spirit parser is also a static object @@ -570,11 +570,11 @@ namespace slideshow::internal // TODO(Q1): Check if a combination of the RTL_UNICODETOTEXT_FLAGS_* // gives better conversion robustness here (we might want to map space // etc. to ASCII space here) - const OString& rAsciiSmilFunction( + const OString aAsciiSmilFunction( OUStringToOString( rSmilFunction, RTL_TEXTENCODING_ASCII_US ) ); - StringIteratorT aStart( rAsciiSmilFunction.getStr() ); - StringIteratorT aEnd( rAsciiSmilFunction.getStr()+rAsciiSmilFunction.getLength() ); + StringIteratorT aStart( aAsciiSmilFunction.getStr() ); + StringIteratorT aEnd( aAsciiSmilFunction.getStr()+aAsciiSmilFunction.getLength() ); // static parser context, because the actual // Spirit parser is also a static object diff --git a/slideshow/source/engine/transitions/combtransition.cxx b/slideshow/source/engine/transitions/combtransition.cxx index 88e5c167e4a0..b5685194e4aa 100644 --- a/slideshow/source/engine/transitions/combtransition.cxx +++ b/slideshow/source/engine/transitions/combtransition.cxx @@ -84,10 +84,10 @@ CombTransition::CombTransition( void CombTransition::renderComb( double t, const ViewEntry& rViewEntry ) const { - const SlideBitmapSharedPtr& pEnteringBitmap = getEnteringBitmap(rViewEntry); + const SlideBitmapSharedPtr xEnteringBitmap = getEnteringBitmap(rViewEntry); const cppcanvas::CanvasSharedPtr pCanvas_ = rViewEntry.mpView->getCanvas(); - if( !pEnteringBitmap || !pCanvas_ ) + if( !xEnteringBitmap || !pCanvas_ ) return; // calc bitmap offsets. The enter/leaving bitmaps are only @@ -124,40 +124,40 @@ void CombTransition::renderComb( double t, basegfx::B2DSize(enteringSizePixel.getX(), enteringSizePixel.getY()), mnNumStripes, 1 ); - SlideBitmapSharedPtr const & pLeavingBitmap = getLeavingBitmap(rViewEntry); - if( pLeavingBitmap ) + SlideBitmapSharedPtr const xLeavingBitmap = getLeavingBitmap(rViewEntry); + if( xLeavingBitmap ) { // render odd strips: - pLeavingBitmap->clip( aClipPolygon1 ); + xLeavingBitmap->clip( aClipPolygon1 ); // don't modify bitmap object (no move!): p = basegfx::B2DPoint( pageOrigin + (t * aPushDirection) ); pCanvas->setTransformation(basegfx::utils::createTranslateB2DHomMatrix(p.getX(), p.getY())); - pLeavingBitmap->draw( pCanvas ); + xLeavingBitmap->draw( pCanvas ); // render even strips: - pLeavingBitmap->clip( aClipPolygon2 ); + xLeavingBitmap->clip( aClipPolygon2 ); // don't modify bitmap object (no move!): p = basegfx::B2DPoint( pageOrigin - (t * aPushDirection) ); pCanvas->setTransformation(basegfx::utils::createTranslateB2DHomMatrix(p.getX(), p.getY())); - pLeavingBitmap->draw( pCanvas ); + xLeavingBitmap->draw( pCanvas ); } // TODO(Q2): Use basegfx bitmaps here // TODO(F1): SlideBitmap is not fully portable between different canvases! // render odd strips: - pEnteringBitmap->clip( aClipPolygon1 ); + xEnteringBitmap->clip( aClipPolygon1 ); // don't modify bitmap object (no move!): p = basegfx::B2DPoint( pageOrigin + ((t - 1.0) * aPushDirection) ); pCanvas->setTransformation(basegfx::utils::createTranslateB2DHomMatrix(p.getX(), p.getY())); - pEnteringBitmap->draw( pCanvas ); + xEnteringBitmap->draw( pCanvas ); // render even strips: - pEnteringBitmap->clip( aClipPolygon2 ); + xEnteringBitmap->clip( aClipPolygon2 ); // don't modify bitmap object (no move!): p = basegfx::B2DPoint( pageOrigin + ((1.0 - t) * aPushDirection) ); pCanvas->setTransformation(basegfx::utils::createTranslateB2DHomMatrix(p.getX(), p.getY())); - pEnteringBitmap->draw( pCanvas ); + xEnteringBitmap->draw( pCanvas ); } bool CombTransition::operator()( double t ) diff --git a/slideshow/source/engine/transitions/slidechangebase.cxx b/slideshow/source/engine/transitions/slidechangebase.cxx index 2fcadf10b647..a04c7bb418bf 100644 --- a/slideshow/source/engine/transitions/slidechangebase.cxx +++ b/slideshow/source/engine/transitions/slidechangebase.cxx @@ -270,7 +270,7 @@ bool SlideChangeBase::operator()( double nValue ) // (i.e. pixel). ViewEntry& rViewEntry( maViewData[i] ); - const ::cppcanvas::CanvasSharedPtr& rCanvas( rViewEntry.mpView->getCanvas() ); + const ::cppcanvas::CanvasSharedPtr xCanvas( rViewEntry.mpView->getCanvas() ); ::cppcanvas::CustomSpriteSharedPtr& rInSprite( rViewEntry.mpInSprite ); ::cppcanvas::CustomSpriteSharedPtr& rOutSprite( rViewEntry.mpOutSprite ); @@ -331,9 +331,9 @@ bool SlideChangeBase::operator()( double nValue ) } if( rOutSprite ) - performOut( rOutSprite, rViewEntry, rCanvas, nValue ); + performOut( rOutSprite, rViewEntry, xCanvas, nValue ); if( rInSprite ) - performIn( rInSprite, rViewEntry, rCanvas, nValue ); + performIn( rInSprite, rViewEntry, xCanvas, nValue ); // finishing deeds for first run. if( !mbSpritesVisible) diff --git a/slideshow/source/inc/tools.hxx b/slideshow/source/inc/tools.hxx index fe8cc7d6911b..fd4e7bc13946 100644 --- a/slideshow/source/inc/tools.hxx +++ b/slideshow/source/inc/tools.hxx @@ -286,7 +286,7 @@ namespace slideshow OUString const & propName ) { try { - const css::uno::Any& a( + const css::uno::Any a( xPropSet->getPropertyValue( propName ) ); bool const bRet = css::uno::fromAny(a, &rValue); #if OSL_DEBUG_LEVEL > 0 @@ -314,7 +314,7 @@ namespace slideshow { try { - const css::uno::Any& a(xPropSet->getPropertyValue( propName )); + const css::uno::Any a(xPropSet->getPropertyValue( propName )); rIfc.set( a, css::uno::UNO_QUERY ); bool const bRet = rIfc.is();