diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2018-01-12 20:13:55 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2018-01-12 20:13:55 +0100 |
commit | c049c76fc521f2b55b39a6e9eb0f0092bcf6ef77 (patch) | |
tree | 2bc2c059a6f6a175a0c0e5321887adc077fef419 /svx/source/sdr | |
parent | 0ae2d98d1f6d29c80bd1ee830db4c333e4ee1e1d (diff) |
More loplugin:cstylecast: svx
auto-rewrite with <https://gerrit.libreoffice.org/#/c/47798/> "Enable
loplugin:cstylecast for some more cases" plus
solenv/clang-format/reformat-formatted-files
Change-Id: I100e6c14cbf1d780f0e5ebca6b0c9e71ce1caaf7
Diffstat (limited to 'svx/source/sdr')
17 files changed, 84 insertions, 84 deletions
diff --git a/svx/source/sdr/animation/animationstate.cxx b/svx/source/sdr/animation/animationstate.cxx index e271e2f586a0..f0e67cfcec07 100644 --- a/svx/source/sdr/animation/animationstate.cxx +++ b/svx/source/sdr/animation/animationstate.cxx @@ -80,7 +80,7 @@ namespace sdr // next time point exists, use it sal_uInt32 nNextTime; - if(fNextTime >= (double)0xffffff00) + if(fNextTime >= double(0xffffff00)) { // take care for very late points in time, e.g. when a text animation stops // in a defined AnimationEntryFixed with endless (0xffffffff) duration @@ -88,12 +88,12 @@ namespace sdr } else { - nNextTime = (sal_uInt32)fNextTime; + nNextTime = static_cast<sal_uInt32>(fNextTime); } // ensure step forward in integer timing, the floating step difference maybe smaller than 1.0. Use // at least 25ms for next step - const sal_uInt32 nMinimumStepTime((sal_uInt32)fCurrentTime + 25); + const sal_uInt32 nMinimumStepTime(static_cast<sal_uInt32>(fCurrentTime) + 25); if(nNextTime <= nMinimumStepTime) { diff --git a/svx/source/sdr/attribute/sdrformtextattribute.cxx b/svx/source/sdr/attribute/sdrformtextattribute.cxx index e0801737d599..bc0d690edca0 100644 --- a/svx/source/sdr/attribute/sdrformtextattribute.cxx +++ b/svx/source/sdr/attribute/sdrformtextattribute.cxx @@ -82,11 +82,11 @@ namespace if(bShadow) { - nRetval = (sal_uInt8)((rSet.Get(SDRATTR_SHADOWTRANSPARENCE).GetValue() * 255) / 100); + nRetval = static_cast<sal_uInt8>((rSet.Get(SDRATTR_SHADOWTRANSPARENCE).GetValue() * 255) / 100); } else { - nRetval = (sal_uInt8)((rSet.Get(XATTR_LINETRANSPARENCE).GetValue() * 255) / 100); + nRetval = static_cast<sal_uInt8>((rSet.Get(XATTR_LINETRANSPARENCE).GetValue() * 255) / 100); } return nRetval; @@ -113,7 +113,7 @@ namespace return drawinglayer::attribute::LineAttribute( aColorAttribute, - (double)nLineWidth, + static_cast<double>(nLineWidth), impGetB2DLineJoin(eLineJoint), eLineCap); } @@ -131,7 +131,7 @@ namespace if(rDash.GetDots() || rDash.GetDashes()) { const sal_uInt32 nLineWidth = rSet.Get(XATTR_LINEWIDTH).GetValue(); - fFullDotDashLen = rDash.CreateDotDashArray(aDotDashArray, (double)nLineWidth); + fFullDotDashLen = rDash.CreateDotDashArray(aDotDashArray, static_cast<double>(nLineWidth)); } } diff --git a/svx/source/sdr/contact/viewcontactofe3dextrude.cxx b/svx/source/sdr/contact/viewcontactofe3dextrude.cxx index 71b973bdb7f9..fa2d7645991c 100644 --- a/svx/source/sdr/contact/viewcontactofe3dextrude.cxx +++ b/svx/source/sdr/contact/viewcontactofe3dextrude.cxx @@ -60,9 +60,9 @@ namespace sdr const basegfx::B2DVector aTextureSize(aRange.getWidth(), aRange.getHeight()); // get more data - const double fDepth((double)GetE3dExtrudeObj().GetExtrudeDepth()); - const double fDiagonal((double)GetE3dExtrudeObj().GetPercentDiagonal() / 100.0); - const double fBackScale((double)GetE3dExtrudeObj().GetPercentBackScale() / 100.0); + const double fDepth(static_cast<double>(GetE3dExtrudeObj().GetExtrudeDepth())); + const double fDiagonal(static_cast<double>(GetE3dExtrudeObj().GetPercentDiagonal()) / 100.0); + const double fBackScale(static_cast<double>(GetE3dExtrudeObj().GetPercentBackScale()) / 100.0); const bool bSmoothNormals(GetE3dExtrudeObj().GetSmoothNormals()); // Plane itself const bool bSmoothLids(GetE3dExtrudeObj().GetSmoothLids()); // Front/back const bool bCharacterMode(GetE3dExtrudeObj().GetCharacterMode()); diff --git a/svx/source/sdr/contact/viewcontactofe3dlathe.cxx b/svx/source/sdr/contact/viewcontactofe3dlathe.cxx index 695edc001e4a..d3bba8823edf 100644 --- a/svx/source/sdr/contact/viewcontactofe3dlathe.cxx +++ b/svx/source/sdr/contact/viewcontactofe3dlathe.cxx @@ -74,9 +74,9 @@ namespace sdr // get more data const sal_uInt32 nHorizontalSegments(GetE3dLatheObj().GetHorizontalSegments()); const sal_uInt32 nVerticalSegments(GetE3dLatheObj().GetVerticalSegments()); - const double fDiagonal((double)GetE3dLatheObj().GetPercentDiagonal() / 100.0); - const double fBackScale((double)GetE3dLatheObj().GetBackScale() / 100.0); - const double fRotation(((double)GetE3dLatheObj().GetEndAngle() / 1800.0) * F_PI); + const double fDiagonal(static_cast<double>(GetE3dLatheObj().GetPercentDiagonal()) / 100.0); + const double fBackScale(static_cast<double>(GetE3dLatheObj().GetBackScale()) / 100.0); + const double fRotation((static_cast<double>(GetE3dLatheObj().GetEndAngle()) / 1800.0) * F_PI); const bool bSmoothNormals(GetE3dLatheObj().GetSmoothNormals()); // Plane itself const bool bSmoothLids(GetE3dLatheObj().GetSmoothLids()); // Front/back const bool bCharacterMode(GetE3dLatheObj().GetCharacterMode()); diff --git a/svx/source/sdr/contact/viewcontactofgraphic.cxx b/svx/source/sdr/contact/viewcontactofgraphic.cxx index 79e5900f4f40..488b69beb941 100644 --- a/svx/source/sdr/contact/viewcontactofgraphic.cxx +++ b/svx/source/sdr/contact/viewcontactofgraphic.cxx @@ -306,7 +306,7 @@ namespace sdr aLocalGrafInfo.SetChannelG(rItemSet.Get(SDRATTR_GRAFGREEN).GetValue()); aLocalGrafInfo.SetChannelB(rItemSet.Get(SDRATTR_GRAFBLUE).GetValue()); aLocalGrafInfo.SetGamma(rItemSet.Get(SDRATTR_GRAFGAMMA).GetValue() * 0.01); - aLocalGrafInfo.SetTransparency((sal_uInt8)::basegfx::fround(std::min(nTrans, (sal_uInt16)100) * 2.55)); + aLocalGrafInfo.SetTransparency(static_cast<sal_uInt8>(::basegfx::fround(std::min(nTrans, sal_uInt16(100)) * 2.55))); aLocalGrafInfo.SetInvert(rItemSet.Get(SDRATTR_GRAFINVERT).GetValue()); aLocalGrafInfo.SetDrawMode(rItemSet.Get(SDRATTR_GRAFMODE).GetValue()); aLocalGrafInfo.SetCrop(rCrop.GetLeft(), rCrop.GetTop(), rCrop.GetRight(), rCrop.GetBottom()); diff --git a/svx/source/sdr/contact/viewcontactofsdrobj.cxx b/svx/source/sdr/contact/viewcontactofsdrobj.cxx index 44a29e487257..14a7efed54c6 100644 --- a/svx/source/sdr/contact/viewcontactofsdrobj.cxx +++ b/svx/source/sdr/contact/viewcontactofsdrobj.cxx @@ -155,7 +155,7 @@ drawinglayer::primitive2d::Primitive2DContainer ViewContactOfSdrObj::createGlueP // create GluePoint primitives. ATM these are relative to the SnapRect for(sal_uInt32 a(0); a < nCount; a++) { - const SdrGluePoint& rCandidate = (*pGluePointList)[(sal_uInt16)a]; + const SdrGluePoint& rCandidate = (*pGluePointList)[static_cast<sal_uInt16>(a)]; const Point aPosition(rCandidate.GetAbsolutePos(GetSdrObject())); aGluepointVector.emplace_back(aPosition.X(), aPosition.Y()); diff --git a/svx/source/sdr/contact/viewcontactofsdrpage.cxx b/svx/source/sdr/contact/viewcontactofsdrpage.cxx index fd49657dd723..26616111848a 100644 --- a/svx/source/sdr/contact/viewcontactofsdrpage.cxx +++ b/svx/source/sdr/contact/viewcontactofsdrpage.cxx @@ -106,8 +106,8 @@ drawinglayer::primitive2d::Primitive2DContainer ViewContactOfPageShadow::createV static bool bUseOldPageShadow(false); const SdrPage& rPage = getPage(); basegfx::B2DHomMatrix aPageMatrix; - aPageMatrix.set(0, 0, (double)rPage.GetWidth()); - aPageMatrix.set(1, 1, (double)rPage.GetHeight()); + aPageMatrix.set(0, 0, static_cast<double>(rPage.GetWidth())); + aPageMatrix.set(1, 1, static_cast<double>(rPage.GetHeight())); if(bUseOldPageShadow) { @@ -246,7 +246,7 @@ ViewObjectContact& ViewContactOfPageFill::CreateObjectSpecificViewObjectContact( drawinglayer::primitive2d::Primitive2DContainer ViewContactOfPageFill::createViewIndependentPrimitive2DSequence() const { const SdrPage& rPage = getPage(); - const basegfx::B2DRange aPageFillRange(0.0, 0.0, (double)rPage.GetWidth(), (double)rPage.GetHeight()); + const basegfx::B2DRange aPageFillRange(0.0, 0.0, static_cast<double>(rPage.GetWidth()), static_cast<double>(rPage.GetHeight())); const basegfx::B2DPolygon aPageFillPolygon(basegfx::utils::createPolygonFromRect(aPageFillRange)); // We have only the page information, not the view information. Use the @@ -282,11 +282,11 @@ drawinglayer::primitive2d::Primitive2DContainer ViewContactOfOuterPageBorder::cr { drawinglayer::primitive2d::Primitive2DContainer xRetval; const SdrPage& rPage = getPage(); - const basegfx::B2DRange aPageBorderRange(0.0, 0.0, (double)rPage.GetWidth(), (double)rPage.GetHeight()); + const basegfx::B2DRange aPageBorderRange(0.0, 0.0, static_cast<double>(rPage.GetWidth()), static_cast<double>(rPage.GetHeight())); // Changed to 0x949599 for renaissance, before svtools::FONTCOLOR was used. // Added old case as fallback for HighContrast. - basegfx::BColor aRGBBorderColor(0x94 / (double)0xff, 0x95 / (double)0xff, 0x99 / (double)0xff); + basegfx::BColor aRGBBorderColor(0x94 / double(0xff), 0x95 / double(0xff), 0x99 / double(0xff)); if(Application::GetSettings().GetStyleSettings().GetHighContrastMode()) { @@ -343,8 +343,8 @@ drawinglayer::primitive2d::Primitive2DContainer ViewContactOfInnerPageBorder::cr { const SdrPage& rPage = getPage(); const basegfx::B2DRange aPageBorderRange( - (double)rPage.GetLeftBorder(), (double)rPage.GetUpperBorder(), - (double)(rPage.GetWidth() - rPage.GetRightBorder()), (double)(rPage.GetHeight() - rPage.GetLowerBorder())); + static_cast<double>(rPage.GetLeftBorder()), static_cast<double>(rPage.GetUpperBorder()), + static_cast<double>(rPage.GetWidth() - rPage.GetRightBorder()), static_cast<double>(rPage.GetHeight() - rPage.GetLowerBorder())); const basegfx::B2DPolygon aPageBorderPolygon(basegfx::utils::createPolygonFromRect(aPageBorderRange)); // We have only the page information, not the view information. Use the diff --git a/svx/source/sdr/contact/viewobjectcontactofpageobj.cxx b/svx/source/sdr/contact/viewobjectcontactofpageobj.cxx index ccdf9c2a9940..db64344e0447 100644 --- a/svx/source/sdr/contact/viewobjectcontactofpageobj.cxx +++ b/svx/source/sdr/contact/viewobjectcontactofpageobj.cxx @@ -164,7 +164,7 @@ void PagePrimitiveExtractor::InvalidatePartOfView(const basegfx::B2DRange& rRang if(pStartPage && !rRange.isEmpty()) { - const basegfx::B2DRange aPageRange(0.0, 0.0, (double)pStartPage->GetWidth(), (double)pStartPage->GetHeight()); + const basegfx::B2DRange aPageRange(0.0, 0.0, static_cast<double>(pStartPage->GetWidth()), static_cast<double>(pStartPage->GetHeight())); if(rRange.overlaps(aPageRange)) { diff --git a/svx/source/sdr/contact/viewobjectcontactofsdrmediaobj.cxx b/svx/source/sdr/contact/viewobjectcontactofsdrmediaobj.cxx index 8b6915259ada..ec1df67520cb 100644 --- a/svx/source/sdr/contact/viewobjectcontactofsdrmediaobj.cxx +++ b/svx/source/sdr/contact/viewobjectcontactofsdrmediaobj.cxx @@ -107,8 +107,8 @@ void ViewObjectContactOfSdrMediaObj::updateMediaItem( ::avmedia::MediaItem& rIte aViewRange.transform(GetObjectContact().getViewInformation2D().getViewTransformation()); const tools::Rectangle aViewRectangle( - (sal_Int32)floor(aViewRange.getMinX()), (sal_Int32)floor(aViewRange.getMinY()), - (sal_Int32)ceil(aViewRange.getMaxX()), (sal_Int32)ceil(aViewRange.getMaxY())); + static_cast<sal_Int32>(floor(aViewRange.getMinX())), static_cast<sal_Int32>(floor(aViewRange.getMinY())), + static_cast<sal_Int32>(ceil(aViewRange.getMaxX())), static_cast<sal_Int32>(ceil(aViewRange.getMaxY()))); mpMediaWindow->setPosSize(aViewRectangle); mpMediaWindow->show(); diff --git a/svx/source/sdr/contact/viewobjectcontactofsdrpage.cxx b/svx/source/sdr/contact/viewobjectcontactofsdrpage.cxx index 1022a51f16f7..6760043bdc08 100644 --- a/svx/source/sdr/contact/viewobjectcontactofsdrpage.cxx +++ b/svx/source/sdr/contact/viewobjectcontactofsdrpage.cxx @@ -215,7 +215,7 @@ drawinglayer::primitive2d::Primitive2DContainer ViewObjectContactOfPageFill::cre { const SdrPage& rPage = getPage(); - const basegfx::B2DRange aPageFillRange(0.0, 0.0, (double)rPage.GetWidth(), (double)rPage.GetHeight()); + const basegfx::B2DRange aPageFillRange(0.0, 0.0, static_cast<double>(rPage.GetWidth()), static_cast<double>(rPage.GetHeight())); const basegfx::B2DPolygon aPageFillPolygon(basegfx::utils::createPolygonFromRect(aPageFillRange)); Color aPageFillColor; @@ -454,10 +454,10 @@ drawinglayer::primitive2d::Primitive2DContainer ViewObjectContactOfPageGrid::cre const basegfx::BColor aRGBGridColor(aGridColor.getBColor()); basegfx::B2DHomMatrix aGridMatrix; - aGridMatrix.set(0, 0, (double)(rPage.GetWidth() - (rPage.GetRightBorder() + rPage.GetLeftBorder()))); - aGridMatrix.set(1, 1, (double)(rPage.GetHeight() - (rPage.GetLowerBorder() + rPage.GetUpperBorder()))); - aGridMatrix.set(0, 2, (double)rPage.GetLeftBorder()); - aGridMatrix.set(1, 2, (double)rPage.GetUpperBorder()); + aGridMatrix.set(0, 0, static_cast<double>(rPage.GetWidth() - (rPage.GetRightBorder() + rPage.GetLeftBorder()))); + aGridMatrix.set(1, 1, static_cast<double>(rPage.GetHeight() - (rPage.GetLowerBorder() + rPage.GetUpperBorder()))); + aGridMatrix.set(0, 2, static_cast<double>(rPage.GetLeftBorder())); + aGridMatrix.set(1, 2, static_cast<double>(rPage.GetUpperBorder())); const Size aRaw(rView.GetGridCoarse()); const Size aFine(rView.GetGridFine()); @@ -537,8 +537,8 @@ drawinglayer::primitive2d::Primitive2DContainer ViewObjectContactOfPageHelplines for(sal_uInt32 a(0); a < nCount; a++) { - const SdrHelpLine& rHelpLine = rHelpLineList[(sal_uInt16)a]; - const basegfx::B2DPoint aPosition((double)rHelpLine.GetPos().X(), (double)rHelpLine.GetPos().Y()); + const SdrHelpLine& rHelpLine = rHelpLineList[static_cast<sal_uInt16>(a)]; + const basegfx::B2DPoint aPosition(static_cast<double>(rHelpLine.GetPos().X()), static_cast<double>(rHelpLine.GetPos().Y())); const double fDiscreteDashLength(4.0); switch(rHelpLine.GetKind()) diff --git a/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx b/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx index ad7415abc495..c9a3d29f0ef5 100644 --- a/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx +++ b/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx @@ -236,7 +236,7 @@ namespace sdr { namespace contact { void ControlHolder::setZoom( const ::basegfx::B2DVector& _rScale ) const { // no check whether we're valid, this is the responsibility of the caller - m_xControlView->setZoom( (float)_rScale.getX(), (float)_rScale.getY() ); + m_xControlView->setZoom( static_cast<float>(_rScale.getX()), static_cast<float>(_rScale.getY()) ); } @@ -265,8 +265,8 @@ namespace sdr { namespace contact { if ( pWindow ) { const Fraction& rZoom( pWindow->GetZoom() ); - aZoom.setX( (double)rZoom ); - aZoom.setY( (double)rZoom ); + aZoom.setX( static_cast<double>(rZoom) ); + aZoom.setY( static_cast<double>(rZoom) ); } return aZoom; } @@ -298,7 +298,7 @@ namespace sdr { namespace contact { ::basegfx::B2DPoint aBottomRight( _rLogicBoundingRect.Right(), _rLogicBoundingRect.Bottom() ); aBottomRight *= _rViewTransformation; - const tools::Rectangle aPaintRectPixel( (long)aTopLeft.getX(), (long)aTopLeft.getY(), (long)aBottomRight.getX(), (long)aBottomRight.getY() ); + const tools::Rectangle aPaintRectPixel( static_cast<long>(aTopLeft.getX()), static_cast<long>(aTopLeft.getY()), static_cast<long>(aBottomRight.getX()), static_cast<long>(aBottomRight.getY()) ); _rControl.setPosSize( aPaintRectPixel ); // determine the scale from the current view transformation, and the normalization matrix @@ -840,8 +840,8 @@ namespace sdr { namespace contact { ::basegfx::B2DHomMatrix aScaleNormalization; const MapMode& aCurrentDeviceMapMode( rPageViewDevice.GetMapMode() ); - aScaleNormalization.set( 0, 0, (double)aCurrentDeviceMapMode.GetScaleX() ); - aScaleNormalization.set( 1, 1, (double)aCurrentDeviceMapMode.GetScaleY() ); + aScaleNormalization.set( 0, 0, static_cast<double>(aCurrentDeviceMapMode.GetScaleX()) ); + aScaleNormalization.set( 1, 1, static_cast<double>(aCurrentDeviceMapMode.GetScaleY()) ); m_aZoomLevelNormalization *= aScaleNormalization; #if OSL_DEBUG_LEVEL > 0 diff --git a/svx/source/sdr/overlay/overlaymanager.cxx b/svx/source/sdr/overlay/overlaymanager.cxx index 083e7692f7cb..bde49aff6ed2 100644 --- a/svx/source/sdr/overlay/overlaymanager.cxx +++ b/svx/source/sdr/overlay/overlaymanager.cxx @@ -304,10 +304,10 @@ namespace sdr // assume AA needs one pixel more and invalidate one pixel more const double fDiscreteOne(getDiscreteOne()); const tools::Rectangle aInvalidateRectangle( - (sal_Int32)floor(rRange.getMinX() - fDiscreteOne), - (sal_Int32)floor(rRange.getMinY() - fDiscreteOne), - (sal_Int32)ceil(rRange.getMaxX() + fDiscreteOne), - (sal_Int32)ceil(rRange.getMaxY() + fDiscreteOne)); + static_cast<sal_Int32>(floor(rRange.getMinX() - fDiscreteOne)), + static_cast<sal_Int32>(floor(rRange.getMinY() - fDiscreteOne)), + static_cast<sal_Int32>(ceil(rRange.getMaxX() + fDiscreteOne)), + static_cast<sal_Int32>(ceil(rRange.getMaxY() + fDiscreteOne))); // simply invalidate static_cast<vcl::Window&>(getOutputDevice()).Invalidate(aInvalidateRectangle, InvalidateFlags::NoErase); @@ -317,8 +317,8 @@ namespace sdr // #i77674# transform to rectangle. Use floor/ceil to get all covered // discrete pixels, see #i75163# and OverlayManagerBuffered::invalidateRange const tools::Rectangle aInvalidateRectangle( - (sal_Int32)floor(rRange.getMinX()), (sal_Int32)floor(rRange.getMinY()), - (sal_Int32)ceil(rRange.getMaxX()), (sal_Int32)ceil(rRange.getMaxY())); + static_cast<sal_Int32>(floor(rRange.getMinX())), static_cast<sal_Int32>(floor(rRange.getMinY())), + static_cast<sal_Int32>(ceil(rRange.getMaxX())), static_cast<sal_Int32>(ceil(rRange.getMaxY()))); // simply invalidate static_cast<vcl::Window&>(getOutputDevice()).Invalidate(aInvalidateRectangle, InvalidateFlags::NoErase); diff --git a/svx/source/sdr/overlay/overlaymanagerbuffered.cxx b/svx/source/sdr/overlay/overlaymanagerbuffered.cxx index a2bc553580c7..ab2e8216f139 100644 --- a/svx/source/sdr/overlay/overlaymanagerbuffered.cxx +++ b/svx/source/sdr/overlay/overlaymanagerbuffered.cxx @@ -457,19 +457,19 @@ namespace sdr // assume AA needs one pixel more and invalidate one pixel more const double fDiscreteOne(getDiscreteOne()); const basegfx::B2IPoint aTopLeft( - (sal_Int32)floor(aDiscreteRange.getMinX() - fDiscreteOne), - (sal_Int32)floor(aDiscreteRange.getMinY() - fDiscreteOne)); + static_cast<sal_Int32>(floor(aDiscreteRange.getMinX() - fDiscreteOne)), + static_cast<sal_Int32>(floor(aDiscreteRange.getMinY() - fDiscreteOne))); const basegfx::B2IPoint aBottomRight( - (sal_Int32)ceil(aDiscreteRange.getMaxX() + fDiscreteOne), - (sal_Int32)ceil(aDiscreteRange.getMaxY() + fDiscreteOne)); + static_cast<sal_Int32>(ceil(aDiscreteRange.getMaxX() + fDiscreteOne)), + static_cast<sal_Int32>(ceil(aDiscreteRange.getMaxY() + fDiscreteOne))); maBufferRememberedRangePixel.expand(aTopLeft); maBufferRememberedRangePixel.expand(aBottomRight); } else { - const basegfx::B2IPoint aTopLeft((sal_Int32)floor(aDiscreteRange.getMinX()), (sal_Int32)floor(aDiscreteRange.getMinY())); - const basegfx::B2IPoint aBottomRight((sal_Int32)ceil(aDiscreteRange.getMaxX()), (sal_Int32)ceil(aDiscreteRange.getMaxY())); + const basegfx::B2IPoint aTopLeft(static_cast<sal_Int32>(floor(aDiscreteRange.getMinX())), static_cast<sal_Int32>(floor(aDiscreteRange.getMinY()))); + const basegfx::B2IPoint aBottomRight(static_cast<sal_Int32>(ceil(aDiscreteRange.getMaxX())), static_cast<sal_Int32>(ceil(aDiscreteRange.getMaxY()))); maBufferRememberedRangePixel.expand(aTopLeft); maBufferRememberedRangePixel.expand(aBottomRight); diff --git a/svx/source/sdr/overlay/overlayobjectlist.cxx b/svx/source/sdr/overlay/overlayobjectlist.cxx index 813a01205b90..706bc692c6e6 100644 --- a/svx/source/sdr/overlay/overlayobjectlist.cxx +++ b/svx/source/sdr/overlay/overlayobjectlist.cxx @@ -126,7 +126,7 @@ namespace sdr const basegfx::B2DPoint aPosition(aPosLogic.X(), aPosLogic.Y()); const Size aSizeLogic(pManager->getOutputDevice().PixelToLogic(Size(nDiscreteTolerance, nDiscreteTolerance))); - return isHitLogic(aPosition, (double)aSizeLogic.Width()); + return isHitLogic(aPosition, static_cast<double>(aSizeLogic.Width())); } } diff --git a/svx/source/sdr/primitive2d/sdrattributecreator.cxx b/svx/source/sdr/primitive2d/sdrattributecreator.cxx index 41988f65d70f..60e130c8b949 100644 --- a/svx/source/sdr/primitive2d/sdrattributecreator.cxx +++ b/svx/source/sdr/primitive2d/sdrattributecreator.cxx @@ -247,14 +247,14 @@ namespace drawinglayer if(rDash.GetDots() || rDash.GetDashes()) { - fFullDotDashLen = rDash.CreateDotDashArray(aDotDashArray, (double)nWidth); + fFullDotDashLen = rDash.CreateDotDashArray(aDotDashArray, static_cast<double>(nWidth)); } } return attribute::SdrLineAttribute( LineJointToB2DLineJoin(eJoint), - (double)nWidth, - (double)nTransparence * 0.01, + static_cast<double>(nWidth), + static_cast<double>(nTransparence) * 0.01, aColor.getBColor(), eCap, aDotDashArray, @@ -284,11 +284,11 @@ namespace drawinglayer { if(nTempStartWidth < 0) { - fStartWidth = ((double)(-nTempStartWidth) * fWidth) * 0.01; + fStartWidth = (static_cast<double>(-nTempStartWidth) * fWidth) * 0.01; } else { - fStartWidth = (double)nTempStartWidth; + fStartWidth = static_cast<double>(nTempStartWidth); } if(0.0 != fStartWidth) @@ -307,11 +307,11 @@ namespace drawinglayer { if(nTempEndWidth < 0) { - fEndWidth = ((double)(-nTempEndWidth) * fWidth) * 0.01; + fEndWidth = (static_cast<double>(-nTempEndWidth) * fWidth) * 0.01; } else { - fEndWidth = (double)nTempEndWidth; + fEndWidth = static_cast<double>(nTempEndWidth); } if(0.0 != fEndWidth) @@ -371,11 +371,11 @@ namespace drawinglayer if(100 != nTransparence) { const basegfx::B2DVector aOffset( - (double)rSet.Get(SDRATTR_SHADOWXDIST).GetValue(), - (double)rSet.Get(SDRATTR_SHADOWYDIST).GetValue()); + static_cast<double>(rSet.Get(SDRATTR_SHADOWXDIST).GetValue()), + static_cast<double>(rSet.Get(SDRATTR_SHADOWYDIST).GetValue())); const Color aColor(rSet.Get(SDRATTR_SHADOWCOLOR).GetColorValue()); - return attribute::SdrShadowAttribute(aOffset, (double)nTransparence * 0.01, aColor.getBColor()); + return attribute::SdrShadowAttribute(aOffset, static_cast<double>(nTransparence) * 0.01, aColor.getBColor()); } } @@ -440,7 +440,7 @@ namespace drawinglayer if(nStartIntens != 100) { const basegfx::BColor aBlack; - aStart = interpolate(aBlack, aStart, (double)nStartIntens * 0.01); + aStart = interpolate(aBlack, aStart, static_cast<double>(nStartIntens) * 0.01); } const Color aEndColor(aXGradient.GetEndColor()); @@ -450,15 +450,15 @@ namespace drawinglayer if(nEndIntens != 100) { const basegfx::BColor aBlack; - aEnd = interpolate(aBlack, aEnd, (double)nEndIntens * 0.01); + aEnd = interpolate(aBlack, aEnd, static_cast<double>(nEndIntens) * 0.01); } aGradient = attribute::FillGradientAttribute( XGradientStyleToGradientStyle(aXGradient.GetGradientStyle()), - (double)aXGradient.GetBorder() * 0.01, - (double)aXGradient.GetXOffset() * 0.01, - (double)aXGradient.GetYOffset() * 0.01, - (double)aXGradient.GetAngle() * F_PI1800, + static_cast<double>(aXGradient.GetBorder()) * 0.01, + static_cast<double>(aXGradient.GetXOffset()) * 0.01, + static_cast<double>(aXGradient.GetYOffset()) * 0.01, + static_cast<double>(aXGradient.GetAngle()) * F_PI1800, aStart, aEnd, rSet.Get(XATTR_GRADIENTSTEPCOUNT).GetValue()); @@ -472,8 +472,8 @@ namespace drawinglayer aHatch = attribute::FillHatchAttribute( XHatchStyleToHatchStyle(rHatch.GetHatchStyle()), - (double)rHatch.GetDistance(), - (double)rHatch.GetAngle() * F_PI1800, + static_cast<double>(rHatch.GetDistance()), + static_cast<double>(rHatch.GetAngle()) * F_PI1800, aColorB.getBColor(), 3, // same default as VCL, a minimum of three discrete units (pixels) offset rSet.Get(XATTR_FILLBACKGROUND).GetValue()); @@ -488,7 +488,7 @@ namespace drawinglayer } return attribute::SdrFillAttribute( - (double)nTransparence * 0.01, + static_cast<double>(nTransparence) * 0.01, aColor.getBColor(), aGradient, aHatch, @@ -617,10 +617,10 @@ namespace drawinglayer return attribute::FillGradientAttribute( XGradientStyleToGradientStyle(rGradient.GetGradientStyle()), - (double)rGradient.GetBorder() * 0.01, - (double)rGradient.GetXOffset() * 0.01, - (double)rGradient.GetYOffset() * 0.01, - (double)rGradient.GetAngle() * F_PI1800, + static_cast<double>(rGradient.GetBorder()) * 0.01, + static_cast<double>(rGradient.GetXOffset()) * 0.01, + static_cast<double>(rGradient.GetYOffset()) * 0.01, + static_cast<double>(rGradient.GetAngle()) * F_PI1800, basegfx::BColor(fStartLum, fStartLum, fStartLum), basegfx::BColor(fEndLum, fEndLum, fEndLum), 0); @@ -691,14 +691,14 @@ namespace drawinglayer // get size const basegfx::B2DVector aSize( - (double) rSet.Get(XATTR_FILLBMP_SIZEX).GetValue(), - (double) rSet.Get(XATTR_FILLBMP_SIZEY).GetValue()); + static_cast<double>(rSet.Get(XATTR_FILLBMP_SIZEX).GetValue()), + static_cast<double>(rSet.Get(XATTR_FILLBMP_SIZEY).GetValue())); const basegfx::B2DVector aOffset( - (double) rSet.Get(XATTR_FILLBMP_TILEOFFSETX).GetValue(), - (double) rSet.Get(XATTR_FILLBMP_TILEOFFSETY).GetValue()); + static_cast<double>(rSet.Get(XATTR_FILLBMP_TILEOFFSETX).GetValue()), + static_cast<double>(rSet.Get(XATTR_FILLBMP_TILEOFFSETY).GetValue())); const basegfx::B2DVector aOffsetPosition( - (double) rSet.Get(XATTR_FILLBMP_POSOFFSETX).GetValue(), - (double) rSet.Get(XATTR_FILLBMP_POSOFFSETY).GetValue()); + static_cast<double>(rSet.Get(XATTR_FILLBMP_POSOFFSETX).GetValue()), + static_cast<double>(rSet.Get(XATTR_FILLBMP_POSOFFSETY).GetValue())); return attribute::SdrFillGraphicAttribute( aGraphic, @@ -992,7 +992,7 @@ namespace drawinglayer void calculateRelativeCornerRadius(sal_Int32 nRadius, const basegfx::B2DRange& rObjectRange, double& rfCornerRadiusX, double& rfCornerRadiusY) { - rfCornerRadiusX = rfCornerRadiusY = (double)nRadius; + rfCornerRadiusX = rfCornerRadiusY = static_cast<double>(nRadius); if(0.0 != rfCornerRadiusX) { diff --git a/svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx index 943775beed68..176eb95e6d86 100644 --- a/svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx +++ b/svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx @@ -74,7 +74,7 @@ namespace else { const sal_uInt16 nPageCount(pPage->GetModel()->GetPageCount()); - nRetval = ((sal_Int16)nPageCount - 1) / 2; + nRetval = (static_cast<sal_Int16>(nPageCount) - 1) / 2; } } diff --git a/svx/source/sdr/properties/e3dsceneproperties.cxx b/svx/source/sdr/properties/e3dsceneproperties.cxx index 2639a96d9e7a..1b3bdbf486b6 100644 --- a/svx/source/sdr/properties/e3dsceneproperties.cxx +++ b/svx/source/sdr/properties/e3dsceneproperties.cxx @@ -304,10 +304,10 @@ namespace sdr mpItemSet->Put(Svx3DPerspectiveItem(aSceneCam.GetProjection())); // CamPos - mpItemSet->Put(makeSvx3DDistanceItem((sal_uInt32)(aSceneCam.GetPosition().getZ() + 0.5))); + mpItemSet->Put(makeSvx3DDistanceItem(static_cast<sal_uInt32>(aSceneCam.GetPosition().getZ() + 0.5))); // FocalLength - mpItemSet->Put(makeSvx3DFocalLengthItem((sal_uInt32)((aSceneCam.GetFocalLength() * 100.0) + 0.5))); + mpItemSet->Put(makeSvx3DFocalLengthItem(static_cast<sal_uInt32>((aSceneCam.GetFocalLength() * 100.0) + 0.5))); } } // end of namespace properties } // end of namespace sdr |