diff options
-rw-r--r-- | vbahelper/source/msforms/vbacontrol.cxx | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/vbahelper/source/msforms/vbacontrol.cxx b/vbahelper/source/msforms/vbacontrol.cxx index 1e877c66d063..bcbbbdcd446e 100644 --- a/vbahelper/source/msforms/vbacontrol.cxx +++ b/vbahelper/source/msforms/vbacontrol.cxx @@ -727,10 +727,11 @@ sal_Int32 ScVbaControl::getBackColor() void ScVbaControl::setBackColor( sal_Int32 nBackColor ) { - if ( ( static_cast<sal_uInt32>(nBackColor) >= sal_uInt32(0x80000000) ) && - ( static_cast<sal_uInt32>(nBackColor) <= sal_uInt32(0x80000000) + SAL_N_ELEMENTS(nSysCols) ) ) + auto const col = static_cast<sal_uInt32>(nBackColor); + if ( ( col >= sal_uInt32(0x80000000) ) && + ( col <= sal_uInt32(0x80000000) + SAL_N_ELEMENTS(nSysCols) ) ) { - nBackColor = nSysCols[ nBackColor & 0x0FF]; + nBackColor = nSysCols[ col & 0x0FF]; } m_xProps->setPropertyValue( "BackgroundColor" , uno::makeAny( XLRGBToOORGB( nBackColor ) ) ); } |