summaryrefslogtreecommitdiff
path: root/include/oox
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 /include/oox
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 'include/oox')
-rw-r--r--include/oox/drawingml/chart/modelbase.hxx10
-rw-r--r--include/oox/dump/dumperbase.hxx6
-rw-r--r--include/oox/ppt/animationspersist.hxx2
-rw-r--r--include/oox/ppt/timenode.hxx2
4 files changed, 10 insertions, 10 deletions
diff --git a/include/oox/drawingml/chart/modelbase.hxx b/include/oox/drawingml/chart/modelbase.hxx
index 312d3e35e2bf..ffac39507d63 100644
--- a/include/oox/drawingml/chart/modelbase.hxx
+++ b/include/oox/drawingml/chart/modelbase.hxx
@@ -42,15 +42,15 @@ public:
bool is() const { return this->get() != 0; }
- ModelType& create() { this->reset( new ModelType ); return **this; }
+ ModelType& create() { (*this) = std::make_shared<ModelType>(); return **this; }
template< typename Param1Type >
- ModelType& create( const Param1Type& rParam1 ) { this->reset( new ModelType( rParam1 ) ); return **this; }
+ ModelType& create( const Param1Type& rParam1 ) { (*this) = std::make_shared<ModelType>( rParam1 ); return **this; }
template< typename Param1Type, typename Param2Type >
- ModelType& create( const Param1Type& rParam1, const Param2Type& rParam2 ) { this->reset( new ModelType( rParam1, rParam2 ) ); return **this; }
+ ModelType& create( const Param1Type& rParam1, const Param2Type& rParam2 ) { (*this) = std::make_shared<ModelType>( rParam1, rParam2 ); return **this; }
- ModelType& getOrCreate() { if( !*this ) this->reset( new ModelType ); return **this; }
+ ModelType& getOrCreate() { if( !*this ) (*this) = std::make_shared<ModelType>(); return **this; }
template< typename Param1Type >
- ModelType& getOrCreate( const Param1Type& rParam1 ) { if( !*this ) this->reset( new ModelType( rParam1 ) ); return **this; }
+ ModelType& getOrCreate( const Param1Type& rParam1 ) { if( !*this ) (*this) = std::make_shared<ModelType>( rParam1 ); return **this; }
};
template< typename ModelType >
diff --git a/include/oox/dump/dumperbase.hxx b/include/oox/dump/dumperbase.hxx
index bab76313fe69..5fe8cc2b0b90 100644
--- a/include/oox/dump/dumperbase.hxx
+++ b/include/oox/dump/dumperbase.hxx
@@ -142,7 +142,7 @@ public:
::oox::BinaryInputStreamRef( pInStrm ) {}
/*implicit*/ BinaryInputStreamRef( const css::uno::Reference< css::io::XInputStream >& rxInStrm ) :
- ::oox::BinaryInputStreamRef( new BinaryXInputStream( rxInStrm, true ) ) {}
+ ::oox::BinaryInputStreamRef( std::make_shared<BinaryXInputStream>( rxInStrm, true ) ) {}
template< typename StreamType >
/*implicit*/ BinaryInputStreamRef( const std::shared_ptr< StreamType >& rxInStrm ) :
@@ -814,7 +814,7 @@ std::shared_ptr< ListType > SharedConfigData::createNameList( const OUString& rL
std::shared_ptr< ListType > xList;
if( !rListName.isEmpty() )
{
- xList.reset( new ListType( *this ) );
+ xList = std::make_shared<ListType>( *this );
setNameList( rListName, xList );
}
return xList;
@@ -1684,7 +1684,7 @@ private:
class SequenceRecordObjectBase : public RecordObjectBase
{
protected:
- SequenceRecordObjectBase() : mxRecData( new StreamDataSequence ) {}
+ SequenceRecordObjectBase() : mxRecData( std::make_shared<StreamDataSequence>() ) {}
using RecordObjectBase::construct;
void construct(
diff --git a/include/oox/ppt/animationspersist.hxx b/include/oox/ppt/animationspersist.hxx
index cd18b9101615..aa808b4908fc 100644
--- a/include/oox/ppt/animationspersist.hxx
+++ b/include/oox/ppt/animationspersist.hxx
@@ -98,7 +98,7 @@ namespace oox { namespace ppt {
static css::uno::Any convertList(const SlidePersistPtr & pSlide, const AnimationConditionList & l);
AnimTargetElementPtr & getTarget()
- { if(!mpTarget) mpTarget.reset( new AnimTargetElement ); return mpTarget; }
+ { if(!mpTarget) mpTarget = std::make_shared<AnimTargetElement>(); return mpTarget; }
css::uno::Any maValue;
sal_Int32 mnType;
private:
diff --git a/include/oox/ppt/timenode.hxx b/include/oox/ppt/timenode.hxx
index d4794ae96dee..6d8ab4794c46 100644
--- a/include/oox/ppt/timenode.hxx
+++ b/include/oox/ppt/timenode.hxx
@@ -81,7 +81,7 @@ namespace oox { namespace ppt {
AnimTargetElementPtr const & getTarget()
{
if( !mpTarget )
- mpTarget.reset( new AnimTargetElement );
+ mpTarget = std::make_shared<AnimTargetElement>();
return mpTarget;
}