summaryrefslogtreecommitdiff
path: root/svx/source/unodraw
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-01-10 12:30:24 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-01-10 13:07:41 +0100
commit175a2063effa1c5a3eab896c6c4b0d07f3588edb (patch)
tree4a252a7e9e6e714343e9ff21c3d78c8e41086009 /svx/source/unodraw
parentddf901664d3dd12191f98b77182652a6889f2b26 (diff)
use more std::make_shared
found using 'git grep', I tried using clang-tidy, but it only successfully found a tiny fraction of these Change-Id: I61c7d85105ff7a911722750e759d6641d578da33 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86526 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx/source/unodraw')
-rw-r--r--svx/source/unodraw/unobrushitemhelper.cxx12
-rw-r--r--svx/source/unodraw/unoshape.cxx4
2 files changed, 8 insertions, 8 deletions
diff --git a/svx/source/unodraw/unobrushitemhelper.cxx b/svx/source/unodraw/unobrushitemhelper.cxx
index d465036d1edf..b8856fdd53b1 100644
--- a/svx/source/unodraw/unobrushitemhelper.cxx
+++ b/svx/source/unodraw/unobrushitemhelper.cxx
@@ -189,7 +189,7 @@ static std::shared_ptr<SvxBrushItem> getSvxBrushItemForSolid(const SfxItemSet& r
aFillColor.SetTransparency(aTargetTrans);
}
- return std::shared_ptr<SvxBrushItem>(new SvxBrushItem(aFillColor, nBackgroundID));
+ return std::make_shared<SvxBrushItem>(aFillColor, nBackgroundID);
}
std::shared_ptr<SvxBrushItem> getSvxBrushItemFromSourceSet(const SfxItemSet& rSourceSet, sal_uInt16 nBackgroundID, bool bSearchInParents, bool bXMLImportHack)
@@ -207,10 +207,10 @@ std::shared_ptr<SvxBrushItem> getSvxBrushItemFromSourceSet(const SfxItemSet& rSo
aFillColor.SetTransparency(0xff);
- return std::shared_ptr<SvxBrushItem>(new SvxBrushItem(aFillColor, nBackgroundID));
+ return std::make_shared<SvxBrushItem>(aFillColor, nBackgroundID);
}
- std::shared_ptr<SvxBrushItem> aRetval(new SvxBrushItem(nBackgroundID));
+ auto aRetval = std::make_shared<SvxBrushItem>(nBackgroundID);
switch(pXFillStyleItem->GetValue())
{
@@ -249,7 +249,7 @@ std::shared_ptr<SvxBrushItem> getSvxBrushItemFromSourceSet(const SfxItemSet& rSo
aMixedColor.SetTransparency(aTargetTrans);
}
- aRetval = std::shared_ptr<SvxBrushItem>(new SvxBrushItem(aMixedColor, nBackgroundID));
+ aRetval = std::make_shared<SvxBrushItem>(aMixedColor, nBackgroundID);
break;
}
case drawing::FillStyle_HATCH:
@@ -281,7 +281,7 @@ std::shared_ptr<SvxBrushItem> getSvxBrushItemFromSourceSet(const SfxItemSet& rSo
const sal_uInt8 aTargetTrans(std::min(sal_uInt8(0xfe), static_cast< sal_uInt8 >((nFillTransparence * 254) / 100)));
aHatchColor.SetTransparency(aTargetTrans);
- aRetval = std::shared_ptr<SvxBrushItem>(new SvxBrushItem(aHatchColor, nBackgroundID));
+ aRetval = std::make_shared<SvxBrushItem>(aHatchColor, nBackgroundID);
}
break;
@@ -324,7 +324,7 @@ std::shared_ptr<SvxBrushItem> getSvxBrushItemFromSourceSet(const SfxItemSet& rSo
}
// create with given graphic and position
- aRetval = std::shared_ptr<SvxBrushItem>(new SvxBrushItem(aGraphic, aSvxGraphicPosition, nBackgroundID));
+ aRetval = std::make_shared<SvxBrushItem>(aGraphic, aSvxGraphicPosition, nBackgroundID);
// get evtl. mixed transparence
const sal_uInt16 nFillTransparence(getTransparenceForSvxBrushItem(rSourceSet, bSearchInParents));
diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx
index 37283fa085f6..835c2e61d6d6 100644
--- a/svx/source/unodraw/unoshape.cxx
+++ b/svx/source/unodraw/unoshape.cxx
@@ -320,9 +320,9 @@ svx::PropertyChangeNotifier& SvxShape::getShapePropertyChangeNotifier()
void SvxShape::impl_construct()
{
mpImpl->maPropertyNotifier.registerProvider( svx::ShapeProperty::Position,
- std::shared_ptr<svx::IPropertyValueProvider>( new ShapePositionProvider( *mpImpl ) ) );
+ std::make_shared<ShapePositionProvider>( *mpImpl ) );
mpImpl->maPropertyNotifier.registerProvider( svx::ShapeProperty::Size,
- std::shared_ptr<svx::IPropertyValueProvider>( new ShapeSizeProvider( *mpImpl ) ) );
+ std::make_shared<ShapeSizeProvider>( *mpImpl ) );
if ( HasSdrObject() )
{