Kaydet (Commit) 703f3f45 authored tarafından Takeshi Abe's avatar Takeshi Abe Kaydeden (comit) Michael Stahl

vcl: These can be static assertions

Change-Id: I220ae4732f221c7798f162653cad01717afb659f
Reviewed-on: https://gerrit.libreoffice.org/20011Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarMichael Stahl <mstahl@redhat.com>
üst 530bc021
......@@ -981,8 +981,7 @@ void WinSalGraphicsImpl::invert( sal_uInt32 nPoints, const SalPoint* pPtAry, Sal
POINT* pWinPtAry;
// for NT, we can handover the array directly
DBG_ASSERT( sizeof( POINT ) == sizeof( SalPoint ),
"WinSalGraphicsImpl::DrawPolyLine(): POINT != SalPoint" );
static_assert( sizeof( POINT ) == sizeof( SalPoint ), "must be the same size" );
pWinPtAry = (POINT*)pPtAry;
// for Windows 95 and its maximum number of points
......@@ -1648,8 +1647,7 @@ void WinSalGraphicsImpl::drawRect( long nX, long nY, long nWidth, long nHeight )
void WinSalGraphicsImpl::drawPolyLine( sal_uInt32 nPoints, const SalPoint* pPtAry )
{
// for NT, we can handover the array directly
DBG_ASSERT( sizeof( POINT ) == sizeof( SalPoint ),
"WinSalGraphicsImpl::DrawPolyLine(): POINT != SalPoint" );
static_assert( sizeof( POINT ) == sizeof( SalPoint ), "must be the same size" );
POINT* pWinPtAry = (POINT*)pPtAry;
......@@ -1695,8 +1693,7 @@ void WinSalGraphicsImpl::drawPolyLine( sal_uInt32 nPoints, const SalPoint* pPtAr
void WinSalGraphicsImpl::drawPolygon( sal_uInt32 nPoints, const SalPoint* pPtAry )
{
// for NT, we can handover the array directly
DBG_ASSERT( sizeof( POINT ) == sizeof( SalPoint ),
"WinSalGraphicsImpl::DrawPolygon(): POINT != SalPoint" );
static_assert( sizeof( POINT ) == sizeof( SalPoint ), "must be the same size" );
POINT* pWinPtAry = (POINT*)pPtAry;
// for Windows 95 and its maximum number of points
......@@ -1732,8 +1729,7 @@ void WinSalGraphicsImpl::drawPolyPolygon( sal_uInt32 nPoly, const sal_uInt32* pP
else
pWinPointAryAry = new POINT[nPolyPolyPoints];
// for NT, we can handover the array directly
DBG_ASSERT( sizeof( POINT ) == sizeof( SalPoint ),
"WinSalGraphicsImpl::DrawPolyPolygon(): POINT != SalPoint" );
static_assert( sizeof( POINT ) == sizeof( SalPoint ), "must be the same size" );
UINT n = 0;
for ( i = 0; i < (UINT)nPoly; i++ )
{
......@@ -1774,8 +1770,7 @@ bool WinSalGraphicsImpl::drawPolyLineBezier( sal_uInt32 nPoints, const SalPoint*
{
#ifdef USE_GDI_BEZIERS
// for NT, we can handover the array directly
DBG_ASSERT( sizeof( POINT ) == sizeof( SalPoint ),
"WinSalGraphicsImpl::DrawPolyLineBezier(): POINT != SalPoint" );
static_assert( sizeof( POINT ) == sizeof( SalPoint ), "must be the same size" );
ImplRenderPath( mrParent.getHDC(), nPoints, pPtAry, pFlgAry );
......@@ -1789,8 +1784,7 @@ bool WinSalGraphicsImpl::drawPolygonBezier( sal_uInt32 nPoints, const SalPoint*
{
#ifdef USE_GDI_BEZIERS
// for NT, we can handover the array directly
DBG_ASSERT( sizeof( POINT ) == sizeof( SalPoint ),
"WinSalGraphicsImpl::DrawPolygonBezier(): POINT != SalPoint" );
static_assert( sizeof( POINT ) == sizeof( SalPoint ), "must be the same size" );
POINT aStackAry1[SAL_POLY_STACKBUF];
BYTE aStackAry2[SAL_POLY_STACKBUF];
......@@ -1840,8 +1834,7 @@ bool WinSalGraphicsImpl::drawPolyPolygonBezier( sal_uInt32 nPoly, const sal_uInt
{
#ifdef USE_GDI_BEZIERS
// for NT, we can handover the array directly
DBG_ASSERT( sizeof( POINT ) == sizeof( SalPoint ),
"WinSalGraphicsImpl::DrawPolyPolygonBezier(): POINT != SalPoint" );
static_assert( sizeof( POINT ) == sizeof( SalPoint ), "must be the same size" );
sal_uLong nCurrPoly, nTotalPoints;
const sal_uInt32* pCurrPoints = pPoints;
......
......@@ -1066,7 +1066,7 @@ bool WinSalFrame::PostEvent(ImplSVEvent* pData)
void WinSalFrame::SetTitle( const OUString& rTitle )
{
DBG_ASSERT( sizeof( WCHAR ) == sizeof( sal_Unicode ), "WinSalFrame::SetTitle(): WCHAR != sal_Unicode" );
static_assert( sizeof( WCHAR ) == sizeof( sal_Unicode ), "must be the same size" );
SetWindowTextW( mhWnd, reinterpret_cast<LPCWSTR>(rTitle.getStr()) );
}
......@@ -2297,7 +2297,7 @@ static void ImplGetKeyNameText( LONG lParam, sal_Unicode* pBuf,
UINT& rCount, UINT nMaxSize,
const sal_Char* pReplace )
{
DBG_ASSERT( sizeof( WCHAR ) == sizeof( sal_Unicode ), "WinSalFrame::ImplGetKeyNameTextW(): WCHAR != sal_Unicode" );
static_assert( sizeof( WCHAR ) == sizeof( sal_Unicode ), "must be the same size" );
static const int nMaxKeyLen = 350;
WCHAR aKeyBuf[ nMaxKeyLen ];
......
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