vcl/inc/osx/salprn.h |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit b261377735231e0556ad682feae0046e1029c1e7
Author:     Okhuomon Ajayi <[email protected]>
AuthorDate: Wed Oct 22 12:36:26 2025 +0100
Commit:     Mike Kaganski <[email protected]>
CommitDate: Wed Oct 22 15:50:40 2025 +0200

    tdf#168226 Fix rounding behavior in PtTo10Mu and TenMuToPt functions
    
    When o3tl::convert is used with floating-point input, it provides double 
output
    without rounding. Before the change to use o3tl::convert in commit
    6c688ee8625f3f5e7be50912e02cdf59f6ae7e5f, the result was rounded.
    After the mentioned commit, it truncated when converting double to int.
    
    To match the previous behavior, the result of o3tl::convert must be rounded.
    This restores the behavior that existed before switching to o3tl::convert.
    
    Change-Id: Id54b1c74f320b6f4cfa49c13ce4182434e9e6a8e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192841
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <[email protected]>

diff --git a/vcl/inc/osx/salprn.h b/vcl/inc/osx/salprn.h
index 491d80b02501..21b63ca758d5 100644
--- a/vcl/inc/osx/salprn.h
+++ b/vcl/inc/osx/salprn.h
@@ -149,8 +149,8 @@ class AquaSalPrinter : public SalPrinter
     AquaSalPrinter& operator=(const AquaSalPrinter&) = delete;
 };
 
-inline int PtTo10Mu( double nPoints ) { return o3tl::convert(nPoints, 
o3tl::Length::pt, o3tl::Length::mm100); }
+inline int PtTo10Mu( double nPoints ) { return 
std::round(o3tl::convert(nPoints, o3tl::Length::pt, o3tl::Length::mm100)); }
 
-inline double TenMuToPt( double nUnits ) { return o3tl::convert(nUnits, 
o3tl::Length::mm100, o3tl::Length::pt); }
+inline double TenMuToPt( double nUnits ) { return 
std::round(o3tl::convert(nUnits, o3tl::Length::mm100, o3tl::Length::pt)); }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Reply via email to