sc/source/ui/docshell/docsh.cxx | 2 - vcl/aqua/source/gdi/salgdi.cxx | 34 ++++++++++++------------ xmlsecurity/source/xmlsec/nss/ciphercontext.cxx | 4 +- 3 files changed, 20 insertions(+), 20 deletions(-)
New commits: commit ceb2dee36c581811c3aba380fcf994c3ccd116b5 Author: Herbert Dürr <h...@apache.org> Date: Thu Dec 12 14:25:58 2013 +0000 #i123840# fix narrowing conversions when initializing SC's szMSFilterNames array diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx index 8c63247..8e540e6 100644 --- a/sc/source/ui/docshell/docsh.cxx +++ b/sc/source/ui/docshell/docsh.cxx @@ -204,7 +204,7 @@ namespace static const struct { const char * mpFilterName; - unsigned mnFilterNameLen; + size_t mnFilterNameLen; } szMSFilterNames [] = { { pFilterExcel4, strlen( pFilterExcel4 ) }, commit ff19bc876f2e2c13f9040e148c32ed8c1c1ab9ca Author: Herbert Dürr <h...@apache.org> Date: Thu Dec 12 14:14:49 2013 +0000 #i123840# fix a 64->32bit narrowing conversion in nss/ciphercontext.cxx diff --git a/xmlsecurity/source/xmlsec/nss/ciphercontext.cxx b/xmlsecurity/source/xmlsec/nss/ciphercontext.cxx index fe505ae..080ac9a 100644 --- a/xmlsecurity/source/xmlsec/nss/ciphercontext.cxx +++ b/xmlsecurity/source/xmlsec/nss/ciphercontext.cxx @@ -38,11 +38,11 @@ uno::Reference< xml::crypto::XCipherContext > OCipherContext::Create( CK_MECHANI xResult->m_pSlot = PK11_GetBestSlot( nNSSCipherID, NULL ); if ( xResult->m_pSlot ) { - SECItem aKeyItem = { siBuffer, const_cast< unsigned char* >( reinterpret_cast< const unsigned char* >( aKey.getConstArray() ) ), aKey.getLength() }; + SECItem aKeyItem = { siBuffer, const_cast< unsigned char* >( reinterpret_cast< const unsigned char* >( aKey.getConstArray() ) ), static_cast<unsigned>(aKey.getLength()) }; xResult->m_pSymKey = PK11_ImportSymKey( xResult->m_pSlot, nNSSCipherID, PK11_OriginDerive, bEncryption ? CKA_ENCRYPT : CKA_DECRYPT, &aKeyItem, NULL ); if ( xResult->m_pSymKey ) { - SECItem aIVItem = { siBuffer, const_cast< unsigned char* >( reinterpret_cast< const unsigned char* >( aInitializationVector.getConstArray() ) ), aInitializationVector.getLength() }; + SECItem aIVItem = { siBuffer, const_cast< unsigned char* >( reinterpret_cast< const unsigned char* >( aInitializationVector.getConstArray() ) ), static_cast<unsigned>(aInitializationVector.getLength()) }; xResult->m_pSecParam = PK11_ParamFromIV( nNSSCipherID, &aIVItem ); if ( xResult->m_pSecParam ) { commit 5e7c8cd9c6772d9b9e5747e74768c61143a7ed01 Author: Herbert Dürr <h...@apache.org> Date: Thu Dec 12 14:08:12 2013 +0000 #i123840# fix narrowing conversions in CoreGraphic's array initializers C++11 says that narrowing conversions in array initializers are illegal. This often happened for signed/unsigned and 32bit/64bit mismatches when initializing CoreGraphics elementary types. Using CoreGraphic helper methods for primitives solves these problems and is recommended anyway. diff --git a/vcl/aqua/source/gdi/salgdi.cxx b/vcl/aqua/source/gdi/salgdi.cxx index 366cda1..abc74a5 100644 --- a/vcl/aqua/source/gdi/salgdi.cxx +++ b/vcl/aqua/source/gdi/salgdi.cxx @@ -592,7 +592,7 @@ bool AquaSalGraphics::setClipRegion( const Region& i_rClip ) if(nH) { - CGRect aRect = {{ aRectIter->Left(), aRectIter->Top() }, { nW, nH }}; + const CGRect aRect = CGRectMake( aRectIter->Left(), aRectIter->Top(), nW, nH); CGPathAddRect( mxClipPath, NULL, aRect ); } } @@ -676,7 +676,7 @@ void AquaSalGraphics::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}}; + const CGRect aDstRect = CGRectMake( nX, nY, 1, 1); CGContextFillRect( mrContext, aDstRect ); RefreshRect( aDstRect ); // reset the fill color @@ -1133,7 +1133,7 @@ void AquaSalGraphics::copyBits( const SalTwoRect& rPosAry, SalGraphics *pSrcGrap DBG_ASSERT( pSrc->mxLayer!=NULL, "AquaSalGraphics::copyBits() from non-layered graphics" ); - const CGPoint aDstPoint = { +rPosAry.mnDestX - rPosAry.mnSrcX, rPosAry.mnDestY - rPosAry.mnSrcY }; + const CGPoint aDstPoint = CGPointMake( +rPosAry.mnDestX - rPosAry.mnSrcX, rPosAry.mnDestY - rPosAry.mnSrcY); if( (rPosAry.mnSrcWidth == rPosAry.mnDestWidth && rPosAry.mnSrcHeight == rPosAry.mnDestHeight) && (!mnBitmapDepth || (aDstPoint.x + pSrc->mnWidth) <= mnWidth) ) // workaround a Quartz crasher { @@ -1145,7 +1145,7 @@ void AquaSalGraphics::copyBits( const SalTwoRect& rPosAry, SalGraphics *pSrcGrap xCopyContext = mpXorEmulation->GetTargetContext(); CGContextSaveGState( xCopyContext ); - const CGRect aDstRect = { {rPosAry.mnDestX, rPosAry.mnDestY}, {rPosAry.mnDestWidth, rPosAry.mnDestHeight} }; + const CGRect aDstRect = CGRectMake( rPosAry.mnDestX, rPosAry.mnDestY, rPosAry.mnDestWidth, rPosAry.mnDestHeight); CGContextClipToRect( xCopyContext, aDstRect ); // draw at new destination @@ -1211,10 +1211,10 @@ void AquaSalGraphics::copyArea( long nDstX, long nDstY,long nSrcX, long nSrcY, l CGLayerRef xSrcLayer = mxLayer; // TODO: if( mnBitmapDepth > 0 ) { - const CGSize aSrcSize = { nSrcWidth, nSrcHeight }; + const CGSize aSrcSize = CGSizeMake( nSrcWidth, nSrcHeight); xSrcLayer = ::CGLayerCreateWithContext( xCopyContext, aSrcSize, NULL ); const CGContextRef xSrcContext = CGLayerGetContext( xSrcLayer ); - CGPoint aSrcPoint = { -nSrcX, -nSrcY }; + CGPoint aSrcPoint = CGPointMake( -nSrcX, -nSrcY); if( IsFlipped() ) { ::CGContextTranslateCTM( xSrcContext, 0, +nSrcHeight ); @@ -1225,7 +1225,7 @@ void AquaSalGraphics::copyArea( long nDstX, long nDstY,long nSrcX, long nSrcY, l } // draw at new destination - const CGPoint aDstPoint = { +nDstX, +nDstY }; + const CGPoint aDstPoint = CGPointMake( +nDstX, +nDstY); ::CGContextDrawLayerAtPoint( xCopyContext, aDstPoint, xSrcLayer ); // cleanup @@ -1249,7 +1249,7 @@ void AquaSalGraphics::drawBitmap( const SalTwoRect& rPosAry, const SalBitmap& rS if( !xImage ) return; - const CGRect aDstRect = {{rPosAry.mnDestX, rPosAry.mnDestY}, {rPosAry.mnDestWidth, rPosAry.mnDestHeight}}; + const CGRect aDstRect = CGRectMake( rPosAry.mnDestX, rPosAry.mnDestY, rPosAry.mnDestWidth, rPosAry.mnDestHeight); CGContextDrawImage( mrContext, aDstRect, xImage ); CGImageRelease( xImage ); RefreshRect( aDstRect ); @@ -1259,7 +1259,7 @@ void AquaSalGraphics::drawBitmap( const SalTwoRect& rPosAry, const SalBitmap& rS void AquaSalGraphics::drawBitmap( const SalTwoRect& rPosAry, const SalBitmap& rSalBitmap,SalColor ) { - DBG_ERROR("not implemented for color masking!"); + DBG_ERROR( "not implemented for color masking!"); drawBitmap( rPosAry, rSalBitmap ); } @@ -1276,7 +1276,7 @@ void AquaSalGraphics::drawBitmap( const SalTwoRect& rPosAry, const SalBitmap& rS if( !xMaskedImage ) return; - const CGRect aDstRect = {{rPosAry.mnDestX, rPosAry.mnDestY}, {rPosAry.mnDestWidth, rPosAry.mnDestHeight}}; + const CGRect aDstRect = CGRectMake( rPosAry.mnDestX, rPosAry.mnDestY, rPosAry.mnDestWidth, rPosAry.mnDestHeight); CGContextDrawImage( mrContext, aDstRect, xMaskedImage ); CGImageRelease( xMaskedImage ); RefreshRect( aDstRect ); @@ -1294,7 +1294,7 @@ void AquaSalGraphics::drawMask( const SalTwoRect& rPosAry, const SalBitmap& rSal if( !xImage ) return; - const CGRect aDstRect = {{rPosAry.mnDestX, rPosAry.mnDestY}, {rPosAry.mnDestWidth, rPosAry.mnDestHeight}}; + const CGRect aDstRect = CGRectMake( rPosAry.mnDestX, rPosAry.mnDestY, rPosAry.mnDestWidth, rPosAry.mnDestHeight); CGContextDrawImage( mrContext, aDstRect, xImage ); CGImageRelease( xImage ); RefreshRect( aDstRect ); @@ -1348,7 +1348,7 @@ SalColor AquaSalGraphics::getPixel( long nX, long nY ) // copy the requested pixel into the bitmap context if( IsFlipped() ) nY = mnHeight - nY; - const CGPoint aCGPoint = {-nX, -nY}; + const CGPoint aCGPoint = CGPointMake( -nX, -nY); CGContextDrawLayerAtPoint( xOnePixelContext, aCGPoint, mxLayer ); CGContextRelease( xOnePixelContext ); @@ -1485,7 +1485,7 @@ sal_Bool AquaSalGraphics::drawEPS( long nX, long nY, long nWidth, long nHeight, [NSGraphicsContext setCurrentContext: pDrawNSCtx]; // draw the EPS - const NSRect aDstRect = {{nX,nY},{nWidth,nHeight}}; + const NSRect aDstRect = NSMakeRect( nX, nY, nWidth, nHeight); const BOOL bOK = [xEpsImage drawInRect: aDstRect]; // restore the NSGraphicsContext @@ -1521,7 +1521,7 @@ bool AquaSalGraphics::drawAlphaBitmap( const SalTwoRect& rTR, if ( CheckContext() ) { - const CGRect aDstRect = {{rTR.mnDestX, rTR.mnDestY}, {rTR.mnDestWidth, rTR.mnDestHeight}}; + const CGRect aDstRect = CGRectMake( rTR.mnDestX, rTR.mnDestY, rTR.mnDestWidth, rTR.mnDestHeight); CGContextDrawImage( mrContext, aDstRect, xMaskedImage ); RefreshRect( aDstRect ); } @@ -1562,7 +1562,7 @@ bool AquaSalGraphics::drawTransformedBitmap( CGContextConcatCTM( mrContext, aCGMat ); // draw the transformed image - const CGRect aSrcRect = {{0,0}, {aSize.Width(), aSize.Height()}}; + const CGRect aSrcRect = CGRectMake( 0, 0, aSize.Width(), aSize.Height()); CGContextDrawImage( mrContext, aSrcRect, xImage ); CGImageRelease( xImage ); // restore the Quartz graphics state @@ -1585,7 +1585,7 @@ bool AquaSalGraphics::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 = CGRectMake( nX, nY, nWidth-1, nHeight-1); if( IsPenVisible() ) { aRect.origin.x += 0.5; @@ -2739,7 +2739,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 = CGRectMake( 0, 0, nWidth, nHeight); CGContextDrawImage( mxTargetContext, aFullRect, xXorImage ); CGImageRelease( xXorImage ); }
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits