sw/source/core/inc/unometa.hxx | 4 ++-- sw/source/core/unocore/unorefmk.cxx | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-)
New commits: commit b640c566908de902c26bf209c79c7c3efa4a0def Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Thu Aug 23 09:25:00 2018 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Thu Aug 23 12:30:43 2018 +0200 loplugin:useuniqueptr in SwXMeta Change-Id: I10c75fd2cd7b78195661b499753a2fbb90e8793c Reviewed-on: https://gerrit.libreoffice.org/59485 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/sw/source/core/inc/unometa.hxx b/sw/source/core/inc/unometa.hxx index ff6188a6d078..87c351b5dcc4 100644 --- a/sw/source/core/inc/unometa.hxx +++ b/sw/source/core/inc/unometa.hxx @@ -84,7 +84,7 @@ protected: /// @param pDoc and pMeta != 0, but not & because of ImplInheritanceHelper SwXMeta(SwDoc *const pDoc, ::sw::Meta *const pMeta, css::uno::Reference< css::text::XText> const& xParentText, - TextRangeList_t const*const pPortions); + std::unique_ptr<TextRangeList_t const> pPortions); SwXMeta(SwDoc *const pDoc); @@ -205,7 +205,7 @@ private: SwXMetaField(SwDoc *const pDoc, ::sw::Meta *const pMeta, css::uno::Reference< css::text::XText> const& xParentText, - TextRangeList_t const*const pPortions); + std::unique_ptr<TextRangeList_t const> pPortions); friend css::uno::Reference<css::rdf::XMetadatable> SwXMeta::CreateXMeta(SwDoc &, bool); diff --git a/sw/source/core/unocore/unorefmk.cxx b/sw/source/core/unocore/unorefmk.cxx index 86cabc326f5b..12608d77cb15 100644 --- a/sw/source/core/unocore/unorefmk.cxx +++ b/sw/source/core/unocore/unorefmk.cxx @@ -627,9 +627,9 @@ public: Impl(SwXMeta& rThis, SwDoc& rDoc, ::sw::Meta* const pMeta, uno::Reference<text::XText> const& xParentText, - TextRangeList_t const * const pPortions) + std::unique_ptr<TextRangeList_t const> pPortions) : m_EventListeners(m_Mutex) - , m_pTextPortions(pPortions) + , m_pTextPortions(std::move(pPortions)) , m_bIsDisposed(false) , m_bIsDescriptor(nullptr == pMeta) , m_xParentText(xParentText) @@ -678,8 +678,8 @@ uno::Reference<text::XText> const & SwXMeta::GetParentText() const SwXMeta::SwXMeta(SwDoc *const pDoc, ::sw::Meta *const pMeta, uno::Reference<text::XText> const& xParentText, - TextRangeList_t const*const pPortions) - : m_pImpl( new SwXMeta::Impl(*this, *pDoc, pMeta, xParentText, pPortions) ) + std::unique_ptr<TextRangeList_t const> pPortions) + : m_pImpl( new SwXMeta::Impl(*this, *pDoc, pMeta, xParentText, std::move(pPortions)) ) { } @@ -750,9 +750,9 @@ SwXMeta::CreateXMeta(::sw::Meta & rMeta, if (!xParentText.is()) { return nullptr; } SwXMeta *const pXMeta( (RES_TXTATR_META == rMeta.GetFormatMeta()->Which()) ? new SwXMeta (pTextNode->GetDoc(), &rMeta, xParentText, - pPortions.release()) // temporarily un-unique_ptr :-( + std::move(pPortions)) : new SwXMetaField(pTextNode->GetDoc(), &rMeta, xParentText, - pPortions.release())); + std::move(pPortions))); // this is why the constructor is private: need to acquire pXMeta here xMeta.set(pXMeta); // in order to initialize the weak pointer cache in the core object @@ -1257,8 +1257,8 @@ inline const ::sw::MetaField* SwXMeta::Impl::GetMetaField() const SwXMetaField::SwXMetaField(SwDoc *const pDoc, ::sw::Meta *const pMeta, uno::Reference<text::XText> const& xParentText, - TextRangeList_t const*const pPortions) - : SwXMetaField_Base(pDoc, pMeta, xParentText, pPortions) + std::unique_ptr<TextRangeList_t const> pPortions) + : SwXMetaField_Base(pDoc, pMeta, xParentText, std::move(pPortions)) { OSL_ENSURE(dynamic_cast< ::sw::MetaField* >(pMeta), "SwXMetaField created for wrong hint!"); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits