summaryrefslogtreecommitdiff
path: root/o3tl
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2021-08-10 08:10:19 +0900
committerTomaž Vajngerl <quikee@gmail.com>2021-08-11 06:41:17 +0200
commitfa339b3adb53300ae68913bed87e18caf9f2e262 (patch)
treee3aed1bb38664cfe343a6d7f0803d2312c86c76a /o3tl
parente89404f00b25cfddd4098b4b2cf900d190617221 (diff)
convert some LogicToLogic calls to use o3tl::convert instead
If a LogicToLogic uses fixed units, we can use o3tl::convert instead. We can also do the same for all other cases where LogicToLogic is used, but that needs additional investigation to determine if it is safe to do so. Note: MapUnit::Pixel is converted to o3tl::Length::pt because it assumed 72 PPI for a logical pixel, which corresponds with the conversion rate of a point (72 PPI). Today, 96 PPI is standard, which is also used for o3tl::Length:px. Change-Id: I29126df38bfcfda74b5d83d4cb880a378aecd18b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120230 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'o3tl')
-rw-r--r--o3tl/qa/test-unit_conversion.cxx2
1 files changed, 2 insertions, 0 deletions
diff --git a/o3tl/qa/test-unit_conversion.cxx b/o3tl/qa/test-unit_conversion.cxx
index 80b01ea2bf2b..8b2c05c54549 100644
--- a/o3tl/qa/test-unit_conversion.cxx
+++ b/o3tl/qa/test-unit_conversion.cxx
@@ -875,5 +875,7 @@ static_assert(o3tl::toTwips(25, o3tl::Length::in100) == 1440 / 4);
static_assert(o3tl::toTwips(15, o3tl::Length::in100) == 216);
// the following twip value used to the constant for 20mm
static_assert(o3tl::toTwips(20, o3tl::Length::mm) == 1134);
+// 847 100thmm used to represent 24pt
+static_assert(o3tl::convert(24, o3tl::Length::pt, o3tl::Length::mm100) == 847);
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */