diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-08-17 08:04:58 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-08-17 11:00:06 +0200 |
commit | 8004bcd6e1180bdeae03200b2e5f6f93351d5e07 (patch) | |
tree | 2f3f67692910f557da7ae7ab04926af63bf5a4e8 /writerfilter | |
parent | 0214be9338f5a375014f8246f9908bbd22b27e58 (diff) |
sw: use std::lround() instead of manual rounding in RTFSdrImport
Change-Id: If869c3f987996918904dca76de92d3e35789efa5
Diffstat (limited to 'writerfilter')
-rw-r--r-- | writerfilter/source/rtftok/rtfsdrimport.cxx | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/writerfilter/source/rtftok/rtfsdrimport.cxx b/writerfilter/source/rtftok/rtfsdrimport.cxx index c70050fe1155..dd700c902972 100644 --- a/writerfilter/source/rtftok/rtfsdrimport.cxx +++ b/writerfilter/source/rtftok/rtfsdrimport.cxx @@ -8,6 +8,7 @@ */ #include <rtfsdrimport.hxx> +#include <cmath> #include <com/sun/star/container/XNamed.hpp> #include <com/sun/star/drawing/FillStyle.hpp> #include <com/sun/star/drawing/EnhancedCustomShapeParameterPair.hpp> @@ -222,7 +223,7 @@ void RTFSdrImport::applyProperty(uno::Reference<drawing::XShape> const& xShape, sal_Int32 nRotation = aValue.toInt32()*100/65536; uno::Reference<lang::XServiceInfo> xServiceInfo(xShape, uno::UNO_QUERY); if (!xServiceInfo->supportsService("com.sun.star.text.TextFrame")) - xPropertySet->setPropertyValue("RotateAngle", uno::makeAny(sal_Int32(NormAngle360(nRotation * -1)))); + xPropertySet->setPropertyValue("RotateAngle", uno::makeAny(sal_Int32(NormAngle360(static_cast<long>(nRotation) * -1)))); } if (nHoriOrient != 0 && xPropertySet.is()) @@ -897,8 +898,8 @@ void RTFSdrImport::resolve(RTFShape& rShape, bool bClose, ShapeOrPict const shap nTop = static_cast< sal_Int32 >(rShape.nTop + fHeightRatio * (*oRelTop - *oGroupTop)); // See lclGetAbsRect() in the VML import. - aSize.Width = static_cast<sal_Int32>(fWidthRatio * (*oRelRight - *oRelLeft) + 0.5); - aSize.Height = static_cast<sal_Int32>(fHeightRatio * (*oRelBottom - *oRelTop) + 0.5); + aSize.Width = std::lround(fWidthRatio * (*oRelRight - *oRelLeft)); + aSize.Height = std::lround(fHeightRatio * (*oRelBottom - *oRelTop)); } if (m_bTextFrame) |