summaryrefslogtreecommitdiff
path: root/vcl/source/gdi/dibtools.cxx
AgeCommit message (Collapse)AuthorFilesLines
2017-10-30loplugin:constantparam in vclNoel Grandin1-19/+4
Change-Id: Ic32e4098dcdae5ca5d7fe2749badedabda86a90d Reviewed-on: https://gerrit.libreoffice.org/44043 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-10-26vcl: make MapMode constructor explicitMichael Stahl1-1/+1
Insert constructor everywhere, except a couple places that apparently want to compare GetMapUnit(). Change-Id: I1910deb60562e5e949203435e827057f70a3f988
2017-10-25ofz#3750 Undefined-shiftCaolán McNamara1-1/+4
Change-Id: If227dea7758c22cadfad83192e0ad31a4183b5b5 Reviewed-on: https://gerrit.libreoffice.org/43747 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-10-25ofz#3753 Integer-overflowCaolán McNamara1-0/+3
Change-Id: Icdcd42cc064e18686e6738b4195b6668c7d5d05e Reviewed-on: https://gerrit.libreoffice.org/43748 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-10-21check bmp seekCaolán McNamara1-1/+2
Change-Id: Ie5e40d7817c4bac2a645822863e62467739801e8 Reviewed-on: https://gerrit.libreoffice.org/43672 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-09-21ofz#2869 avoid oom with bmp rle imagesCaolán McNamara1-16/+33
and to the sanity checks on remaining data size *after* the seek to the offset, which requires moving the read of the palette to remain before that seek Change-Id: I687a79fb3f109556c1a7aaa9423f77a1eb98a3cf Reviewed-on: https://gerrit.libreoffice.org/42461 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-08-17remove UL/L suffixes from integer constants on the RHS of expressionsNoel Grandin1-12/+12
Change-Id: I899a8126c9d971601fea6c77eca165718aea0ac5 Reviewed-on: https://gerrit.libreoffice.org/41237 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-08-17remove UL/L suffixes from integer constants in initialiser/call expressionsNoel Grandin1-20/+20
Change-Id: Iae081567c4fa5b88edbd12cf2fbafd2b8f31b300 Reviewed-on: https://gerrit.libreoffice.org/41214 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-08-17remove UL/L suffixes from shift-by-constant expressionsNoel Grandin1-1/+1
Change-Id: Ia470f643e3eefeccc14183133603db260460bd53 Reviewed-on: https://gerrit.libreoffice.org/41212 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-18loplugin:constparams in vclNoel Grandin1-6/+6
Change-Id: I36afe2107e07ffb9b73c0b76be600e3e999a0fd4 Reviewed-on: https://gerrit.libreoffice.org/40116 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-14use ERRCODE_NONE instead of 0Noel Grandin1-6/+6
peeling off a small chunk of my ErrCode strong_int conversion Change-Id: Idc89e8496083beed7608cba705cd981139eb7111 Reviewed-on: https://gerrit.libreoffice.org/38777 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-30teach redundantcast plugin about functional castsNoel Grandin1-1/+1
Change-Id: Iac8ccd17d9e46ebb2cb55db7adb06c469bbd4ea0 Reviewed-on: https://gerrit.libreoffice.org/37910 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-04-17move the exception handlingCaolán McNamara1-159/+152
Change-Id: Ie61a424a78be85c1dc54dd56451319356227f443
2017-04-16return false on exceptionCaolán McNamara1-152/+159
Change-Id: I478724b2842eed847c28fdd90c95ea86c80e86f4
2017-04-06Improved loplugin:redundantcast, static_cast on arithmetic types: vclStephan Bergmann1-3/+3
Change-Id: I5c85d3df578d0b7e9ffc54679b73a0ce35de8620
2017-04-04ofz#984 better match post-creation aBitmap.HasGreyPalette() logicCaolán McNamara1-1/+1
i.e. Bitmap::HsGreyPalette checks that the palette has entries before calling Palette::IsGreyPalette Change-Id: I287647869ad615327f3119b7798f410e22140302
2017-03-31ofz: 0 bitcount bmps are unsupportedCaolán McNamara1-0/+4
Change-Id: Ibd7b25546006506350f9fc009596f2989a305a4c
2017-03-31expand forcing to mono mask during load to non-indexed sources tooCaolán McNamara1-4/+12
Change-Id: I38c1eec5e180d689de72413b1438c88a1085bbb5
2017-03-27ofz#948 optimize the edge-case of converting masks to 1bit during dib loadCaolán McNamara1-36/+46
Change-Id: Ibed50b92ab49685a1ac033c93bd52bc7d2ea581c Reviewed-on: https://gerrit.libreoffice.org/35757 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-03-27move bitmap allocation after palette readCaolán McNamara1-10/+10
Change-Id: Ie7b2d64bde48d49c6e389c0770f2456187107bda
2017-03-27return early on errorCaolán McNamara1-186/+184
no logc change intended Change-Id: I9a000ccc53b13d2948264b18ae0abf29a6ddc33c
2017-03-27reuse palette objectCaolán McNamara1-3/+3
Change-Id: I72035a49d30955cdc6334f6064a1a2e902c1a9f0
2017-03-27process palette standaloneCaolán McNamara1-5/+6
Change-Id: I489a5cdecf4a5c856e9e5fdd03e6f9c920c0a4d5
2017-03-23loplugins:redundantcast teach it about c-style typedef castsNoel Grandin1-1/+1
Change-Id: I1ac11a2481c0f4d8be1e1fd7c7637ac0ece3d65c Reviewed-on: https://gerrit.libreoffice.org/35558 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-03-14ofz: reject broken rle bmpsCaolán McNamara1-1/+2
Change-Id: I1354d4aa4d7e46cd3bf463e3350071aad3ff5674
2017-03-10ofz#787 avoid bmp oomCaolán McNamara1-2/+3
Change-Id: Id5d1a1b8dd6d4e78bef9d09ab68d1e7daf7e1bd5
2017-03-02-Werror,-Wimplicit-fallthroughStephan Bergmann1-0/+1
Change-Id: I7a3f7233018e76208f80e47eb176c2879e943e47
2017-03-02reject bmps with unknown compression schemesCaolán McNamara1-6/+22
and RLE8/RLE4 compression with wrong bitmap depth Change-Id: I7e580cb119e90262a88c57b86f562eaba81c4944
2017-03-01ofz: Z_NEED_DICT is unsupportedCaolán McNamara1-2/+3
Change-Id: Ib0945d5a4606915aff9ee3019203caaf2a3cc7c5
2017-02-24vector::data seems more natural than &vector::frontCaolán McNamara1-2/+2
Change-Id: I0ce48075ad186cf1f9bd3e13fa76269fa9819af1
2017-01-27loplugin: unnecessary destructor vbahelper..vclNoel Grandin1-12/+0
Change-Id: I6b7800d4a456391251168f7923a1ec7a5ca9efc9 Reviewed-on: https://gerrit.libreoffice.org/33577 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-12-22Resolves: ofz#310: Sanitize 1 bit bitmap palette indexes tooCaolán McNamara1-1/+5
Change-Id: Ied2b71eb1c9088bbbff5fed97f7a04b43f4b4827
2016-12-05Change Read/Write access to Scoped Read/Write accessMark Page1-17/+13
Change-Id: I2259af0d169f850ceb39f22424197912dfd20171 Reviewed-on: https://gerrit.libreoffice.org/31624 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-10-05convert MapUnit to scoped enumNoel Grandin1-3/+3
I left a prefix on the names "Map" so that I would not have to re-arrange each name too much, since I can't start identifiers with digits like "100thMM" And remove RSC_EXTRAMAPUNIT, which doesn't seem to be doing anything anymore. Change-Id: I5187824aa87e30caf5357b51b5384b5ab919d224 Reviewed-on: https://gerrit.libreoffice.org/29096 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-09-16tdf#96505 - Remove "long" integer literals in vcl/source/gdi/e123461-34/+34
Removed the "long" integer literals in "vcl/source/gdi/". Some literals are left to match external methods Change-Id: I55aa9bd2935bfd82c9c1cc5cd1efcc4b7c3d9346 Reviewed-on: https://gerrit.libreoffice.org/27784 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2016-09-15replace sal_Size with std::size_t (or sal_uInt64 for SvStream pos)Michael Stahl1-4/+4
... except in include/rtl, include/sal, include/uno, where sal_Size is retained for compatibility, and where callers of rtl functions pass in pointers that are incompatible on MSVC. Change-Id: I8344453780689f5120ba0870e44965b6d292450c
2016-09-01For Valgrind, zero out alignment bytes of 24-bit bitmap, tooStephan Bergmann1-2/+7
...caused false warnings in CppunitTest_sw_filters_test testing sw/qa/core/exportdata/html/pass/cp1000068.odt Change-Id: I48943d5d4999e1b8c9a7ab50e39e65b2171b1b94
2016-06-22crashtesting: fix bmp->odg failure...Caolán McNamara1-15/+43
id:000178,src:000000,op:havoc,rep:16.bmp id:000383,src:000047,op:flip2,pos:18,+cov.bmp id:000403,src:000047,op:arith32,pos:22,val:-33.bmp id:000317,src:000025,op:havoc,rep:8.bmp id:000119,src:000000,op:havoc,rep:16.bmp id:000167,src:000000,op:havoc,rep:8.bmp revealed since commit 81e3ca4f60e6ac0823c1233841c22a759cfe937f Author: Tor Lillqvist <tml@collabora.com> Date: Tue Jun 21 10:34:21 2016 +0300 Use real assert() instead of DBG_ASSERT() sanitize invalid palette entry indexes at the outer perimeter on initial load to try and avoid having to do it in all sort of places in the interior. we load the palette before getting here, so we should always know the palette size here Change-Id: I8856787d28310898c3806647fc181a97cfa88514
2016-06-21Put more local functions into the unnamed namespaceTor Lillqvist1-13/+12
Change-Id: I483a1943c3c229aa839a72b333061f92c6b728ba
2016-06-06tools: rename SvStream::Read/Write to ReadBytes/WriteBytesMichael Stahl1-27/+29
Change-Id: Ib788a30d413436aa03f813aa2fddcbc4d6cd2f9a Reviewed-on: https://gerrit.libreoffice.org/25972 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2016-05-30convert TransparentType to scoped enumNoel Grandin1-8/+9
Change-Id: I25ec59fd41b5aa8741a9e864b5204481a84c3ba6 Reviewed-on: https://gerrit.libreoffice.org/25601 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-25Convert BMP_FORMAT to scoped enumNoel Grandin1-11/+11
Change-Id: I751ab762b6e6f961e9e73a8a2ca92a3f5a5eb1c8 Reviewed-on: https://gerrit.libreoffice.org/25189 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-03-17loplugin:constantparam in toolsNoel Grandin1-1/+1
Change-Id: I3774661799c074561c694515baba42a375d0a077 Reviewed-on: https://gerrit.libreoffice.org/23301 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-03-15remove unnecessary parentheses in case labelsNoel Grandin1-18/+18
Change-Id: I987bf68c767709080c67c8b183c036a4109c6caa
2016-02-22loplugin:commaoperator in vcl/Noel Grandin1-2/+2
Change-Id: Ia5bbce27d9e9526122ce1e27389c7845e6709f27
2016-02-09Formatting changes across all modulesChris Sherlock1-1/+0
+ Removed comment cruft + Tab formatting in number of files + Some commented out code removed + Tab characters replaced with spaces + Newline cleanup in quite a few files + Tweak header guard #endifs Change-Id: I3208ff2f047da890edcc49b73389aca22442f5fc Reviewed-on: https://gerrit.libreoffice.org/22221 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
2016-02-08loplugin:unusedmethodsNoel Grandin1-5/+0
using an idea from dtardon: <dtardon> noelgrandin, hi. could you try to run the unusedmethods clang plugin with "make build-nocheck"? that would catch functions that are only used in tests. e.g., i just removed the whole o3tl::range class, which has not been used in many years, but htere was a test for it... <noelgrandin> dtardon, interesting idea! Sure, I can do that. Change-Id: I5653953a426a2186a1e43017212d87ffce520387 Reviewed-on: https://gerrit.libreoffice.org/22041 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
2016-02-06vcl: bmpacc.hxx -> bitmapaccess.hxxChris Sherlock1-1/+1
Change-Id: I4bb19d6103c4a6a902d86b62a857e3478493924c
2016-01-29tdf#91017 Enhance WMF import of EMR_ALPHABLEND actionArmin Le Grand1-6/+16
The EMR_ALPHABLEND action was added 2012/2013, but missed support for Bitmaps with Mask/Alpha. Due to that files with WMF containing these actions may look different from before. Added suport to load contained Mask/Alpha information in DIBs and the needed additional processing through the display chain. WMF import is still based on Metafile creation, when it would be using Primitives more original data could be preserved. Change-Id: I577569848cee2528328181fa0c7eb7f87857d094 Reviewed-on: https://gerrit.libreoffice.org/21709 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Reviewed-by: Armin Le Grand <Armin.Le.Grand@cib.de>
2016-01-25also use the right stream for checkDavid Tardon1-1/+1
Change-Id: I019956e80c310317314673c6444e38e6e78ec7f2