From 10943505162d515f16acfb4d195d171421ff834f Mon Sep 17 00:00:00 2001 From: Noel Date: Thu, 4 Feb 2021 13:01:25 +0200 Subject: have one set of twips<->mm conversions Change-Id: I510f4a0524a7c72eb124cba103cbf398024976d3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110407 Tested-by: Jenkins Reviewed-by: Noel Grandin --- editeng/source/uno/unoipset.cxx | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'editeng') diff --git a/editeng/source/uno/unoipset.cxx b/editeng/source/uno/unoipset.cxx index 523b29794461..417e62d771e0 100644 --- a/editeng/source/uno/unoipset.cxx +++ b/editeng/source/uno/unoipset.cxx @@ -260,10 +260,6 @@ uno::Reference< beans::XPropertySetInfo > const & SvxItemPropertySet::getProper } -#ifndef TWIPS_TO_MM -#define TWIPS_TO_MM(val) ((val * 127 + 36) / 72) -#endif - /** converts the given any with a metric to 100th/mm if needed */ void SvxUnoConvertToMM( const MapUnit eSourceMapUnit, uno::Any & rMetric ) throw() { @@ -275,19 +271,19 @@ void SvxUnoConvertToMM( const MapUnit eSourceMapUnit, uno::Any & rMetric ) throw switch( rMetric.getValueTypeClass() ) { case uno::TypeClass_BYTE: - rMetric <<= static_cast(TWIPS_TO_MM(*o3tl::forceAccess(rMetric))); + rMetric <<= static_cast(TwipsToHMM(*o3tl::forceAccess(rMetric))); break; case uno::TypeClass_SHORT: - rMetric <<= static_cast(TWIPS_TO_MM(*o3tl::forceAccess(rMetric))); + rMetric <<= static_cast(TwipsToHMM(*o3tl::forceAccess(rMetric))); break; case uno::TypeClass_UNSIGNED_SHORT: - rMetric <<= static_cast(TWIPS_TO_MM(*o3tl::forceAccess(rMetric))); + rMetric <<= static_cast(TwipsToHMM(*o3tl::forceAccess(rMetric))); break; case uno::TypeClass_LONG: - rMetric <<= static_cast(TWIPS_TO_MM(*o3tl::forceAccess(rMetric))); + rMetric <<= static_cast(TwipsToHMM(*o3tl::forceAccess(rMetric))); break; case uno::TypeClass_UNSIGNED_LONG: - rMetric <<= static_cast(TWIPS_TO_MM(*o3tl::forceAccess(rMetric))); + rMetric <<= static_cast(TwipsToHMM(*o3tl::forceAccess(rMetric))); break; default: SAL_WARN("editeng", "AW: Missing unit translation to 100th mm, " << OString::number(static_cast(rMetric.getValueTypeClass()))); -- cgit