[Libreoffice-commits] core.git: include/tools
Tomaž Vajngerl (via logerrit)
logerrit at kemper.freedesktop.org
Mon Jun 1 16:46:50 UTC 2020
include/tools/UnitConversion.hxx | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
New commits:
commit 5f8f8889a47a7079fc1beaa179e29cc32aa10e0e
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Sat May 23 11:54:01 2020 +0200
Commit: Tomaž Vajngerl <quikee at gmail.com>
CommitDate: Mon Jun 1 18:46:13 2020 +0200
vcl: add conversion point to twip int64 & double values
Change-Id: Id54d28b57c055269259317521f59d37dcdf9a456
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95274
Tested-by: Tomaž Vajngerl <quikee at gmail.com>
Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>
diff --git a/include/tools/UnitConversion.hxx b/include/tools/UnitConversion.hxx
index 2093db6181d9..2585fecbb590 100644
--- a/include/tools/UnitConversion.hxx
+++ b/include/tools/UnitConversion.hxx
@@ -20,11 +20,15 @@ constexpr sal_Int64 convertMm100ToTwip(sal_Int64 n)
return (n >= 0) ? (n * 72 + 63) / 127 : (n * 72 - 63) / 127;
}
+constexpr sal_Int64 convertPointToTwip(sal_Int64 nNumber) { return nNumber * 20; }
+
constexpr sal_Int64 convertPointToMm100(sal_Int64 nNumber)
{
- return convertTwipToMm100(nNumber * 20);
+ return convertTwipToMm100(convertPointToTwip(nNumber));
}
+constexpr double convertPointToTwip(double fNumber) { return fNumber * 20.0; }
+
constexpr double convertPointToMm100(double fNumber) { return fNumber * 35.27777777778; }
// Convert PPT's "master unit" (1/576 inch) to twips
More information about the Libreoffice-commits
mailing list