Some places across the code base that currently instantiate a local std::unique_ptr and then std::move it into a function call can make use of std::make_unique instead (which is only C++14, so we have o3tl::make_unique for now, #include <o3tl/make_unique.hxx>). For example: > diff --git a/basctl/source/basicide/moduldl2.cxx b/basctl/source/basicide/moduldl2.cxx > index a9b8c69..bab81f6 100644 > --- a/basctl/source/basicide/moduldl2.cxx > +++ b/basctl/source/basicide/moduldl2.cxx > @@ -58,7 +58,6 @@ > #include <cppuhelper/implbase.hxx> > > #include <cassert> > -#include <memory> > > namespace basctl > { > @@ -254,9 +253,9 @@ void CheckBox::InitEntry(SvTreeListEntry* pEntry, const OUString& rTxt, > for ( sal_uInt16 nCol = 1; nCol < nCount; ++nCol ) > { > SvLBoxString& rCol = static_cast<SvLBoxString&>(pEntry->GetItem( nCol )); > - std::unique_ptr<LibLBoxString> pStr( > - new LibLBoxString( pEntry, 0, rCol.GetText())); > - pEntry->ReplaceItem(std::move(pStr), nCol); > + pEntry->ReplaceItem( > + o3tl::make_unique<LibLBoxString>(pEntry, 0, rCol.GetText()), > + nCol); > } > } > }
I started to work on this bug: https://gerrit.libreoffice.org/#/c/19071/
bureken committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=86a8c08a3f7f8412fd1a8659a3e9db5f0d1d8846 tdf#94205 Use o3tl::make_unique instead of new + std::move It will be available in 5.1.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Migrating Whiteboard tags to Keywords: (easyHack, difficultyBeginner, skillCpp, topicCleanup) [NinjaEdit]
Sheikha AL-Hinai committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=d75b9fd582f0aa83bd2fc99028b3f83eb7171d61 tdf#94205: Use o3tl::make_unique insted of new+std::move. It will be available in 5.2.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
JanI is default CC for Easy Hacks (Add Jan; remove LibreOffice Dev List from CC) [NinjaEdit]
krishna keshav committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=a7e2d4923b220900f41d0b70904377c771939e6f tdf#94205 Use o3tl::make_unique instead of new + std::move It will be available in 5.3.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
apurvapriyadarshi committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=04068eb6f9c153950e4fda75733728fc8922f668 tdf#94205 Use o3tl::make_unique instead of new + std::move It will be available in 5.3.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
krishna keshav committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=9eb08b9534567801988c4137281ff153117edd32 tdf#94205 Use o3tl::make_unique instead of new + std::move It will be available in 5.3.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Seems solved
Stephan Bergmann committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=83360372383fdcbab18560a5113c92115b166cd5 tdf#94205: Some remaining new+std::move -> o3tl::make_unique It will be available in 5.3.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
(In reply to jan iversen from comment #9) > Seems solved Yeah, a quick and dirty grep only found a handful of cases now; fixed those with the commit from comment 10.