summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbureken <berkgureken@gmail.com>2015-10-01 13:43:09 +0300
committerStephan Bergmann <sbergman@redhat.com>2015-10-02 15:25:10 +0000
commit86a8c08a3f7f8412fd1a8659a3e9db5f0d1d8846 (patch)
tree564a5b456f05b24c2f90cffb5400b7ed18fa0d80
parenta6e6eb8b37ba431df575be4799114bb821f54b0d (diff)
tdf#94205 Use o3tl::make_unique instead of new + std::move
Change-Id: I27ed3c3fb826e7ce63b0bc12f7d17e18b21c9949 Reviewed-on: https://gerrit.libreoffice.org/19071 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com>
-rw-r--r--basctl/source/basicide/moduldl2.cxx4
-rw-r--r--sw/source/core/doc/tblcpy.cxx4
-rw-r--r--sw/source/core/undo/undobj.cxx5
-rw-r--r--sw/source/filter/html/svxcss1.cxx4
-rw-r--r--sw/source/uibase/docvw/SidebarTxtControlAcc.cxx5
-rw-r--r--sw/source/uibase/utlui/content.cxx7
-rw-r--r--sw/source/uibase/utlui/glbltree.cxx5
7 files changed, 14 insertions, 20 deletions
diff --git a/basctl/source/basicide/moduldl2.cxx b/basctl/source/basicide/moduldl2.cxx
index 9918f827962e..b21f3166ffff 100644
--- a/basctl/source/basicide/moduldl2.cxx
+++ b/basctl/source/basicide/moduldl2.cxx
@@ -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);
}
}
}
diff --git a/sw/source/core/doc/tblcpy.cxx b/sw/source/core/doc/tblcpy.cxx
index 3d3b1103bf7a..8a4e80a09b1a 100644
--- a/sw/source/core/doc/tblcpy.cxx
+++ b/sw/source/core/doc/tblcpy.cxx
@@ -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));
}
}
diff --git a/sw/source/core/undo/undobj.cxx b/sw/source/core/undo/undobj.cxx
index e4d18ce70d25..f54130e85253 100644
--- a/sw/source/core/undo/undobj.cxx
+++ b/sw/source/core/undo/undobj.cxx
@@ -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));
}
}
diff --git a/sw/source/filter/html/svxcss1.cxx b/sw/source/filter/html/svxcss1.cxx
index 6a259c89a4e1..cb790ac8cc47 100644
--- a/sw/source/filter/html/svxcss1.cxx
+++ b/sw/source/filter/html/svxcss1.cxx
@@ -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
{
diff --git a/sw/source/uibase/docvw/SidebarTxtControlAcc.cxx b/sw/source/uibase/docvw/SidebarTxtControlAcc.cxx
index 8bf33de51ec8..733d0d5fc983 100644
--- a/sw/source/uibase/docvw/SidebarTxtControlAcc.cxx
+++ b/sw/source/uibase/docvw/SidebarTxtControlAcc.cxx
@@ -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() );
}
diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx
index 3d86f271e239..b6da66af6191 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -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,
diff --git a/sw/source/uibase/utlui/glbltree.cxx b/sw/source/uibase/utlui/glbltree.cxx
index 9fa8273a0b78..d393b1e81726 100644
--- a/sw/source/uibase/utlui/glbltree.cxx
+++ b/sw/source/uibase/utlui/glbltree.cxx
@@ -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,