cui/source/tabpages/tpgradnt.cxx | 10 +++++----- cui/source/tabpages/tphatch.cxx | 8 ++++---- sc/source/ui/sidebar/AlignmentPropertyPanel.cxx | 2 +- sd/source/filter/eppt/epptso.cxx | 6 ++++-- 4 files changed, 14 insertions(+), 12 deletions(-)
New commits: commit 4d38ce60f6edc72285e1bf16223e7b7d9a379a3d Author: Caolán McNamara <[email protected]> AuthorDate: Fri Nov 7 08:48:56 2025 +0000 Commit: Caolán McNamara <[email protected]> CommitDate: Sat Nov 8 16:21:21 2025 +0100 cid#1667047 silence Overflowed constant and cid#1667073 Overflowed constant cid#1667087 Overflowed constant Change-Id: Ie8490beaa6b2143d137079b514827c37dfb7794f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193619 Reviewed-by: Caolán McNamara <[email protected]> Tested-by: Jenkins diff --git a/cui/source/tabpages/tpgradnt.cxx b/cui/source/tabpages/tpgradnt.cxx index 3ffec08f41d1..91342ba7b8a6 100644 --- a/cui/source/tabpages/tpgradnt.cxx +++ b/cui/source/tabpages/tpgradnt.cxx @@ -216,7 +216,7 @@ bool SvxGradientTabPage::FillItemSet( SfxItemSet* rSet ) pBGradient.reset(new basegfx::BGradient( createColorStops(), static_cast<css::awt::GradientStyle>(m_xLbGradientType->get_active()), - Degree10(static_cast<sal_Int16>(m_xMtrAngle->get_value(FieldUnit::NONE) * 10)), // should be changed in resource + Degree10(static_cast<sal_Int16>((m_xMtrAngle->get_value(FieldUnit::NONE) % 360) * 10)), static_cast<sal_uInt16>(m_xMtrCenterX->get_value(FieldUnit::NONE)), static_cast<sal_uInt16>(m_xMtrCenterY->get_value(FieldUnit::NONE)), static_cast<sal_uInt16>(m_xMtrBorder->get_value(FieldUnit::NONE)), @@ -313,7 +313,7 @@ void SvxGradientTabPage::ModifiedHdl_Impl( void const * pControl ) basegfx::BGradient aBGradient( createColorStops(), eXGS, - Degree10(static_cast<sal_Int16>(m_xMtrAngle->get_value(FieldUnit::NONE) * 10)), // should be changed in resource + Degree10(static_cast<sal_Int16>((m_xMtrAngle->get_value(FieldUnit::NONE) % 360) * 10)), static_cast<sal_uInt16>(m_xMtrCenterX->get_value(FieldUnit::NONE)), static_cast<sal_uInt16>(m_xMtrCenterY->get_value(FieldUnit::NONE)), static_cast<sal_uInt16>(m_xMtrBorder->get_value(FieldUnit::NONE)), @@ -380,7 +380,7 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ClickAddHdl_Impl, weld::Button&, void) basegfx::BGradient aBGradient( createColorStops(), static_cast<css::awt::GradientStyle>(m_xLbGradientType->get_active()), - Degree10(static_cast<sal_Int16>(m_xMtrAngle->get_value(FieldUnit::NONE) * 10)), // should be changed in resource + Degree10(static_cast<sal_Int16>((m_xMtrAngle->get_value(FieldUnit::NONE) % 360) * 10)), static_cast<sal_uInt16>(m_xMtrCenterX->get_value(FieldUnit::NONE)), static_cast<sal_uInt16>(m_xMtrCenterY->get_value(FieldUnit::NONE)), static_cast<sal_uInt16>(m_xMtrBorder->get_value(FieldUnit::NONE)), @@ -424,7 +424,7 @@ IMPL_LINK_NOARG(SvxGradientTabPage, ClickModifyHdl_Impl, weld::Button&, void) basegfx::BGradient aBGradient( createColorStops(), static_cast<css::awt::GradientStyle>(m_xLbGradientType->get_active()), - Degree10(static_cast<sal_Int16>(m_xMtrAngle->get_value(FieldUnit::NONE) * 10)), // should be changed in resource + Degree10(static_cast<sal_Int16>((m_xMtrAngle->get_value(FieldUnit::NONE) % 360) * 10)), static_cast<sal_uInt16>(m_xMtrCenterX->get_value(FieldUnit::NONE)), static_cast<sal_uInt16>(m_xMtrCenterY->get_value(FieldUnit::NONE)), static_cast<sal_uInt16>(m_xMtrBorder->get_value(FieldUnit::NONE)), @@ -581,7 +581,7 @@ void SvxGradientTabPage::ChangeGradientHdl_Impl() else m_aColorStops.clear(); - m_xMtrAngle->set_value(pGradient->GetAngle().get() / 10, FieldUnit::NONE); // should be changed in resource + m_xMtrAngle->set_value(pGradient->GetAngle().get() / 10, FieldUnit::NONE); m_xSliderAngle->set_value(pGradient->GetAngle().get() / 10); m_xMtrBorder->set_value(pGradient->GetBorder(), FieldUnit::NONE); m_xSliderBorder->set_value(pGradient->GetBorder()); diff --git a/cui/source/tabpages/tphatch.cxx b/cui/source/tabpages/tphatch.cxx index d8a00f6b788f..46c7f2754a3b 100644 --- a/cui/source/tabpages/tphatch.cxx +++ b/cui/source/tabpages/tphatch.cxx @@ -249,7 +249,7 @@ bool SvxHatchTabPage::FillItemSet( SfxItemSet* rSet ) pXHatch.reset(new XHatch( m_xLbLineColor->GetSelectEntryColor(), static_cast<css::drawing::HatchStyle>(m_xLbLineType->get_active()), GetCoreValue( *m_xMtrDistance, m_ePoolUnit ), - Degree10(static_cast<sal_Int16>(m_xMtrAngle->get_value(FieldUnit::NONE) * 10)) )); + Degree10(static_cast<sal_Int16>((m_xMtrAngle->get_value(FieldUnit::NONE) % 360) * 10)) )); } assert( pXHatch && "XHatch couldn't be created" ); rSet->Put( XFillStyleItem( drawing::FillStyle_HATCH ) ); @@ -349,7 +349,7 @@ void SvxHatchTabPage::ModifiedHdl_Impl( void const * p ) XHatch aXHatch( m_xLbLineColor->GetSelectEntryColor(), static_cast<css::drawing::HatchStyle>(m_xLbLineType->get_active()), GetCoreValue( *m_xMtrDistance, m_ePoolUnit ), - Degree10(static_cast<sal_Int16>(m_xMtrAngle->get_value(FieldUnit::NONE) * 10)) ); + Degree10(static_cast<sal_Int16>((m_xMtrAngle->get_value(FieldUnit::NONE) % 360) * 10)) ); m_rXFSet.Put( XFillHatchItem( OUString(), aXHatch ) ); @@ -457,7 +457,7 @@ IMPL_LINK_NOARG(SvxHatchTabPage, ClickAddHdl_Impl, weld::Button&, void) XHatch aXHatch( m_xLbLineColor->GetSelectEntryColor(), static_cast<css::drawing::HatchStyle>(m_xLbLineType->get_active()), GetCoreValue( *m_xMtrDistance, m_ePoolUnit ), - Degree10(static_cast<sal_Int16>(m_xMtrAngle->get_value(FieldUnit::NONE) * 10)) ); + Degree10(static_cast<sal_Int16>((m_xMtrAngle->get_value(FieldUnit::NONE) % 360) * 10)) ); m_pHatchingList->Insert(std::make_unique<XHatchEntry>(aXHatch, aName), nCount); @@ -486,7 +486,7 @@ IMPL_LINK_NOARG(SvxHatchTabPage, ClickModifyHdl_Impl, weld::Button&, void) XHatch aXHatch( m_xLbLineColor->GetSelectEntryColor(), static_cast<css::drawing::HatchStyle>(m_xLbLineType->get_active()), GetCoreValue( *m_xMtrDistance, m_ePoolUnit ), - Degree10(static_cast<sal_Int16>(m_xMtrAngle->get_value(FieldUnit::NONE) * 10)) ); + Degree10(static_cast<sal_Int16>((m_xMtrAngle->get_value(FieldUnit::NONE) % 360) * 10)) ); m_pHatchingList->Replace(std::make_unique<XHatchEntry>(aXHatch, aName), nPos); diff --git a/sc/source/ui/sidebar/AlignmentPropertyPanel.cxx b/sc/source/ui/sidebar/AlignmentPropertyPanel.cxx index 15a8e91f9cf0..ad69fe7016cf 100644 --- a/sc/source/ui/sidebar/AlignmentPropertyPanel.cxx +++ b/sc/source/ui/sidebar/AlignmentPropertyPanel.cxx @@ -148,7 +148,7 @@ IMPL_LINK(AlignmentPropertyPanel, ReferenceEdgeHdl, weld::Button&, rToggle, void IMPL_LINK_NOARG( AlignmentPropertyPanel, AngleModifiedHdl, weld::MetricSpinButton&, void ) { - Degree100 nAngle(mxMtrAngle->get_value(FieldUnit::DEGREE) * 100); + Degree100 nAngle((mxMtrAngle->get_value(FieldUnit::DEGREE) % 360) * 100); ScRotateValueItem aAngleItem(nAngle); GetBindings()->GetDispatcher()->ExecuteList( commit 1f5c0b7ce48217be278252336a7cc6ed838e5916 Author: Caolán McNamara <[email protected]> AuthorDate: Fri Nov 7 08:37:57 2025 +0000 Commit: Caolán McNamara <[email protected]> CommitDate: Sat Nov 8 16:21:13 2025 +0100 Related: cid#1660467 Division or modulo by float zero Change-Id: I4a52c528e0fbd8ba5a224d6ebd0586e80ae36a6a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193618 Reviewed-by: Caolán McNamara <[email protected]> Tested-by: Jenkins diff --git a/sd/source/filter/eppt/epptso.cxx b/sd/source/filter/eppt/epptso.cxx index 8676a3f9aee8..d2537f1feb08 100644 --- a/sd/source/filter/eppt/epptso.cxx +++ b/sd/source/filter/eppt/epptso.cxx @@ -97,13 +97,15 @@ sal_uInt16 PPTExBulletProvider::GetId(Graphic const & rGraphic, Size& rGraphicSi const auto nGraphicHeight = rGraphicSize.Height(); if (nGraphicWidth && nGraphicHeight) { - if (aPrefSize.IsEmpty()) + const auto nPrefWidth = aPrefSize.Width(); + const auto nPrefHeight = aPrefSize.Height(); + if (!nPrefWidth || !nPrefHeight) { aBmp.Scale(aPrefSize); } else { - double fQ1 = static_cast<double>(aPrefSize.Width()) / static_cast<double>(aPrefSize.Height()); + double fQ1 = static_cast<double>(nPrefWidth) / static_cast<double>(nPrefHeight); double fQ2 = static_cast<double>(nGraphicWidth) / static_cast<double>(nGraphicHeight); double fXScale = 1; double fYScale = 1;
