Kaydet (Commit) 305ccd4f authored tarafından Tor Lillqvist's avatar Tor Lillqvist

WaE: non-constant-expression cannot be narrowed

Change-Id: I401fd149e62d74a96edfc2a7e5105fb2cc95f0c7
üst bbfd7f0d
......@@ -88,7 +88,7 @@ bool IosSalBitmap::Create( CGLayerRef xLayer, int nBitmapBits,
CreateContext();
// copy layer content into the bitmap buffer
const CGPoint aSrcPoint = { -nX, -nY };
const CGPoint aSrcPoint = { static_cast<CGFloat>(-nX), static_cast<CGFloat>(-nY) };
::CGContextDrawLayerAtPoint( mxGraphicContext, aSrcPoint, xLayer );
return true;
}
......@@ -731,7 +731,7 @@ CGImageRef IosSalBitmap::CreateCroppedImage( int nX, int nY, int nNewWidth, int
else
{
nY = mnHeight - (nY + nNewHeight); // adjust for y-mirrored context
const CGRect aCropRect = {{nX, nY}, {nNewWidth, nNewHeight}};
const CGRect aCropRect = { { static_cast<CGFloat>(nX), static_cast<CGFloat>(nY)}, { static_cast<CGFloat>(nNewWidth), static_cast<CGFloat>(nNewHeight) } };
xCroppedImage = CGImageCreateWithImageInRect( mxCachedImage, aCropRect );
}
......
......@@ -98,7 +98,7 @@ void CoreTextStyleInfo::SetColor(SalColor color)
msgs_debug(style, "r:%d g:%d b:%d -->", SALCOLOR_RED(color), SALCOLOR_GREEN(color), SALCOLOR_BLUE(color));
SafeCFRelease(m_color);
CGColorSpaceRef rgb_space = CGColorSpaceCreateDeviceRGB();
CGFloat c[] = { SALCOLOR_RED(color) / 255.0, SALCOLOR_GREEN(color) / 255.0, SALCOLOR_BLUE(color) / 255.0, 1.0 };
CGFloat c[] = { SALCOLOR_RED(color) / 255.0f, SALCOLOR_GREEN(color) / 255.0f, SALCOLOR_BLUE(color) / 255.0f, 1.0 };
m_color = CGColorCreate(rgb_space, c);
CGColorSpaceRelease(rgb_space);
msgs_debug(style,"color=%p <--", m_color);
......
......@@ -314,7 +314,7 @@ void IosSalGraphics::copyBits( const SalTwoRect *pPosAry, SalGraphics *pSrcGraph
DBG_ASSERT( pSrc->mxLayer!=NULL, "IosSalGraphics::copyBits() from non-layered graphics" );
const CGPoint aDstPoint = { +pPosAry->mnDestX - pPosAry->mnSrcX, pPosAry->mnDestY - pPosAry->mnSrcY };
const CGPoint aDstPoint = { static_cast<CGFloat>(+pPosAry->mnDestX - pPosAry->mnSrcX), static_cast<CGFloat>(pPosAry->mnDestY - pPosAry->mnSrcY) };
if( (pPosAry->mnSrcWidth == pPosAry->mnDestWidth &&
pPosAry->mnSrcHeight == pPosAry->mnDestHeight) &&
(!mnBitmapDepth || (aDstPoint.x + pSrc->mnWidth) <= mnWidth) ) // workaround a Quartz crasher
......@@ -330,7 +330,7 @@ void IosSalGraphics::copyBits( const SalTwoRect *pPosAry, SalGraphics *pSrcGraph
}
}
CGContextSaveGState( xCopyContext );
const CGRect aDstRect = { {pPosAry->mnDestX, pPosAry->mnDestY}, {pPosAry->mnDestWidth, pPosAry->mnDestHeight} };
const CGRect aDstRect = { { static_cast<CGFloat>(pPosAry->mnDestX), static_cast<CGFloat>(pPosAry->mnDestY) }, { static_cast<CGFloat>(pPosAry->mnDestWidth), static_cast<CGFloat>(pPosAry->mnDestHeight) } };
CGContextClipToRect( xCopyContext, aDstRect );
// draw at new destination
......@@ -447,10 +447,10 @@ void IosSalGraphics::copyArea( long nDstX, long nDstY,long nSrcX, long nSrcY,
CGLayerRef xSrcLayer = mxLayer;
// TODO: if( mnBitmapDepth > 0 )
{
const CGSize aSrcSize = { nSrcWidth, nSrcHeight };
const CGSize aSrcSize = { static_cast<CGFloat>(nSrcWidth), static_cast<CGFloat>(nSrcHeight) };
xSrcLayer = ::CGLayerCreateWithContext( xCopyContext, aSrcSize, NULL );
const CGContextRef xSrcContext = CGLayerGetContext( xSrcLayer );
CGPoint aSrcPoint = { -nSrcX, -nSrcY };
CGPoint aSrcPoint = { static_cast<CGFloat>(-nSrcX), static_cast<CGFloat>(-nSrcY) };
if( IsFlipped() )
{
::CGContextTranslateCTM( xSrcContext, 0, +nSrcHeight );
......@@ -461,7 +461,7 @@ void IosSalGraphics::copyArea( long nDstX, long nDstY,long nSrcX, long nSrcY,
}
// draw at new destination
const CGPoint aDstPoint = { +nDstX, +nDstY };
const CGPoint aDstPoint = { static_cast<CGFloat>(+nDstX), static_cast<CGFloat>(+nDstY) };
::CGContextDrawLayerAtPoint( xCopyContext, aDstPoint, xSrcLayer );
// cleanup
......@@ -512,7 +512,7 @@ bool IosSalGraphics::drawAlphaBitmap( const SalTwoRect& rTR,
}
if ( CheckContext() )
{
const CGRect aDstRect = {{rTR.mnDestX, rTR.mnDestY}, {rTR.mnDestWidth, rTR.mnDestHeight}};
const CGRect aDstRect = { { static_cast<CGFloat>(rTR.mnDestX), static_cast<CGFloat>(rTR.mnDestY) }, { static_cast<CGFloat>(rTR.mnDestWidth), static_cast<CGFloat>(rTR.mnDestHeight) } };
CGContextDrawImage( mrContext, aDstRect, xMaskedImage );
RefreshRect( aDstRect );
}
......@@ -532,7 +532,7 @@ bool IosSalGraphics::drawAlphaRect( long nX, long nY, long nWidth,
CGContextSaveGState( mrContext );
CGContextSetAlpha( mrContext, (100-nTransparency) * (1.0/100) );
CGRect aRect = {{nX,nY},{nWidth-1,nHeight-1}};
CGRect aRect = { { static_cast<CGFloat>(nX), static_cast<CGFloat>(nY) }, { static_cast<CGFloat>(nWidth-1), static_cast<CGFloat>(nHeight-1) } };
if( IsPenVisible() )
{
aRect.origin.x += 0.5;
......@@ -562,8 +562,8 @@ void IosSalGraphics::drawBitmap( const SalTwoRect* pPosAry, const SalBitmap& rSa
{
return;
}
const CGRect aDstRect = {{pPosAry->mnDestX, pPosAry->mnDestY},
{pPosAry->mnDestWidth, pPosAry->mnDestHeight}};
const CGRect aDstRect = { { static_cast<CGFloat>(pPosAry->mnDestX), static_cast<CGFloat>(pPosAry->mnDestY) },
{ static_cast<CGFloat>(pPosAry->mnDestWidth), static_cast<CGFloat>(pPosAry->mnDestHeight) } };
CGContextDrawImage( mrContext, aDstRect, xImage );
CGImageRelease( xImage );
RefreshRect( aDstRect );
......@@ -590,8 +590,8 @@ void IosSalGraphics::drawBitmap( const SalTwoRect* pPosAry, const SalBitmap& rSa
{
return;
}
const CGRect aDstRect = {{pPosAry->mnDestX, pPosAry->mnDestY},
{pPosAry->mnDestWidth, pPosAry->mnDestHeight}};
const CGRect aDstRect = { { static_cast<CGFloat>(pPosAry->mnDestX), static_cast<CGFloat>(pPosAry->mnDestY) },
{ static_cast<CGFloat>(pPosAry->mnDestWidth), static_cast<CGFloat>(pPosAry->mnDestHeight) } };
CGContextDrawImage( mrContext, aDstRect, xMaskedImage );
CGImageRelease( xMaskedImage );
RefreshRect( aDstRect );
......@@ -640,8 +640,8 @@ void IosSalGraphics::drawMask( const SalTwoRect* pPosAry,
{
return;
}
const CGRect aDstRect = {{pPosAry->mnDestX, pPosAry->mnDestY},
{pPosAry->mnDestWidth, pPosAry->mnDestHeight}};
const CGRect aDstRect = { { static_cast<CGFloat>(pPosAry->mnDestX), static_cast<CGFloat>(pPosAry->mnDestY) },
{ static_cast<CGFloat>(pPosAry->mnDestWidth), static_cast<CGFloat>(pPosAry->mnDestHeight) } };
CGContextDrawImage( mrContext, aDstRect, xImage );
CGImageRelease( xImage );
RefreshRect( aDstRect );
......@@ -1103,7 +1103,7 @@ SalColor IosSalGraphics::getPixel( long nX, long nY )
{
nY = mnHeight - nY;
}
const CGPoint aCGPoint = {-nX, -nY};
const CGPoint aCGPoint = { static_cast<CGFloat>(-nX), static_cast<CGFloat>(-nY)};
CGContextDrawLayerAtPoint( xOnePixelContext, aCGPoint, mxLayer );
CGContextRelease( xOnePixelContext );
......@@ -1131,7 +1131,7 @@ void IosSalGraphics::ImplDrawPixel( long nX, long nY, const RGBAColor& rColor )
// overwrite the fill color
CGContextSetFillColor( mrContext, rColor.AsArray() );
// draw 1x1 rect, there is no pixel drawing in Quartz
CGRect aDstRect = {{nX,nY,},{1,1}};
CGRect aDstRect = { { static_cast<CGFloat>(nX), static_cast<CGFloat>(nY) }, { 1, 1 } };
CGContextFillRect( mrContext, aDstRect );
RefreshRect( aDstRect );
// reset the fill color
......@@ -1352,7 +1352,7 @@ bool IosSalGraphics::setClipRegion( const Region& i_rClip )
{
if( nW && nH )
{
CGRect aRect = {{nX,nY}, {nW,nH}};
CGRect aRect = { { static_cast<CGFloat>(nX), static_cast<CGFloat>(nY) }, { static_cast<CGFloat>(nW), static_cast<CGFloat>(nH) } };
CGPathAddRect( mxClipPath, NULL, aRect );
}
bRegionRect = i_rClip.ImplGetNextRect( aInfo, nX, nY, nW, nH );
......@@ -1582,7 +1582,7 @@ bool XorEmulation::UpdateTarget()
const int nWidth = (int)CGImageGetWidth( xXorImage );
const int nHeight = (int)CGImageGetHeight( xXorImage );
// TODO: update minimal changerect
const CGRect aFullRect = {{0,0},{nWidth,nHeight}};
const CGRect aFullRect = { { 0, 0 }, { static_cast<CGFloat>(nWidth), static_cast<CGFloat>(nHeight) } };
CGContextDrawImage( m_xTargetContext, aFullRect, xXorImage );
CGImageRelease( xXorImage );
}
......
......@@ -216,7 +216,7 @@ sal_Bool IosSalVirtualDevice::SetSize( long nDX, long nDY )
DBG_ASSERT( xCGContext, "no context" );
const CGSize aNewSize = { nDX, nDY };
const CGSize aNewSize = { static_cast<CGFloat>(nDX), static_cast<CGFloat>(nDY) };
mxLayer = CGLayerCreateWithContext( xCGContext, aNewSize, NULL );
if( mxLayer && mpGraphics )
......
......@@ -1076,7 +1076,7 @@ void IosSalFrame::UnionClipRegion( long nX, long nY, long nWidth, long nHeight )
if( nWidth && nHeight )
{
CGRect aRect = { { nX, nY }, { nWidth, nHeight } };
CGRect aRect = { { static_cast<CGFloat>(nX), static_cast<CGFloat>(nY) }, { static_cast<CGFloat>(nWidth), static_cast<CGFloat>(nHeight) } };
VCLToCocoaTouch( aRect, false );
maClippingRects.push_back( CGRectMake(aRect.origin.x, aRect.origin.y, aRect.size.width, aRect.size.height) );
}
......
......@@ -153,14 +153,14 @@ void IosSalObject::SetPosSize( long nX, long nY, long nWidth, long nHeight )
void IosSalObject::setClippedPosSize()
{
CGRect aViewRect = { { 0, 0 }, { mnWidth, mnHeight } };
CGRect aViewRect = { { 0, 0 }, { static_cast<CGFloat>(mnWidth), static_cast<CGFloat>(mnHeight) } };
if( maSysData.pView )
{
UIView *pView = maSysData.pView;
[pView setFrame: aViewRect];
}
CGRect aClipViewRect = { { mnX, mnY }, { mnWidth, mnHeight } };
CGRect aClipViewRect = { { static_cast<CGFloat>(mnX), static_cast<CGFloat>(mnY) }, { static_cast<CGFloat>(mnWidth), static_cast<CGFloat>(mnHeight) } };
CGPoint aClipPt = { 0, 0 };
if( mbClip )
{
......
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