summaryrefslogtreecommitdiff
path: root/starmath/inc
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2022-11-02 11:03:08 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2022-11-04 19:01:48 +0100
commit4d493db529600c3ae39b39da0c708c36d679a76b (patch)
tree86abc8bd45aea8a9a4691b2e2692c450d28d1909 /starmath/inc
parente126c98bf8ca4be6f4f8018446ab0d6060d731d5 (diff)
lok: use twips in Math
Change-Id: I11acd281da64b0023d74b3bc02e0f54864b94da9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142275 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'starmath/inc')
-rw-r--r--starmath/inc/utility.hxx13
1 files changed, 13 insertions, 0 deletions
diff --git a/starmath/inc/utility.hxx b/starmath/inc/utility.hxx
index c0b473264532..a05578a53647 100644
--- a/starmath/inc/utility.hxx
+++ b/starmath/inc/utility.hxx
@@ -21,10 +21,13 @@
#include <sal/config.h>
+#include <comphelper/lok.hxx>
+#include <o3tl/unit_conversion.hxx>
#include <sal/log.hxx>
#include <vcl/font.hxx>
#include <vcl/weld.hxx>
#include <tools/fract.hxx>
+#include <tools/mapunit.hxx>
#include <deque>
@@ -113,4 +116,14 @@ public:
virtual void Insert(const vcl::Font &rFont) override;
};
+// Math uses 100ths of MM by default, but lok needs twips everywhere
+inline MapUnit SmMapUnit()
+{
+ return comphelper::LibreOfficeKit::isActive() ? MapUnit::MapTwip : MapUnit::Map100thMM;
+}
+inline o3tl::Length SmO3tlLengthUnit()
+{
+ return comphelper::LibreOfficeKit::isActive() ? o3tl::Length::twip : o3tl::Length::mm100;
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */