diff options
author | Armin Le Grand <Armin.Le.Grand@Sun.COM> | 2009-09-22 18:14:05 +0200 |
---|---|---|
committer | Armin Le Grand <Armin.Le.Grand@Sun.COM> | 2009-09-22 18:14:05 +0200 |
commit | 602841adb34579bcc9bb1ae3ec961753b8bd97f9 (patch) | |
tree | 8c920836e05f5abdc5ff02071032004db168b766 /sd | |
parent | 5cd6a50c1e2783b21340b7d6ee89e4e42221ffe7 (diff) |
#i97509# continued matrix tooling and adapting the usages now to all the ooo code
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/core/CustomAnimationEffect.cxx | 19 | ||||
-rw-r--r-- | sd/source/ui/animations/motionpathtag.cxx | 8 | ||||
-rw-r--r-- | sd/source/ui/func/fumorph.cxx | 16 | ||||
-rw-r--r-- | sd/source/ui/slideshow/slideshowviewimpl.cxx | 12 | ||||
-rw-r--r-- | sd/source/ui/slidesorter/view/SlsViewOverlay.cxx | 5 | ||||
-rw-r--r-- | sd/source/ui/view/PrintManager.cxx | 7 | ||||
-rw-r--r-- | sd/source/ui/view/sdview.cxx | 10 |
7 files changed, 33 insertions, 44 deletions
diff --git a/sd/source/core/CustomAnimationEffect.cxx b/sd/source/core/CustomAnimationEffect.cxx index 23a04bf9d5ee..040bc7c0a78c 100644 --- a/sd/source/core/CustomAnimationEffect.cxx +++ b/sd/source/core/CustomAnimationEffect.cxx @@ -69,6 +69,7 @@ #include <basegfx/polygon/b2dpolypolygontools.hxx> #include <basegfx/matrix/b2dhommatrix.hxx> #include <basegfx/range/b2drange.hxx> +#include <basegfx/matrix/b2dhommatrixtools.hxx> #include <algorithm> @@ -1715,21 +1716,16 @@ void CustomAnimationEffect::updateSdrPathObjFromPath( SdrPathObj& rPathObj ) SdrObject* pObj = GetSdrObjectFromXShape( getTargetShape() ); if( pObj ) { - ::basegfx::B2DHomMatrix aTransform; - SdrPage* pPage = pObj->GetPage(); if( pPage ) { const Size aPageSize( pPage->GetSize() ); - aTransform.scale( (double)aPageSize.Width(), (double)aPageSize.Height() ); - xPolyPoly.transform( aTransform ); - aTransform.identity(); + xPolyPoly.transform(basegfx::tools::createScaleB2DHomMatrix((double)aPageSize.Width(), (double)aPageSize.Height())); } const Rectangle aBoundRect( pObj->GetCurrentBoundRect() ); const Point aCenter( aBoundRect.Center() ); - aTransform.translate( aCenter.X(), aCenter.Y() ); - xPolyPoly.transform( aTransform ); + xPolyPoly.transform(basegfx::tools::createTranslateB2DHomMatrix(aCenter.X(), aCenter.Y())); } } @@ -1748,17 +1744,14 @@ void CustomAnimationEffect::updatePathFromSdrPathObj( const SdrPathObj& rPathObj const Rectangle aBoundRect( pObj->GetCurrentBoundRect() ); const Point aCenter( aBoundRect.Center() ); - ::basegfx::B2DHomMatrix aTransform; - aTransform.translate( -aCenter.X(), -aCenter.Y() ); - xPolyPoly.transform( aTransform ); + xPolyPoly.transform(basegfx::tools::createTranslateB2DHomMatrix(-aCenter.X(), -aCenter.Y())); SdrPage* pPage = pObj->GetPage(); if( pPage ) { - aTransform.identity(); const Size aPageSize( pPage->GetSize() ); - aTransform.scale( 1.0 / (double)aPageSize.Width(), 1.0 / (double)aPageSize.Height() ); - xPolyPoly.transform( aTransform ); + xPolyPoly.transform(basegfx::tools::createScaleB2DHomMatrix( + 1.0 / (double)aPageSize.Width(), 1.0 / (double)aPageSize.Height())); } } diff --git a/sd/source/ui/animations/motionpathtag.cxx b/sd/source/ui/animations/motionpathtag.cxx index 887c6014f29c..4fc0ec0dc80e 100644 --- a/sd/source/ui/animations/motionpathtag.cxx +++ b/sd/source/ui/animations/motionpathtag.cxx @@ -36,6 +36,7 @@ #include <basegfx/matrix/b2dhommatrix.hxx> #include <basegfx/polygon/b2dpolygontools.hxx> +#include <basegfx/matrix/b2dhommatrixtools.hxx> #include <sfx2/viewfrm.hxx> #include <sfx2/dispatch.hxx> @@ -196,9 +197,8 @@ bool PathDragResize::EndSdrDrag(bool /*bCopy*/) SdrPathObj* pPathObj = mxTag->getPathObj(); if( pPathObj ) { - basegfx::B2DHomMatrix aTrans; const Point aRef( DragStat().Ref1() ); - aTrans.translate(-aRef.X(), -aRef.Y()); + basegfx::B2DHomMatrix aTrans(basegfx::tools::createTranslateB2DHomMatrix(-aRef.X(), -aRef.Y())); aTrans.scale(double(aXFact), double(aYFact)); aTrans.translate(aRef.X(), aRef.Y()); basegfx::B2DPolyPolygon aDragPoly(pPathObj->GetPathPoly()); @@ -966,8 +966,8 @@ void MotionPathTag::addCustomHandles( SdrHdlList& rHandlerList ) ::com::sun::star::awt::Point aPos( mxOrigin->getPosition() ); if( (aPos.X != maOriginPos.X) || (aPos.Y != maOriginPos.Y) ) { - ::basegfx::B2DHomMatrix aTransform; - aTransform.translate( aPos.X - maOriginPos.X, aPos.Y - maOriginPos.Y ); + const basegfx::B2DHomMatrix aTransform(basegfx::tools::createTranslateB2DHomMatrix( + aPos.X - maOriginPos.X, aPos.Y - maOriginPos.Y)); mxPolyPoly.transform( aTransform ); mpPathObj->SetPathPoly( mxPolyPoly ); maOriginPos = aPos; diff --git a/sd/source/ui/func/fumorph.cxx b/sd/source/ui/func/fumorph.cxx index 83851db28cae..db1dc120e478 100644 --- a/sd/source/ui/func/fumorph.cxx +++ b/sd/source/ui/func/fumorph.cxx @@ -42,13 +42,13 @@ #include <svx/svdogrp.hxx> #include <svx/eeitem.hxx> - #include "View.hxx" #include "ViewShell.hxx" #include "Window.hxx" #include <basegfx/polygon/b2dpolygontools.hxx> #include <basegfx/polygon/b2dpolypolygontools.hxx> #include <basegfx/matrix/b2dhommatrix.hxx> +#include <basegfx/matrix/b2dhommatrixtools.hxx> #include "strings.hrc" #include "sdresid.hxx" @@ -264,9 +264,8 @@ void FuMorph::ImpEqualizePolyPointCount(::basegfx::B2DPolygon& rSmall, const ::b const ::basegfx::B2DPoint aSrcPos(aSrcSize.getCenter()); const ::basegfx::B2DRange aDstSize(::basegfx::tools::getRange(rSmall)); const ::basegfx::B2DPoint aDstPos(aDstSize.getCenter()); - ::basegfx::B2DHomMatrix aTrans; - aTrans.translate(-aSrcPos.getX(), -aSrcPos.getY()); + basegfx::B2DHomMatrix aTrans(basegfx::tools::createTranslateB2DHomMatrix(-aSrcPos.getX(), -aSrcPos.getY())); aTrans.scale(aDstSize.getWidth() / aSrcSize.getWidth(), aDstSize.getHeight() / aSrcSize.getHeight()); aTrans.translate(aDstPos.getX(), aDstPos.getY()); @@ -499,16 +498,15 @@ sal_Bool FuMorph::ImpMorphPolygons( for(sal_uInt16 i(0); i < nSteps; i++) { fValue += fFactor; - ::basegfx::B2DPolyPolygon* pNewPolyPoly3D = ImpCreateMorphedPolygon(rPolyPoly1, rPolyPoly2, fValue); + ::basegfx::B2DPolyPolygon* pNewPolyPoly2D = ImpCreateMorphedPolygon(rPolyPoly1, rPolyPoly2, fValue); - const ::basegfx::B2DRange aNewPolySize(::basegfx::tools::getRange(*pNewPolyPoly3D)); + const ::basegfx::B2DRange aNewPolySize(::basegfx::tools::getRange(*pNewPolyPoly2D)); const ::basegfx::B2DPoint aNewS(aNewPolySize.getCenter()); const ::basegfx::B2DPoint aRealS(aStartCenter + (aDelta * fValue)); - ::basegfx::B2DHomMatrix aTrans; const ::basegfx::B2DPoint aDiff(aRealS - aNewS); - aTrans.translate(aDiff.getX(), aDiff.getY()); - pNewPolyPoly3D->transform(aTrans); - rPolyPolyList3D.Insert(pNewPolyPoly3D, LIST_APPEND); + + pNewPolyPoly2D->transform(basegfx::tools::createTranslateB2DHomMatrix(aDiff)); + rPolyPolyList3D.Insert(pNewPolyPoly2D, LIST_APPEND); } } return TRUE; diff --git a/sd/source/ui/slideshow/slideshowviewimpl.cxx b/sd/source/ui/slideshow/slideshowviewimpl.cxx index f4de77f03394..69190f68a0aa 100644 --- a/sd/source/ui/slideshow/slideshowviewimpl.cxx +++ b/sd/source/ui/slideshow/slideshowviewimpl.cxx @@ -38,6 +38,8 @@ #include <basegfx/polygon/b2dpolygon.hxx> #include <basegfx/polygon/b2dpolygontools.hxx> +#include <basegfx/matrix/b2dhommatrixtools.hxx> + #include <cppcanvas/vclfactory.hxx> #include <cppcanvas/basegfxfactory.hxx> @@ -384,16 +386,12 @@ geometry::AffineMatrix2D SAL_CALL SlideShowView::getTransformation( ) throw (Ru Point aOutputOffset( ( aWindowSize.Width() - aOutputSize.Width() ) >> 1, ( aWindowSize.Height() - aOutputSize.Height() ) >> 1 ); - ::basegfx::B2DHomMatrix aMatrix; - maPresentationArea = Rectangle( aOutputOffset, aOutputSize ); mrOutputWindow.SetPresentationArea( maPresentationArea ); - // scale presentation into available window rect (minus 10%) - aMatrix.scale( aOutputSize.Width(), aOutputSize.Height() ); - - // center in the window - aMatrix.translate( aOutputOffset.X(), aOutputOffset.Y() ); + // scale presentation into available window rect (minus 10%); center in the window + const basegfx::B2DHomMatrix aMatrix(basegfx::tools::createScaleTranslateB2DHomMatrix( + aOutputSize.Width(), aOutputSize.Height(), aOutputOffset.X(), aOutputOffset.Y())); geometry::AffineMatrix2D aRes; diff --git a/sd/source/ui/slidesorter/view/SlsViewOverlay.cxx b/sd/source/ui/slidesorter/view/SlsViewOverlay.cxx index 5e338480e236..7d9887d9b8b1 100644 --- a/sd/source/ui/slidesorter/view/SlsViewOverlay.cxx +++ b/sd/source/ui/slidesorter/view/SlsViewOverlay.cxx @@ -55,6 +55,8 @@ #include <basegfx/polygon/b2dpolygon.hxx> #include <basegfx/polygon/b2dpolygontools.hxx> #include <basegfx/polygon/b2dpolypolygontools.hxx> +#include <basegfx/matrix/b2dhommatrixtools.hxx> + #include <svx/sdr/overlay/overlaymanager.hxx> #include <svx/svdpagv.hxx> #include <svx/sdrpagewindow.hxx> @@ -245,8 +247,7 @@ void SubstitutionOverlay::Clear (void) void SubstitutionOverlay::Move (const Point& rOffset) { - basegfx::B2DHomMatrix aTranslation; - aTranslation.translate(rOffset.X(), rOffset.Y()); + const basegfx::B2DHomMatrix aTranslation(basegfx::tools::createTranslateB2DHomMatrix(rOffset.X(), rOffset.Y())); maShapes.transform(aTranslation); maPosition += rOffset; diff --git a/sd/source/ui/view/PrintManager.cxx b/sd/source/ui/view/PrintManager.cxx index 34e3c780d14e..667ef7419cbc 100644 --- a/sd/source/ui/view/PrintManager.cxx +++ b/sd/source/ui/view/PrintManager.cxx @@ -34,6 +34,7 @@ #include <basegfx/polygon/b2dpolygon.hxx> #include <basegfx/polygon/b2dpolypolygon.hxx> #include <basegfx/matrix/b2dhommatrix.hxx> +#include <basegfx/matrix/b2dhommatrixtools.hxx> #include "PrintManager.hxx" @@ -1775,10 +1776,10 @@ void PrintManager::InitHandoutTemplate( PrintInfo& /*rInfo*/, USHORT nSlidesPerH aPoly.insert(0, basegfx::B2DPoint( aRect.Left(), aRect.Top() ) ); aPoly.insert(1, basegfx::B2DPoint( aRect.Right(), aRect.Top() ) ); - basegfx::B2DHomMatrix aMatrix; - aMatrix.translate( 0.0, static_cast< double >( aRect.GetHeight() / 7 ) ); - + const basegfx::B2DHomMatrix aMatrix(basegfx::tools::createTranslateB2DHomMatrix( + 0.0, static_cast< double >( aRect.GetHeight() / 7 ))); basegfx::B2DPolyPolygon aPathPoly; + for( sal_uInt16 nLine = 0; nLine < 7; nLine++ ) { aPoly.transform( aMatrix ); diff --git a/sd/source/ui/view/sdview.cxx b/sd/source/ui/view/sdview.cxx index 9a63afc03479..a387e7b6450d 100644 --- a/sd/source/ui/view/sdview.cxx +++ b/sd/source/ui/view/sdview.cxx @@ -99,6 +99,7 @@ #include <basegfx/matrix/b2dhommatrix.hxx> #include <drawinglayer/primitive2d/textprimitive2d.hxx> #include <svx/unoapi.hxx> +#include <basegfx/matrix/b2dhommatrixtools.hxx> #include <numeric> @@ -454,12 +455,9 @@ drawinglayer::primitive2d::Primitive2DSequence ViewRedirector::createRedirectedP false)); // fill text matrix - basegfx::B2DHomMatrix aTextMatrix; - - aTextMatrix.scale(aSize.getX(), aSize.getY()); - aTextMatrix.shearX(fShearX); - aTextMatrix.rotate(fRotate); - aTextMatrix.translate(fPosX, fPosY); + const basegfx::B2DHomMatrix aTextMatrix(basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix( + aSize.getX(), aSize.getY(), + fShearX, fRotate, fPosX, fPosY)); // create DXTextArray (can be empty one) const ::std::vector< double > aDXArray; |