[Libreoffice-commits] .: Branch 'feature/pdf-signing' - vcl/source

Gökcen Eraslan gokcen at kemper.freedesktop.org
Wed Jun 20 05:46:44 PDT 2012


 vcl/source/gdi/pdfwriter_impl.cxx |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 9ad3203bc1585085c70b026465de1fdc27d1a3a2
Author: Gökçen Eraslan <gokcen.eraslan at gmail.com>
Date:   Wed Jun 20 15:46:13 2012 +0300

    Fix the calculation of ByteRange values.
    
    Change-Id: I1d386f381871da7e73cd9efc30ccb71081d24bbc

diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index cc65911..6746d4b 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -6111,9 +6111,9 @@ bool PDFWriterImpl::emitSignature()
     appendLiteralStringEncrypt( m_aCreationDateString, m_nSignatureObject, aLine );
 
     aLine.append( " /ByteRange [ 0 ");
-    aLine.append( m_nSignatureContentOffset, 10 );
+    aLine.append( m_nSignatureContentOffset - 1, 10 );
     aLine.append( " " );
-    aLine.append( m_nSignatureContentOffset + MAX_SIGNATURE_CONTENT_LENGTH, 10 );
+    aLine.append( m_nSignatureContentOffset + MAX_SIGNATURE_CONTENT_LENGTH + 1, 10 );
     aLine.append( " " );
 
     m_nSignatureLastByteRangeNoOffset = nOffset + aLine.getLength();
@@ -6142,7 +6142,7 @@ bool PDFWriterImpl::finalizeSignature()
     if ( aError != osl_File_E_None )
         return false;
 
-    sal_Int64 nLastByteRangeNo = nOffset - (m_nSignatureContentOffset + MAX_SIGNATURE_CONTENT_LENGTH);
+    sal_Int64 nLastByteRangeNo = nOffset - (m_nSignatureContentOffset + MAX_SIGNATURE_CONTENT_LENGTH) - 1;
 
     // 2- overwrite the value to the m_nSignatureLastByteRangeNoOffset position
     sal_uInt64 nWritten = 0;


More information about the Libreoffice-commits mailing list