Description: Unit conversion is done in various places in LibreOffice core. It is recommended to use the built-in function: o3tl::convert instead of writing a custom formula. The goal is to the increase accuracy and avoid errors, and also to be able to handle possible overflows. This is an example commit: Use o3tl::convert instead of manual conversion 6cbadf8bf1295a9c3d1d9a389e8cf076314facf4 This task is described in more details in this blog post: https://dev.blog.documentfoundation.org/2025/08/28/unit-conversion-in-libreoffice-code/ Code Pointers: To to find instances to change, one can try finding some magic numbers listed in the blog post. For example, consider measuring a line based on twips: line – Line unit (312 twip) If you search for 312 as a whole word, you may find some examples: $ git grep -w 312 *.cxx
Okhuomon Ajayi committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/6c688ee8625f3f5e7be50912e02cdf59f6ae7e5f tdf#168226 Use o3tl::convert() for unit conversion instead of custom It will be available in 26.2.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Okhuomon Ajayi committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/b261377735231e0556ad682feae0046e1029c1e7 tdf#168226 Fix rounding behavior in PtTo10Mu and TenMuToPt functions It will be available in 26.2.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.