Kaydet (Commit) 4fa3e47a authored tarafından Stephan Bergmann's avatar Stephan Bergmann

More loplugin:cstylecast: vbahelper

auto-rewrite with <https://gerrit.libreoffice.org/#/c/47798/> "Enable
loplugin:cstylecast for some more cases" plus
solenv/clang-format/reformat-formatted-files

Change-Id: I4ab5ca8cc7c3e26b43937ec9edae3d106f11cf56
üst 5e3a76a8
......@@ -722,8 +722,8 @@ sal_Int32 ScVbaControl::getBackColor()
void ScVbaControl::setBackColor( sal_Int32 nBackColor )
{
if ( ( (sal_uInt32)nBackColor >= (sal_uInt32)0x80000000 ) &&
( (sal_uInt32)nBackColor <= (sal_uInt32)0x80000000 + SAL_N_ELEMENTS(nSysCols) ) )
if ( ( static_cast<sal_uInt32>(nBackColor) >= sal_uInt32(0x80000000) ) &&
( static_cast<sal_uInt32>(nBackColor) <= sal_uInt32(0x80000000) + SAL_N_ELEMENTS(nSysCols) ) )
{
nBackColor = nSysCols[ nBackColor & 0x0FF];
}
......
......@@ -78,7 +78,7 @@ ScVbaTextBox::getMaxLength()
aValue = m_xProps->getPropertyValue( "MaxTextLen" );
sal_Int16 nMaxLength = 0;
aValue >>= nMaxLength;
return (sal_Int32)nMaxLength;
return static_cast<sal_Int32>(nMaxLength);
}
void SAL_CALL
......
......@@ -85,7 +85,7 @@ public:
nDiffDays += 2; // Change VisualBasic: 1.Jan.1900 == 2
long nDiffSeconds = aTimeNow.GetHour() * 3600 + aTimeNow.GetMin() * 60 + aTimeNow.GetSec();
return (double)nDiffDays + ((double)nDiffSeconds)/(double)(24*3600);
return static_cast<double>(nDiffDays) + static_cast<double>(nDiffSeconds)/double(24*3600);
}
static sal_Int32 GetTimerMiliseconds( double nFrom, double nTo )
......@@ -96,7 +96,7 @@ public:
else
nResult = 50;
return (sal_Int32) nResult;
return static_cast<sal_Int32>(nResult);
}
void Start( const ::rtl::Reference< VbaApplicationBase >& xBase, const OUString& aFunction, double nFrom, double nTo )
......@@ -140,9 +140,9 @@ struct VbaTimerInfoHash
{
size_t operator()( const VbaTimerInfo& rTimerInfo ) const
{
return (size_t)rTimerInfo.first.hashCode()
+ (size_t)rtl_str_hashCode_WithLength( reinterpret_cast<char const *>(&rTimerInfo.second.first), sizeof( double ) )
+ (size_t)rtl_str_hashCode_WithLength( reinterpret_cast<char const *>(&rTimerInfo.second.second), sizeof( double ) );
return static_cast<size_t>(rTimerInfo.first.hashCode())
+ static_cast<size_t>(rtl_str_hashCode_WithLength( reinterpret_cast<char const *>(&rTimerInfo.second.first), sizeof( double ) ))
+ static_cast<size_t>(rtl_str_hashCode_WithLength( reinterpret_cast<char const *>(&rTimerInfo.second.second), sizeof( double ) ));
}
};
......
......@@ -401,7 +401,7 @@ void PrintOutHelper( SfxViewShell const * pViewShell, const uno::Any& From, cons
}
}
else
pDispatcher->Execute( (sal_uInt16)SID_PRINTDOC, SfxCallMode::SYNCHRON, aArgs );
pDispatcher->Execute( sal_uInt16(SID_PRINTDOC), SfxCallMode::SYNCHRON, aArgs );
}
......
......@@ -421,7 +421,7 @@ ScVbaShape::ZOrder( sal_Int32 ZOrderCmd )
m_xPropertySet->setPropertyValue( "ZOrder" , uno::makeAny( SAL_MAX_INT32 ) );
break;
case office::MsoZOrderCmd::msoSendToBack:
m_xPropertySet->setPropertyValue( "ZOrder" , uno::makeAny( (sal_Int32)0 ) );
m_xPropertySet->setPropertyValue( "ZOrder" , uno::makeAny( sal_Int32(0) ) );
break;
case office::MsoZOrderCmd::msoBringForward:
nOrderPosition += 1;
......
......@@ -78,7 +78,7 @@ float SAL_CALL
VbaTextFrame::getMarginBottom()
{
sal_Int32 nMargin = getMargin( "TextLowerDistance" );
float fMargin = (float)Millimeter::getInPoints( nMargin );
float fMargin = static_cast<float>(Millimeter::getInPoints( nMargin ));
return fMargin;
}
......@@ -92,7 +92,7 @@ float SAL_CALL
VbaTextFrame::getMarginTop()
{
sal_Int32 nMargin = getMargin( "TextUpperDistance" );
float fMargin = (float)Millimeter::getInPoints( nMargin );
float fMargin = static_cast<float>(Millimeter::getInPoints( nMargin ));
return fMargin;
}
......@@ -106,7 +106,7 @@ float SAL_CALL
VbaTextFrame::getMarginLeft()
{
sal_Int32 nMargin = getMargin( "TextLeftDistance" );
float fMargin = (float)Millimeter::getInPoints( nMargin );
float fMargin = static_cast<float>(Millimeter::getInPoints( nMargin ));
return fMargin;
}
......@@ -120,7 +120,7 @@ float SAL_CALL
VbaTextFrame::getMarginRight()
{
sal_Int32 nMargin = getMargin( "TextRightDistance" );
float fMargin = (float)Millimeter::getInPoints( nMargin );
float fMargin = static_cast<float>(Millimeter::getInPoints( nMargin ));
return fMargin;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment