sd/source/ui/slideshow/showwin.cxx | 14 ++++++++++---- sfx2/source/dialog/templdlg.cxx | 3 ++- vcl/source/gdi/CommonSalLayout.cxx | 4 ++-- 3 files changed, 14 insertions(+), 7 deletions(-)
New commits: commit 10464b74097f114bb73e6e4aaece7aebc43ed680 Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Mon Aug 26 21:19:00 2024 +0100 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Wed Aug 28 12:17:06 2024 +0200 cid#1607037 silence Overflowed constant and cid#1606925 Overflowed constant cid#1606695 Overflowed constant Change-Id: I2162e9b5da1f31ea1dfc603d6e60b96d98f82be1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172509 Tested-by: Caolán McNamara <caolan.mcnam...@collabora.com> Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> diff --git a/sd/source/ui/slideshow/showwin.cxx b/sd/source/ui/slideshow/showwin.cxx index d6ecc19a69d0..f0dcd4857a17 100644 --- a/sd/source/ui/slideshow/showwin.cxx +++ b/sd/source/ui/slideshow/showwin.cxx @@ -593,8 +593,11 @@ void ShowWindow::DeleteWindowFromPaintView() mpViewShell->GetView()->DeleteDeviceFromPaintView( *GetOutDev() ); sal_uInt16 nChild = GetChildCount(); - while( nChild-- ) - GetChild( nChild )->Show( false ); + while (nChild) + { + --nChild; + GetChild(nChild)->Show( false ); + } } void ShowWindow::AddWindowToPaintView() @@ -603,8 +606,11 @@ void ShowWindow::AddWindowToPaintView() mpViewShell->GetView()->AddDeviceToPaintView( *GetOutDev(), nullptr ); sal_uInt16 nChild = GetChildCount(); - while( nChild-- ) - GetChild( nChild )->Show(); + while (nChild) + { + --nChild; + GetChild(nChild)->Show(); + } } // Override the sd::Window's CreateAccessible to create a different accessible object diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx index 7fbb3b45d1de..09e320e05357 100644 --- a/sfx2/source/dialog/templdlg.cxx +++ b/sfx2/source/dialog/templdlg.cxx @@ -295,8 +295,9 @@ IMPL_LINK(SfxCommonTemplateDialog_Impl, ReadResource_Hdl, StyleList&, rStyleList if(nCount > 4) ReplaceUpdateButtonByMenu(); - for( ; nCount--; ) + while (nCount) { + --nCount; const SfxStyleFamilyItem &rItem = rStyleList.GetFamilyItemByIndex( nCount ); sal_uInt16 nId = SfxTemplate::SfxFamilyIdToNId( rItem.GetFamily() ); InsertFamilyItem(nId, rItem); diff --git a/vcl/source/gdi/CommonSalLayout.cxx b/vcl/source/gdi/CommonSalLayout.cxx index 855a5355c59d..0602ecca3fc8 100644 --- a/vcl/source/gdi/CommonSalLayout.cxx +++ b/vcl/source/gdi/CommonSalLayout.cxx @@ -929,8 +929,8 @@ void GenericSalLayout::ApplyJustificationData(const JustificationData& rstJustif // Adjust the X position of the rest of the glyphs in the cluster. // We iterate backwards since this is an RTL glyph. - for (int j = i - 1; j >= 0 && m_GlyphItems[j].IsInCluster(); j--) - m_GlyphItems[j].adjustLinearPosX(nDelta + nDiff); + for (size_t j = i; j >= 1 && m_GlyphItems[j - 1].IsInCluster(); --j) + m_GlyphItems[j - 1].adjustLinearPosX(nDelta + nDiff); // This is a Kashida insertion position, mark it. Kashida glyphs // will be inserted below.