summaryrefslogtreecommitdiff
path: root/vcl/source/gdi/dibtools.cxx
AgeCommit message (Collapse)AuthorFilesLines
2016-01-25return directlyDavid Tardon1-1/+2
Change-Id: I606ef8281774bba13e28c3ee9fe1f99594152f4a
2016-01-24fix buildCaolán McNamara1-1/+1
Change-Id: I3c8874787c1828ef3d3f02684384bd5634545d18
2016-01-24limit variable scopeDavid Tardon1-2/+1
Change-Id: I98d281f55ad76930ccc3fb768fe87aef0c55d2c7
2016-01-24move bmp dimension sanity check to a better placeDavid Tardon1-18/+17
Change-Id: I0eb67fedb14d9847417f1fef74d6837bfa672ae1
2016-01-24limit variable scopeDavid Tardon1-36/+36
Change-Id: I961d1378f81b511be3173c61206b53983841abbe
2016-01-24limit variable scopeDavid Tardon1-1/+1
Change-Id: Ic78c1e437f680a24427e48523d26c89b309d1a32
2016-01-24sanitize input to avoid large allocationDavid Tardon1-16/+47
Also avoid use of zero-sized array. Change-Id: I843f6ffa7821b10676e590a5744b1cdc4864913b
2016-01-24absolute seek is clearerDavid Tardon1-2/+2
Change-Id: Iec8ff121e630bc6f63f935af248edce4dd572428
2016-01-24sanitize valueDavid Tardon1-0/+2
Change-Id: I0dfde2343263251a6b3034736c5c7219c5e130e4
2016-01-21at least partially sanitize image dimensionsDavid Tardon1-0/+11
... to avoid enormous allocations later. Change-Id: I8ffb050f095bd7ba2fee5be738bb30cd45170b82
2015-11-12Windows header sanitizationAshod Nakashian1-1/+4
Isolation of windows headers using prewin.h and postwin.h headers and making headers dependent on them more self contained. Conversion of TCHAR to WCHAR and LPCTSTR to LPCWSTR etc. and cleanup of unnecessary casts. Change-Id: I7eff5c477d9223a064bfb4d962ff6d61960ee69c Reviewed-on: https://gerrit.libreoffice.org/19901 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-11-11new loplugin: memoryvarNoel Grandin1-3/+3
detect when we can convert a new/delete sequence on a local variable to use std::unique_ptr Change-Id: Iecae4e4197eccdfacfce2eed39aa4a69e4a660bc Reviewed-on: https://gerrit.libreoffice.org/19884 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2015-11-10loplugin:nullptr (automatic rewrite)Stephan Bergmann1-13/+13
Change-Id: I05e89f9896170d4df3d1377549ea074f06b884a0
2015-10-15cppcheck:variableScopeNoel Grandin1-14/+8
Change-Id: I9b671637fbe0f32e695d22b74bfb40a39a9fe884 Reviewed-on: https://gerrit.libreoffice.org/19364 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
2015-10-09Abstract out repeated code into lambdasStephan Bergmann1-32/+51
...to silence a clang-analyzer-deadcode.DeadStores on the last update of nUsed Change-Id: Ib470f09155bd181b05bc0342543a36e59b8dd937
2015-09-29loplugin:removeunusedmethods, remove unused stuffNoel Grandin1-8/+0
Change-Id: I35456b2a3ad2a84a1d045f09cdfb29e4c19b8350
2015-09-29coverity#1325070 Resource leakCaolán McNamara1-5/+5
Change-Id: I9ae845f1350095e5049ca4e56956fe9f5c7c918f
2015-09-29coverity#1325067 Resource leakCaolán McNamara1-1/+6
Change-Id: I1db24c81a2698ff49dd2441ddd1bc94a1a3e6f58
2015-09-28wmf spec says that these are only allowed bitcount valuesCaolán McNamara1-1/+13
Change-Id: Ia174feec73ee676567a3632d2f88b11c176b6363
2015-09-17make CalcMaskShift a verifiable operationCaolán McNamara1-2/+22
and check it on untrusted data Change-Id: I7c97a27d70f91b9686adf9dcb8b68c5aa25c2b4c Reviewed-on: https://gerrit.libreoffice.org/18637 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-08-31other bitmap methods check for bad_allocCaolán McNamara1-90/+89
Change-Id: Ic1083fdb566de0b5487b92197f33070ef42146f7
2015-06-17Replace boost::scoped_array<T> with std::unique_ptr<T[]>Takeshi Abe1-7/+7
This may reduce some degree of dependency on boost. Done by running a script like: git grep -l '#include *.boost/scoped_array.hpp.' \ | xargs sed -i -e 's@#include *.boost/scoped_array.hpp.@#include <memory>@' git grep -l '\(boost::\)\?scoped_array<\([^<>]*\)>' \ | xargs sed -i -e 's/\(boost::\)\?scoped_array<\([^<>]*\)>/std::unique_ptr<\2[]>/' ... and then killing duplicate or unnecessary includes, while changing manually m_xOutlineStylesCandidates in xmloff/source/text/txtimp.cxx, extensions/source/ole/unoconversionutilities.hxx, and extensions/source/ole/oleobjw.cxx. Change-Id: I3955ed3ad99b94499a7bd0e6e3a09078771f9bfd Reviewed-on: https://gerrit.libreoffice.org/16289 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-06-02loplugin:cstylecast: deal with those that are (technically) const_castStephan Bergmann1-3/+3
Change-Id: I1a9aa868d3724a7d14c181e45d956cdf2423e40c
2015-04-17loplugin:implicitboolconversion clean-upStephan Bergmann1-28/+33
Change-Id: I3c6baec2cec24e23e9bdf78882a69838f10b533c
2015-04-02loplugin:staticmethodsNoel Grandin1-4/+4
Change-Id: Ibf0c73ac17ec19ed672f66907db47057920babca
2015-03-28Clean up C-style casts from pointers to voidStephan Bergmann1-2/+2
Change-Id: Iad602cece6e328c7f5d5f36adb294c97b152ade3
2015-02-26expand this 1980's shift-fest, torture-by-ternery and magic '3' into humanCaolán McNamara1-9/+0
Change-Id: Ifb18d5fd0b330dde0edc428621af417ddc836b21
2015-01-24coverity#1264390 try and help coverity out wrt Bad bit shift operationCaolán McNamara1-1/+1
nBitCount can only be <=8 if aHeader.nBitCount <= 8, hopefully using aHeader.nBitCount here will make it clear to coverity that aHeader.nBitCount cannot be more than 31 and thus silence that warning Change-Id: Ie195ab55cafb9a967c1face8070089e040b242fa
2015-01-20Some more loplugin:cstylecast: vclStephan Bergmann1-7/+7
Change-Id: I74d35630b9fcdaa97af0b1f1e6d1e5c72488964d
2015-01-16remove unnecessary parenthesesNoel Grandin1-1/+1
left over from "SVStream operator>> to Write method" conversion Change-Id: I619eb743d7890d5c70d0a94e51ce263567fa6f3b
2015-01-12Resolves: fdo#87015 image missing from docCaolán McNamara1-7/+32
regression from commit e0cce521f1ad0cc384d30ce2f1077ea229fffe62 Author: Armin Le Grand <alg@apache.org> AuthorDate: Thu Jan 10 16:28:40 2013 +0000 Commit: Caolán McNamara <caolanm@redhat.com> CommitDate: Thu Jun 13 14:50:46 2013 +0100 Resolves: #i121504# Support for alpha channel in clipboard for all systems (cherry picked from commit ef3931ff410117e1237b3bef7bc090e8b83b9519) which blindly just bulldozed out the bMSOFormat branch Change-Id: Iec354f1fb585f0803b9df472bc9ec9e103aa5847
2015-01-08valgrind, zero out the trailing unused alignment bytesCaolán McNamara1-9/+14
as seen with fdo55736-1.docx Change-Id: Ie1dec06282a600e600f606a3b4ddd814613b0108
2015-01-07fdo#84938: convert COMPRESSMODE_ #defines to 'enum class'Noel Grandin1-1/+1
Change-Id: Ica501fc73e7e5f9dbd30dd9da3f337b2dc7e6f02
2015-01-05fdo#84938: replace NUMBERFORMAT_INT_ constants with 'enum class'Noel Grandin1-6/+6
Change-Id: I9c67de31f5571b282adc132d973b79bccb35fdc9
2014-11-14vcl: move the Impl class of MapMode ...uhm... out of the public header?Michael Stahl1-0/+1
And remove the tools/fract.hxx include. grep -l -r fract.hxx workdir/Dep/*Object* |wc -l before: 4569 after: 1851 Shrinks some libraries, example from --enable-dbgutil Fedora gcc 4.8.3: libvcllo.so by 473k (0.35%) libswlo.so by ~1Mb (sadly that is just 0.2%) Change-Id: I09bd025d551a5d2c5528b938a68c6aa5f8f114a0
2014-11-12valgrind+afl: bad rleCaolán McNamara1-3/+38
Change-Id: I0a9e5fc88ed1fcc7f1bd21218cabeb0adf65c9f4
2014-11-12valgrind+afl: short readCaolán McNamara1-1/+1
Change-Id: I4e78a434e4e49b376864549f7b96ca515eb1654a
2014-11-12Fix common typos. No automatic tools. Handmade…Andrea Gelmini1-1/+1
Change-Id: I1ab4e23b0539f8d39974787f226e57a21f96e959 Reviewed-on: https://gerrit.libreoffice.org/12164 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
2014-10-23Fraction: Revert "fdo#81356: convert Fraction to boost::rational<long> - wip"Jan Holesovsky1-2/+2
This reverts commit 47a2d7642d249d70b5da0c330a73f3a0032e4bba. Conflicts: cui/source/tabpages/transfrm.cxx svx/source/svdraw/svdedtv1.cxx svx/source/svdraw/svdibrow.cxx sw/source/filter/ww1/w1filter.cxx tools/source/generic/rational.cxx Change-Id: I4849916f5f277a4afef0e279b0135c76b36b9d15
2014-10-23Fraction: Revert "fdo#84854 it seems long is not enough on 32 bit"Jan Holesovsky1-2/+2
This reverts commit 582ef22d3e8e30ffd58f092d37ffda30bd07bd9e. Conflicts: svx/source/svdraw/svdedtv1.cxx svx/source/svdraw/svdibrow.cxx sw/source/filter/ww1/w1filter.cxx Change-Id: I80abc7abdeddc267eaabc9f8ab49611bb3f8ae83
2014-10-16fdo#84854 it seems long is not enough on 32 bitDavid Tardon1-2/+2
Fraction used BigInt internally for computations, rational does nothing like that. Change-Id: I3e9b25074f979bc291208f7c6362c3c40eb77ff5
2014-10-09fdo#81356: convert Fraction to boost::rational<long> - wipJuan Picca1-2/+2
* Added rational util functions used by Fraction class not available in the boost::rational class. * Replaced usage of Fraction by boost::rational<long> * Removed code that relies on: 1. fraction.IsValid() -- rational only allow valid values, ie denominator() != 0 2. rational.denominator() == 0 -- always false 3. rational.denominator() < 0 -- always false but implementation detail: http://www.boost.org/doc/libs/release/libs/rational/rational.html#Internal%20representation * Simplified code that relies on: 1. rational.denominator() != 0 -- always true * BUGS EXIST because Fraction allows the creation of invalid values but boost::rational throws the exception boost::bad_rational Change-Id: I84970a4956afb3f91ac0c8f726547466319420f9 Reviewed-on: https://gerrit.libreoffice.org/11551 Reviewed-by: David Tardon <dtardon@redhat.com> Tested-by: David Tardon <dtardon@redhat.com>
2014-09-26remove unnecessary casts in calls to SvStream.WriteUInt32Noel Grandin1-3/+3
left over from our conversion of the SvStream output operators to more specific methods Change-Id: I1d848f19f82783e6eabf2da37dbde78fe36ea1e0
2014-09-26remove unnecessary casts in calls to SvStream.WriteUInt16Noel Grandin1-3/+3
left over from our conversion of the SvStream output operators to more specific methods Change-Id: I482ca7abb84613971e7e8f839f7aa67a65cd71ff
2014-09-26remove unnecessary casts in calls to SvStream.WriteUCharNoel Grandin1-3/+3
left over from our conversion of the SvStream output operators to more specific methods Change-Id: I2ea4c7d97e745b3e6a3834f41ac7bfefa4883c7a
2014-06-19Avoid overflowStephan Bergmann1-1/+8
Change-Id: Iedcde3411a1bfeb1eb0207f572c8befe2071f54c
2014-04-24Fix scoped_ptr -> scoped_arrayStephan Bergmann1-1/+1
Change-Id: I427c49efabbe5cb60b5dc945d9c7f48c504700f0
2014-04-23Check for short readsStephan Bergmann1-13/+57
Change-Id: I55b9cec694623a3736a78b11b5fdde7d0edaf199
2014-04-11replace some SvStream seeking with calls to remainingSize()Michael Stahl1-5/+1
Change-Id: I2905e98425b9991d6138ab0adc15083d313ca445
2014-04-04WMF import: restore support for the ImplReadDIB(bFileHeader=false) versionMiklos Vajna1-1/+3
Regression from commit f7799c9317cc3187ae8aaedc36f829d478a59e77 (Resolves: #i124467# add check for image data offset..., 2014-03-28). Change-Id: I71e78aefca2ca5b07f763ec798226b9bb39a5254