sd/inc/textapi.hxx | 2 +- sd/source/core/text/textapi.cxx | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-)
New commits: commit 85a90158d69db1926feb3e2af0712502bb77f6ee Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Mon Aug 20 16:57:37 2018 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Tue Aug 21 12:11:58 2018 +0200 loplugin:useuniqueptr in TextApiObject Change-Id: I57c6f91ff034f06f947dd8498aa10a2e61a5ff9e Reviewed-on: https://gerrit.libreoffice.org/59366 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/sd/inc/textapi.hxx b/sd/inc/textapi.hxx index 00a60d13791d..05cc7ee27e41 100644 --- a/sd/inc/textapi.hxx +++ b/sd/inc/textapi.hxx @@ -48,7 +48,7 @@ public: private: std::unique_ptr<TextAPIEditSource> mpSource; - TextApiObject( TextAPIEditSource* pEditSource ); + TextApiObject( std::unique_ptr<TextAPIEditSource> pEditSource ); }; } // namespace sd diff --git a/sd/source/core/text/textapi.cxx b/sd/source/core/text/textapi.cxx index ec968c510f6e..9cfc8dfcdb47 100644 --- a/sd/source/core/text/textapi.cxx +++ b/sd/source/core/text/textapi.cxx @@ -32,6 +32,7 @@ #include <Outliner.hxx> #include <svx/svdpool.hxx> #include <svx/svdundo.hxx> +#include <o3tl/make_unique.hxx> using namespace ::com::sun::star::uno; using namespace ::com::sun::star::text; @@ -123,9 +124,9 @@ const SvxItemPropertySet* ImplGetSdTextPortionPropertyMap() return &aSdTextPortionPropertyMap; } -TextApiObject::TextApiObject( TextAPIEditSource* pEditSource ) -: SvxUnoText( pEditSource, ImplGetSdTextPortionPropertyMap(), Reference < XText >() ) -, mpSource(pEditSource) +TextApiObject::TextApiObject( std::unique_ptr<TextAPIEditSource> pEditSource ) +: SvxUnoText( pEditSource.get(), ImplGetSdTextPortionPropertyMap(), Reference < XText >() ) +, mpSource(std::move(pEditSource)) { } @@ -136,7 +137,7 @@ TextApiObject::~TextApiObject() throw() rtl::Reference< TextApiObject > TextApiObject::create( SdDrawDocument* pDoc ) { - rtl::Reference< TextApiObject > xRet( new TextApiObject( new TextAPIEditSource( pDoc ) ) ); + rtl::Reference< TextApiObject > xRet( new TextApiObject( o3tl::make_unique<TextAPIEditSource>( pDoc ) ) ); return xRet; } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits