summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-04-21 12:41:45 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-04-22 18:52:14 +0200
commit688a520111a2dd3ab4cb3b846b561936d8a887bf (patch)
treedd3b298776d21ae85ec8715a00507d66f9c19489 /oox
parent4048ddc65a36fe0b8940019ded4fd1d58f907bcc (diff)
use more make_shared in oox
Change-Id: I54c085a0720a381cf8bc27b2a4b4d2a3b2900918 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92620 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'oox')
-rw-r--r--oox/source/drawingml/shape.cxx2
-rw-r--r--oox/source/dump/dumperbase.cxx4
-rw-r--r--oox/source/dump/oledumper.cxx6
-rw-r--r--oox/source/ppt/slidefragmenthandler.cxx10
4 files changed, 14 insertions, 8 deletions
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index 7ffd1058fda9..d962f008f34e 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -329,7 +329,7 @@ void Shape::applyShapeReference( const Shape& rReferencedShape, bool bUseText )
mpShapeRefLinePropPtr = std::make_shared<LineProperties>( rReferencedShape.getActualLineProperties(nullptr) );
mpShapeRefFillPropPtr = std::make_shared<FillProperties>( rReferencedShape.getActualFillProperties(nullptr, nullptr) );
mpCustomShapePropertiesPtr = std::make_shared<CustomShapeProperties>( *rReferencedShape.mpCustomShapePropertiesPtr );
- mpTablePropertiesPtr = table::TablePropertiesPtr( rReferencedShape.mpTablePropertiesPtr.get() ? new table::TableProperties( *rReferencedShape.mpTablePropertiesPtr ) : nullptr );
+ mpTablePropertiesPtr = rReferencedShape.mpTablePropertiesPtr ? std::make_shared<table::TableProperties>( *rReferencedShape.mpTablePropertiesPtr ) : nullptr;
mpShapeRefEffectPropPtr = std::make_shared<EffectProperties>( rReferencedShape.getActualEffectProperties(nullptr) );
mpMasterTextListStyle = std::make_shared<TextListStyle>( *rReferencedShape.mpMasterTextListStyle );
maSize = rReferencedShape.maSize;
diff --git a/oox/source/dump/dumperbase.cxx b/oox/source/dump/dumperbase.cxx
index 1fdcd267edca..3f00248a26cc 100644
--- a/oox/source/dump/dumperbase.cxx
+++ b/oox/source/dump/dumperbase.cxx
@@ -1806,7 +1806,7 @@ void StorageObjectBase::implDump()
}
else if( xBaseStrm.is() )
{
- BinaryInputStreamRef xInStrm( new BinaryXInputStream( xBaseStrm, false ) );
+ BinaryInputStreamRef xInStrm( std::make_shared<BinaryXInputStream>( xBaseStrm, false ) );
xInStrm->seekToStart();
implDumpBaseStream( xInStrm, aSysOutPath );
}
@@ -2521,7 +2521,7 @@ void SequenceRecordObjectBase::construct( const ObjectBase& rParent,
const BinaryInputStreamRef& rxBaseStrm, const OUString& rSysFileName,
const String& rRecNames, const String& rSimpleRecs )
{
- BinaryInputStreamRef xRecStrm( new SequenceInputStream( *mxRecData ) );
+ BinaryInputStreamRef xRecStrm( std::make_shared<SequenceInputStream>( *mxRecData ) );
RecordObjectBase::construct( rParent, rxBaseStrm, rSysFileName, xRecStrm, rRecNames, rSimpleRecs );
}
diff --git a/oox/source/dump/oledumper.cxx b/oox/source/dump/oledumper.cxx
index 4a9102bb7ccc..f8ce1ec59fa8 100644
--- a/oox/source/dump/oledumper.cxx
+++ b/oox/source/dump/oledumper.cxx
@@ -1726,7 +1726,7 @@ void VbaOStreamObject::implDump()
writeDecItem( "control-id", siteInfo.mnId );
writeInfoItem( "prog-id", siteInfo.maProgId );
IndentGuard aIndGuard( mxOut );
- BinaryInputStreamRef xRelStrm( new RelativeInputStream( *mxStrm, siteInfo.mnLength ) );
+ BinaryInputStreamRef xRelStrm( std::make_shared<RelativeInputStream>( *mxStrm, siteInfo.mnLength ) );
FormControlStreamObject( *this, xRelStrm, &siteInfo.maProgId ).dump();
}
}
@@ -1861,7 +1861,7 @@ VbaDirStreamObject::VbaDirStreamObject( const ObjectBase& rParent,
mxInStrm = rxStrm;
if( mxInStrm.get() )
{
- BinaryInputStreamRef xVbaStrm( new ::oox::ole::VbaInputStream( *mxInStrm ) );
+ BinaryInputStreamRef xVbaStrm( std::make_shared<::oox::ole::VbaInputStream>( *mxInStrm ) );
SequenceRecordObjectBase::construct( rParent, xVbaStrm, rSysFileName, "VBA-DIR-RECORD-NAMES", "VBA-DIR-SIMPLE-RECORDS" );
}
}
@@ -2006,7 +2006,7 @@ void VbaModuleStreamObject::implDump()
mxOut->emptyLine();
writeEmptyItem( "source-code" );
IndentGuard aIndGuard( mxOut );
- BinaryInputStreamRef xVbaStrm( new ::oox::ole::VbaInputStream( *mxStrm ) );
+ BinaryInputStreamRef xVbaStrm( std::make_shared<::oox::ole::VbaInputStream>( *mxStrm ) );
TextLineStreamObject( *this, xVbaStrm, mrVbaData.meTextEnc ).dump();
}
diff --git a/oox/source/ppt/slidefragmenthandler.cxx b/oox/source/ppt/slidefragmenthandler.cxx
index 58a9a60c09f2..d316c53f3b49 100644
--- a/oox/source/ppt/slidefragmenthandler.cxx
+++ b/oox/source/ppt/slidefragmenthandler.cxx
@@ -164,7 +164,10 @@ SlideFragmentHandler::~SlideFragmentHandler()
const FillProperties *pFillProperties = nullptr;
if( mpSlidePersistPtr->getTheme() )
pFillProperties = mpSlidePersistPtr->getTheme()->getFillStyle( rAttribs.getInteger( XML_idx, -1 ) );
- FillPropertiesPtr pFillPropertiesPtr( pFillProperties ? new FillProperties( *pFillProperties ) : new FillProperties );
+ FillPropertiesPtr pFillPropertiesPtr =
+ pFillProperties
+ ? std::make_shared<FillProperties>( *pFillProperties )
+ : std::make_shared<FillProperties>();
mpSlidePersistPtr->setBackgroundProperties( pFillPropertiesPtr );
ContextHandlerRef ret = new ColorContext( *this, mpSlidePersistPtr->getBackgroundColor() );
return ret;
@@ -174,7 +177,10 @@ SlideFragmentHandler::~SlideFragmentHandler()
case A_TOKEN( overrideClrMapping ):
case PPT_TOKEN( clrMap ): // CT_ColorMapping
{
- oox::drawingml::ClrMapPtr pClrMapPtr( ( aElementToken == PPT_TOKEN( clrMap ) || !mpSlidePersistPtr.get() || !mpSlidePersistPtr->getClrMap().get() ) ? new oox::drawingml::ClrMap : new oox::drawingml::ClrMap( *mpSlidePersistPtr->getClrMap() ) );
+ oox::drawingml::ClrMapPtr pClrMapPtr =
+ ( aElementToken == PPT_TOKEN( clrMap ) || !mpSlidePersistPtr.get() || !mpSlidePersistPtr->getClrMap().get() )
+ ? std::make_shared<oox::drawingml::ClrMap>()
+ : std::make_shared<oox::drawingml::ClrMap>( *mpSlidePersistPtr->getClrMap() );
ContextHandlerRef ret = new oox::drawingml::clrMapContext( *this, rAttribs, *pClrMapPtr );
mpSlidePersistPtr->setClrMap( pClrMapPtr );
return ret;