summaryrefslogtreecommitdiff
path: root/oox/source/ppt
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-01-24 08:31:14 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-01-24 08:27:40 +0100
commit09d56ba6d907199b124929272db9b5f61e0bb2d9 (patch)
tree98189ed1cd71f3311a80c8d008b66ec491d642f6 /oox/source/ppt
parentd4ed6ff5c1d0638dd46d3a2272c5c54b9700551f (diff)
loplugin:makeshared in oox
Change-Id: I6502e7be4881834b143ec7207c432881b2ae263c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87322 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'oox/source/ppt')
-rw-r--r--oox/source/ppt/pptgraphicshapecontext.cxx2
-rw-r--r--oox/source/ppt/pptimport.cxx2
-rw-r--r--oox/source/ppt/pptshape.cxx4
-rw-r--r--oox/source/ppt/pptshapecontext.cxx2
-rw-r--r--oox/source/ppt/pptshapegroupcontext.cxx8
-rw-r--r--oox/source/ppt/presentationfragmenthandler.cxx38
-rw-r--r--oox/source/ppt/slidefragmenthandler.cxx8
-rw-r--r--oox/source/ppt/slidepersist.cxx10
-rw-r--r--oox/source/ppt/timenodelistcontext.cxx2
9 files changed, 37 insertions, 39 deletions
diff --git a/oox/source/ppt/pptgraphicshapecontext.cxx b/oox/source/ppt/pptgraphicshapecontext.cxx
index 94638e2e5070..32483139746e 100644
--- a/oox/source/ppt/pptgraphicshapecontext.cxx
+++ b/oox/source/ppt/pptgraphicshapecontext.cxx
@@ -184,7 +184,7 @@ ContextHandlerRef PPTGraphicShapeContext::onCreateContext( sal_Int32 aElementTok
case PPT_TOKEN(txBody):
{
- oox::drawingml::TextBodyPtr xTextBody( new oox::drawingml::TextBody );
+ oox::drawingml::TextBodyPtr xTextBody = std::make_shared<oox::drawingml::TextBody>();
mpShapePtr->setTextBody( xTextBody );
return new oox::drawingml::TextBodyContext( *this, *xTextBody );
}
diff --git a/oox/source/ppt/pptimport.cxx b/oox/source/ppt/pptimport.cxx
index 184d0e5b5976..1a2ef397febc 100644
--- a/oox/source/ppt/pptimport.cxx
+++ b/oox/source/ppt/pptimport.cxx
@@ -60,7 +60,7 @@ XmlFilterBase* PowerPointImport::mpDebugFilterBase = nullptr;
PowerPointImport::PowerPointImport( const Reference< XComponentContext >& rxContext ) :
XmlFilterBase( rxContext ),
- mxChartConv( new ::oox::drawingml::chart::ChartConverter )
+ mxChartConv( std::make_shared<::oox::drawingml::chart::ChartConverter>() )
{
#if OSL_DEBUG_LEVEL > 0
diff --git a/oox/source/ppt/pptshape.cxx b/oox/source/ppt/pptshape.cxx
index e9610112e5ee..44bdb3e76cec 100644
--- a/oox/source/ppt/pptshape.cxx
+++ b/oox/source/ppt/pptshape.cxx
@@ -284,7 +284,7 @@ void PPTShape::addShape(
}
if (pPlaceholder.get()) {
PPTShape* pPPTPlaceholder = dynamic_cast< PPTShape* >( pPlaceholder.get() );
- TextListStylePtr pNewTextListStyle ( new TextListStyle() );
+ TextListStylePtr pNewTextListStyle = std::make_shared<TextListStyle>();
if (pPlaceholder->getTextBody()) {
@@ -338,7 +338,7 @@ void PPTShape::addShape(
}
if( aMasterTextListStyle.get() && getTextBody().get() ) {
- TextListStylePtr aCombinedTextListStyle (new TextListStyle());
+ TextListStylePtr aCombinedTextListStyle = std::make_shared<TextListStyle>();
aCombinedTextListStyle->apply( *aMasterTextListStyle );
diff --git a/oox/source/ppt/pptshapecontext.cxx b/oox/source/ppt/pptshapecontext.cxx
index fd9ccfba5f8c..76741bee3869 100644
--- a/oox/source/ppt/pptshapecontext.cxx
+++ b/oox/source/ppt/pptshapecontext.cxx
@@ -172,7 +172,7 @@ ContextHandlerRef PPTShapeContext::onCreateContext( sal_Int32 aElementToken, con
case PPT_TOKEN( txBody ):
{
- oox::drawingml::TextBodyPtr xTextBody( new oox::drawingml::TextBody( mpShapePtr->getTextBody() ) );
+ oox::drawingml::TextBodyPtr xTextBody = std::make_shared<oox::drawingml::TextBody>( mpShapePtr->getTextBody() );
xTextBody->getTextProperties().maPropertyMap.setProperty( PROP_FontIndependentLineSpacing, true );
mpShapePtr->setTextBody( xTextBody );
return new oox::drawingml::TextBodyContext( *this, mpShapePtr );
diff --git a/oox/source/ppt/pptshapegroupcontext.cxx b/oox/source/ppt/pptshapegroupcontext.cxx
index 8990a12bd3fa..ce9fd1cd7ab1 100644
--- a/oox/source/ppt/pptshapegroupcontext.cxx
+++ b/oox/source/ppt/pptshapegroupcontext.cxx
@@ -96,9 +96,9 @@ ContextHandlerRef PPTShapeGroupContext::onCreateContext( sal_Int32 aElementToken
return new ShapeStyleContext( getParser() );
*/
case PPT_TOKEN( cxnSp ): // connector shape
- return new oox::drawingml::ConnectorShapeContext( *this, mpGroupShapePtr, oox::drawingml::ShapePtr( new PPTShape( meShapeLocation, "com.sun.star.drawing.ConnectorShape" ) ) );
+ return new oox::drawingml::ConnectorShapeContext( *this, mpGroupShapePtr, std::make_shared<PPTShape>( meShapeLocation, "com.sun.star.drawing.ConnectorShape" ) );
case PPT_TOKEN( grpSp ): // group shape
- return new PPTShapeGroupContext( *this, mpSlidePersistPtr, meShapeLocation, mpGroupShapePtr, oox::drawingml::ShapePtr( new PPTShape( meShapeLocation, "com.sun.star.drawing.GroupShape" ) ) );
+ return new PPTShapeGroupContext( *this, mpSlidePersistPtr, meShapeLocation, mpGroupShapePtr, std::make_shared<PPTShape>( meShapeLocation, "com.sun.star.drawing.GroupShape" ) );
case PPT_TOKEN( sp ): // Shape
{
auto pShape = std::make_shared<PPTShape>( meShapeLocation, "com.sun.star.drawing.CustomShape" );
@@ -135,10 +135,10 @@ ContextHandlerRef PPTShapeGroupContext::onCreateContext( sal_Int32 aElementToken
return new PPTShapeContext( *this, mpSlidePersistPtr, mpGroupShapePtr, pShape );
}
case PPT_TOKEN( pic ): // CT_Picture
- return new PPTGraphicShapeContext( *this, mpSlidePersistPtr, mpGroupShapePtr, oox::drawingml::ShapePtr( new PPTShape( meShapeLocation, "com.sun.star.drawing.GraphicObjectShape" ) ) );
+ return new PPTGraphicShapeContext( *this, mpSlidePersistPtr, mpGroupShapePtr, std::make_shared<PPTShape>( meShapeLocation, "com.sun.star.drawing.GraphicObjectShape" ) );
case PPT_TOKEN( graphicFrame ): // CT_GraphicalObjectFrame
{
- pGraphicShape = oox::drawingml::ShapePtr( new PPTShape( meShapeLocation, "com.sun.star.drawing.OLE2Shape" ) );
+ pGraphicShape = std::make_shared<PPTShape>( meShapeLocation, "com.sun.star.drawing.OLE2Shape" );
return new oox::drawingml::GraphicalObjectFrameContext( *this, mpGroupShapePtr, pGraphicShape, true );
}
}
diff --git a/oox/source/ppt/presentationfragmenthandler.cxx b/oox/source/ppt/presentationfragmenthandler.cxx
index 63ac3ee10953..dcad8358bd49 100644
--- a/oox/source/ppt/presentationfragmenthandler.cxx
+++ b/oox/source/ppt/presentationfragmenthandler.cxx
@@ -84,7 +84,7 @@ static std::map<PredefinedClrSchemeId, sal_Int32> PredefinedClrTokens =
PresentationFragmentHandler::PresentationFragmentHandler(XmlFilterBase& rFilter, const OUString& rFragmentPath)
: FragmentHandler2( rFilter, rFragmentPath )
- , mpTextListStyle( new TextListStyle )
+ , mpTextListStyle( std::make_shared<TextListStyle>() )
, mbCommentAuthorsRead(false)
{
TextParagraphPropertiesVector& rParagraphDefaultsVector( mpTextListStyle->getListStyle() );
@@ -249,8 +249,8 @@ void PresentationFragmentHandler::importSlide(sal_uInt32 nSlide, bool bFirstPage
if( !aSlideFragmentPath.isEmpty() )
{
SlidePersistPtr pMasterPersistPtr;
- SlidePersistPtr pSlidePersistPtr( new SlidePersist( rFilter, false, false, xSlide,
- ShapePtr( new PPTShape( Slide, "com.sun.star.drawing.GroupShape" ) ), mpTextListStyle ) );
+ SlidePersistPtr pSlidePersistPtr = std::make_shared<SlidePersist>( rFilter, false, false, xSlide,
+ std::make_shared<PPTShape>( Slide, "com.sun.star.drawing.GroupShape" ), mpTextListStyle );
FragmentHandlerRef xSlideFragmentHandler( new SlideFragmentHandler( rFilter, aSlideFragmentPath, pSlidePersistPtr, Slide ) );
@@ -294,7 +294,7 @@ void PresentationFragmentHandler::importSlide(sal_uInt32 nSlide, bool bFirstPage
}
pMasterPersistPtr = std::make_shared<SlidePersist>( rFilter, true, false, xMasterPage,
- ShapePtr( new PPTShape( Master, "com.sun.star.drawing.GroupShape" ) ), mpTextListStyle );
+ std::make_shared<PPTShape>( Master, "com.sun.star.drawing.GroupShape" ), mpTextListStyle );
pMasterPersistPtr->setLayoutPath( aLayoutFragmentPath );
rFilter.getMasterPages().push_back( pMasterPersistPtr );
rFilter.setActualSlidePersist( pMasterPersistPtr );
@@ -308,7 +308,7 @@ void PresentationFragmentHandler::importSlide(sal_uInt32 nSlide, bool bFirstPage
std::map< OUString, oox::drawingml::ThemePtr >::iterator aIter2( rThemes.find( aThemeFragmentPath ) );
if( aIter2 == rThemes.end() )
{
- oox::drawingml::ThemePtr pThemePtr( new oox::drawingml::Theme() );
+ oox::drawingml::ThemePtr pThemePtr = std::make_shared<oox::drawingml::Theme>();
pMasterPersistPtr->setTheme( pThemePtr );
Reference<xml::dom::XDocument> xDoc=
rFilter.importFragment(aThemeFragmentPath);
@@ -362,8 +362,8 @@ void PresentationFragmentHandler::importSlide(sal_uInt32 nSlide, bool bFirstPage
Reference< XDrawPage > xNotesPage( xPresentationPage->getNotesPage() );
if ( xNotesPage.is() )
{
- SlidePersistPtr pNotesPersistPtr( new SlidePersist( rFilter, false, true, xNotesPage,
- ShapePtr( new PPTShape( Slide, "com.sun.star.drawing.GroupShape" ) ), mpTextListStyle ) );
+ SlidePersistPtr pNotesPersistPtr = std::make_shared<SlidePersist>( rFilter, false, true, xNotesPage,
+ std::make_shared<PPTShape>( Slide, "com.sun.star.drawing.GroupShape" ), mpTextListStyle );
FragmentHandlerRef xNotesFragmentHandler( new SlideFragmentHandler( getFilter(), aNotesFragmentPath, pNotesPersistPtr, Slide ) );
rFilter.getNotesPages().push_back( pNotesPersistPtr );
rFilter.setActualSlidePersist( pNotesPersistPtr );
@@ -382,12 +382,11 @@ void PresentationFragmentHandler::importSlide(sal_uInt32 nSlide, bool bFirstPage
OUString aCommentAuthorsFragmentPath = "ppt/commentAuthors.xml";
Reference< XPresentationPage > xPresentationPage( xSlide, UNO_QUERY );
Reference< XDrawPage > xCommentAuthorsPage( xPresentationPage->getNotesPage() );
- SlidePersistPtr pCommentAuthorsPersistPtr(
- new SlidePersist( rFilter, false, true, xCommentAuthorsPage,
- ShapePtr(
- new PPTShape(
- Slide, "com.sun.star.drawing.GroupShape" ) ),
- mpTextListStyle ) );
+ SlidePersistPtr pCommentAuthorsPersistPtr =
+ std::make_shared<SlidePersist>( rFilter, false, true, xCommentAuthorsPage,
+ std::make_shared<PPTShape>(
+ Slide, "com.sun.star.drawing.GroupShape" ),
+ mpTextListStyle );
FragmentHandlerRef xCommentAuthorsFragmentHandler(
new SlideFragmentHandler( getFilter(),
aCommentAuthorsFragmentPath,
@@ -401,13 +400,12 @@ void PresentationFragmentHandler::importSlide(sal_uInt32 nSlide, bool bFirstPage
{
Reference< XPresentationPage > xPresentationPage( xSlide, UNO_QUERY );
Reference< XDrawPage > xCommentsPage( xPresentationPage->getNotesPage() );
- SlidePersistPtr pCommentsPersistPtr(
- new SlidePersist(
+ SlidePersistPtr pCommentsPersistPtr =
+ std::make_shared<SlidePersist>(
rFilter, false, true, xCommentsPage,
- ShapePtr(
- new PPTShape(
- Slide, "com.sun.star.drawing.GroupShape" ) ),
- mpTextListStyle ) );
+ std::make_shared<PPTShape>(
+ Slide, "com.sun.star.drawing.GroupShape" ),
+ mpTextListStyle );
FragmentHandlerRef xCommentsFragmentHandler(
new SlideFragmentHandler(
@@ -521,7 +519,7 @@ void PresentationFragmentHandler::finalizeImport()
uno::Reference<io::XInputStream> xInStrm = getFilter().openInputStream(aVbaFragmentPath);
if (xInStrm.is())
{
- StorageRef xPrjStrg(new oox::ole::OleStorage(getFilter().getComponentContext(), xInStrm, false));
+ StorageRef xPrjStrg = std::make_shared<oox::ole::OleStorage>(getFilter().getComponentContext(), xInStrm, false);
getFilter().getVbaProject().importVbaProject(*xPrjStrg);
}
}
diff --git a/oox/source/ppt/slidefragmenthandler.cxx b/oox/source/ppt/slidefragmenthandler.cxx
index a0872d365b5f..c3ab59d4e9ae 100644
--- a/oox/source/ppt/slidefragmenthandler.cxx
+++ b/oox/source/ppt/slidefragmenthandler.cxx
@@ -110,9 +110,9 @@ SlideFragmentHandler::~SlideFragmentHandler()
}
if( !bNotesFragmentPathFound && !mpSlidePersistPtr->getMasterPersist() )
{
- TextListStylePtr pTextListStyle(new TextListStyle);
+ TextListStylePtr pTextListStyle = std::make_shared<TextListStyle>();
SlidePersistPtr pMasterPersistPtr = std::make_shared<SlidePersist>( rFilter, true, true, mpSlidePersistPtr->getPage(),
- ShapePtr( new PPTShape( Master, "com.sun.star.drawing.GroupShape" ) ), mpSlidePersistPtr->getNotesTextStyle() );
+ std::make_shared<PPTShape>( Master, "com.sun.star.drawing.GroupShape" ), mpSlidePersistPtr->getNotesTextStyle() );
pMasterPersistPtr->setPath( aNotesFragmentPath );
rFilter.getMasterPages().push_back( pMasterPersistPtr );
FragmentHandlerRef xMasterFragmentHandler( new SlideFragmentHandler( rFilter, aNotesFragmentPath, pMasterPersistPtr, Master ) );
@@ -131,7 +131,7 @@ SlideFragmentHandler::~SlideFragmentHandler()
{
return new PPTShapeGroupContext(
*this, mpSlidePersistPtr, meShapeLocation, mpSlidePersistPtr->getShapes(),
- oox::drawingml::ShapePtr( new PPTShape( meShapeLocation, "com.sun.star.drawing.GroupShape" ) ) );
+ std::make_shared<PPTShape>( meShapeLocation, "com.sun.star.drawing.GroupShape" ) );
}
break;
@@ -159,7 +159,7 @@ SlideFragmentHandler::~SlideFragmentHandler()
return this;
case PPT_TOKEN( bgPr ): // CT_BackgroundProperties
{
- FillPropertiesPtr pFillPropertiesPtr( new FillProperties );
+ FillPropertiesPtr pFillPropertiesPtr =std::make_shared<FillProperties>();
mpSlidePersistPtr->setBackgroundProperties( pFillPropertiesPtr );
return new BackgroundPropertiesContext( *this, *pFillPropertiesPtr );
}
diff --git a/oox/source/ppt/slidepersist.cxx b/oox/source/ppt/slidepersist.cxx
index f9ee8ef91d5b..abfe49163745 100644
--- a/oox/source/ppt/slidepersist.cxx
+++ b/oox/source/ppt/slidepersist.cxx
@@ -53,17 +53,17 @@ namespace oox::ppt {
SlidePersist::SlidePersist( XmlFilterBase& rFilter, bool bMaster, bool bNotes,
const css::uno::Reference< css::drawing::XDrawPage >& rxPage,
oox::drawingml::ShapePtr const & pShapesPtr, const drawingml::TextListStylePtr & pDefaultTextStyle )
-: mpDrawingPtr( new oox::vml::Drawing( rFilter, rxPage, oox::vml::VMLDRAWING_POWERPOINT ) )
+: mpDrawingPtr( std::make_shared<oox::vml::Drawing>( rFilter, rxPage, oox::vml::VMLDRAWING_POWERPOINT ) )
, mxPage( rxPage )
, maShapesPtr( pShapesPtr )
, mnLayoutValueToken( 0 )
, mbMaster( bMaster )
, mbNotes ( bNotes )
, maDefaultTextStylePtr( pDefaultTextStyle )
-, maTitleTextStylePtr( new oox::drawingml::TextListStyle )
-, maBodyTextStylePtr( new oox::drawingml::TextListStyle )
-, maNotesTextStylePtr( new oox::drawingml::TextListStyle )
-, maOtherTextStylePtr( new oox::drawingml::TextListStyle )
+, maTitleTextStylePtr( std::make_shared<oox::drawingml::TextListStyle>() )
+, maBodyTextStylePtr( std::make_shared<oox::drawingml::TextListStyle>() )
+, maNotesTextStylePtr( std::make_shared<oox::drawingml::TextListStyle>() )
+, maOtherTextStylePtr( std::make_shared<oox::drawingml::TextListStyle>() )
{
#if OSL_DEBUG_LEVEL > 0
mxDebugPage = mxPage;
diff --git a/oox/source/ppt/timenodelistcontext.cxx b/oox/source/ppt/timenodelistcontext.cxx
index a50ac20fcb48..075d2fbb589e 100644
--- a/oox/source/ppt/timenodelistcontext.cxx
+++ b/oox/source/ppt/timenodelistcontext.cxx
@@ -1029,7 +1029,7 @@ namespace oox::ppt {
break;
}
- TimeNodePtr pNode(new TimeNode(nNodeType));
+ TimeNodePtr pNode = std::make_shared<TimeNode>(nNodeType);
maList.push_back( pNode );
FragmentHandler2 * pContext = TimeNodeContext::makeContext( *this, aElementToken, rAttribs.getFastAttributeList(), pNode );