diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-01-24 08:30:02 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-01-24 09:04:45 +0100 |
commit | 6b4fe3e44b4daa89fef6a3385919b00472eaed60 (patch) | |
tree | db2d11ae4e08d0782e1eb240513abfbe8ff33113 /drawinglayer | |
parent | e975ab34daf72a2b708a46095994d0df3c23dec0 (diff) |
loplugin:makeshared in drawinglayer..fpicker
Change-Id: Ib20fec3a7b6bfe2f94c6f5f2f9fa0be6f7c21e97
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87320
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'drawinglayer')
7 files changed, 52 insertions, 61 deletions
diff --git a/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx b/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx index 6258c03d33f3..45ba38c2ece5 100644 --- a/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx +++ b/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx @@ -605,8 +605,7 @@ namespace drawinglayer::primitive2d const Primitive2DReference aPrimitiveGrey( new ModifiedColorPrimitive2D( aRetval, - basegfx::BColorModifierSharedPtr( - new basegfx::BColorModifier_gray()))); + std::make_shared<basegfx::BColorModifier_gray>())); aRetval = Primitive2DContainer { aPrimitiveGrey }; break; @@ -617,8 +616,7 @@ namespace drawinglayer::primitive2d const Primitive2DReference aPrimitiveBlackAndWhite( new ModifiedColorPrimitive2D( aRetval, - basegfx::BColorModifierSharedPtr( - new basegfx::BColorModifier_black_and_white(0.5)))); + std::make_shared<basegfx::BColorModifier_black_and_white>(0.5))); aRetval = Primitive2DContainer { aPrimitiveBlackAndWhite }; break; @@ -644,13 +642,12 @@ namespace drawinglayer::primitive2d const Primitive2DReference aPrimitiveRGBLuminannceContrast( new ModifiedColorPrimitive2D( aRetval, - basegfx::BColorModifierSharedPtr( - new basegfx::BColorModifier_RGBLuminanceContrast( + std::make_shared<basegfx::BColorModifier_RGBLuminanceContrast>( fRed, fGreen, fBlue, fLuminance, - fContrast)))); + fContrast))); aRetval = Primitive2DContainer { aPrimitiveRGBLuminannceContrast }; } @@ -661,9 +658,8 @@ namespace drawinglayer::primitive2d const Primitive2DReference aPrimitiveGamma( new ModifiedColorPrimitive2D( aRetval, - basegfx::BColorModifierSharedPtr( - new basegfx::BColorModifier_gamma( - fGamma)))); + std::make_shared<basegfx::BColorModifier_gamma>( + fGamma))); aRetval = Primitive2DContainer { aPrimitiveGamma }; } @@ -674,8 +670,7 @@ namespace drawinglayer::primitive2d const Primitive2DReference aPrimitiveInvert( new ModifiedColorPrimitive2D( aRetval, - basegfx::BColorModifierSharedPtr( - new basegfx::BColorModifier_invert()))); + std::make_shared<basegfx::BColorModifier_invert>())); aRetval = Primitive2DContainer { aPrimitiveInvert }; } diff --git a/drawinglayer/source/primitive2d/shadowprimitive2d.cxx b/drawinglayer/source/primitive2d/shadowprimitive2d.cxx index ff198eeeb29f..ba239ee02123 100644 --- a/drawinglayer/source/primitive2d/shadowprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/shadowprimitive2d.cxx @@ -64,9 +64,9 @@ namespace drawinglayer::primitive2d if(!getChildren().empty()) { // create a modifiedColorPrimitive containing the shadow color and the content - const basegfx::BColorModifierSharedPtr aBColorModifier( - new basegfx::BColorModifier_replace( - getShadowColor())); + const basegfx::BColorModifierSharedPtr aBColorModifier = + std::make_shared<basegfx::BColorModifier_replace>( + getShadowColor()); const Primitive2DReference xRefA( new ModifiedColorPrimitive2D( getChildren(), diff --git a/drawinglayer/source/primitive2d/texteffectprimitive2d.cxx b/drawinglayer/source/primitive2d/texteffectprimitive2d.cxx index 925d1638ae25..6d1948bee899 100644 --- a/drawinglayer/source/primitive2d/texteffectprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/texteffectprimitive2d.cxx @@ -78,9 +78,9 @@ namespace drawinglayer::primitive2d if(bDefaultTextColor) { // emboss/engrave in black, original forced to white - const basegfx::BColorModifierSharedPtr aBColorModifierToGray( - new basegfx::BColorModifier_replace( - basegfx::BColor(0.0))); + const basegfx::BColorModifierSharedPtr aBColorModifierToGray = + std::make_shared<basegfx::BColorModifier_replace>( + basegfx::BColor(0.0)); const Primitive2DReference xModifiedColor( new ModifiedColorPrimitive2D( getTextContent(), @@ -92,9 +92,9 @@ namespace drawinglayer::primitive2d Primitive2DContainer { xModifiedColor })); // add original, too - const basegfx::BColorModifierSharedPtr aBColorModifierToWhite( - new basegfx::BColorModifier_replace( - basegfx::BColor(1.0))); + const basegfx::BColorModifierSharedPtr aBColorModifierToWhite = + std::make_shared<basegfx::BColorModifier_replace>( + basegfx::BColor(1.0)); rContainer.push_back( new ModifiedColorPrimitive2D( @@ -104,9 +104,9 @@ namespace drawinglayer::primitive2d else { // emboss/engrave in gray, keep original's color - const basegfx::BColorModifierSharedPtr aBColorModifierToGray( - new basegfx::BColorModifier_replace( - basegfx::BColor(0.75))); // 192 + const basegfx::BColorModifierSharedPtr aBColorModifierToGray = + std::make_shared<basegfx::BColorModifier_replace>( + basegfx::BColor(0.75)); // 192 const Primitive2DReference xModifiedColor( new ModifiedColorPrimitive2D( getTextContent(), @@ -161,9 +161,9 @@ namespace drawinglayer::primitive2d rContainer.push_back(new TransformPrimitive2D(aTransform, getTextContent())); // at last, place original over it, but force to white - const basegfx::BColorModifierSharedPtr aBColorModifierToWhite( - new basegfx::BColorModifier_replace( - basegfx::BColor(1.0, 1.0, 1.0))); + const basegfx::BColorModifierSharedPtr aBColorModifierToWhite = + std::make_shared<basegfx::BColorModifier_replace>( + basegfx::BColor(1.0, 1.0, 1.0)); rContainer.push_back( new ModifiedColorPrimitive2D( getTextContent(), diff --git a/drawinglayer/source/primitive3d/sdrdecompositiontools3d.cxx b/drawinglayer/source/primitive3d/sdrdecompositiontools3d.cxx index d86b51f3b0d6..5d2a2b6d2e1d 100644 --- a/drawinglayer/source/primitive3d/sdrdecompositiontools3d.cxx +++ b/drawinglayer/source/primitive3d/sdrdecompositiontools3d.cxx @@ -239,8 +239,8 @@ namespace drawinglayer::primitive3d if(css::drawing::TextureKind2_LUMINANCE == aSdr3DObjectAttribute.getTextureKind()) { // use modified color primitive to force textures to gray - const basegfx::BColorModifierSharedPtr aBColorModifier( - new basegfx::BColorModifier_gray()); + const basegfx::BColorModifierSharedPtr aBColorModifier = + std::make_shared<basegfx::BColorModifier_gray>(); const Primitive3DReference xRef2( new ModifiedColorPrimitive3D( aRetval, diff --git a/drawinglayer/source/processor3d/defaultprocessor3d.cxx b/drawinglayer/source/processor3d/defaultprocessor3d.cxx index 36862b0db230..6415fb00a2ed 100644 --- a/drawinglayer/source/processor3d/defaultprocessor3d.cxx +++ b/drawinglayer/source/processor3d/defaultprocessor3d.cxx @@ -87,47 +87,45 @@ namespace drawinglayer::processor3d { case attribute::GradientStyle::Linear: { - pNewTex.reset( - new texture::GeoTexSvxGradientLinear( + pNewTex = std::make_shared<texture::GeoTexSvxGradientLinear>( aOutlineRange, aOutlineRange, aStart, aEnd, nSteps, rFillGradient.getBorder(), - rFillGradient.getAngle())); + rFillGradient.getAngle()); break; } case attribute::GradientStyle::Axial: { - pNewTex.reset( - new texture::GeoTexSvxGradientAxial( + pNewTex = std::make_shared<texture::GeoTexSvxGradientAxial>( aOutlineRange, aOutlineRange, aStart, aEnd, nSteps, rFillGradient.getBorder(), - rFillGradient.getAngle())); + rFillGradient.getAngle()); break; } case attribute::GradientStyle::Radial: { - pNewTex.reset( - new texture::GeoTexSvxGradientRadial( + pNewTex = + std::make_shared<texture::GeoTexSvxGradientRadial>( aOutlineRange, aStart, aEnd, nSteps, rFillGradient.getBorder(), rFillGradient.getOffsetX(), - rFillGradient.getOffsetY())); + rFillGradient.getOffsetY()); break; } case attribute::GradientStyle::Elliptical: { - pNewTex.reset( - new texture::GeoTexSvxGradientElliptical( + pNewTex = + std::make_shared<texture::GeoTexSvxGradientElliptical>( aOutlineRange, aStart, aEnd, @@ -135,13 +133,13 @@ namespace drawinglayer::processor3d rFillGradient.getBorder(), rFillGradient.getOffsetX(), rFillGradient.getOffsetY(), - rFillGradient.getAngle())); + rFillGradient.getAngle()); break; } case attribute::GradientStyle::Square: { - pNewTex.reset( - new texture::GeoTexSvxGradientSquare( + pNewTex = + std::make_shared<texture::GeoTexSvxGradientSquare>( aOutlineRange, aStart, aEnd, @@ -149,13 +147,13 @@ namespace drawinglayer::processor3d rFillGradient.getBorder(), rFillGradient.getOffsetX(), rFillGradient.getOffsetY(), - rFillGradient.getAngle())); + rFillGradient.getAngle()); break; } case attribute::GradientStyle::Rect: { - pNewTex.reset( - new texture::GeoTexSvxGradientRect( + pNewTex = + std::make_shared<texture::GeoTexSvxGradientRect>( aOutlineRange, aStart, aEnd, @@ -163,7 +161,7 @@ namespace drawinglayer::processor3d rFillGradient.getBorder(), rFillGradient.getOffsetX(), rFillGradient.getOffsetY(), - rFillGradient.getAngle())); + rFillGradient.getAngle()); break; } } @@ -173,7 +171,7 @@ namespace drawinglayer::processor3d else { // no color distance -> same color, use simple texture - pNewTex.reset(new texture::GeoTexSvxMono(aStart, 1.0 - aStart.luminance())); + pNewTex = std::make_shared<texture::GeoTexSvxMono>(aStart, 1.0 - aStart.luminance()); mbSimpleTextureActive = true; } @@ -235,7 +233,7 @@ namespace drawinglayer::processor3d const double fLogicTexSize(std::max(fLogicTexSizeX, fLogicTexSizeY)); // create texture and set - mpGeoTexSvx.reset(new texture::GeoTexSvxMultiHatch(rPrimitive, fLogicTexSize)); + mpGeoTexSvx = std::make_shared<texture::GeoTexSvxMultiHatch>(rPrimitive, fLogicTexSize); // process sub-list process(rSubSequence); @@ -273,19 +271,19 @@ namespace drawinglayer::processor3d if(rFillGraphicAttribute.getTiling()) { - mpGeoTexSvx.reset( - new texture::GeoTexSvxBitmapExTiled( + mpGeoTexSvx = + std::make_shared<texture::GeoTexSvxBitmapExTiled>( aBitmapEx, aGraphicRange, rFillGraphicAttribute.getOffsetX(), - rFillGraphicAttribute.getOffsetY())); + rFillGraphicAttribute.getOffsetY()); } else { - mpGeoTexSvx.reset( - new texture::GeoTexSvxBitmapEx( + mpGeoTexSvx = + std::make_shared<texture::GeoTexSvxBitmapEx>( aBitmapEx, - aGraphicRange)); + aGraphicRange); } // process sub-list diff --git a/drawinglayer/source/tools/converters.cxx b/drawinglayer/source/tools/converters.cxx index 010f71810c30..ff9b79a688fa 100644 --- a/drawinglayer/source/tools/converters.cxx +++ b/drawinglayer/source/tools/converters.cxx @@ -122,9 +122,8 @@ namespace drawinglayer const primitive2d::Primitive2DReference xRef( new primitive2d::ModifiedColorPrimitive2D( aSequence, - basegfx::BColorModifierSharedPtr( - new basegfx::BColorModifier_replace( - basegfx::BColor(0.0, 0.0, 0.0))))); + std::make_shared<basegfx::BColorModifier_replace>( + basegfx::BColor(0.0, 0.0, 0.0)))); const primitive2d::Primitive2DContainer xSeq { xRef }; // render diff --git a/drawinglayer/source/tools/wmfemfhelper.cxx b/drawinglayer/source/tools/wmfemfhelper.cxx index e153d5d3b7a8..09217d32212e 100644 --- a/drawinglayer/source/tools/wmfemfhelper.cxx +++ b/drawinglayer/source/tools/wmfemfhelper.cxx @@ -900,9 +900,8 @@ namespace wmfemfhelper rTargetHolders.Current().append( std::make_unique<drawinglayer::primitive2d::ModifiedColorPrimitive2D>( aSubContent, - basegfx::BColorModifierSharedPtr( - new basegfx::BColorModifier_replace( - basegfx::BColor(0.0, 0.0, 0.0))))); + std::make_shared<basegfx::BColorModifier_replace>( + basegfx::BColor(0.0, 0.0, 0.0)))); } else // if(rPropertyHolders.Current().isRasterOpInvert()) { |