summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorAdam Seskunas <adamseskunas@gmail.com>2023-09-20 13:54:44 -0700
committerHossein <hossein@libreoffice.org>2023-10-20 03:37:45 +0200
commit1e6c1b672b1b93376f3c816e870d956b84e089e7 (patch)
treecc0e074192ed012c07d789df88b48264fe66bd92 /svtools
parent26a08eb18eb18963652b063ce8bfb3e36b7529f4 (diff)
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 <hossein@libreoffice.org>
Diffstat (limited to 'svtools')
-rw-r--r--svtools/source/control/ctrlbox.cxx4
-rw-r--r--svtools/source/control/valueset.cxx4
2 files changed, 4 insertions, 4 deletions
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 );