diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-03-27 12:22:15 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-03-27 13:47:47 +0100 |
commit | dfed481524113a1be03d29ec8a9e13bb96052895 (patch) | |
tree | b80f9265c76f9a2446b19242349c826428b13ef3 /vcl | |
parent | c8c4c84a5dda6f06aedba8d4cfef208be6812dbc (diff) |
process palette standalone
Change-Id: I489a5cdecf4a5c856e9e5fdd03e6f9c920c0a4d5
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/gdi/dibtools.cxx | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/vcl/source/gdi/dibtools.cxx b/vcl/source/gdi/dibtools.cxx index 1f2b0a63e26d..5ac640a167e7 100644 --- a/vcl/source/gdi/dibtools.cxx +++ b/vcl/source/gdi/dibtools.cxx @@ -288,9 +288,9 @@ bool ImplReadDIBInfoHeader(SvStream& rIStm, DIBV5Header& rHeader, bool& bTopDown return rIStm.good(); } -bool ImplReadDIBPalette( SvStream& rIStm, BitmapWriteAccess& rAcc, bool bQuad ) +bool ImplReadDIBPalette(SvStream& rIStm, BitmapPalette& rPal, bool bQuad) { - const sal_uInt16 nColors = rAcc.GetPaletteEntryCount(); + const sal_uInt16 nColors = rPal.GetEntryCount(); const sal_uLong nPalSize = nColors * ( bQuad ? 4UL : 3UL ); BitmapColor aPalColor; @@ -310,7 +310,7 @@ bool ImplReadDIBPalette( SvStream& rIStm, BitmapWriteAccess& rAcc, bool bQuad ) if( bQuad ) pTmpEntry++; - rAcc.SetPaletteColor( i, aPalColor ); + rPal[i] = aPalColor; } return( rIStm.GetError() == 0UL ); @@ -935,8 +935,9 @@ bool ImplReadDIBBody( SvStream& rIStm, Bitmap& rBmp, AlphaMask* pBmpAlpha, sal_u // read palette if (nColors) { - pAcc->SetPaletteEntryCount(nColors); - ImplReadDIBPalette(*pIStm, *pAcc, aHeader.nSize != DIBCOREHEADERSIZE); + BitmapPalette aPalette(nColors); + ImplReadDIBPalette(*pIStm, aPalette, aHeader.nSize != DIBCOREHEADERSIZE); + pAcc->SetPalette(aPalette); } // read bits |