diff options
author | Chris Sherlock <chris.sherlock79@gmail.com> | 2020-12-18 17:35:41 +1100 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2020-12-19 04:21:23 +0100 |
commit | 641d6c35f3494f7e62d5ca3089b1f0764cfeb0a8 (patch) | |
tree | 51cebcc6404ecce9f71a7450bc74d25cc88905d9 /vcl | |
parent | 0920491fef0f20cea19d31547589e66a0d0912d7 (diff) |
vcl: remove duplicate pScanlineRead assignment
Change-Id: I7864b8f009c2ea837f9d7afe43f882cf7037dca9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107953
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/gdi/bitmap3.cxx | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/vcl/source/gdi/bitmap3.cxx b/vcl/source/gdi/bitmap3.cxx index 5c27100ef50a..a6c83bb52cc1 100644 --- a/vcl/source/gdi/bitmap3.cxx +++ b/vcl/source/gdi/bitmap3.cxx @@ -769,20 +769,22 @@ bool Bitmap::Dither() bool bPal = pReadAcc->HasPalette(); pTmp = p2T; - if( bPal ) { Scanline pScanlineRead = pReadAcc->GetScanline(0); - for( tools::Long nZ = 0; nZ < nWidth; nZ++ ) + + if( bPal ) { - shiftColor(pTmp, pReadAcc->GetPaletteColor(pReadAcc->GetIndexFromData(pScanlineRead, nZ))); + for (tools::Long nZ = 0; nZ < nWidth; nZ++) + { + shiftColor(pTmp, pReadAcc->GetPaletteColor(pReadAcc->GetIndexFromData(pScanlineRead, nZ))); + } } - } - else - { - Scanline pScanlineRead = pReadAcc->GetScanline(0); - for( tools::Long nZ = 0; nZ < nWidth; nZ++ ) + else { - shiftColor(pTmp, pReadAcc->GetPixelFromData(pScanlineRead, nZ)); + for (tools::Long nZ = 0; nZ < nWidth; nZ++) + { + shiftColor(pTmp, pReadAcc->GetPixelFromData(pScanlineRead, nZ)); + } } } @@ -795,11 +797,12 @@ bool Bitmap::Dither() p1T = p2T; p2T = pTmp; - if( nY < nHeight ) + if (nY < nHeight) { + Scanline pScanlineRead = pReadAcc->GetScanline(nY); + if( bPal ) { - Scanline pScanlineRead = pReadAcc->GetScanline(nY); for( tools::Long nZ = 0; nZ < nWidth; nZ++ ) { shiftColor(pTmp, pReadAcc->GetPaletteColor(pReadAcc->GetIndexFromData(pScanlineRead, nZ))); @@ -807,7 +810,6 @@ bool Bitmap::Dither() } else { - Scanline pScanlineRead = pReadAcc->GetScanline(nY); for( tools::Long nZ = 0; nZ < nWidth; nZ++ ) { shiftColor(pTmp, pReadAcc->GetPixelFromData(pScanlineRead, nZ)); |