summaryrefslogtreecommitdiff
path: root/oox
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 /oox
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 'oox')
-rw-r--r--oox/source/drawingml/diagram/constraintlistcontext.cxx2
-rw-r--r--oox/source/drawingml/textbody.cxx2
-rw-r--r--oox/source/drawingml/textbodycontext.cxx2
-rw-r--r--oox/source/ppt/pptshapegroupcontext.cxx2
-rw-r--r--oox/source/shape/ShapeContextHandler.cxx10
-rw-r--r--oox/source/vml/vmlshapecontainer.cxx2
6 files changed, 9 insertions, 11 deletions
diff --git a/oox/source/drawingml/diagram/constraintlistcontext.cxx b/oox/source/drawingml/diagram/constraintlistcontext.cxx
index cc71c89b226a..42cefee41d28 100644
--- a/oox/source/drawingml/diagram/constraintlistcontext.cxx
+++ b/oox/source/drawingml/diagram/constraintlistcontext.cxx
@@ -49,7 +49,7 @@ ConstraintListContext::onCreateContext( ::sal_Int32 aElement,
{
case DGM_TOKEN( constr ):
{
- std::shared_ptr< ConstraintAtom > pNode( new ConstraintAtom(mpNode->getLayoutNode()) );
+ auto pNode = std::make_shared<ConstraintAtom>(mpNode->getLayoutNode());
LayoutAtom::connect(mpNode, pNode);
Constraint& rConstraint = pNode->getConstraint();
diff --git a/oox/source/drawingml/textbody.cxx b/oox/source/drawingml/textbody.cxx
index ab1659d8ada9..219128c7f6e0 100644
--- a/oox/source/drawingml/textbody.cxx
+++ b/oox/source/drawingml/textbody.cxx
@@ -45,7 +45,7 @@ TextBody::TextBody( const TextBodyPtr& pBody )
TextParagraph& TextBody::addParagraph()
{
- std::shared_ptr< TextParagraph > xPara( new TextParagraph );
+ auto xPara = std::make_shared<TextParagraph>();
maParagraphs.push_back( xPara );
return *xPara;
}
diff --git a/oox/source/drawingml/textbodycontext.cxx b/oox/source/drawingml/textbodycontext.cxx
index 0f8c90ab4c89..d0f8769cc962 100644
--- a/oox/source/drawingml/textbodycontext.cxx
+++ b/oox/source/drawingml/textbodycontext.cxx
@@ -84,7 +84,7 @@ ContextHandlerRef TextParagraphContext::onCreateContext( sal_Int32 aElementToken
}
case A_TOKEN( fld ): // "CT_TextField" Text Field.
{
- std::shared_ptr< TextField > pField( new TextField );
+ auto pField = std::make_shared<TextField>();
mrParagraph.addRun( pField );
return new TextFieldContext( *this, rAttribs, *pField );
}
diff --git a/oox/source/ppt/pptshapegroupcontext.cxx b/oox/source/ppt/pptshapegroupcontext.cxx
index 251fff8ab78e..b445a3eec703 100644
--- a/oox/source/ppt/pptshapegroupcontext.cxx
+++ b/oox/source/ppt/pptshapegroupcontext.cxx
@@ -101,7 +101,7 @@ ContextHandlerRef PPTShapeGroupContext::onCreateContext( sal_Int32 aElementToken
return new PPTShapeGroupContext( *this, mpSlidePersistPtr, meShapeLocation, mpGroupShapePtr, oox::drawingml::ShapePtr( new PPTShape( meShapeLocation, "com.sun.star.drawing.GroupShape" ) ) );
case PPT_TOKEN( sp ): // Shape
{
- std::shared_ptr<PPTShape> pShape( new PPTShape( meShapeLocation, "com.sun.star.drawing.CustomShape" ) );
+ auto pShape = std::make_shared<PPTShape>( meShapeLocation, "com.sun.star.drawing.CustomShape" );
bool bUseBgFill = rAttribs.getBool(XML_useBgFill, false);
pShape->setUseBgFill(bUseBgFill);
if (bUseBgFill)
diff --git a/oox/source/shape/ShapeContextHandler.cxx b/oox/source/shape/ShapeContextHandler.cxx
index 23041d6cee48..acc8624af602 100644
--- a/oox/source/shape/ShapeContextHandler.cxx
+++ b/oox/source/shape/ShapeContextHandler.cxx
@@ -123,9 +123,8 @@ uno::Reference<xml::sax::XFastContextHandler> const & ShapeContextHandler::getWp
*rFragmentHandler,
xShape,
pMasterShape,
- ShapePtr(
- new oox::drawingml::Shape(
- "com.sun.star.drawing.CustomShape"))));
+ std::make_shared<oox::drawingml::Shape>(
+ "com.sun.star.drawing.CustomShape")));
break;
default:
break;
@@ -160,8 +159,7 @@ ShapeContextHandler::getGraphicShapeContext(::sal_Int32 Element )
{
if (! mxGraphicShapeContext.is())
{
- std::shared_ptr<ContextHandler2Helper> pFragmentHandler
- (new ShapeFragmentHandler(*mxFilterBase, msRelationFragmentPath));
+ auto pFragmentHandler = std::make_shared<ShapeFragmentHandler>(*mxFilterBase, msRelationFragmentPath);
ShapePtr pMasterShape;
switch (Element & 0xffff)
@@ -216,7 +214,7 @@ ShapeContextHandler::getDiagramShapeContext()
{
if (!mxDiagramShapeContext.is())
{
- std::shared_ptr<ContextHandler2Helper> pFragmentHandler(new ShapeFragmentHandler(*mxFilterBase, msRelationFragmentPath));
+ auto pFragmentHandler = std::make_shared<ShapeFragmentHandler>(*mxFilterBase, msRelationFragmentPath);
mpShape.reset(new Shape());
mxDiagramShapeContext.set(new DiagramGraphicDataContext(*pFragmentHandler, mpShape));
}
diff --git a/oox/source/vml/vmlshapecontainer.cxx b/oox/source/vml/vmlshapecontainer.cxx
index e8008a1f4638..71713d3e7120 100644
--- a/oox/source/vml/vmlshapecontainer.cxx
+++ b/oox/source/vml/vmlshapecontainer.cxx
@@ -61,7 +61,7 @@ ShapeContainer::~ShapeContainer()
std::shared_ptr<ShapeType> ShapeContainer::createShapeType()
{
- std::shared_ptr< ShapeType > xShape( new ShapeType( mrDrawing ) );
+ auto xShape = std::make_shared<ShapeType>( mrDrawing );
maTypes.push_back( xShape );
return xShape;
}