basegfx/source/polygon/b2dlinegeometry.cxx | 6 - drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx | 46 ++++++------- include/basegfx/polygon/b2dlinegeometry.hxx | 5 - sw/source/filter/ww8/ww8par3.cxx | 2 xmloff/source/draw/ximpcustomshape.cxx | 2 5 files changed, 26 insertions(+), 35 deletions(-)
New commits: commit dc584b4dd8de75bdacdd6d78e055332a547f12cd Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Tue Aug 19 16:04:42 2025 +0100 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Wed Aug 20 09:25:44 2025 +0200 always pass fCandidateLength in at the boundary Change-Id: Idcddf4e576bb74f241c532fbf66b8772f3cd1c6f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189932 Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> Tested-by: Jenkins diff --git a/basegfx/source/polygon/b2dlinegeometry.cxx b/basegfx/source/polygon/b2dlinegeometry.cxx index 62207702af63..e6189e240eb8 100644 --- a/basegfx/source/polygon/b2dlinegeometry.cxx +++ b/basegfx/source/polygon/b2dlinegeometry.cxx @@ -88,12 +88,6 @@ namespace basegfx::utils // move arrow to have docking position centered aArrowTransform.translate(0.0, -fArrowYLength * fDockingPosition + fShift); - // prepare polygon length - if(fTools::equalZero(fCandidateLength)) - { - fCandidateLength = getLength(rCandidate); - } - // get the polygon vector we want to plant this arrow on const double fConsumedLength(fArrowYLength * (1.0 - fDockingPosition) - fShift); const B2DVector aHead(rCandidate.getB2DPoint(bStart ? 0 : rCandidate.count() - 1)); diff --git a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx index 89a4aa5d74a6..56baa0c58453 100644 --- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx +++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx @@ -360,36 +360,34 @@ std::unique_ptr<SvtGraphicStroke> VclMetafileProcessor2D::impTryToCreateSvtGraph if (!aLocalPolygon.isClosed()) { - double fPolyLength(0.0); - double fStart(0.0); - double fEnd(0.0); - - if (pStart && pStart->isActive()) + const bool bCalcStart = pStart && pStart->isActive(); + const bool bCalcEnd = pEnd && pEnd->isActive(); + if (bCalcStart || bCalcEnd) { - fPolyLength = basegfx::utils::getLength(aLocalPolygon); - - aStartArrow = basegfx::utils::createAreaGeometryForLineStartEnd( - aLocalPolygon, pStart->getB2DPolyPolygon(), true, pStart->getWidth(), - fPolyLength, pStart->isCentered() ? 0.5 : 0.0, &fStart); - } + double fPolyLength = basegfx::utils::getLength(aLocalPolygon); + double fStart(0.0); + double fEnd(0.0); - if (pEnd && pEnd->isActive()) - { - if (basegfx::fTools::equalZero(fPolyLength)) + if (bCalcStart) { - fPolyLength = basegfx::utils::getLength(aLocalPolygon); + aStartArrow = basegfx::utils::createAreaGeometryForLineStartEnd( + aLocalPolygon, pStart->getB2DPolyPolygon(), true, pStart->getWidth(), + fPolyLength, pStart->isCentered() ? 0.5 : 0.0, &fStart); } - aEndArrow = basegfx::utils::createAreaGeometryForLineStartEnd( - aLocalPolygon, pEnd->getB2DPolyPolygon(), false, pEnd->getWidth(), fPolyLength, - pEnd->isCentered() ? 0.5 : 0.0, &fEnd); - } + if (bCalcEnd) + { + aEndArrow = basegfx::utils::createAreaGeometryForLineStartEnd( + aLocalPolygon, pEnd->getB2DPolyPolygon(), false, pEnd->getWidth(), + fPolyLength, pEnd->isCentered() ? 0.5 : 0.0, &fEnd); + } - if (0.0 != fStart || 0.0 != fEnd) - { - // build new poly, consume something from old poly - aLocalPolygon = basegfx::utils::getSnippetAbsolute(aLocalPolygon, fStart, - fPolyLength - fEnd, fPolyLength); + if (0.0 != fStart || 0.0 != fEnd) + { + // build new poly, consume something from old poly + aLocalPolygon = basegfx::utils::getSnippetAbsolute( + aLocalPolygon, fStart, fPolyLength - fEnd, fPolyLength); + } } } diff --git a/include/basegfx/polygon/b2dlinegeometry.hxx b/include/basegfx/polygon/b2dlinegeometry.hxx index ab9e54652c22..e9cb13ef0781 100644 --- a/include/basegfx/polygon/b2dlinegeometry.hxx +++ b/include/basegfx/polygon/b2dlinegeometry.hxx @@ -54,8 +54,7 @@ namespace basegfx::utils @param fCandidateLength This should contain the length of rCandidate to allow work without - again calculating the length (which may be expensive with beziers). If 0.0 is - given, the length is calculated on demand. + again calculating the length (which may be expensive with beziers). @param fShift When it is necessary to count with the thickness of the line, it @@ -69,7 +68,7 @@ namespace basegfx::utils const B2DPolyPolygon& rArrow, bool bStart, double fWidth, - double fCandidateLength, // 0.0 -> calculate self + double fCandidateLength, double fDockingPosition, // 0->top, 1->bottom double* pConsumedLength = nullptr, double fShift = 0.0); commit 910dcef906f1331d83d08dc025d79ab6e9e1add8 Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Tue Aug 19 15:53:08 2025 +0100 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Wed Aug 20 09:25:34 2025 +0200 cid#1664876 silence Overflowed integer argument and cid#1664874 Overflowed integer argument Change-Id: I7b1000f0032bd70f53e09de44815f13f55489a53 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189931 Tested-by: Caolán McNamara <caolan.mcnam...@collabora.com> Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> diff --git a/sw/source/filter/ww8/ww8par3.cxx b/sw/source/filter/ww8/ww8par3.cxx index 766b308fd8f9..a0752a25b301 100644 --- a/sw/source/filter/ww8/ww8par3.cxx +++ b/sw/source/filter/ww8/ww8par3.cxx @@ -94,7 +94,7 @@ eF_ResT SwWW8ImplReader::Read_F_FormTextBox( WW8FieldDesc* pF, OUString& rStr ) WW8FormulaEditBox aFormula(*this); sal_Int32 const nPos(rStr.indexOf(0x01)); - if (pF->nLCode && nPos != -1 && nPos < pF->nLCode) { + if (pF->nLCode && nPos >= 0 && nPos < pF->nLCode) { ImportFormulaControl(aFormula, pF->nSCode + nPos, WW8_CT_EDIT); } diff --git a/xmloff/source/draw/ximpcustomshape.cxx b/xmloff/source/draw/ximpcustomshape.cxx index 4d96c114b2dc..9be35a5a1d0f 100644 --- a/xmloff/source/draw/ximpcustomshape.cxx +++ b/xmloff/source/draw/ximpcustomshape.cxx @@ -1236,7 +1236,7 @@ void XMLEnhancedCustomShapeContext::endFastElement(sal_Int32 ) do { nIndexOf = rEquation.indexOf( '?', nIndexOf ); - if ( nIndexOf != -1 ) + if ( nIndexOf >= 0 ) { OUString aEquationName; if ( GetEquationName( rEquation, nIndexOf + 1, aEquationName ) )