Further loplugin:redundantcast improvements for floating-integer conversions

Desktop / LibreOffice - Stephan Bergmann [redhat.com] - 17 May 2018 06:23 EDT

The code in svx/source/customshapes/EnhancedCustomShape2d.cxx started out as

> aStart.X() = (sal_Int32)( ( (double)( aStart.X() - aCenter.X() ) / fXScale ) ) + aCenter.X(); > aStart.Y() = (sal_Int32)( ( (double)( aStart.Y() - aCenter.Y() ) / fYScale ) ) + aCenter.Y(); > aEnd.X() = (sal_Int32)( ( (double)( aEnd.X() - aCenter.X() ) / fXScale ) ) + aCenter.X(); > aEnd.Y() = (sal_Int32)( ( (double)( aEnd.Y() - aCenter.Y() ) / fYScale ) ) + aCenter.Y();

in afd1cf255d9cb4c78633e668376a09bd309be7ef "INTEGRATION: CWS sj05", then the floating-point scaling factors got gradually removed first with 101559f88022162ede229fe14366d394700816fe "INTEGRATION: CWS bm3" and then completely with d9f21c90bd61d15fd78a8df9115bf2e9ededbd1b "Fixes Circular arrow distortion, Bug #46272".

Change-Id: I337d7893e513738c986d0e85efabcbf7bab912e5 Reviewed-on: https://gerrit.libreoffice.org/54434

ae39b1ef2dcc Further loplugin:redundantcast improvements for floating-integer conversions
compilerplugins/clang/redundantcast.cxx | 16 ++++++++++++++--
svx/source/customshapes/EnhancedCustomShape2d.cxx | 5 -----
sw/source/ui/vba/vbaparagraphformat.cxx | 4 ++--
3 files changed, 16 insertions(+), 9 deletions(-)

Upstream: cgit.freedesktop.org


  • Share