summaryrefslogtreecommitdiff
path: root/comphelper/source/misc/docpasswordhelper.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'comphelper/source/misc/docpasswordhelper.cxx')
-rw-r--r--comphelper/source/misc/docpasswordhelper.cxx16
1 files changed, 8 insertions, 8 deletions
diff --git a/comphelper/source/misc/docpasswordhelper.cxx b/comphelper/source/misc/docpasswordhelper.cxx
index 173b196f9df1..3619b2846a45 100644
--- a/comphelper/source/misc/docpasswordhelper.cxx
+++ b/comphelper/source/misc/docpasswordhelper.cxx
@@ -56,7 +56,7 @@ static uno::Sequence< sal_Int8 > GeneratePBKDF2Hash( const ::rtl::OUString& aPas
{
uno::Sequence< sal_Int8 > aResult;
- if ( aPassword.getLength() && aSalt.getLength() && nCount && nHashLength )
+ if ( !aPassword.isEmpty() && aSalt.getLength() && nCount && nHashLength )
{
::rtl::OString aBytePass = ::rtl::OUStringToOString( aPassword, RTL_TEXTENCODING_UTF8 );
aResult.realloc( 16 );
@@ -107,7 +107,7 @@ uno::Sequence< beans::PropertyValue > DocPasswordHelper::GenerateNewModifyPasswo
sal_Bool DocPasswordHelper::IsModifyPasswordCorrect( const ::rtl::OUString& aPassword, const uno::Sequence< beans::PropertyValue >& aInfo )
{
sal_Bool bResult = sal_False;
- if ( aPassword.getLength() && aInfo.getLength() )
+ if ( !aPassword.isEmpty() && aInfo.getLength() )
{
::rtl::OUString sAlgorithm;
uno::Sequence< sal_Int8 > aSalt;
@@ -227,7 +227,7 @@ sal_uInt16 DocPasswordHelper::GetXLHashAsUINT16(
::rtl::OString aString = ::rtl::OUStringToOString( aUString, nEnc );
- if ( aString.getLength() && aString.getLength() <= SAL_MAX_UINT16 )
+ if ( !aString.isEmpty() && aString.getLength() <= SAL_MAX_UINT16 )
{
for ( sal_Int32 nInd = aString.getLength() - 1; nInd >= 0; nInd-- )
{
@@ -276,7 +276,7 @@ Sequence< sal_Int8 > DocPasswordHelper::GetXLHashAsSequence(
/*static*/ uno::Sequence< sal_Int8 > DocPasswordHelper::GenerateStd97Key( const ::rtl::OUString& aPassword, const uno::Sequence< sal_Int8 >& aDocId )
{
uno::Sequence< sal_Int8 > aResultKey;
- if ( aPassword.getLength() && aDocId.getLength() == 16 )
+ if ( !aPassword.isEmpty() && aDocId.getLength() == 16 )
{
sal_uInt16 pPassData[16];
rtl_zeroMemory( pPassData, sizeof(pPassData) );
@@ -366,8 +366,8 @@ Sequence< sal_Int8 > DocPasswordHelper::GetXLHashAsSequence(
{
for( ::std::vector< OUString >::const_iterator aIt = pDefaultPasswords->begin(), aEnd = pDefaultPasswords->end(); (eResult == DocPasswordVerifierResult_WRONG_PASSWORD) && (aIt != aEnd); ++aIt )
{
- OSL_ENSURE( aIt->getLength() > 0, "DocPasswordHelper::requestAndVerifyDocPassword - unexpected empty default password" );
- if( aIt->getLength() > 0 )
+ OSL_ENSURE( !aIt->isEmpty(), "DocPasswordHelper::requestAndVerifyDocPassword - unexpected empty default password" );
+ if( !aIt->isEmpty() )
{
eResult = rVerifier.verifyPassword( *aIt, aEncData );
if( pbIsDefaultPassword )
@@ -390,7 +390,7 @@ Sequence< sal_Int8 > DocPasswordHelper::GetXLHashAsSequence(
// try media password (skip, if result is OK or ABORT)
if( eResult == DocPasswordVerifierResult_WRONG_PASSWORD )
{
- if( rMediaPassword.getLength() > 0 )
+ if( !rMediaPassword.isEmpty() )
eResult = rVerifier.verifyPassword( rMediaPassword, aEncData );
}
@@ -405,7 +405,7 @@ Sequence< sal_Int8 > DocPasswordHelper::GetXLHashAsSequence(
rxInteractHandler->handle( xRequest );
if( pRequest->isPassword() )
{
- if( pRequest->getPassword().getLength() > 0 )
+ if( !pRequest->getPassword().isEmpty() )
eResult = rVerifier.verifyPassword( pRequest->getPassword(), aEncData );
}
else