diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-07-23 15:08:41 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-07-23 16:35:56 +0200 |
commit | c13865a4caf7898c4e59a5b22bbd493d6dad9661 (patch) | |
tree | ec240498d4ba884309904e5b156a5d421740d71b /desktop | |
parent | ad7d72f0381f6a16db5c6c7bee538c475c233555 (diff) |
tdf#118716 Inner border of an embedded table can't be dragged around
regression from
commit f14b9d30293f180500fc56d81e5390021758e7c1
convert (a>b?a:b) to std::max(a,b)
In this code
int a;
std::max<sal_uInt16>(a,0)
std::max will first convert a and b to sal_uInt16, therefore potentially
converting a negative number to a positive number due to the conversion
rules. Then it will take the larger number.
While this code
int a;
static_cast<sal_uInt16>(a > 0 ? a : 0)
will compare first, and then convert the larger number to sal_uInt16,
which might result in making a "a" that is larger than 2^16 into a
smaller value, but which will never convert a negative "a" value into a
positive value.
Change-Id: Id4f6df0089b1a74ea4ac1c5d05655e7c1d8f0c7f
Reviewed-on: https://gerrit.libreoffice.org/57846
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'desktop')
0 files changed, 0 insertions, 0 deletions