summaryrefslogtreecommitdiff
path: root/include/tools
diff options
context:
space:
mode:
authorSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2020-05-12 12:47:31 +0200
committerSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2020-05-14 09:59:11 +0200
commit9c4048b1883f1dc9fdd621ffa2bb06ff9fe19d14 (patch)
treedb3ffad81acdc538d6377cbb16177345399cc53c /include/tools
parent68af4f050c5768ce30357cbc5f40e7bc031518c4 (diff)
tdf#79082 Improve ppt tab import/export
Import/export the paragraph tabs without any text offset, tabs are relative to the text box anyway. Change-Id: Ife3b762e7581548e65500c16259a4481cc07a88f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94101 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Diffstat (limited to 'include/tools')
-rw-r--r--include/tools/UnitConversion.hxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/tools/UnitConversion.hxx b/include/tools/UnitConversion.hxx
index 8ad489dee590..e59077d8a5fa 100644
--- a/include/tools/UnitConversion.hxx
+++ b/include/tools/UnitConversion.hxx
@@ -22,4 +22,10 @@ constexpr sal_Int64 convertMm100ToTwip(sal_Int64 n)
return (n >= 0) ? (n * 72 + 63) / 127 : (n * 72 - 63) / 127;
}
+// Convert PPT's "master unit" (1/576 inch) to twips
+constexpr sal_Int64 convertMasterUnitToTwip(sal_Int64 n) { return n * 2540.0 / 576.0; }
+
+// Convert twips to PPT's "master unit"
+constexpr sal_Int64 convertTwipToMasterUnit(sal_Int64 n) { return n / (2540.0 / 576.0); }
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */