summaryrefslogtreecommitdiff
path: root/drawinglayer
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2018-05-16 10:16:01 +0200
committerStephan Bergmann <sbergman@redhat.com>2018-05-17 08:22:14 +0200
commit7ab34b51f2d45137191145d31b4b0c7d18f577bf (patch)
treeabb760e86740a0e073008047d966af250e8c8c5d /drawinglayer
parentf8e3ad02737854686a590f7f8f02eb72e03a0f8e (diff)
loplugin:redundantcast improvements for floating-integer conversions
Change-Id: I63dbf18f144a792ae775fe6706da81657f790016 Reviewed-on: https://gerrit.libreoffice.org/54416 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'drawinglayer')
-rw-r--r--drawinglayer/source/primitive3d/sdrextrudeprimitive3d.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/drawinglayer/source/primitive3d/sdrextrudeprimitive3d.cxx b/drawinglayer/source/primitive3d/sdrextrudeprimitive3d.cxx
index cf00f208b9b8..1921c71dac25 100644
--- a/drawinglayer/source/primitive3d/sdrextrudeprimitive3d.cxx
+++ b/drawinglayer/source/primitive3d/sdrextrudeprimitive3d.cxx
@@ -17,6 +17,10 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <sal/config.h>
+
+#include <cmath>
+
#include <drawinglayer/primitive3d/sdrextrudeprimitive3d.hxx>
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx>
@@ -62,7 +66,7 @@ namespace drawinglayer
const double fFrontArea(basegfx::utils::getArea(aFirstPolygon));
const double fSqrtFrontArea(sqrt(fFrontArea));
double fRelativeTextureWidth = basegfx::fTools::equalZero(fSqrtFrontArea) ? 1.0 : fFrontLength / fSqrtFrontArea;
- fRelativeTextureWidth = static_cast<double>(static_cast<sal_uInt32>(fRelativeTextureWidth - 0.5));
+ fRelativeTextureWidth = std::trunc(fRelativeTextureWidth - 0.5);
if(fRelativeTextureWidth < 1.0)
{