svtools/source/control/ctrlbox.cxx  |    4 ++--
 svtools/source/control/valueset.cxx |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 1e6c1b672b1b93376f3c816e870d956b84e089e7
Author:     Adam Seskunas <adamsesku...@gmail.com>
AuthorDate: Wed Sep 20 13:54:44 2023 -0700
Commit:     Hossein <hoss...@libreoffice.org>
CommitDate: Fri Oct 20 03:37:45 2023 +0200

    tdf#114441 Convert use of sal_uLong to better integer types
    
    In ctrlbox.cxx, nCount and i were changed to sal_uInt32 because
    aFontSizeNames.Count() returns sal_uInt32.
    
    In valueset.cxx, nFirstItem and nLastItem are only used in a comparison
    with a value of size_t. They were both changed to size_t because
    nLastItem contains the product of tools::Long mnVisLines and
    sal_uInt16 mnCols where tools::Long can be 64 bit in some cases.
    
    Change-Id: Ib3f10cdf6ae81e96f28f13a0bb32699f26c8a0cb
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157109
    Tested-by: Jenkins
    Reviewed-by: Hossein <hoss...@libreoffice.org>

diff --git a/svtools/source/control/ctrlbox.cxx 
b/svtools/source/control/ctrlbox.cxx
index 22bfde7febe5..3d4ce47b0814 100644
--- a/svtools/source/control/ctrlbox.cxx
+++ b/svtools/source/control/ctrlbox.cxx
@@ -1186,8 +1186,8 @@ void FontSizeBox::Fill( const FontList* pList )
         if ( pAry == FontList::GetStdSizeAry() )
         {
             // for scalable fonts all font size names
-            sal_uLong nCount = aFontSizeNames.Count();
-            for( sal_uLong i = 0; i < nCount; i++ )
+            sal_uInt32 nCount = aFontSizeNames.Count();
+            for( sal_uInt32 i = 0; i < nCount; i++ )
             {
                 OUString aSizeName = aFontSizeNames.GetIndexName( i );
                 int nSize = aFontSizeNames.GetIndexSize( i );
diff --git a/svtools/source/control/valueset.cxx 
b/svtools/source/control/valueset.cxx
index 89ce7f8cdb23..87696d1a7886 100644
--- a/svtools/source/control/valueset.cxx
+++ b/svtools/source/control/valueset.cxx
@@ -1076,8 +1076,8 @@ void ValueSet::Format(vcl::RenderContext const & 
rRenderContext)
         }
 
         // draw items
-        sal_uLong nFirstItem = static_cast<sal_uLong>(mnFirstLine) * mnCols;
-        sal_uLong nLastItem = nFirstItem + (mnVisLines * mnCols);
+        size_t nFirstItem = static_cast<size_t>(mnFirstLine) * mnCols;
+        size_t nLastItem = nFirstItem + (mnVisLines * mnCols);
 
         maItemListRect.SetLeft( x );
         maItemListRect.SetTop( y );

Reply via email to