diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2022-09-21 12:17:00 +0200 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2023-07-13 13:19:00 +0200 |
commit | f896bbcffeccd27248f908d2628d03dddf83ea94 (patch) | |
tree | ffbf0300461780c94e897cad2ad29906695ac91d /slideshow | |
parent | 6086d896183a529d4a0b83d4862970c8f320b0aa (diff) |
basegfx: replace typedef with a class B2ISize based on Size2D
Change-Id: Iaf7d02bb236f81a38a67a1430a718b6c3c78efae
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139708
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'slideshow')
-rw-r--r-- | slideshow/source/engine/slide/slideimpl.cxx | 11 | ||||
-rw-r--r-- | slideshow/source/engine/slideshowimpl.cxx | 5 | ||||
-rw-r--r-- | slideshow/source/engine/tools.cxx | 8 | ||||
-rw-r--r-- | slideshow/source/engine/transitions/combtransition.cxx | 4 | ||||
-rw-r--r-- | slideshow/source/engine/transitions/slidechangebase.cxx | 20 | ||||
-rw-r--r-- | slideshow/source/engine/transitions/slidetransitionfactory.cxx | 6 | ||||
-rw-r--r-- | slideshow/source/inc/tools.hxx | 2 |
7 files changed, 28 insertions, 28 deletions
diff --git a/slideshow/source/engine/slide/slideimpl.cxx b/slideshow/source/engine/slide/slideimpl.cxx index bf07e18acf60..57a76f752767 100644 --- a/slideshow/source/engine/slide/slideimpl.cxx +++ b/slideshow/source/engine/slide/slideimpl.cxx @@ -322,7 +322,7 @@ SlideImpl::SlideImpl( const uno::Reference< drawing::XDrawPage >& xDra xDrawPage)), mpSubsettableShapeManager( mpShapeManager ), mpBox2DWorld( std::make_shared<box2d::utils::box2DWorld>( - basegfx::B2DVector( getSlideSizeImpl() ) ) ), + basegfx::B2DVector(getSlideSizeImpl().getWidth(), getSlideSizeImpl().getHeight()) ) ), maContext( mpSubsettableShapeManager, rEventQueue, rEventMultiplexer, @@ -336,7 +336,7 @@ SlideImpl::SlideImpl( const uno::Reference< drawing::XDrawPage >& xDra mpBox2DWorld ), mrCursorManager( rCursorManager ), maAnimations( maContext, - basegfx::B2DVector( getSlideSizeImpl() ) ), + basegfx::B2DVector(getSlideSizeImpl().getWidth(), getSlideSizeImpl().getHeight()) ), maPolygons(std::move(rPolyPolygonVector)), maUserPaintColor(aUserPaintColor), mdUserPaintStrokeWidth(dUserPaintStrokeWidth), @@ -569,9 +569,8 @@ SlideBitmapSharedPtr SlideImpl::getCurrentSlideBitmap( const UnoViewSharedPtr& r } SlideBitmapSharedPtr& rBitmap( aIter->second.at( meAnimationState )); - const ::basegfx::B2ISize& rSlideSize( - getSlideSizePixel( ::basegfx::B2DVector( getSlideSize() ), - rView )); + auto aSize = getSlideSizePixel(basegfx::B2DVector(getSlideSize().getWidth(), getSlideSize().getHeight()), rView); + const basegfx::B2ISize rSlideSize(aSize.getX(), aSize.getY()); // is the bitmap valid (actually existent, and of correct // size)? @@ -920,7 +919,7 @@ void SlideImpl::applyShapeAttributes( extractValue( bVisible, rShapeProp.Value, pShape, - basegfx::B2DVector(getSlideSize()) )) + basegfx::B2DVector(getSlideSize().getWidth(), getSlideSize().getHeight()) )) { pAttrShape->setVisibility( bVisible ); } diff --git a/slideshow/source/engine/slideshowimpl.cxx b/slideshow/source/engine/slideshowimpl.cxx index 473791bb620f..f02647097ea8 100644 --- a/slideshow/source/engine/slideshowimpl.cxx +++ b/slideshow/source/engine/slideshowimpl.cxx @@ -881,7 +881,7 @@ ActivitySharedPtr SlideShowImpl::createSlideTransition( 0.0, 0.0, ShapeSharedPtr(), - basegfx::B2DVector( rEnteringSlide->getSlideSize() ) ), + basegfx::B2DVector(rEnteringSlide->getSlideSize().getWidth(), rEnteringSlide->getSlideSize().getHeight()) ), pTransition, true )); } @@ -1360,8 +1360,7 @@ sal_Bool SlideShowImpl::addView( { // set view transformation const basegfx::B2ISize slideSize = mpCurrentSlide->getSlideSize(); - pView->setViewSize( basegfx::B2DSize( slideSize.getX(), - slideSize.getY() ) ); + pView->setViewSize( basegfx::B2DSize(slideSize) ); } // clear view area (since it's newly added, diff --git a/slideshow/source/engine/tools.cxx b/slideshow/source/engine/tools.cxx index de7030f80778..13cf471a985c 100644 --- a/slideshow/source/engine/tools.cxx +++ b/slideshow/source/engine/tools.cxx @@ -686,8 +686,8 @@ namespace slideshow::internal // line will show to the bottom and the right. fillRect( pCanvas, ::basegfx::B2DRectangle( 0.0, 0.0, - rSize.getX(), - rSize.getY() ), + rSize.getWidth(), + rSize.getHeight() ), 0x000000FFU ); // tdf#148884 in dark mode impress's auto text color assumes it will render against @@ -710,8 +710,8 @@ namespace slideshow::internal // thus revealing ugly white pixel to the right and the bottom. fillRect( pCanvas, ::basegfx::B2DRectangle( 0.0, 0.0, - rSize.getX()-1, - rSize.getY()-1 ), + rSize.getWidth()-1, + rSize.getHeight()-1 ), nCanvasColor ); } diff --git a/slideshow/source/engine/transitions/combtransition.cxx b/slideshow/source/engine/transitions/combtransition.cxx index b79046542000..88e5c167e4a0 100644 --- a/slideshow/source/engine/transitions/combtransition.cxx +++ b/slideshow/source/engine/transitions/combtransition.cxx @@ -110,8 +110,8 @@ void CombTransition::renderComb( double t, // TODO(Q2): Use basegfx bitmaps here // TODO(F1): SlideBitmap is not fully portable between different canvases! - const basegfx::B2DVector enteringSizePixel( - getEnteringSlideSizePixel( rViewEntry.mpView) ); + auto aSlideSizePixel = getEnteringSlideSizePixel(rViewEntry.mpView); + const basegfx::B2DVector enteringSizePixel(aSlideSizePixel.getWidth(), aSlideSizePixel.getHeight()); const basegfx::B2DVector aPushDirection( enteringSizePixel * maPushDirectionUnit ); diff --git a/slideshow/source/engine/transitions/slidechangebase.cxx b/slideshow/source/engine/transitions/slidechangebase.cxx index 6c8a0ec9eef4..03534822f140 100644 --- a/slideshow/source/engine/transitions/slidechangebase.cxx +++ b/slideshow/source/engine/transitions/slidechangebase.cxx @@ -92,9 +92,9 @@ SlideBitmapSharedPtr SlideChangeBase::createBitmap( const UnoViewSharedPtr& // sprite to black. // create empty, black-filled bitmap - const basegfx::B2ISize slideSizePixel( - getSlideSizePixel( basegfx::B2DVector( mpEnteringSlide->getSlideSize() ), - rView )); + auto aSlideSize = mpEnteringSlide->getSlideSize(); + auto aVector = getSlideSizePixel(basegfx::B2DVector(aSlideSize.getWidth(), aSlideSize.getHeight()), rView); + const basegfx::B2ISize slideSizePixel(aVector.getX(), aVector.getY()); cppcanvas::CanvasSharedPtr pCanvas( rView->getCanvas() ); @@ -121,8 +121,8 @@ SlideBitmapSharedPtr SlideChangeBase::createBitmap( const UnoViewSharedPtr& // clear bitmap to black fillRect( pBitmapCanvas, ::basegfx::B2DRectangle( 0.0, 0.0, - slideSizePixel.getX(), - slideSizePixel.getY() ), + slideSizePixel.getWidth(), + slideSizePixel.getHeight() ), 0x000000FFU ); pRet = std::make_shared<SlideBitmap>( pBitmap ); @@ -137,8 +137,9 @@ SlideBitmapSharedPtr SlideChangeBase::createBitmap( const UnoViewSharedPtr& ::basegfx::B2ISize SlideChangeBase::getEnteringSlideSizePixel( const UnoViewSharedPtr& pView ) const { - return getSlideSizePixel( basegfx::B2DVector(mpEnteringSlide->getSlideSize().getX(), mpEnteringSlide->getSlideSize().getY()), - pView ); + auto aSlideSize = mpEnteringSlide->getSlideSize(); + auto aSlideSizePixel = getSlideSizePixel( basegfx::B2DVector(aSlideSize.getWidth(), aSlideSize.getHeight()), pView); + return {aSlideSizePixel.getX(), aSlideSizePixel.getY() }; } void SlideChangeBase::renderBitmap( @@ -486,9 +487,8 @@ void SlideChangeBase::addSprites( ViewEntry& rEntry ) if( mbCreateEnteringSprites ) { // create entering sprite: - const basegfx::B2ISize enteringSlideSizePixel( - getSlideSizePixel( basegfx::B2DVector( mpEnteringSlide->getSlideSize() ), - rEntry.mpView )); + auto aSlideSizePixel = getSlideSizePixel(basegfx::B2DVector(mpEnteringSlide->getSlideSize().getWidth(), mpEnteringSlide->getSlideSize().getHeight()), rEntry.mpView); + const basegfx::B2ISize enteringSlideSizePixel(aSlideSizePixel.getX(), aSlideSizePixel.getY()); rEntry.mpInSprite = createSprite( rEntry.mpView, basegfx::B2DSize( enteringSlideSizePixel ), diff --git a/slideshow/source/engine/transitions/slidetransitionfactory.cxx b/slideshow/source/engine/transitions/slidetransitionfactory.cxx index fcee18e262c3..f183fc6d818a 100644 --- a/slideshow/source/engine/transitions/slidetransitionfactory.cxx +++ b/slideshow/source/engine/transitions/slidetransitionfactory.cxx @@ -616,10 +616,11 @@ void MovingSlideChange::performIn( aViewTransform * basegfx::B2DPoint() ); // move sprite + auto aSlideSizePixel = getEnteringSlideSizePixel(rViewEntry.mpView); rSprite->movePixel( aPageOrigin + ((t - 1.0) * - basegfx::B2DVector( getEnteringSlideSizePixel(rViewEntry.mpView) ) * + basegfx::B2DVector( aSlideSizePixel.getWidth(), aSlideSizePixel.getHeight()) * maEnteringDirection) ); } @@ -648,9 +649,10 @@ void MovingSlideChange::performOut( aViewTransform * basegfx::B2DPoint() ); // move sprite + auto aSlideSizePixel = getEnteringSlideSizePixel(rViewEntry.mpView); rSprite->movePixel( aPageOrigin + (t * - basegfx::B2DVector( getEnteringSlideSizePixel(rViewEntry.mpView) ) * + basegfx::B2DVector(aSlideSizePixel.getWidth(), aSlideSizePixel.getHeight()) * maLeavingDirection) ); } diff --git a/slideshow/source/inc/tools.hxx b/slideshow/source/inc/tools.hxx index edfefe246fe4..b3081d9fff37 100644 --- a/slideshow/source/inc/tools.hxx +++ b/slideshow/source/inc/tools.hxx @@ -45,7 +45,7 @@ namespace basegfx class B2DVector; class B2IVector; class B2DHomMatrix; - typedef B2IVector B2ISize; + class B2ISize; } namespace cppcanvas{ class Canvas; } |