core.git: basegfx/source
basegfx/source/curve/b2dcubicbezier.cxx | 26 ++ 1 file changed, 14 insertions(+), 12 deletions(-) New commits: commit c0adf5a90a51f500d633aad9786015f187531d31 Author: HakimOttey AuthorDate: Mon May 20 15:25:20 2024 -0400 Commit: Mike Kaganski CommitDate: Thu Jun 13 15:58:40 2024 +0200 Related: tdf#147906 Rename fQuadDist to pointDistance after commit 9dad7c0f1095e85ad40ad874215f1051137b0347 Author: HakimOttey Date: Mon May 6 12:44:29 2024 -0400 tdf#147906 implement hypot function for s1 x s1 + s2 x s2 statements where the names were kept, but became confusing. Change-Id: If2bfa4b5fc1dd04bb4f1026b6f89e3c97a43caf8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167850 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/basegfx/source/curve/b2dcubicbezier.cxx b/basegfx/source/curve/b2dcubicbezier.cxx index 31801db53559..788c63b828c1 100644 --- a/basegfx/source/curve/b2dcubicbezier.cxx +++ b/basegfx/source/curve/b2dcubicbezier.cxx @@ -22,7 +22,9 @@ #include #include #include + #include + #include #include @@ -644,17 +646,17 @@ namespace basegfx // now look for the closest point const sal_uInt32 nPointCount(aInitialPolygon.count()); B2DVector aVector(rTestPoint - aInitialPolygon.getB2DPoint(0)); -double fQuadDist(std::hypot(aVector.getX(), aVector.getY())); -double fNewQuadDist; +double pointDistance(std::hypot(aVector.getX(), aVector.getY())); +double newPointDistance; sal_uInt32 nSmallestIndex(0); for(sal_uInt32 a(1); a < nPointCount; a++) { aVector = B2DVector(rTestPoint - aInitialPolygon.getB2DPoint(a)); -fNewQuadDist = std::hypot(aVector.getX(), aVector.getY()); -if(fNewQuadDist < fQuadDist) +newPointDistance = std::hypot(aVector.getX(), aVector.getY()); +if(newPointDistance < pointDistance) { -fQuadDist = fNewQuadDist; +pointDistance = newPointDistance; nSmallestIndex = a; } } @@ -678,11 +680,11 @@ namespace basegfx aVector = B2DVector(rTestPoint - interpolatePoint(fPosLeft)); } -fNewQuadDist = std::hypot(aVector.getX(), aVector.getY()); +newPointDistance = std::hypot(aVector.getX(), aVector.getY()); -if(fTools::less(fNewQuadDist, fQuadDist)) +if(fTools::less(newPointDistance, pointDistance)) { -fQuadDist = fNewQuadDist; +pointDistance = newPointDistance; fPosition = fPosLeft; } else @@ -700,11 +702,11 @@ namespace basegfx aVector = B2DVector(rTestPoint - interpolatePoint(fPosRight)); } -fNewQuadDist = std::hypot(aVector.getX(), aVector.getY()); +newPointDistance = std::hypot(aVector.getX(), aVector.getY()); -if(fTools::less(fNewQuadDist, fQuadDist)) +if(fTools::less(newPointDistance, pointDistance)) { -fQuadDist = fNewQuadDist; +pointDistance = newPointDistance; fPosition = fPosRight; } else @@ -725,7 +727,7 @@ namespace basegfx } rCut = fPosition; -return fQuadDist; +return pointDistance; } void B2DCubicBezier::split(double t, B2DCubicBezier* pBezierA, B2DCubicBezier* pBezierB) const
core.git: basegfx/source
basegfx/source/curve/b2dcubicbezier.cxx | 14 ++ 1 file changed, 6 insertions(+), 8 deletions(-) New commits: commit 9dad7c0f1095e85ad40ad874215f1051137b0347 Author: HakimOttey AuthorDate: Mon May 6 12:44:29 2024 -0400 Commit: Ilmari Lauhakangas CommitDate: Mon May 20 08:20:40 2024 +0200 tdf#147906 implement hypot function for s1 x s1 + s2 x s2 statements Change-Id: I50a2f4cf7738ee3797723929fb6840d2633c882c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166814 Tested-by: Ilmari Lauhakangas Tested-by: Jenkins Reviewed-by: Ilmari Lauhakangas diff --git a/basegfx/source/curve/b2dcubicbezier.cxx b/basegfx/source/curve/b2dcubicbezier.cxx index 3f5d87aa79f6..31801db53559 100644 --- a/basegfx/source/curve/b2dcubicbezier.cxx +++ b/basegfx/source/curve/b2dcubicbezier.cxx @@ -22,9 +22,8 @@ #include #include #include - #include - +#include #include // #i37443# @@ -645,15 +644,14 @@ namespace basegfx // now look for the closest point const sal_uInt32 nPointCount(aInitialPolygon.count()); B2DVector aVector(rTestPoint - aInitialPolygon.getB2DPoint(0)); -double fQuadDist(aVector.getX() * aVector.getX() + aVector.getY() * aVector.getY()); +double fQuadDist(std::hypot(aVector.getX(), aVector.getY())); double fNewQuadDist; sal_uInt32 nSmallestIndex(0); for(sal_uInt32 a(1); a < nPointCount; a++) { aVector = B2DVector(rTestPoint - aInitialPolygon.getB2DPoint(a)); -fNewQuadDist = aVector.getX() * aVector.getX() + aVector.getY() * aVector.getY(); - +fNewQuadDist = std::hypot(aVector.getX(), aVector.getY()); if(fNewQuadDist < fQuadDist) { fQuadDist = fNewQuadDist; @@ -680,7 +678,7 @@ namespace basegfx aVector = B2DVector(rTestPoint - interpolatePoint(fPosLeft)); } -fNewQuadDist = aVector.getX() * aVector.getX() + aVector.getY() * aVector.getY(); +fNewQuadDist = std::hypot(aVector.getX(), aVector.getY()); if(fTools::less(fNewQuadDist, fQuadDist)) { @@ -702,7 +700,7 @@ namespace basegfx aVector = B2DVector(rTestPoint - interpolatePoint(fPosRight)); } -fNewQuadDist = aVector.getX() * aVector.getX() + aVector.getY() * aVector.getY(); +fNewQuadDist = std::hypot(aVector.getX(), aVector.getY()); if(fTools::less(fNewQuadDist, fQuadDist)) { @@ -727,7 +725,7 @@ namespace basegfx } rCut = fPosition; -return sqrt(fQuadDist); +return fQuadDist; } void B2DCubicBezier::split(double t, B2DCubicBezier* pBezierA, B2DCubicBezier* pBezierB) const
core.git: accessibility/source
accessibility/source/extended/accessibletabbar.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit ad3f86880bd6f5a0800a2820177715dc88c13a3c Author: HakimOttey AuthorDate: Wed May 1 17:45:38 2024 -0400 Commit: Michael Weghorn CommitDate: Mon May 20 07:47:44 2024 +0200 Change for loop to have getAccessibleChildCount in accessibletabbar Change-Id: Ic020b1cd36abe2c568a119dfd400c718dc9de452 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166989 Tested-by: Jenkins Reviewed-by: Michael Weghorn diff --git a/accessibility/source/extended/accessibletabbar.cxx b/accessibility/source/extended/accessibletabbar.cxx index 711d2a7b8c5c..beae5dd61331 100644 --- a/accessibility/source/extended/accessibletabbar.cxx +++ b/accessibility/source/extended/accessibletabbar.cxx @@ -358,7 +358,7 @@ namespace accessibility OExternalLockGuard aGuard( this ); Reference< XAccessible > xChild; -for ( size_t i = 0; i < m_aAccessibleChildren.size(); ++i ) +for( sal_Int64 i = 0; i < getAccessibleChildCount(); ++i ) { Reference< XAccessible > xAcc = getAccessibleChild( i ); if ( xAcc.is() )
core.git: vcl/inc
vcl/inc/textlineinfo.hxx |5 + 1 file changed, 1 insertion(+), 4 deletions(-) New commits: commit 7d38bdbf96c42d367dfa2cc7e2916c814aa08de2 Author: HakimOttey AuthorDate: Fri Apr 12 20:35:25 2024 -0400 Commit: Ilmari Lauhakangas CommitDate: Sat Apr 13 20:40:02 2024 +0200 tdf#143148 replace includes guards in vcl textlineinfo with pragma Change-Id: I733263074a5c4911499a6b5becfbbc87cbda968d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166044 Tested-by: Ilmari Lauhakangas Reviewed-by: Ilmari Lauhakangas diff --git a/vcl/inc/textlineinfo.hxx b/vcl/inc/textlineinfo.hxx index 0d5f4428920d..e2726e0a836b 100644 --- a/vcl/inc/textlineinfo.hxx +++ b/vcl/inc/textlineinfo.hxx @@ -17,8 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_VCL_INC_TEXTLINEINFO_HXX -#define INCLUDED_VCL_INC_TEXTLINEINFO_HXX +#pragma once #include @@ -69,6 +68,4 @@ private: }; -#endif // INCLUDED_VCL_INC_TEXTLINEINFO_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */