diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2021-02-05 19:35:14 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2021-02-06 17:05:44 +0100 |
commit | 956c09ca7d690471f62e8e2e14ad04fefcebf7e7 (patch) | |
tree | c681ace388370acf5842c73d45e9e9d8880777af /oox/source/ole/vbacontrol.cxx | |
parent | ca074a47e8fdae396633dad6f59450508bb2c9f0 (diff) |
Use more conversion functions from <tools/UnitConversion.hxx>
This unifies conversion functions to provide both floating-point
and integral overloads, with correct rounding for the latter.
Also sanitizing code it templatized to allow reuse if needed.
Change-Id: Ibe1c9fe4d5baa226c600445779dbaf7dc41a02cb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110487
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'oox/source/ole/vbacontrol.cxx')
-rw-r--r-- | oox/source/ole/vbacontrol.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/oox/source/ole/vbacontrol.cxx b/oox/source/ole/vbacontrol.cxx index 1b85c27dd6f6..07c91483c773 100644 --- a/oox/source/ole/vbacontrol.cxx +++ b/oox/source/ole/vbacontrol.cxx @@ -30,6 +30,7 @@ #include <osl/diagnose.h> #include <rtl/ustrbuf.hxx> #include <sal/log.hxx> +#include <tools/UnitConversion.hxx> #include <xmlscript/xmldlg_imexp.hxx> #include <oox/helper/attributelist.hxx> #include <oox/helper/binaryinputstream.hxx> @@ -706,8 +707,7 @@ void VbaFormControl::moveEmbeddedToAbsoluteParent() const AxFontDataModel* pFontModel = dynamic_cast< const AxFontDataModel* >( mxCtrlModel.get() ); if( pFontModel && (pFontModel->getControlType() == API_CONTROL_GROUPBOX) ) { - // convert points to 1/100 mm (1 pt = 1/72 inch = 2.54/72 cm = 2540/72 1/100 mm) - sal_Int32 nFontHeight = static_cast< sal_Int32 >( pFontModel->getFontHeight() * 2540 / 72 ); + sal_Int32 nFontHeight = convertPointToMm100(pFontModel->getFontHeight()); aDistance.second += nFontHeight / 2; } |