Kaydet (Commit) 86a8c08a authored tarafından bureken's avatar bureken Kaydeden (comit) Stephan Bergmann

tdf#94205 Use o3tl::make_unique instead of new + std::move

Change-Id: I27ed3c3fb826e7ce63b0bc12f7d17e18b21c9949
Reviewed-on: https://gerrit.libreoffice.org/19071Reviewed-by: 's avatarStephan Bergmann <sbergman@redhat.com>
Tested-by: 's avatarStephan Bergmann <sbergman@redhat.com>
üst a6e6eb8b
......@@ -254,9 +254,7 @@ 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);
}
}
}
......
......@@ -46,6 +46,7 @@
#include <fmtfsize.hxx>
#include <list>
#include <memory>
#include <o3tl/make_unique.hxx>
static void lcl_CpyBox( const SwTable& rCpyTable, const SwTableBox* pCpyBox,
SwTable& rDstTable, SwTableBox* pDstBox,
......@@ -213,8 +214,7 @@ namespace
SwTableLine *pLine2 = rLines[ ++nEndLn ];
SwTableBox *pTmpBox = pLine2->GetTabBoxes()[0];
_FndLine *pInsLine = new _FndLine( pLine2, &rFndBox );
std::unique_ptr<_FndBox> pFndBox(new _FndBox(pTmpBox, pInsLine));
pInsLine->GetBoxes().insert(pInsLine->GetBoxes().begin(), std::move(pFndBox));
pInsLine->GetBoxes().insert(pInsLine->GetBoxes().begin(), o3tl::make_unique<_FndBox>(pTmpBox, pInsLine));
rFndLines.push_back(std::unique_ptr<_FndLine>(pInsLine));
}
}
......
......@@ -40,6 +40,7 @@
#include <undo.hrc>
#include <comcore.hrc>
#include <docsh.hxx>
#include <o3tl/make_unique.hxx>
// This class saves the Pam as integers and can recompose those into a PaM
SwUndRng::SwUndRng()
......@@ -1028,9 +1029,7 @@ bool SwUndo::FillSaveDataForFormat(
&& eCmpPos != POS_COLLIDE_END
&& eCmpPos != POS_COLLIDE_START )
{
std::unique_ptr<SwRedlineSaveData> pNewData(
new SwRedlineSaveData(eCmpPos, *pStt, *pEnd, *pRedl, true));
rSData.push_back(std::move(pNewData));
rSData.push_back(o3tl::make_unique<SwRedlineSaveData>(eCmpPos, *pStt, *pEnd, *pRedl, true));
}
}
......
......@@ -48,6 +48,7 @@
#include <svtools/svparser.hxx>
#include <vcl/svapp.hxx>
#include <vcl/wrkwin.hxx>
#include <o3tl/make_unique.hxx>
#include "css1kywd.hxx"
#include "svxcss1.hxx"
......@@ -928,8 +929,7 @@ void SvxCSS1Parser::InsertMapEntry( const OUString& rKey,
CSS1Map::iterator itr = rMap.find(rKey);
if (itr == rMap.end())
{
std::unique_ptr<SvxCSS1MapEntry> p(new SvxCSS1MapEntry(rKey, rItemSet, rProp));
rMap.insert(std::make_pair(rKey, std::move(p)));
rMap.insert(std::make_pair(rKey, o3tl::make_unique<SvxCSS1MapEntry>(rKey, rItemSet, rProp)));
}
else
{
......
......@@ -34,6 +34,7 @@
#include <editeng/unoedhlp.hxx>
#include <svx/AccessibleTextHelper.hxx>
#include <editeng/outliner.hxx>
#include <o3tl/make_unique.hxx>
namespace sw { namespace sidebarwindows {
......@@ -166,9 +167,7 @@ SidebarTextControlAccessibleContext::SidebarTextControlAccessibleContext( Sideba
, mpAccessibleTextHelper( 0 )
, maMutex()
{
::std::unique_ptr<SvxEditSource> pEditSource(
new SidebarTextEditSource( mrSidebarTextControl ) );
mpAccessibleTextHelper = new ::accessibility::AccessibleTextHelper( std::move(pEditSource) );
mpAccessibleTextHelper = new ::accessibility::AccessibleTextHelper( o3tl::make_unique<SidebarTextEditSource>(mrSidebarTextControl) );
mpAccessibleTextHelper->SetEventSource( mrSidebarTextControl.GetWindowPeer() );
}
......
......@@ -25,6 +25,8 @@
#include <sfx2/dispatch.hxx>
#include <sfx2/event.hxx>
#include <o3tl/enumrange.hxx>
#include <o3tl/make_unique.hxx>
#include <o3tl/sorted_vector.hxx>
#include <vcl/help.hxx>
#include <vcl/settings.hxx>
#include <sot/formats.hxx>
......@@ -84,7 +86,6 @@
#include <postithelper.hxx>
#include <redline.hxx>
#include <docary.hxx>
#include <o3tl/sorted_vector.hxx>
#include <svtools/treelistentry.hxx>
#include "swabstdlg.hxx"
......@@ -3468,9 +3469,7 @@ void SwContentTree::InitEntry(SvTreeListEntry* pEntry,
const size_t nColToHilite = 1; //0==Bitmap;1=="Column1";2=="Column2"
SvTreeListBox::InitEntry( pEntry, rStr, rImg1, rImg2, eButtonKind );
SvLBoxString& rCol = static_cast<SvLBoxString&>(pEntry->GetItem( nColToHilite ));
std::unique_ptr<SwContentLBoxString> pStr(
new SwContentLBoxString(pEntry, 0, rCol.GetText()));
pEntry->ReplaceItem(std::move(pStr), nColToHilite);
pEntry->ReplaceItem(o3tl::make_unique<SwContentLBoxString>(pEntry, 0, rCol.GetText()), nColToHilite);
}
void SwContentLBoxString::Paint(const Point& rPos, SvTreeListBox& rDev, vcl::RenderContext& rRenderContext,
......
......@@ -49,6 +49,7 @@
#include <navicont.hxx>
#include <edtwin.hxx>
#include <uitool.hxx>
#include <o3tl/make_unique.hxx>
#include <cmdid.h>
#include <helpid.h>
......@@ -1232,9 +1233,7 @@ void SwGlobalTree::InitEntry(SvTreeListEntry* pEntry,
const size_t nColToHilite = 1; //0==Bitmap;1=="Column1";2=="Column2"
SvTreeListBox::InitEntry( pEntry, rStr, rImg1, rImg2, eButtonKind );
SvLBoxString& rCol = static_cast<SvLBoxString&>(pEntry->GetItem( nColToHilite ));
std::unique_ptr<SwLBoxString> pStr(
new SwLBoxString(pEntry, 0, rCol.GetText()));
pEntry->ReplaceItem(std::move(pStr), nColToHilite);
pEntry->ReplaceItem(o3tl::make_unique<SwLBoxString>(pEntry, 0, rCol.GetText()), nColToHilite);
}
void SwLBoxString::Paint(const Point& rPos, SvTreeListBox& rDev, vcl::RenderContext& rRenderContext,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment