summaryrefslogtreecommitdiff
path: root/vbahelper
diff options
context:
space:
mode:
authorNorbert Thiebaud <nthiebaud@gmail.com>2014-01-30 02:54:21 -0600
committerNorbert Thiebaud <nthiebaud@gmail.com>2014-01-31 21:27:24 -0600
commit4f957dc0c734c9a9e918ab213175f0d0fac43c67 (patch)
tree4559d6e957a149d470abfc662749930c980d8892 /vbahelper
parent05a9f91d5e83d3f57410e261e12204be48c3b1ca (diff)
coverity#735370 : signed/unsigned mixup
Change-Id: I98366335430ba5ede4e46e1e9ec6488739e2099a
Diffstat (limited to 'vbahelper')
-rw-r--r--vbahelper/source/msforms/vbacontrol.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/vbahelper/source/msforms/vbacontrol.cxx b/vbahelper/source/msforms/vbacontrol.cxx
index 31b4244f806a..21825c9ab6f3 100644
--- a/vbahelper/source/msforms/vbacontrol.cxx
+++ b/vbahelper/source/msforms/vbacontrol.cxx
@@ -737,9 +737,10 @@ sal_Int32 ScVbaControl::getBackColor() throw (uno::RuntimeException)
void ScVbaControl::setBackColor( sal_Int32 nBackColor ) throw (uno::RuntimeException)
{
- if ( ( nBackColor >= (sal_Int32)0x80000000 ) && ( nBackColor <= (sal_Int32)0x80000018 ) )
+ if ( ( (sal_uInt32)nBackColor >= (sal_uInt32)0x80000000 ) &&
+ ( (sal_uInt32)nBackColor <= (sal_uInt32)0x80000000 + SAL_N_ELEMENTS(nSysCols) ) )
{
- nBackColor = nSysCols[ nBackColor - 0x80000000 ];
+ nBackColor = nSysCols[ nBackColor & 0x0FF];
}
m_xProps->setPropertyValue( "BackgroundColor" , uno::makeAny( XLRGBToOORGB( nBackColor ) ) );
}