summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.com>2015-12-04 18:19:08 +0100
committerTomaž Vajngerl <tomaz.vajngerl@collabora.com>2015-12-04 18:27:12 +0100
commit2ec558395c70db9d493e705566673f7e7c349a7a (patch)
tree6cfd9c1b55228fdbc2a9cc612f1ee3c8291c5bd2
parent5a3e156f9595cc9490d6ac942a71c824429adea2 (diff)
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)
-rw-r--r--vcl/source/gdi/pdfwriter_impl.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index a04fa0d0613b..7b82e0190340 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -11420,7 +11420,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( long i = 0; i < pAccess->Height(); i++ )
{