RFC: Sane rectangle class
noelgrandin at gmail.com
Fri Mar 20 13:00:52 UTC 2020
On 2020/03/20 2:12 pm, Luboš Luňák wrote:
>> With one extra wrinkle: the current tools::Rectangle uses long, and lots of
>> places that work with tools::Rectangle also use long, which is particularly
>> pernicious because long is a different bit-size on Windows and Linux.
> Do you know a specific case where that actually matters? My personal position
> on integers is "use int, unless you explicitly need something else".
It means that various things that work fine on Linux because of the greater range (and where we do most of our testing)
fail in odd ways under Windows, because of under/overflow.
"int" is fine because it is 32-bits on both Linux and Windows - but will start to flush out weird issues which will most
likely be revealed by the ASAN buildbots - as happened when I tried to make tools::Rectangle use sal_Int32, we fixed a
handful of things and then gave up and rolled back.
see commit 8bc951daf79d
More information about the LibreOffice