oox/source/crypto/Standard2007Engine.cxx | 6 ++---- vcl/opengl/salbmp.cxx | 24 ++++++++++++------------ vcl/source/gdi/virdev.cxx | 10 ++++++---- 3 files changed, 20 insertions(+), 20 deletions(-)
New commits: commit 2f9d2919e1cc73e68403b14fea1ffc92c798b23a Author: Tomaž Vajngerl <[email protected]> Date: Mon Sep 28 16:56:31 2015 +0200 remove outputLength variable when calculating encryption verifier Change-Id: I144957b64ba2b693db61c17e42b08014124f8c99 diff --git a/oox/source/crypto/Standard2007Engine.cxx b/oox/source/crypto/Standard2007Engine.cxx index 09035d7..299d251 100644 --- a/oox/source/crypto/Standard2007Engine.cxx +++ b/oox/source/crypto/Standard2007Engine.cxx @@ -72,7 +72,6 @@ bool Standard2007Engine::generateVerifier() if (mKey.size() != 16) return false; - sal_uInt32 outputLength; vector<sal_uInt8> verifier(ENCRYPTED_VERIFIER_LENGTH); vector<sal_uInt8> encryptedVerifier(ENCRYPTED_VERIFIER_LENGTH); @@ -80,8 +79,7 @@ bool Standard2007Engine::generateVerifier() vector<sal_uInt8> iv; Encrypt aEncryptorVerifier(mKey, iv, Crypto::AES_128_ECB); - outputLength = aEncryptorVerifier.update(encryptedVerifier, verifier); - if (outputLength != ENCRYPTED_VERIFIER_LENGTH) + if (aEncryptorVerifier.update(encryptedVerifier, verifier) != ENCRYPTED_VERIFIER_LENGTH) return false; std::copy(encryptedVerifier.begin(), encryptedVerifier.end(), mInfo.verifier.encryptedVerifier); @@ -93,7 +91,7 @@ bool Standard2007Engine::generateVerifier() vector<sal_uInt8> encryptedHash(ENCRYPTED_VERIFIER_HASH_LENGTH, 0); Encrypt aEncryptorHash(mKey, iv, Crypto::AES_128_ECB); - outputLength = aEncryptorHash.update(encryptedHash, hash, hash.size()); + aEncryptorHash.update(encryptedHash, hash, hash.size()); std::copy(encryptedHash.begin(), encryptedHash.end(), mInfo.verifier.encryptedVerifierHash); return true; commit f306af880b702d8d7e869f78240e52c8d79a138d Author: Tomaž Vajngerl <[email protected]> Date: Mon Sep 28 12:56:20 2015 +0200 opengl: use VCL_GL_INFO in salbmp so messages appear apitrace Change-Id: I134820fa81c206b835d68dcaa3967045038b6f33 diff --git a/vcl/opengl/salbmp.cxx b/vcl/opengl/salbmp.cxx index 6144d9a..53e4687 100644 --- a/vcl/opengl/salbmp.cxx +++ b/vcl/opengl/salbmp.cxx @@ -62,7 +62,7 @@ OpenGLSalBitmap::OpenGLSalBitmap() OpenGLSalBitmap::~OpenGLSalBitmap() { Destroy(); - SAL_INFO( "vcl.opengl", "~OpenGLSalBitmap" ); + VCL_GL_INFO( "vcl.opengl", "~OpenGLSalBitmap" ); } bool OpenGLSalBitmap::Create( const OpenGLTexture& rTex, long nX, long nY, long nWidth, long nHeight ) @@ -71,7 +71,7 @@ bool OpenGLSalBitmap::Create( const OpenGLTexture& rTex, long nX, long nY, long OpenGLZone aZone; Destroy(); - SAL_INFO( "vcl.opengl", "OpenGLSalBitmap::Create from FBO: [" << nX << ", " << nY << "] " << nWidth << "x" << nHeight ); + VCL_GL_INFO( "vcl.opengl", "OpenGLSalBitmap::Create from FBO: [" << nX << ", " << nY << "] " << nWidth << "x" << nHeight ); mnWidth = nWidth; mnHeight = nHeight; @@ -87,7 +87,7 @@ bool OpenGLSalBitmap::Create( const OpenGLTexture& rTex, long nX, long nY, long else maTexture = OpenGLTexture( nX, nY, nWidth, nHeight ); mbDirtyTexture = false; - SAL_INFO( "vcl.opengl", "Created texture " << maTexture.Id() ); + VCL_GL_INFO( "vcl.opengl", "Created texture " << maTexture.Id() ); return true; } @@ -97,7 +97,7 @@ bool OpenGLSalBitmap::Create( const Size& rSize, sal_uInt16 nBits, const BitmapP OpenGLZone aZone; Destroy(); - SAL_INFO( "vcl.opengl", "OpenGLSalBitmap::Create with size: " << rSize ); + VCL_GL_INFO( "vcl.opengl", "OpenGLSalBitmap::Create with size: " << rSize ); if( !isValidBitCount( nBits ) ) return false; @@ -127,7 +127,7 @@ bool OpenGLSalBitmap::Create( const SalBitmap& rSalBmp, sal_uInt16 nNewBitCount const OpenGLSalBitmap& rSourceBitmap = static_cast<const OpenGLSalBitmap&>(rSalBmp); - SAL_INFO( "vcl.opengl", "OpenGLSalBitmap::Create from BMP: " << rSourceBitmap.mnWidth << "x" << rSourceBitmap.mnHeight ); + VCL_GL_INFO( "vcl.opengl", "OpenGLSalBitmap::Create from BMP: " << rSourceBitmap.mnWidth << "x" << rSourceBitmap.mnHeight ); if( isValidBitCount( nNewBitCount ) ) { @@ -169,7 +169,7 @@ OpenGLTexture& OpenGLSalBitmap::GetTexture() const pThis->CreateTexture(); else if( !maPendingOps.empty() ) pThis->ExecuteOperations(); - SAL_INFO( "vcl.opengl", "Got texture " << maTexture.Id() ); + VCL_GL_INFO( "vcl.opengl", "Got texture " << maTexture.Id() ); return pThis->maTexture; } @@ -177,7 +177,7 @@ void OpenGLSalBitmap::Destroy() { OpenGLZone aZone; - SAL_INFO( "vcl.opengl", "Destroy OpenGLSalBitmap" ); + VCL_GL_INFO( "vcl.opengl", "Destroy OpenGLSalBitmap" ); maPendingOps.clear(); maTexture = OpenGLTexture(); maUserBuffer.reset(); @@ -185,7 +185,7 @@ void OpenGLSalBitmap::Destroy() bool OpenGLSalBitmap::AllocateUserData() { - SAL_INFO( "vcl.opengl", "OpenGLSalBitmap::AllocateUserData" ); + VCL_GL_INFO( "vcl.opengl", "OpenGLSalBitmap::AllocateUserData" ); if( mnWidth && mnHeight ) { @@ -384,7 +384,7 @@ void OpenGLSalBitmap::ExecuteOperations() GLuint OpenGLSalBitmap::CreateTexture() { - SAL_INFO( "vcl.opengl", "::CreateTexture" ); + VCL_GL_INFO( "vcl.opengl", "::CreateTexture" ); GLenum nFormat = GL_RGBA; GLenum nType = GL_UNSIGNED_BYTE; sal_uInt8* pData( NULL ); @@ -454,7 +454,7 @@ GLuint OpenGLSalBitmap::CreateTexture() lclInstantiateTexture(maTexture, mnBufWidth, mnBufHeight, nFormat, nType, pData); - SAL_INFO( "vcl.opengl", "Created texture " << maTexture.Id() ); + VCL_GL_INFO( "vcl.opengl", "Created texture " << maTexture.Id() ); if( bAllocated ) delete[] pData; @@ -470,7 +470,7 @@ bool OpenGLSalBitmap::ReadTexture() { sal_uInt8* pData = maUserBuffer.get(); - SAL_INFO( "vcl.opengl", "::ReadTexture " << mnWidth << "x" << mnHeight ); + VCL_GL_INFO( "vcl.opengl", "::ReadTexture " << mnWidth << "x" << mnHeight ); if( pData == NULL ) return false; @@ -686,7 +686,7 @@ BitmapBuffer* OpenGLSalBitmap::AcquireBuffer( BitmapAccessMode nMode ) if( !maPendingOps.empty() ) { - SAL_INFO( "vcl.opengl", "** Creating texture and reading it back immediately" ); + VCL_GL_INFO( "vcl.opengl", "** Creating texture and reading it back immediately" ); if( !CreateTexture() || !AllocateUserData() || !ReadTexture() ) return NULL; } commit d76c5aa78f0b9004c6719dcc4d2be052c0703ba5 Author: Tomaž Vajngerl <[email protected]> Date: Mon Sep 28 12:51:02 2015 +0200 don't allocate (by eraseing) an un-initialized 1x1 virtual device Change-Id: I11c7063d7ac689866461ceabf8648f1c3c7bb17d diff --git a/vcl/source/gdi/virdev.cxx b/vcl/source/gdi/virdev.cxx index b8dc061..7319a1f 100644 --- a/vcl/source/gdi/virdev.cxx +++ b/vcl/source/gdi/virdev.cxx @@ -129,6 +129,8 @@ void VirtualDevice::ImplInitVirDev( const OutputDevice* pOutDev, { SAL_INFO( "vcl.virdev", "ImplInitVirDev(" << nDX << "," << nDY << "," << nBitCount << ")" ); + bool bErase = nDX > 0 && nDY > 0; + if ( nDX < 1 ) nDX = 1; @@ -191,7 +193,7 @@ void VirtualDevice::ImplInitVirDev( const OutputDevice* pOutDev, SetBackground( Wallpaper( Color( COL_WHITE ) ) ); // #i59283# don't erase user-provided surface - if( !pData ) + if( !pData && bErase) Erase(); // register VirDev in the list @@ -212,7 +214,7 @@ VirtualDevice::VirtualDevice( sal_uInt16 nBitCount ) "VirtualDevice::VirtualDevice(): Only 0, 1 or 8 allowed for BitCount, not " << nBitCount ); SAL_INFO( "vcl.gdi", "VirtualDevice::VirtualDevice( " << nBitCount << " )" ); - ImplInitVirDev( Application::GetDefaultDevice(), 1, 1, nBitCount ); + ImplInitVirDev( Application::GetDefaultDevice(), 0, 0, nBitCount ); } VirtualDevice::VirtualDevice( const OutputDevice& rCompDev, sal_uInt16 nBitCount ) @@ -223,7 +225,7 @@ VirtualDevice::VirtualDevice( const OutputDevice& rCompDev, sal_uInt16 nBitCount "VirtualDevice::VirtualDevice(): Only 0, 1 or 8 allowed for BitCount, not " << nBitCount ); SAL_INFO( "vcl.gdi", "VirtualDevice::VirtualDevice( " << nBitCount << " )" ); - ImplInitVirDev( &rCompDev, 1, 1, nBitCount ); + ImplInitVirDev( &rCompDev, 0, 0, nBitCount ); } VirtualDevice::VirtualDevice( const OutputDevice& rCompDev, sal_uInt16 nBitCount, sal_uInt16 nAlphaBitCount ) @@ -235,7 +237,7 @@ VirtualDevice::VirtualDevice( const OutputDevice& rCompDev, sal_uInt16 nBitCount SAL_INFO( "vcl.gdi", "VirtualDevice::VirtualDevice( " << nBitCount << ", " << nAlphaBitCount << " )" ); - ImplInitVirDev( &rCompDev, 1, 1, nBitCount ); + ImplInitVirDev( &rCompDev, 0, 0, nBitCount ); // Enable alpha channel mnAlphaDepth = sal::static_int_cast<sal_Int8>(nAlphaBitCount);
_______________________________________________ Libreoffice-commits mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
