summaryrefslogtreecommitdiff
path: root/hwpfilter
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-01-11 08:47:15 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-01-15 07:26:17 +0100
commit7d8e94444d989d0ac4a4055b207726708e9ec0da (patch)
treece3e4a09ed7932496c4d901360ff23787c8f6e24 /hwpfilter
parent80fb8d406ced47e6a2089f0c8ba5c103d2fec91f (diff)
convert a<b?a:b to std::min(a,b)
with something like git grep -nP '(.*)\s*<\s*(.*)\s*\?\s*\g1\s*:\s*\g2' -- *.?xx Change-Id: Id5078b35961847feb78a66204fdb7598ee63fd23 Note: we also convert a>b?b:a Reviewed-on: https://gerrit.libreoffice.org/47736 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'hwpfilter')
-rw-r--r--hwpfilter/source/hwpread.cxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/hwpfilter/source/hwpread.cxx b/hwpfilter/source/hwpread.cxx
index cd29aae17e25..25d1d5188fc4 100644
--- a/hwpfilter/source/hwpread.cxx
+++ b/hwpfilter/source/hwpread.cxx
@@ -80,9 +80,9 @@ bool FieldCode::Read(HWPFile & hwpf)
hwpf.Read4b(&len3, 1);
hwpf.Read4b(&binlen, 1);
- uint const len1_ = ((len1 > 1024) ? 1024 : len1) / sizeof(hchar);
- uint const len2_ = ((len2 > 1024) ? 1024 : len2) / sizeof(hchar);
- uint const len3_ = ((len3 > 1024) ? 1024 : len3) / sizeof(hchar);
+ uint const len1_ = std::min<uint>(len1, 1024) / sizeof(hchar);
+ uint const len2_ = std::min<uint>(len2, 1024) / sizeof(hchar);
+ uint const len3_ = std::min<uint>(len3, 1024) / sizeof(hchar);
str1.reset( new hchar[len1_ ? len1_ : 1] );
str2.reset( new hchar[len2_ ? len2_ : 1] );