From 494270ff91d1617cb69262b409d56a591a1e7c07 Mon Sep 17 00:00:00 2001 From: Mikhail Voytenko Date: Mon, 7 Jun 2010 09:15:54 +0200 Subject: tl78: #i10000# fix warnings --- comphelper/source/misc/docpasswordhelper.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'comphelper/source') diff --git a/comphelper/source/misc/docpasswordhelper.cxx b/comphelper/source/misc/docpasswordhelper.cxx index 858d1ff19bca..fc41eaec3194 100644 --- a/comphelper/source/misc/docpasswordhelper.cxx +++ b/comphelper/source/misc/docpasswordhelper.cxx @@ -120,7 +120,7 @@ sal_uInt32 DocPasswordHelper::GetWordHashAsUINT32( nLowResult = ( ( ( nLowResult >> 14 ) & 0x0001 ) | ( ( nLowResult << 1 ) & 0x7FFF ) ) ^ nChar; } - nLowResult = ( ( ( nLowResult >> 14 ) & 0x001 ) | ( ( nLowResult << 1 ) & 0x7FF ) ) ^ nLen ^ 0xCE4B; + nLowResult = (sal_uInt16)( ( ( ( nLowResult >> 14 ) & 0x001 ) | ( ( nLowResult << 1 ) & 0x7FF ) ) ^ nLen ^ 0xCE4B ); nResult = ( nHighResult << 16 ) | nLowResult; } @@ -135,8 +135,8 @@ Sequence< sal_Int8 > DocPasswordHelper::GetWordHashAsSequence( sal_uInt32 nHash = GetWordHashAsUINT32( aUString ); Sequence< sal_Int8 > aResult( 4 ); aResult[0] = ( nHash >> 24 ); - aResult[1] = ( nHash & 0xFF0000 ); - aResult[2] = ( nHash & 0xFF00 ); + aResult[1] = ( ( nHash >> 16 ) & 0xFF ); + aResult[2] = ( ( nHash >> 8 ) & 0xFF ); aResult[3] = ( nHash & 0xFF ); return aResult; -- cgit