[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/source

Tomaž Vajngerl tomaz.vajngerl at collabora.com
Fri Dec 11 12:38:44 PST 2015


 vcl/source/gdi/pdfwriter_impl.cxx |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit ffe150ce903d9cdc62c25ad3437e61d24ede17d6
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.com>
Date:   Fri Dec 4 18:19:08 2015 +0100

    tdf#94739 use GetScanlineSize instead of calculating it
    
    We calculate the scanline size wrongly when writing a PDF so the
    image is not exported correctly. BitmapAccess already has a method
    to determine the scanline size so use that instead.
    
    Change-Id: Icccba8f26c5e0fd4bd4c37bba7c5a7fe8d0094bd
    (cherry picked from commit 82e0c38e1205a3c8a70234a95ca33ab1400fbe57)
    Signed-off-by: Michael Meeks <michael.meeks at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/20595
    Tested-by: Jenkins <ci at libreoffice.org>

diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index 0b7fa46..e509b1a 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -11426,7 +11426,7 @@ bool PDFWriterImpl::writeBitmapObject( BitmapEmit& rObject, bool bMask )
         beginCompression();
         if( ! bTrueColor || pAccess->GetScanlineFormat() == BMP_FORMAT_24BIT_TC_RGB )
         {
-            const int nScanLineBytes = 1 + ( pAccess->GetBitCount() * ( pAccess->Width() - 1 ) / 8U );
+            const int nScanLineBytes = pAccess->GetScanlineSize();
 
             for( int i = 0; i < pAccess->Height(); i++ )
             {


More information about the Libreoffice-commits mailing list