diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index 88a9853ca392..5adb2e53358a 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -1661,16 +1661,14 @@ bool PDFWriterImpl::writeBufferBytes( const void* pBuffer, sal_uInt64 nBytes ) } else { - bool buffOK = true; if (m_aPDFEncryptor.m_bEncryptThisStream) { /* implement the encryption part of the PDF spec encryption algorithm 3.1 */ m_vEncryptionBuffer.resize(nBytes); - if (buffOK) - rtl_cipher_encodeARCFOUR(m_aPDFEncryptor.m_aCipher, pBuffer, static_cast(nBytes), m_vEncryptionBuffer.data(), static_cast(nBytes)); + rtl_cipher_encodeARCFOUR(m_aPDFEncryptor.m_aCipher, pBuffer, static_cast(nBytes), m_vEncryptionBuffer.data(), static_cast(nBytes)); } - const void* pWriteBuffer = (m_aPDFEncryptor.m_bEncryptThisStream && buffOK) ? m_vEncryptionBuffer.data() : pBuffer; + const void* pWriteBuffer = m_aPDFEncryptor.m_bEncryptThisStream ? m_vEncryptionBuffer.data() : pBuffer; m_DocDigest.update(static_cast(pWriteBuffer), static_cast(nBytes)); if (m_aFile.write(pWriteBuffer, nBytes, nWritten) != osl::File::E_None)