[Libreoffice-commits] core.git: basctl/source sw/source

bureken berkgureken at gmail.com
Fri Oct 2 08:25:37 PDT 2015


 basctl/source/basicide/moduldl2.cxx             |    4 +---
 sw/source/core/doc/tblcpy.cxx                   |    4 ++--
 sw/source/core/undo/undobj.cxx                  |    5 ++---
 sw/source/filter/html/svxcss1.cxx               |    4 ++--
 sw/source/uibase/docvw/SidebarTxtControlAcc.cxx |    5 ++---
 sw/source/uibase/utlui/content.cxx              |    7 +++----
 sw/source/uibase/utlui/glbltree.cxx             |    5 ++---
 7 files changed, 14 insertions(+), 20 deletions(-)

New commits:
commit 86a8c08a3f7f8412fd1a8659a3e9db5f0d1d8846
Author: bureken <berkgureken at gmail.com>
Date:   Thu Oct 1 13:43:09 2015 +0300

    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 at redhat.com>
    Tested-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/basctl/source/basicide/moduldl2.cxx b/basctl/source/basicide/moduldl2.cxx
index 9918f82..b21f316 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 3d3b110..8a4e80a 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 e4d18ce..f54130e 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 6a259c8..cb790ac 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 8bf33de..733d0d5 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 3d86f27..b6da66a 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 9fa8273..d393b1e 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,


More information about the Libreoffice-commits mailing list