summaryrefslogtreecommitdiff
path: root/include/vcl/salbtype.hxx
AgeCommit message (Collapse)Author
2018-04-25loplugin:useuniqueptr pass BitmapBuffer around via std::unique_ptrNoel Grandin
Change-Id: I0a20e7d3816714e42d6863fff27734dd08ae24ae Reviewed-on: https://gerrit.libreoffice.org/53357 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-04-07Revert "long->sal_Int32 in tools/gen.hxx"Stephan Bergmann
This reverts commit 8bc951daf79decbd8a599a409c6d33c5456710e0. As discussed at <https://lists.freedesktop.org/archives/libreoffice/2018-April/079955.html> "long->sal_Int32 in tools/gen.hxx", that commit caused lots of problems with signed integer overflow, and the original plan was to redo it to consistently use sal_Int64 instead of sal_Int32. <https://gerrit.libreoffice.org/#/c/52471/> "sal_Int32->sal_Int64 in tools/gen.hxx" tried that. However, it failed miserably on Windows, causing odd failures like not writing out Pictures/*.svm streams out into .odp during CppunitTest_sd_export_ooxml2. So the next best approach is to just revert the original commit, at least for now. Includes revert of follow-up 8c50aff2175e85c54957d98ce32af40a3a87e168 "Fix Library_vclplug_qt5". Change-Id: Ia8bf34272d1ed38aac00e5d07a9d13fb03f439ae Reviewed-on: https://gerrit.libreoffice.org/52532 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-04-03long->sal_Int32 in tools/gen.hxxNoel Grandin
which triggered a lot of changes in sw/ Change-Id: Ia2aa22ea3f76463a85ea077a411246fcfed00bf6 Reviewed-on: https://gerrit.libreoffice.org/48806 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-02-18vcl: change mbIndex from sal_uInt8 to bool in BitmapColorChris Sherlock
In 193ec57c the comment not to change this bool was kept accidentally, but memcpy was removed in that commit so this is no longer an issue. Change-Id: I772d60bb940b3327f195707524b124d034f50f64 Reviewed-on: https://gerrit.libreoffice.org/49852 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-02-05vcl: remove BitmapColor Color() operatorChris Sherlock
BitmapColor has a Color() operator. However, this is confusing and tends to hide that the two classes aren't the same. I have converted this to GetColor(). Change-Id: I0be2dcb3fc420e7be9c8d04330e7a3fe69a5412a Reviewed-on: https://gerrit.libreoffice.org/48245 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com>
2018-01-31BitmapColor can be finalNoel Grandin
Change-Id: I903362c158190a9f1ee68c2e580a0c695a4c86d8 Reviewed-on: https://gerrit.libreoffice.org/48970 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-01-12More loplugin:cstylecast: vclStephan Bergmann
auto-rewrite with <https://gerrit.libreoffice.org/#/c/47798/> "Enable loplugin:cstylecast for some more cases" plus solenv/clang-format/reformat-formatted-files Change-Id: I363c01a1ae9e863fca4fb4589829492d7280d711
2018-01-11Replace macro with functionStephan Bergmann
...and move it into the only .cxx that uses it; making just enough of BitmapColor constexpr as is useful here Change-Id: I8a035f67f4b218dcef2f100814c62b25fb32d5be Reviewed-on: https://gerrit.libreoffice.org/47750 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-01-09convert COLOR_CHANNEL_MERGE to constexpr functionNoel Grandin
Change-Id: Ie46e0a47b433517b0bae0deabb447ff5c1000f22 Reviewed-on: https://gerrit.libreoffice.org/47595 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-11-06BitmapColor::GetLuminance doesn't need to use unsigned longNoel Grandin
Change-Id: Ic0f4c2c7576023a96266116a1237190586e4e816 Reviewed-on: https://gerrit.libreoffice.org/44316 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-10-08Make Color a forward declarationChris Sherlock
Change-Id: Ib28833555661b119de8e967b05e3c8691fca826a Reviewed-on: https://gerrit.libreoffice.org/43227 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
2017-08-17remove UL/L suffixes from integer constants on the RHS of expressionsNoel Grandin
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 shift-by-constant expressionsNoel Grandin
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-02-23loplugin:unusedmethodsNoel Grandin
Change-Id: I5a72ee666e71b4c5c8f43d327aa7e8eb62d1e51b Reviewed-on: https://gerrit.libreoffice.org/34537 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-02-08loplugin:unusedenumconstants read-only constants in vclNoel Grandin
Change-Id: I8c81444cbecdc103cc47d9a4133b0b4d9010e0c2 Reviewed-on: https://gerrit.libreoffice.org/34018 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-02-08coverity#1400143 Missing move assignment operatorCaolán McNamara
by using a vector and let the defaults kick in Change-Id: I84e6144ab4beeeb316ccb830e7be55e35d942062
2016-12-16CppunitTest_vcl_complextext: fix loplugin:cppunitassertequals warningsMiklos Vajna
Change-Id: I18b052cadb061535d7552f2ec1eac4b932489d22
2016-07-18Resolves: tdf#100731 include palette in checksumCaolán McNamara
Change-Id: I084d840b9fa078ebea3ff1471d8c8bc88171abc7
2016-06-24loplugin:singlevalfields in vcl(part1)Noel Grandin
Change-Id: I0031199937cc95793951a070c4b3d8910933e69f Reviewed-on: https://gerrit.libreoffice.org/26595 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-06-21Use real assert() instead of DBG_ASSERT()Tor Lillqvist
These assertions guard important invariants. We use real assert() also in the neighbouring bitmapaccess.hxx, for instance. Drop annoying exclamation marks. Change-Id: I9d08cb80b18e8f3a922357ec33c1418f8f1b33e6
2016-05-25Convert BMP_FORMAT to scoped enumNoel Grandin
Change-Id: I751ab762b6e6f961e9e73a8a2ca92a3f5a5eb1c8 Reviewed-on: https://gerrit.libreoffice.org/25189 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-05-22Convert BitmapAccessMode to scoped enumNoel Grandin
Change-Id: I0f2b86f0a34e257d00856ce4f1dbbb1869ec967a Reviewed-on: https://gerrit.libreoffice.org/25208 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-03-16loplugin:constantparams in vcl/Noel Grandin
also some improvements to the plugin Change-Id: I0e3a519d70756e577fcb1bd47dd66864b5b4c871 Reviewed-on: https://gerrit.libreoffice.org/23289 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
2016-02-23new loplugin: commaoperatorNoel Grandin
Change-Id: I03f24e61f696b7619855e3c7010aa0d874e5a4ff
2016-02-09Remove excess newlinesChris Sherlock
A ridiculously fast way of doing this is: for i in $(pcregrep -l -M -r --include='.*[hc]xx$' \ --exclude-dir=workdir --exclude-dir=instdir '^ {3,}' .) do perl -0777 -i -pe 's/^ {3,}/ /gm' $i done Change-Id: Iebb93eccbee9e4fc5c4380474ba595858a27ac2c Reviewed-on: https://gerrit.libreoffice.org/22224 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
2016-02-09Formatting changes across all modulesChris Sherlock
+ 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>
2015-11-10loplugin:nullptr (automatic rewrite)Stephan Bergmann
Change-Id: I05e89f9896170d4df3d1377549ea074f06b884a0
2015-09-29coverity#708213 ditch the empty ctor/dtorsCaolán McNamara
which should silence "708213 Uninitialized pointer field" Change-Id: I0e16a0b02f3d48c4da324f371cae2234ad4cb6e2
2015-09-17make CalcMaskShift a verifiable operationCaolán McNamara
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-09-17WaE: this method can be declared static ColorMaskElement::CalcMaskShiftTor Lillqvist
[loplugin:staticmethods]. And then 'const' makes no sense. Also, fix fallout warning: calling static member function through member call syntax, use 'ColorMaskElement::CalcMaskShift' instead [loplugin:staticcall]. But actually I wonder if this should be a non-static member function that operates on 'this' (and takes no parameter) instead? Also, the return value is unused. Change-Id: I24949b74bd43eb90499e3c881941b102a3622f92
2015-09-16move CalcMaskShift to ColorMaskElementCaolán McNamara
Change-Id: I6ed7e9bfea8b4500724866214fabd179fba20f20 Reviewed-on: https://gerrit.libreoffice.org/18636 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-09-16move mask into ColorMaskElement tooCaolán McNamara
Change-Id: I1bd5e2ee71aba088ed8b395a31977e7b567d8b48 Reviewed-on: https://gerrit.libreoffice.org/18635 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-09-16split out shared rgb components into structsCaolán McNamara
Change-Id: I125e0525f918e68714c1027c5b7144d8f914a575 Reviewed-on: https://gerrit.libreoffice.org/18634 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-08-21sal_uLong to size_tMatteo Casalin
Change-Id: Ie1774045329f543c05316ba2acfa332e3b323c7c
2015-08-21ColorMask: sal_uLong to better types, minor code reworkMatteo Casalin
Change-Id: I426fa847038e7a6f788761242cb43e38cb355a36
2015-08-21sal_uLong to sal_uInt16 as return type of BitmapColor::GetColorErrorMatteo Casalin
Change-Id: I62c0d073d6b22346b65e3560303d7fc9373bfc7e
2015-08-21There's no need to loop backward, in the endMatteo Casalin
Change-Id: I2ef533fcc2ac29446a07b98ab34acf1887909c6b
2015-08-21Bail-out early and rework loops to use correct unsigned typeMatteo Casalin
Change-Id: If70d600e1253e9d9271282c361e7edf01314eaa1
2015-08-21Improve readability (minor code modification, formatting)Matteo Casalin
Change-Id: I2ce0087493f53579f155f8c399909cdb542aa8a3
2015-08-19vcl: kill 'special member functions' the compiler generatesThorsten Behrens
No need to spell out otherwise auto-generated functions. Change-Id: I1d2aec552df197f6656b0a495cef22696667dc4b Reviewed-on: https://gerrit.libreoffice.org/17846 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-07-29Remove the unnecessary type definition: HPBYTEDaniel Robertson
HPBYTE is a duplicate defintion of Scanline as seen below. include/vcl/salbtype.hxx: 34: typedef sal_uInt8* HPBYTE; 35: typedef HPBYTE Scanline; Remove the definition of HPBYTE and inline the definition of Scanline. Replace all instances with sal_uInt8*. Change-Id: I8a79a9d6c45af57fbabf8d3e6a04a1b5eba15a7b Reviewed-on: https://gerrit.libreoffice.org/17175 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
2015-07-08loplugin:unusedmethods vclNoel Grandin
Change-Id: I98b88ca3369a2c888fd63796e39d42376d513002
2015-06-30remove some unnecessary typedefs to pointerNoel Grandin
that were really not helping make the code any clearer. Found with a search git grep -P 'typedef\s+\w+\s*\*\s*\w+\;' and manual inspection Change-Id: I6a5c031e9e060ad3623a7586ec8a8cc4fe6252e9
2015-05-23Remove include stdio (part6)Julien Nabet
Change-Id: I4dde46c81b36b318710e32c8f420dff8d9c2e655 Reviewed-on: https://gerrit.libreoffice.org/15879 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2015-05-20fix indentationNoel Grandin
Change-Id: Ia6fde08193f3e43225e843291ddc508afe74c356
2015-04-17loplugin:implicitboolconversion clean-upStephan Bergmann
Change-Id: I3c6baec2cec24e23e9bdf78882a69838f10b533c
2015-03-19MSVC and gcc are wrong, Clang was right, apparentlyTor Lillqvist
The 'unsigned int(expression)' syntax is *not* correct, says http://en.cppreference.com/w/cpp/language/explicit_cast, but apparently MSVC and gcc don't mind. Clang doesn't like it, though. Re-introduce kendy's change but use static_cast instead of functional cast. This reverts commit 33d2475d9f2f01308ba4675ac99aaabb43870e0f Change-Id: I799cce13e9bebf1a375243c294c4fa8788502ec6
2015-03-19Revert "Dr.Memory complains about this..."Tor Lillqvist
Obviously some thinko, does not compile. This reverts commit 684aec5496f7394969743614cfda12b11c0466af.
2015-03-19Dr.Memory complains about this...Jan Holesovsky
Change-Id: I00ad970ab7cc97cfa37d6785540d6cfa825976c8
2015-01-20Some more loplugin:cstylecast: vclStephan Bergmann
Change-Id: I74d35630b9fcdaa97af0b1f1e6d1e5c72488964d