basic/source/sbx/sbxbase.cxx | 3 cui/source/dialogs/scriptdlg.cxx | 11 +- cui/source/options/optaboutconfig.cxx | 12 +- cui/source/options/optfltr.cxx | 19 +-- editeng/source/uno/unoedhlp.cxx | 3 filter/source/msfilter/msdffimp.cxx | 5 filter/source/msfilter/svdfppt.cxx | 3 formula/source/core/api/FormulaOpCodeMapperObj.cxx | 3 sc/source/core/data/cellvalues.cxx | 5 sc/source/core/data/colorscale.cxx | 2 sc/source/core/data/table3.cxx | 3 sc/source/core/tool/dbdata.cxx | 3 sc/source/filter/html/htmlpars.cxx | 2 sc/source/ui/drawfunc/graphsh.cxx | 5 sd/source/ui/view/drviews2.cxx | 5 sfx2/source/sidebar/SidebarController.cxx | 3 slideshow/source/engine/transitions/slidechangebase.hxx | 2 slideshow/source/inc/listenercontainer.hxx | 13 -- starmath/inc/utility.hxx | 4 starmath/source/utility.cxx | 10 - stoc/source/security/lru_cache.h | 15 -- svl/source/inc/passwordcontainer.hxx | 28 ----- svl/source/inc/strmadpt.hxx | 56 ---------- svl/source/items/style.cxx | 3 svl/source/misc/strmadpt.cxx | 82 ---------------- svl/source/numbers/numfmuno.hxx | 3 svl/source/numbers/supservs.cxx | 2 svtools/inc/table/tablecontrolinterface.hxx | 7 - svtools/source/contnr/treelistentry.cxx | 4 svx/source/dialog/ctredlin.cxx | 21 ++-- svx/source/dialog/fontlb.cxx | 13 +- svx/source/fmcomp/gridcell.cxx | 5 sw/source/core/crsr/bookmrk.cxx | 5 sw/source/core/doc/docbm.cxx | 5 sw/source/core/doc/tblafmt.cxx | 3 sw/source/core/fields/authfld.cxx | 3 sw/source/core/frmedt/fetab.cxx | 3 sw/source/core/tox/ToxLinkProcessor.cxx | 5 sw/source/core/unocore/unoportenum.cxx | 3 sw/source/core/unocore/unostyle.cxx | 5 sw/source/filter/xml/xmltbli.cxx | 17 +-- sw/source/uibase/shells/grfsh.cxx | 5 sw/source/uibase/shells/txtattr.cxx | 3 sw/source/uibase/sidebar/StylePresetsPanel.cxx | 3 vcl/opengl/salbmp.cxx | 11 +- xmloff/source/style/impastpl.cxx | 8 - 46 files changed, 122 insertions(+), 312 deletions(-)
New commits: commit b3ff2f450f2e20af8e8f77515ad0615106859292 Author: Noel Grandin <n...@peralex.com> Date: Thu May 19 09:20:35 2016 +0200 loplugin:unusedmethods in slideshow to svtools Change-Id: Icf0056e13c88d7d347e668adaeddd4ed72af85cf Reviewed-on: https://gerrit.libreoffice.org/25141 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Noel Grandin <noelgran...@gmail.com> diff --git a/slideshow/source/engine/transitions/slidechangebase.hxx b/slideshow/source/engine/transitions/slidechangebase.hxx index fbb3d6d..13e699f 100644 --- a/slideshow/source/engine/transitions/slidechangebase.hxx +++ b/slideshow/source/engine/transitions/slidechangebase.hxx @@ -88,8 +88,6 @@ protected: /// Info on a per-view basis struct ViewEntry { - ViewEntry() {} - explicit ViewEntry( const UnoViewSharedPtr& rView ) : mpView( rView ) { diff --git a/slideshow/source/inc/listenercontainer.hxx b/slideshow/source/inc/listenercontainer.hxx index 7999066..c16fa89 100644 --- a/slideshow/source/inc/listenercontainer.hxx +++ b/slideshow/source/inc/listenercontainer.hxx @@ -43,19 +43,6 @@ struct EmptyBase class MutexBase { public: - struct Guard : public osl::MutexGuard - { - explicit Guard(MutexBase const& rBase) : - osl::MutexGuard(rBase.maMutex) - {} - }; - struct ClearableGuard : public osl::ClearableMutexGuard - { - explicit ClearableGuard(MutexBase const& rBase) : - osl::ClearableMutexGuard(rBase.maMutex) - {} - }; - mutable osl::Mutex maMutex; }; diff --git a/starmath/inc/utility.hxx b/starmath/inc/utility.hxx index 3576c5f..6e8b977 100644 --- a/starmath/inc/utility.hxx +++ b/starmath/inc/utility.hxx @@ -84,8 +84,6 @@ public: Font(rFont), nBorderWidth(-1) { Impl_Init(); } SmFace(const OUString& rName, const Size& rSize) : Font(rName, rSize), nBorderWidth(-1) { Impl_Init(); } - SmFace( FontFamily eFamily, const Size& rSize) : - Font(eFamily, rSize), nBorderWidth(-1) { Impl_Init(); } SmFace(const SmFace &rFace) : Font(rFace), nBorderWidth(-1) { Impl_Init(); } @@ -124,7 +122,6 @@ public: virtual ~SmFontPickList() { Clear(); } virtual void Insert(const vcl::Font &rFont); - void Update(const vcl::Font &rFont, const vcl::Font &rNewFont); void Remove(const vcl::Font &rFont); void Clear(); @@ -152,7 +149,6 @@ public: virtual void Insert(const vcl::Font &rFont) override; using Window::Update; - using SmFontPickList::Update; }; #endif diff --git a/starmath/source/utility.cxx b/starmath/source/utility.cxx index 0a1b61b..6983cb4 100644 --- a/starmath/source/utility.cxx +++ b/starmath/source/utility.cxx @@ -104,16 +104,6 @@ void SmFontPickList::Insert(const vcl::Font &rFont) } } -void SmFontPickList::Update(const vcl::Font &rFont, const vcl::Font &rNewFont) -{ - for (vcl::Font & rPos : aFontVec) - if (CompareItem( rPos, rFont )) - { - rPos = rNewFont; - break; - } -} - void SmFontPickList::Remove(const vcl::Font &rFont) { for (size_t nPos = 0; nPos < aFontVec.size(); nPos++) diff --git a/stoc/source/security/lru_cache.h b/stoc/source/security/lru_cache.h index b2c3847..78523c5 100644 --- a/stoc/source/security/lru_cache.h +++ b/stoc/source/security/lru_cache.h @@ -58,11 +58,6 @@ public: /** Default Ctor. Does not cache. */ inline lru_cache(); - /** Ctor. - - @param size number of elements to be cached; default param set to 128 - */ - explicit inline lru_cache( ::std::size_t size ); /** Destructor: releases all cached elements and keys. */ @@ -112,16 +107,6 @@ inline void lru_cache< t_key, t_val, t_hashKey, t_equalKey >::setSize( } template< typename t_key, typename t_val, typename t_hashKey, typename t_equalKey > -inline lru_cache< t_key, t_val, t_hashKey, t_equalKey >::lru_cache( - ::std::size_t size ) - : m_size( 0 ) - , m_block( nullptr ) - , m_tail( nullptr ) -{ - setSize( size ); -} - -template< typename t_key, typename t_val, typename t_hashKey, typename t_equalKey > inline lru_cache< t_key, t_val, t_hashKey, t_equalKey >::lru_cache() : m_size( 0 ) , m_block( nullptr ) diff --git a/svl/source/inc/passwordcontainer.hxx b/svl/source/inc/passwordcontainer.hxx index 884a451..d87d08a 100644 --- a/svl/source/inc/passwordcontainer.hxx +++ b/svl/source/inc/passwordcontainer.hxx @@ -79,14 +79,6 @@ public: { } - NamePassRecord( const OUString& aName, const ::std::vector< OUString >& aMemoryList ) - : m_aName( aName ) - , m_bHasMemPass( true ) - , m_aMemPass( aMemoryList ) - , m_bHasPersPass( false ) - { - } - NamePassRecord( const OUString& aName, const OUString& aPersistentList ) : m_aName( aName ) , m_bHasMemPass( false ) @@ -95,16 +87,6 @@ public: { } - NamePassRecord( const OUString& aName, - bool bHasMemoryList, const ::std::vector< OUString >& aMemoryList, - bool bHasPersistentList, const OUString & aPersistentList ) - : m_aName( aName ) - , m_bHasMemPass( bHasMemoryList ) - , m_bHasPersPass( bHasPersistentList ) - { - InitArrays( bHasMemoryList, aMemoryList, bHasPersistentList, aPersistentList ); - } - NamePassRecord( const NamePassRecord& aRecord ) : m_aName( aRecord.m_aName ) , m_bHasMemPass( false ) @@ -394,16 +376,6 @@ public: }; -class RW_SvMemoryStream : public SvMemoryStream { -public: - RW_SvMemoryStream( void* Buf, sal_uLong Size, StreamMode eMode ): - SvMemoryStream( Buf, Size, eMode){} - - RW_SvMemoryStream( sal_uLong InitSize=512, sal_uLong Resize=64 ): - SvMemoryStream( InitSize, Resize ){} -}; - - #endif // INCLUDED_SVL_SOURCE_INC_PASSWORDCONTAINER_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/inc/strmadpt.hxx b/svl/source/inc/strmadpt.hxx deleted file mode 100644 index 90fc31e..0000000 --- a/svl/source/inc/strmadpt.hxx +++ /dev/null @@ -1,56 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_SVL_STRMADPT_HXX -#define INCLUDED_SVL_STRMADPT_HXX - -#include <sal/config.h> - -#include <com/sun/star/io/XOutputStream.hpp> - - -class SvOutputStreamOpenLockBytes: public SvOpenLockBytes -{ - css::uno::Reference< css::io::XOutputStream > m_xOutputStream; - sal_uInt64 m_nPosition; - -public: - - SvOutputStreamOpenLockBytes( - const css::uno::Reference< css::io::XOutputStream > & rTheOutputStream): - m_xOutputStream(rTheOutputStream), m_nPosition(0) {} - - virtual ErrCode ReadAt(sal_uInt64, void *, sal_uLong, sal_Size *) const override; - - virtual ErrCode WriteAt(sal_uInt64 nPos, const void * pBuffer, sal_uLong nCount, - sal_Size * pWritten) override; - - virtual ErrCode Flush() const override; - - virtual ErrCode SetSize(sal_uInt64) override; - - virtual ErrCode Stat(SvLockBytesStat * pStat, SvLockBytesStatFlag) const override; - - virtual ErrCode FillAppend(const void * pBuffer, sal_uLong nCount, - sal_uLong * pWritten) override; -}; - -#endif // INCLUDED_SVL_STRMADPT_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svl/source/misc/strmadpt.cxx b/svl/source/misc/strmadpt.cxx index b608563..f8ae732 100644 --- a/svl/source/misc/strmadpt.cxx +++ b/svl/source/misc/strmadpt.cxx @@ -26,6 +26,7 @@ #include <string.h> #include <com/sun/star/io/XInputStream.hpp> +#include <com/sun/star/io/XOutputStream.hpp> #include <com/sun/star/io/XSeekable.hpp> #include <osl/diagnose.h> @@ -34,8 +35,6 @@ #include <svl/instrm.hxx> #include <svl/outstrm.hxx> -#include <strmadpt.hxx> - using namespace com::sun::star; class SvDataPipe_Impl @@ -126,89 +125,10 @@ inline bool SvDataPipe_Impl::isEOF() const && (!m_pReadPage || m_pReadPage->m_pRead == m_pReadPage->m_pEnd); } -// SvOutputStreamOpenLockBytes - - -// virtual -ErrCode SvOutputStreamOpenLockBytes::ReadAt(sal_uInt64, void *, sal_uLong, sal_uLong*) - const -{ - return ERRCODE_IO_CANTREAD; -} - -// virtual -ErrCode SvOutputStreamOpenLockBytes::WriteAt(sal_uInt64 const nPos, void const * pBuffer, - sal_uLong nCount, sal_uLong * pWritten) -{ - if (nPos != m_nPosition) - return ERRCODE_IO_CANTWRITE; - return FillAppend(pBuffer, nCount, pWritten); -} - -// virtual -ErrCode SvOutputStreamOpenLockBytes::Flush() const -{ - if (!m_xOutputStream.is()) - return ERRCODE_IO_CANTWRITE; - try - { - m_xOutputStream->flush(); - } - catch (const io::IOException&) - { - return ERRCODE_IO_CANTWRITE; - } - return ERRCODE_NONE; -} - -// virtual -ErrCode SvOutputStreamOpenLockBytes::SetSize(sal_uInt64) -{ - return ERRCODE_IO_NOTSUPPORTED; -} - -// virtual -ErrCode SvOutputStreamOpenLockBytes::Stat(SvLockBytesStat * pStat, - SvLockBytesStatFlag) const -{ - if (pStat) - pStat->nSize = m_nPosition; - return ERRCODE_NONE; -} -// virtual -ErrCode SvOutputStreamOpenLockBytes::FillAppend(void const * pBuffer, - sal_uLong nCount, - sal_uLong * pWritten) -{ - if (!m_xOutputStream.is()) - return ERRCODE_IO_CANTWRITE; - if (nCount > 0 - && nCount > std::numeric_limits< sal_uLong >::max() - m_nPosition) - { - nCount = std::numeric_limits< sal_uLong >::max() - m_nPosition; - if (nCount == 0) - return ERRCODE_IO_CANTWRITE; - } - try - { - m_xOutputStream-> - writeBytes(uno::Sequence< sal_Int8 >( - static_cast< sal_Int8 const * >(pBuffer), nCount)); - } - catch (const io::IOException&) - { - return ERRCODE_IO_CANTWRITE; - } - m_nPosition += nCount; - if (pWritten) - *pWritten = nCount; - return ERRCODE_NONE; -} // SvInputStream - bool SvInputStream::open() { if (GetError() != ERRCODE_NONE) diff --git a/svl/source/numbers/numfmuno.hxx b/svl/source/numbers/numfmuno.hxx index 729574b..3523a86 100644 --- a/svl/source/numbers/numfmuno.hxx +++ b/svl/source/numbers/numfmuno.hxx @@ -159,9 +159,6 @@ public: throw(css::uno::RuntimeException, std::exception) override; virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw(css::uno::RuntimeException, std::exception) override; - -private: - SvNumberFormatsObj(); // never implemented }; diff --git a/svl/source/numbers/supservs.cxx b/svl/source/numbers/supservs.cxx index 5aebe07..28a7f16f 100644 --- a/svl/source/numbers/supservs.cxx +++ b/svl/source/numbers/supservs.cxx @@ -30,8 +30,6 @@ #include <tools/stream.hxx> #include <svl/instrm.hxx> -#include <strmadpt.hxx> - using namespace ::com::sun::star::uno; using namespace ::com::sun::star::lang; using namespace ::com::sun::star::io; diff --git a/svtools/inc/table/tablecontrolinterface.hxx b/svtools/inc/table/tablecontrolinterface.hxx index 5f957b9..2e5e6d4 100644 --- a/svtools/inc/table/tablecontrolinterface.hxx +++ b/svtools/inc/table/tablecontrolinterface.hxx @@ -95,13 +95,6 @@ namespace svt { namespace table RowPos nRow; TableCellArea eArea; - TableCell() - :nColumn( COL_INVALID ) - ,nRow( ROW_INVALID ) - ,eArea( CellContent ) - { - } - TableCell( ColPos const i_column, RowPos const i_row ) :nColumn( i_column ) ,nRow( i_row ) commit d4d2fc24793960a07275e49706b90928b4a0c764 Author: Noel Grandin <n...@peralex.com> Date: Thu May 19 09:10:43 2016 +0200 clang-tidy modernize-make-unique Change-Id: I550bb69ddcef69906027516ccde62cf8e87c295b Reviewed-on: https://gerrit.libreoffice.org/25138 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Noel Grandin <noelgran...@gmail.com> diff --git a/basic/source/sbx/sbxbase.cxx b/basic/source/sbx/sbxbase.cxx index 3eb9e6f..cc26051 100644 --- a/basic/source/sbx/sbxbase.cxx +++ b/basic/source/sbx/sbxbase.cxx @@ -17,6 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <o3tl/make_unique.hxx> #include <tools/debug.hxx> #include <tools/stream.hxx> #include <vcl/svapp.hxx> @@ -305,7 +306,7 @@ SbxInfo::~SbxInfo() void SbxInfo::AddParam(const OUString& rName, SbxDataType eType, SbxFlagBits nFlags) { - m_Params.push_back(std::unique_ptr<SbxParamInfo>(new SbxParamInfo(rName, eType, nFlags))); + m_Params.push_back(o3tl::make_unique<SbxParamInfo>(rName, eType, nFlags)); } const SbxParamInfo* SbxInfo::GetParam( sal_uInt16 n ) const diff --git a/cui/source/dialogs/scriptdlg.cxx b/cui/source/dialogs/scriptdlg.cxx index 7ae62e4..ec995ee 100644 --- a/cui/source/dialogs/scriptdlg.cxx +++ b/cui/source/dialogs/scriptdlg.cxx @@ -24,6 +24,7 @@ #include <vcl/svapp.hxx> #include <vcl/layout.hxx> #include <vcl/builderfactory.hxx> +#include <o3tl/make_unique.hxx> #include <osl/mutex.hxx> #include <cuires.hrc> @@ -242,7 +243,7 @@ void SFTreeListBox::Init( const OUString& language ) getLangNodeFromRootNode( children[ n ], lang ); insertEntry( uiName, app ? RID_CUIIMG_HARDDISK : RID_CUIIMG_DOC, - nullptr, true, std::unique_ptr< SFEntry >(new SFEntry( OBJTYPE_SFROOT, langEntries, xDocumentModel )), factoryURL ); + nullptr, true, o3tl::make_unique< SFEntry >( OBJTYPE_SFROOT, langEntries, xDocumentModel ), factoryURL ); } SetUpdateMode( true ); @@ -323,11 +324,11 @@ void SFTreeListBox:: RequestSubEntries( SvTreeListEntry* pRootEntry, Reference< OUString name( children[ n ]->getName() ); if ( children[ n ]->getType() != browse::BrowseNodeTypes::SCRIPT) { - insertEntry( name, RID_CUIIMG_LIB, pRootEntry, true, std::unique_ptr< SFEntry >(new SFEntry( OBJTYPE_SCRIPTCONTAINER, children[ n ],model ))); + insertEntry( name, RID_CUIIMG_LIB, pRootEntry, true, o3tl::make_unique< SFEntry >( OBJTYPE_SCRIPTCONTAINER, children[ n ],model )); } else { - insertEntry( name, RID_CUIIMG_MACRO, pRootEntry, false, std::unique_ptr< SFEntry >(new SFEntry( OBJTYPE_METHOD, children[ n ],model ))); + insertEntry( name, RID_CUIIMG_MACRO, pRootEntry, false, o3tl::make_unique< SFEntry >( OBJTYPE_METHOD, children[ n ],model )); } } } @@ -964,12 +965,12 @@ void SvxScriptOrgDialog::createEntry( SvTreeListEntry* pEntry ) if ( aChildNode->getType() == browse::BrowseNodeTypes::SCRIPT ) { pNewEntry = m_pScriptsBox->insertEntry( aChildName, - RID_CUIIMG_MACRO, pEntry, false, std::unique_ptr< SFEntry >(new SFEntry( OBJTYPE_METHOD, aChildNode,xDocumentModel ) ) ); + RID_CUIIMG_MACRO, pEntry, false, o3tl::make_unique< SFEntry >( OBJTYPE_METHOD, aChildNode,xDocumentModel ) ); } else { pNewEntry = m_pScriptsBox->insertEntry( aChildName, - RID_CUIIMG_LIB, pEntry, false, std::unique_ptr< SFEntry >(new SFEntry( OBJTYPE_SCRIPTCONTAINER, aChildNode,xDocumentModel ) ) ); + RID_CUIIMG_LIB, pEntry, false, o3tl::make_unique< SFEntry >( OBJTYPE_SCRIPTCONTAINER, aChildNode,xDocumentModel ) ); // If the Parent is not loaded then set to // loaded, this will prevent RequestingChildren ( called diff --git a/cui/source/options/optaboutconfig.cxx b/cui/source/options/optaboutconfig.cxx index 3661856..15d3544 100644 --- a/cui/source/options/optaboutconfig.cxx +++ b/cui/source/options/optaboutconfig.cxx @@ -204,12 +204,12 @@ void CuiAboutConfigTabPage::InsertEntry(const OUString& rPropertyPath, const OUS bool bInsertToPrefBox) { SvTreeListEntry* pEntry = new SvTreeListEntry; - pEntry->AddItem(std::unique_ptr<SvLBoxContextBmp>( - new SvLBoxContextBmp( Image(), Image(), false))); //It is needed, otherwise causes crash - pEntry->AddItem(std::unique_ptr<SvLBoxString>(new SvLBoxString(rProp))); - pEntry->AddItem(std::unique_ptr<SvLBoxString>(new SvLBoxString(rStatus))); - pEntry->AddItem(std::unique_ptr<SvLBoxString>(new SvLBoxString(rType))); - pEntry->AddItem(std::unique_ptr<SvLBoxString>(new SvLBoxString(rValue))); + pEntry->AddItem(o3tl::make_unique<SvLBoxContextBmp>( + Image(), Image(), false)); //It is needed, otherwise causes crash + pEntry->AddItem(o3tl::make_unique<SvLBoxString>(rProp)); + pEntry->AddItem(o3tl::make_unique<SvLBoxString>(rStatus)); + pEntry->AddItem(o3tl::make_unique<SvLBoxString>(rType)); + pEntry->AddItem(o3tl::make_unique<SvLBoxString>(rValue)); pEntry->SetUserData( new UserData(rPropertyPath) ); if(bInsertToPrefBox) diff --git a/cui/source/options/optfltr.cxx b/cui/source/options/optfltr.cxx index 2bf67f9..0602cef 100644 --- a/cui/source/options/optfltr.cxx +++ b/cui/source/options/optfltr.cxx @@ -17,6 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <o3tl/make_unique.hxx> #include <unotools/moduleoptions.hxx> #include <unotools/fltrcfg.hxx> #include "optfltr.hxx" @@ -336,16 +337,16 @@ void OfaMSFilterTabPage2::InsertEntry( const OUString& _rTxt, sal_IntPtr _nType, if( !pCheckButtonData ) pCheckButtonData = new SvLBoxButtonData( m_pCheckLB ); - pEntry->AddItem(std::unique_ptr<SvLBoxContextBmp>( - new SvLBoxContextBmp(Image(), Image(), false))); - pEntry->AddItem(std::unique_ptr<SvLBoxButton>( - new SvLBoxButton(SvLBoxButtonKind::EnabledCheckbox, - pCheckButtonData))); - pEntry->AddItem(std::unique_ptr<SvLBoxButton>( - new SvLBoxButton(saveEnabled ? SvLBoxButtonKind::EnabledCheckbox + pEntry->AddItem(o3tl::make_unique<SvLBoxContextBmp>( + Image(), Image(), false)); + pEntry->AddItem(o3tl::make_unique<SvLBoxButton>( + SvLBoxButtonKind::EnabledCheckbox, + pCheckButtonData)); + pEntry->AddItem(o3tl::make_unique<SvLBoxButton>( + saveEnabled ? SvLBoxButtonKind::EnabledCheckbox : SvLBoxButtonKind::DisabledCheckbox, - pCheckButtonData))); - pEntry->AddItem(std::unique_ptr<SvLBoxString>(new SvLBoxString(_rTxt))); + pCheckButtonData)); + pEntry->AddItem(o3tl::make_unique<SvLBoxString>(_rTxt)); pEntry->SetUserData( reinterpret_cast<void*>(_nType) ); m_pCheckLB->Insert( pEntry ); diff --git a/editeng/source/uno/unoedhlp.cxx b/editeng/source/uno/unoedhlp.cxx index 2ce5797..04202aa 100644 --- a/editeng/source/uno/unoedhlp.cxx +++ b/editeng/source/uno/unoedhlp.cxx @@ -20,6 +20,7 @@ #include <editeng/unoedhlp.hxx> #include <editeng/editdata.hxx> #include <editeng/editeng.hxx> +#include <o3tl/make_unique.hxx> #include <svl/itemset.hxx> #include <osl/diagnose.h> @@ -91,7 +92,7 @@ sal_uLong SvxEditSourceHint::GetValue() const } } - return ::std::unique_ptr<SfxHint>( new SfxHint() ); + return o3tl::make_unique<SfxHint>( ); } bool SvxEditSourceHelper::GetAttributeRun( sal_Int32& nStartIndex, sal_Int32& nEndIndex, const EditEngine& rEE, sal_Int32 nPara, sal_Int32 nIndex, bool bInCell ) diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx index dae59b1..1728f90 100644 --- a/filter/source/msfilter/msdffimp.cxx +++ b/filter/source/msfilter/msdffimp.cxx @@ -139,6 +139,7 @@ #include <rtl/ustring.hxx> #include <svtools/embedhlp.hxx> #include <memory> +#include <o3tl/make_unique.hxx> using namespace ::com::sun::star ; using namespace ::com::sun::star::drawing; @@ -6186,8 +6187,8 @@ bool SvxMSDffManager::GetShapeContainerData( SvStream& rSt, } m_xShapeInfosByTxBxComp->insert(std::make_shared<SvxMSDffShapeInfo>( aInfo)); - m_pShapeOrders->push_back(std::unique_ptr<SvxMSDffShapeOrder>( - new SvxMSDffShapeOrder( aInfo.nShapeId ))); + m_pShapeOrders->push_back(o3tl::make_unique<SvxMSDffShapeOrder>( + aInfo.nShapeId )); } // and position the Stream correctly again diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx index 1a2c019..8708a330 100644 --- a/filter/source/msfilter/svdfppt.cxx +++ b/filter/source/msfilter/svdfppt.cxx @@ -119,6 +119,7 @@ #include <vcl/virdev.hxx> #include <svtools/embedhlp.hxx> #include <o3tl/enumrange.hxx> +#include <o3tl/make_unique.hxx> #include <algorithm> #include <cassert> @@ -5886,7 +5887,7 @@ PPTParagraphObj::~PPTParagraphObj() void PPTParagraphObj::AppendPortion( PPTPortionObj& rPPTPortion ) { m_PortionList.push_back( - std::unique_ptr<PPTPortionObj>(new PPTPortionObj(rPPTPortion))); + o3tl::make_unique<PPTPortionObj>(rPPTPortion)); if ( !mbTab ) { mbTab = m_PortionList.back()->HasTabulator(); diff --git a/formula/source/core/api/FormulaOpCodeMapperObj.cxx b/formula/source/core/api/FormulaOpCodeMapperObj.cxx index ceb934c..55bdc9e 100644 --- a/formula/source/core/api/FormulaOpCodeMapperObj.cxx +++ b/formula/source/core/api/FormulaOpCodeMapperObj.cxx @@ -25,6 +25,7 @@ #include "formula/opcode.hxx" #include <comphelper/sequence.hxx> #include <cppuhelper/supportsservice.hxx> +#include <o3tl/make_unique.hxx> namespace formula { @@ -107,7 +108,7 @@ uno::Sequence< OUString > SAL_CALL FormulaOpCodeMapperObj::getSupportedServiceNa uno::Reference< uno::XInterface > SAL_CALL FormulaOpCodeMapperObj::create( uno::Reference< uno::XComponentContext > const & /*_xContext*/) { - return static_cast<sheet::XFormulaOpCodeMapper*>(new FormulaOpCodeMapperObj(::std::unique_ptr<FormulaCompiler>(new FormulaCompiler()))); + return static_cast<sheet::XFormulaOpCodeMapper*>(new FormulaOpCodeMapperObj(o3tl::make_unique<FormulaCompiler>())); } } // formula diff --git a/sc/source/core/data/cellvalues.cxx b/sc/source/core/data/cellvalues.cxx index d653687..867bac4 100644 --- a/sc/source/core/data/cellvalues.cxx +++ b/sc/source/core/data/cellvalues.cxx @@ -10,6 +10,7 @@ #include <cellvalues.hxx> #include <column.hxx> #include <cellvalue.hxx> +#include <o3tl/make_unique.hxx> #include <cassert> @@ -265,10 +266,10 @@ struct TableValues::Impl for (size_t nTab = 0; nTab < nTabs; ++nTab) { - m_Tables.push_back(std::unique_ptr<TableType>(new TableType)); + m_Tables.push_back(o3tl::make_unique<TableType>()); std::unique_ptr<TableType>& rTab2 = m_Tables.back(); for (size_t nCol = 0; nCol < nCols; ++nCol) - rTab2.get()->push_back(std::unique_ptr<CellValues>(new CellValues)); + rTab2.get()->push_back(o3tl::make_unique<CellValues>()); } } diff --git a/sc/source/core/data/colorscale.cxx b/sc/source/core/data/colorscale.cxx index fd5c203..0ef57f5 100644 --- a/sc/source/core/data/colorscale.cxx +++ b/sc/source/core/data/colorscale.cxx @@ -320,7 +320,7 @@ ScColorScaleFormat::ScColorScaleFormat(ScDocument* pDoc, const ScColorScaleForma { for(ScColorScaleEntries::const_iterator itr = rFormat.begin(); itr != rFormat.end(); ++itr) { - maColorScales.push_back(std::unique_ptr<ScColorScaleEntry>(new ScColorScaleEntry(pDoc, **itr))); + maColorScales.push_back(o3tl::make_unique<ScColorScaleEntry>(pDoc, **itr)); } } diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx index 6493440..7206a2e 100644 --- a/sc/source/core/data/table3.cxx +++ b/sc/source/core/data/table3.cxx @@ -72,6 +72,7 @@ #include <vector> #include <boost/checked_delete.hpp> #include <mdds/flat_segment_tree.hpp> +#include <o3tl/make_unique.hxx> using namespace ::com::sun::star; @@ -722,7 +723,7 @@ void fillSortedColumnArray( // In the sorted column container, element positions and row // positions must match, else formula cells may mis-behave during // grouping. - aSortedCols.push_back(std::unique_ptr<SortedColumn>(new SortedColumn(nRow1))); + aSortedCols.push_back(o3tl::make_unique<SortedColumn>(nRow1)); } for (size_t i = 0; i < pRows->size(); ++i) diff --git a/sc/source/core/tool/dbdata.cxx b/sc/source/core/tool/dbdata.cxx index fcf56ea..1d62a47 100644 --- a/sc/source/core/tool/dbdata.cxx +++ b/sc/source/core/tool/dbdata.cxx @@ -35,6 +35,7 @@ #include "brdcst.hxx" #include <comphelper/stl_types.hxx> +#include <o3tl/make_unique.hxx> #include <memory> #include <utility> @@ -1279,7 +1280,7 @@ ScDBCollection::AnonDBs::AnonDBs(AnonDBs const& r) m_DBs.reserve(r.m_DBs.size()); for (auto const& it : r.m_DBs) { - m_DBs.push_back(std::unique_ptr<ScDBData>(new ScDBData(*it))); + m_DBs.push_back(o3tl::make_unique<ScDBData>(*it)); } } diff --git a/sc/source/filter/html/htmlpars.cxx b/sc/source/filter/html/htmlpars.cxx index c397074..a094f04 100644 --- a/sc/source/filter/html/htmlpars.cxx +++ b/sc/source/filter/html/htmlpars.cxx @@ -2356,7 +2356,7 @@ bool ScHTMLTable::IsSpaceCharInfo( const ImportInfo& rInfo ) ScHTMLTable::ScHTMLEntryPtr ScHTMLTable::CreateEntry() const { - return ScHTMLEntryPtr( new ScHTMLEntry( GetCurrItemSet() ) ); + return o3tl::make_unique<ScHTMLEntry>( GetCurrItemSet() ); } void ScHTMLTable::CreateNewEntry( const ImportInfo& rInfo ) diff --git a/sc/source/ui/drawfunc/graphsh.cxx b/sc/source/ui/drawfunc/graphsh.cxx index c3242c5..1632fd0 100644 --- a/sc/source/ui/drawfunc/graphsh.cxx +++ b/sc/source/ui/drawfunc/graphsh.cxx @@ -17,6 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <o3tl/make_unique.hxx> #include <sfx2/app.hxx> #include <sfx2/objface.hxx> #include <sfx2/request.hxx> @@ -164,8 +165,8 @@ void ScGraphicShell::ExecuteExternalEdit( SfxRequest& ) if( pObj && dynamic_cast<const SdrGrafObj*>( pObj) != nullptr && static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GRAPHIC_BITMAP ) { GraphicObject aGraphicObject( static_cast<SdrGrafObj*>(pObj)->GetGraphicObject() ); - m_ExternalEdits.push_back( std::unique_ptr<SdrExternalToolEdit>( - new SdrExternalToolEdit(pView, pObj))); + m_ExternalEdits.push_back( o3tl::make_unique<SdrExternalToolEdit>( + pView, pObj)); m_ExternalEdits.back()->Edit( &aGraphicObject ); } } diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx index 4060695..bbfe30b 100644 --- a/sd/source/ui/view/drviews2.cxx +++ b/sd/source/ui/view/drviews2.cxx @@ -38,6 +38,7 @@ #include <editeng/eeitem.hxx> #include <editeng/flditem.hxx> #include <editeng/editeng.hxx> +#include <o3tl/make_unique.hxx> #include <sfx2/bindings.hxx> #include <sfx2/dispatch.hxx> @@ -970,8 +971,8 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) { GraphicObject aGraphicObject( static_cast<SdrGrafObj*>(pObj)->GetGraphicObject() ); m_ExternalEdits.push_back( - std::unique_ptr<SdrExternalToolEdit>( - new SdrExternalToolEdit(mpDrawView, pObj))); + o3tl::make_unique<SdrExternalToolEdit>( + mpDrawView, pObj)); m_ExternalEdits.back()->Edit( &aGraphicObject ); } } diff --git a/sfx2/source/sidebar/SidebarController.cxx b/sfx2/source/sidebar/SidebarController.cxx index 045fbb1..0506b77 100644 --- a/sfx2/source/sidebar/SidebarController.cxx +++ b/sfx2/source/sidebar/SidebarController.cxx @@ -44,6 +44,7 @@ #include <toolkit/helper/vclunohelper.hxx> #include <comphelper/processfactory.hxx> #include <comphelper/namedvaluecollection.hxx> +#include <o3tl/make_unique.hxx> #include <com/sun/star/frame/XDispatchProvider.hpp> #include <com/sun/star/lang/XInitialization.hpp> @@ -117,7 +118,7 @@ SidebarController::SidebarController ( mpResourceManager() { // Decks and panel collections for this sidebar - mpResourceManager = std::unique_ptr<ResourceManager>(new ResourceManager()); + mpResourceManager = o3tl::make_unique<ResourceManager>(); registerSidebarForFrame(this, mxFrame->getController()); // Listen for window events. diff --git a/svl/source/items/style.cxx b/svl/source/items/style.cxx index d0c2428..8559edb 100644 --- a/svl/source/items/style.cxx +++ b/svl/source/items/style.cxx @@ -35,6 +35,7 @@ #include <unotools/syslocale.hxx> #include <algorithm> #include <comphelper/servicehelper.hxx> +#include <o3tl/make_unique.hxx> #include <string.h> @@ -283,7 +284,7 @@ SfxItemSet& SfxStyleSheetBase::GetItemSet() std::unique_ptr<SfxItemSet> SfxStyleSheetBase::GetItemSetForPreview() { - return std::unique_ptr<SfxItemSet>(new SfxItemSet(GetItemSet())); + return o3tl::make_unique<SfxItemSet>(GetItemSet()); } /** diff --git a/svtools/source/contnr/treelistentry.cxx b/svtools/source/contnr/treelistentry.cxx index 19c0b0d..5d6105f3 100644 --- a/svtools/source/contnr/treelistentry.cxx +++ b/svtools/source/contnr/treelistentry.cxx @@ -19,7 +19,7 @@ #include <svtools/treelistentry.hxx> #include <svtools/treelist.hxx> - +#include <o3tl/make_unique.hxx> #include <vcl/svapp.hxx> #include <vcl/settings.hxx> @@ -70,7 +70,7 @@ SvTreeListEntry::SvTreeListEntry(const SvTreeListEntry& r) , maBackColor(Application::GetSettings().GetStyleSettings().GetWindowColor()) { for (auto const& it : r.m_Children) - m_Children.push_back(std::unique_ptr<SvTreeListEntry>(new SvTreeListEntry(*it))); + m_Children.push_back(o3tl::make_unique<SvTreeListEntry>(*it)); } SvTreeListEntry::~SvTreeListEntry() diff --git a/svx/source/dialog/ctredlin.cxx b/svx/source/dialog/ctredlin.cxx index a744182..7003011 100644 --- a/svx/source/dialog/ctredlin.cxx +++ b/svx/source/dialog/ctredlin.cxx @@ -17,6 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <o3tl/make_unique.hxx> #include <vcl/dialog.hxx> #include <vcl/layout.hxx> #include <vcl/svapp.hxx> @@ -335,22 +336,22 @@ void SvxRedlinTable::InitEntry(SvTreeListEntry* pEntry, const OUString& rStr, { if (nTreeFlags & SvTreeFlags::CHKBTN) { - pEntry->AddItem(std::unique_ptr<SvLBoxButton>( - new SvLBoxButton(eButtonKind, pCheckButtonData))); + pEntry->AddItem(o3tl::make_unique<SvLBoxButton>( + eButtonKind, pCheckButtonData)); } - pEntry->AddItem(std::unique_ptr<SvLBoxContextBmp>( - new SvLBoxContextBmp(rColl, rExp, true))); + pEntry->AddItem(o3tl::make_unique<SvLBoxContextBmp>( + rColl, rExp, true)); // the type of the change assert((rStr.isEmpty() && !!maEntryImage) || (!rStr.isEmpty() && !maEntryImage)); if (rStr.isEmpty()) - pEntry->AddItem(std::unique_ptr<SvLBoxContextBmp>(new SvLBoxContextBmp( - maEntryImage, maEntryImage, true))); + pEntry->AddItem(o3tl::make_unique<SvLBoxContextBmp>( + maEntryImage, maEntryImage, true)); else - pEntry->AddItem(std::unique_ptr<SvLBoxColorString>( - new SvLBoxColorString(rStr, maEntryColor))); + pEntry->AddItem(o3tl::make_unique<SvLBoxColorString>( + rStr, maEntryColor)); // the change tracking entries sal_Int32 nIndex = 0; @@ -358,8 +359,8 @@ void SvxRedlinTable::InitEntry(SvTreeListEntry* pEntry, const OUString& rStr, for (sal_uInt16 nToken = 0; nToken < nCount; nToken++) { const OUString aToken = GetToken(maEntryString, nIndex); - pEntry->AddItem(std::unique_ptr<SvLBoxColorString>( - new SvLBoxColorString(aToken, maEntryColor))); + pEntry->AddItem(o3tl::make_unique<SvLBoxColorString>( + aToken, maEntryColor)); } } diff --git a/svx/source/dialog/fontlb.cxx b/svx/source/dialog/fontlb.cxx index 65f41e2..265e5c1 100644 --- a/svx/source/dialog/fontlb.cxx +++ b/svx/source/dialog/fontlb.cxx @@ -18,6 +18,7 @@ */ #include "svx/fontlb.hxx" +#include <o3tl/make_unique.hxx> #include <vcl/builderfactory.hxx> #include <vcl/svapp.hxx> #include <vcl/settings.hxx> @@ -133,12 +134,12 @@ void SvxFontListBox::InitEntry( if( mbUseFont ) { if( nTreeFlags & SvTreeFlags::CHKBTN ) - pEntry->AddItem(std::unique_ptr<SvLBoxButton>(new SvLBoxButton( - eButtonKind, pCheckButtonData))); - pEntry->AddItem(std::unique_ptr<SvLBoxContextBmp>(new SvLBoxContextBmp( - rCollImg, rExpImg, true))); - pEntry->AddItem(std::unique_ptr<SvLBoxFontString>(new SvLBoxFontString( - rEntryText, maEntryFont, mpEntryColor))); + pEntry->AddItem(o3tl::make_unique<SvLBoxButton>( + eButtonKind, pCheckButtonData)); + pEntry->AddItem(o3tl::make_unique<SvLBoxContextBmp>( + rCollImg, rExpImg, true)); + pEntry->AddItem(o3tl::make_unique<SvLBoxFontString>( + rEntryText, maEntryFont, mpEntryColor)); } else SvTreeListBox::InitEntry( pEntry, rEntryText, rCollImg, rExpImg, diff --git a/svx/source/fmcomp/gridcell.cxx b/svx/source/fmcomp/gridcell.cxx index 6ca782c..b14cdd1 100644 --- a/svx/source/fmcomp/gridcell.cxx +++ b/svx/source/fmcomp/gridcell.cxx @@ -52,6 +52,7 @@ #include <connectivity/formattedcolumnvalue.hxx> #include <cppuhelper/typeprovider.hxx> #include <i18nlangtag/lang.h> +#include <o3tl/make_unique.hxx> #include <rtl/math.hxx> #include <svtools/calendar.hxx> @@ -1787,8 +1788,8 @@ OUString DbPatternField::GetFormatText(const Reference< css::sdb::XColumn >& _rx if ( !rpFormatter.get() ) { - rpFormatter = ::std::unique_ptr< FormattedColumnValue> ( - new FormattedColumnValue(m_xContext, getCursor(), Reference< XPropertySet >( _rxField, UNO_QUERY ) ) ); + rpFormatter = o3tl::make_unique< FormattedColumnValue> ( + m_xContext, getCursor(), Reference< XPropertySet >( _rxField, UNO_QUERY ) ); OSL_ENSURE( rpFormatter.get(), "DbPatternField::Init: no value formatter!" ); } else diff --git a/sw/source/core/crsr/bookmrk.cxx b/sw/source/core/crsr/bookmrk.cxx index 2f30021..08594bc 100644 --- a/sw/source/core/crsr/bookmrk.cxx +++ b/sw/source/core/crsr/bookmrk.cxx @@ -32,6 +32,7 @@ #include <UndoBookmark.hxx> #include <unobookmark.hxx> #include <rtl/random.h> +#include <o3tl/make_unique.hxx> #include <xmloff/odffields.hxx> #include <libxml/xmlwriter.h> #include <comphelper/anytostring.hxx> @@ -167,13 +168,13 @@ namespace sw { namespace mark void MarkBase::SetMarkPos(const SwPosition& rNewPos) { - std::unique_ptr<SwPosition>(new SwPosition(rNewPos)).swap(m_pPos1); + o3tl::make_unique<SwPosition>(rNewPos).swap(m_pPos1); m_pPos1->nContent.SetMark(this); } void MarkBase::SetOtherMarkPos(const SwPosition& rNewPos) { - std::unique_ptr<SwPosition>(new SwPosition(rNewPos)).swap(m_pPos2); + o3tl::make_unique<SwPosition>(rNewPos).swap(m_pPos2); m_pPos2->nContent.SetMark(this); } diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx index 2c79ac1..89252fb 100644 --- a/sw/source/core/doc/docbm.cxx +++ b/sw/source/core/doc/docbm.cxx @@ -40,6 +40,7 @@ #include <pam.hxx> #include <redline.hxx> #include <rolbck.hxx> +#include <o3tl/make_unique.hxx> #include <rtl/ustrbuf.hxx> #include <rtl/ustring.hxx> #include <sal/types.h> @@ -135,7 +136,7 @@ namespace return lcl_PositionFromContentNode( pNode, bPosAtEndOfNode ); } - return ::std::unique_ptr<SwPosition>(new SwPosition(rOtherPosition)); + return o3tl::make_unique<SwPosition>(rOtherPosition); } IMark* lcl_getMarkAfter(const IDocumentMarkAccess::container_t& rMarks, const SwPosition& rPos) @@ -756,7 +757,7 @@ namespace sw { namespace mark { if ( pEndIdx != nullptr ) { - pNewPos = ::std::unique_ptr< SwPosition >( new SwPosition( rEnd, *pEndIdx ) ); + pNewPos = o3tl::make_unique< SwPosition >( rEnd, *pEndIdx ); } else { diff --git a/sw/source/core/doc/tblafmt.cxx b/sw/source/core/doc/tblafmt.cxx index 414895b..c27194c 100644 --- a/sw/source/core/doc/tblafmt.cxx +++ b/sw/source/core/doc/tblafmt.cxx @@ -17,6 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <o3tl/make_unique.hxx> #include <tools/resid.hxx> #include <tools/stream.hxx> #include <vcl/svapp.hxx> @@ -1032,7 +1033,7 @@ void SwTableAutoFormatTable::AddAutoFormat(const SwTableAutoFormat& rTableStyle) if (FindAutoFormat(rTableStyle.GetName())) return; - InsertAutoFormat(size(), std::unique_ptr<SwTableAutoFormat>(new SwTableAutoFormat(rTableStyle))); + InsertAutoFormat(size(), o3tl::make_unique<SwTableAutoFormat>(rTableStyle)); } void SwTableAutoFormatTable::InsertAutoFormat(size_t const i, std::unique_ptr<SwTableAutoFormat> pFormat) diff --git a/sw/source/core/fields/authfld.cxx b/sw/source/core/fields/authfld.cxx index 8f65c6a..9339aa2 100644 --- a/sw/source/core/fields/authfld.cxx +++ b/sw/source/core/fields/authfld.cxx @@ -21,6 +21,7 @@ #include <comphelper/string.hxx> #include <editeng/unolingu.hxx> #include <editeng/langitem.hxx> +#include <o3tl/make_unique.hxx> #include <swtypes.hxx> #include <tools/resid.hxx> #include <comcore.hrc> @@ -217,7 +218,7 @@ sal_uInt16 SwAuthorityFieldType::AppendField( const SwAuthEntry& rInsert ) } //if it is a new Entry - insert - m_DataArr.push_back(std::unique_ptr<SwAuthEntry>(new SwAuthEntry(rInsert))); + m_DataArr.push_back(o3tl::make_unique<SwAuthEntry>(rInsert)); return m_DataArr.size()-1; } diff --git a/sw/source/core/frmedt/fetab.cxx b/sw/source/core/frmedt/fetab.cxx index de56b8c..d0fd94d 100644 --- a/sw/source/core/frmedt/fetab.cxx +++ b/sw/source/core/frmedt/fetab.cxx @@ -19,6 +19,7 @@ #include <hintids.hxx> +#include <o3tl/make_unique.hxx> #include <tools/errinf.hxx> #include <vcl/svapp.hxx> #include <basegfx/vector/b2dvector.hxx> @@ -91,7 +92,7 @@ class TableWait { return our_kLineLimit < nCnt || our_kLineLimit < nCnt2 || (pFrame && our_kLineLimit < pFrame->ImplFindTabFrame()->GetTable()->GetTabLines().size()); } public: TableWait(size_t nCnt, SwFrame *pFrame, SwDocShell &rDocShell, size_t nCnt2 = 0) - : m_pWait( ShouldWait(nCnt, pFrame, nCnt2) ? ::std::unique_ptr<SwWait>(new SwWait( rDocShell, true )) : nullptr ) + : m_pWait( ShouldWait(nCnt, pFrame, nCnt2) ? o3tl::make_unique<SwWait>( rDocShell, true ) : nullptr ) { } }; diff --git a/sw/source/core/tox/ToxLinkProcessor.cxx b/sw/source/core/tox/ToxLinkProcessor.cxx index cbb7275..1ef40d2 100644 --- a/sw/source/core/tox/ToxLinkProcessor.cxx +++ b/sw/source/core/tox/ToxLinkProcessor.cxx @@ -11,6 +11,7 @@ #include "SwStyleNameMapper.hxx" #include "ndtxt.hxx" +#include <o3tl/make_unique.hxx> #include <poolfmt.hrc> #include <stdexcept> @@ -20,8 +21,8 @@ namespace sw { void ToxLinkProcessor::StartNewLink(sal_Int32 startPosition, const OUString& characterStyle) { - m_StartedLinks.push_back(std::unique_ptr<StartedLink>( - new StartedLink(startPosition, characterStyle))); + m_StartedLinks.push_back(o3tl::make_unique<StartedLink>( + startPosition, characterStyle)); } void diff --git a/sw/source/core/unocore/unoportenum.cxx b/sw/source/core/unocore/unoportenum.cxx index 1f0db3d..920f3b7 100644 --- a/sw/source/core/unocore/unoportenum.cxx +++ b/sw/source/core/unocore/unoportenum.cxx @@ -62,6 +62,7 @@ #include <comphelper/string.hxx> #include <comphelper/servicehelper.hxx> #include <cppuhelper/supportsservice.hxx> +#include <o3tl/make_unique.hxx> #include <algorithm> #include <memory> #include <set> @@ -160,7 +161,7 @@ namespace else if (pCrossRefMark) { // Crossrefbookmarks only remember the start position but have to span the whole paragraph - pCrossRefEndPos = unique_ptr<SwPosition>(new SwPosition(rEndPos)); + pCrossRefEndPos = o3tl::make_unique<SwPosition>(rEndPos); pCrossRefEndPos->nContent = pCrossRefEndPos->nNode.GetNode().GetTextNode()->Len(); pEndPos = pCrossRefEndPos.get(); } diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx index e4b67d8..7b7a467 100644 --- a/sw/source/core/unocore/unostyle.cxx +++ b/sw/source/core/unocore/unostyle.cxx @@ -72,6 +72,7 @@ #include <comphelper/servicehelper.hxx> #include <cppuhelper/supportsservice.hxx> #include <comphelper/sequence.hxx> +#include <o3tl/make_unique.hxx> //UUUU #include <svx/unobrushitemhelper.hxx> @@ -1180,8 +1181,8 @@ SwXStyle::SwXStyle(SwDoc* pDoc, SfxStyleFamily eFamily, bool bConditional) assert(!m_bIsConditional || m_rEntry.m_eFamily == SfxStyleFamily::Para); // only paragraph styles are conditional // Register ourselves as a listener to the document (via the page descriptor) pDoc->getIDocumentStylePoolAccess().GetPageDescFromPool(RES_POOLPAGE_STANDARD)->Add(this); - m_pPropertiesImpl = std::unique_ptr<SwStyleProperties_Impl>( - new SwStyleProperties_Impl(aSwMapProvider.GetPropertySet(m_bIsConditional ? PROPERTY_MAP_CONDITIONAL_PARA_STYLE : m_rEntry.m_nPropMapType)->getPropertyMap())); + m_pPropertiesImpl = o3tl::make_unique<SwStyleProperties_Impl>( + aSwMapProvider.GetPropertySet(m_bIsConditional ? PROPERTY_MAP_CONDITIONAL_PARA_STYLE : m_rEntry.m_nPropMapType)->getPropertyMap()); } SwXStyle::SwXStyle(SfxStyleSheetBasePool* pPool, SfxStyleFamily eFamily, SwDoc* pDoc, const OUString& rStyleName) diff --git a/sw/source/filter/xml/xmltbli.cxx b/sw/source/filter/xml/xmltbli.cxx index 96915cd..0e65d2f 100644 --- a/sw/source/filter/xml/xmltbli.cxx +++ b/sw/source/filter/xml/xmltbli.cxx @@ -23,6 +23,7 @@ #include <com/sun/star/text/XTextTable.hpp> #include <com/sun/star/table/XCellRange.hpp> #include <o3tl/numeric.hxx> +#include <o3tl/make_unique.hxx> #include <svl/itemset.hxx> #include <svl/zformat.hxx> #include <sax/tools/converter.hxx> @@ -338,7 +339,7 @@ SwXMLTableRow_Impl::SwXMLTableRow_Impl( const OUString& rStyleName, for( sal_uInt32 i=0U; i<nCells; ++i ) { - m_Cells.push_back(std::unique_ptr<SwXMLTableCell_Impl>(new SwXMLTableCell_Impl)); + m_Cells.push_back(o3tl::make_unique<SwXMLTableCell_Impl>()); } } @@ -362,8 +363,8 @@ void SwXMLTableRow_Impl::Expand( sal_uInt32 nCells, bool bOneCell ) sal_uInt32 nColSpan = nCells - m_Cells.size(); for (size_t i = m_Cells.size(); i < nCells; ++i) { - m_Cells.push_back(std::unique_ptr<SwXMLTableCell_Impl>( - new SwXMLTableCell_Impl(1UL, (bOneCell) ? nColSpan : 1UL))); + m_Cells.push_back(o3tl::make_unique<SwXMLTableCell_Impl>( + 1UL, (bOneCell) ? nColSpan : 1UL)); nColSpan--; } @@ -1635,8 +1636,8 @@ void SwXMLTableContext::InsertCell( const OUString& rStyleName, if (m_pRows->size() < nRowsReq) { for (size_t i = m_pRows->size(); i < nRowsReq; ++i) - m_pRows->push_back(std::unique_ptr<SwXMLTableRow_Impl>( - new SwXMLTableRow_Impl("", GetColumnCount()))); + m_pRows->push_back(o3tl::make_unique<SwXMLTableRow_Impl>( + "", GetColumnCount())); } OUString sStyleName( rStyleName ); @@ -1694,9 +1695,9 @@ void SwXMLTableContext::InsertRow( const OUString& rStyleName, else { // add a new row - m_pRows->push_back(std::unique_ptr<SwXMLTableRow_Impl>( - new SwXMLTableRow_Impl(rStyleName, GetColumnCount(), - &rDfltCellStyleName, i_rXmlId))); + m_pRows->push_back(o3tl::make_unique<SwXMLTableRow_Impl>( + rStyleName, GetColumnCount(), + &rDfltCellStyleName, i_rXmlId)); } // We start at the first column ... diff --git a/sw/source/uibase/shells/grfsh.cxx b/sw/source/uibase/shells/grfsh.cxx index 43362f4..a056e9a 100644 --- a/sw/source/uibase/shells/grfsh.cxx +++ b/sw/source/uibase/shells/grfsh.cxx @@ -19,6 +19,7 @@ #include <cmdid.h> #include <hintids.hxx> +#include <o3tl/make_unique.hxx> #include <tools/urlobj.hxx> #include <vcl/msgbox.hxx> #include <svl/stritem.hxx> @@ -195,8 +196,8 @@ void SwGrfShell::Execute(SfxRequest &rReq) GraphicObject const*const pGraphicObject(rSh.GetGraphicObj()); if(nullptr != pGraphicObject) { - m_ExternalEdits.push_back(std::unique_ptr<SwExternalToolEdit>( - new SwExternalToolEdit(&rSh))); + m_ExternalEdits.push_back(o3tl::make_unique<SwExternalToolEdit>( + &rSh)); m_ExternalEdits.back()->Edit(pGraphicObject); } } diff --git a/sw/source/uibase/shells/txtattr.cxx b/sw/source/uibase/shells/txtattr.cxx index a6532d6..4125dd3 100644 --- a/sw/source/uibase/shells/txtattr.cxx +++ b/sw/source/uibase/shells/txtattr.cxx @@ -19,6 +19,7 @@ #include <hintids.hxx> +#include <o3tl/make_unique.hxx> #include <vcl/msgbox.hxx> #include <svl/whiter.hxx> #include <svl/stritem.hxx> @@ -231,7 +232,7 @@ void SwTextShell::ExecCharAttrArgs(SfxRequest &rReq) { // must create new one, otherwise document is without pam SwPaM* pPaM = rWrtSh.GetCursor(); - vItems.push_back( std::make_pair( pSize, std::unique_ptr<SwPaM>(new SwPaM( *(pPaM->GetMark()), *(pPaM->GetPoint()))) ) ); + vItems.push_back( std::make_pair( pSize, o3tl::make_unique<SwPaM>( *(pPaM->GetMark()), *(pPaM->GetPoint())) ) ); } else vItems = rWrtSh.GetItemWithPaM( RES_CHRATR_FONTSIZE ); diff --git a/sw/source/uibase/sidebar/StylePresetsPanel.cxx b/sw/source/uibase/sidebar/StylePresetsPanel.cxx index 6800535..2dc1203 100644 --- a/sw/source/uibase/sidebar/StylePresetsPanel.cxx +++ b/sw/source/uibase/sidebar/StylePresetsPanel.cxx @@ -40,6 +40,7 @@ #include <comphelper/processfactory.hxx> #include <comphelper/documentconstants.hxx> #include <comphelper/string.hxx> +#include <o3tl/make_unique.hxx> namespace sw { namespace sidebar { @@ -182,7 +183,7 @@ void StylePresetsPanel::RefreshList() OUString aURL = aTemplates.GetPath(i,j); BitmapEx aPreview = CreatePreview(aURL, aName); mpValueSet->InsertItem(j, Image(aPreview), aName); - maTemplateEntries.push_back(std::unique_ptr<TemplateEntry>(new TemplateEntry(aURL))); + maTemplateEntries.push_back(o3tl::make_unique<TemplateEntry>(aURL)); mpValueSet->SetItemData(j, maTemplateEntries.back().get()); } } diff --git a/vcl/opengl/salbmp.cxx b/vcl/opengl/salbmp.cxx index e317004..946a35f 100644 --- a/vcl/opengl/salbmp.cxx +++ b/vcl/opengl/salbmp.cxx @@ -30,6 +30,7 @@ #include "vcleventlisteners.hxx" #include <vcl/lazydelete.hxx> +#include <o3tl/make_unique.hxx> #include <o3tl/make_shared.hxx> #include "opengl/zone.hxx" @@ -396,11 +397,11 @@ void lclInstantiateTexture(OpenGLTexture& rTexture, const int nWidth, const int TextureAtlasVector &sTextureAtlases = *gTextureAtlases.get(); if (sTextureAtlases.empty()) { - sTextureAtlases.push_back(std::unique_ptr<FixedTextureAtlasManager>(new FixedTextureAtlasManager(8, 8, 16))); - sTextureAtlases.push_back(std::unique_ptr<FixedTextureAtlasManager>(new FixedTextureAtlasManager(8, 8, 24))); - sTextureAtlases.push_back(std::unique_ptr<FixedTextureAtlasManager>(new FixedTextureAtlasManager(8, 8, 32))); - sTextureAtlases.push_back(std::unique_ptr<FixedTextureAtlasManager>(new FixedTextureAtlasManager(8, 8, 48))); - sTextureAtlases.push_back(std::unique_ptr<FixedTextureAtlasManager>(new FixedTextureAtlasManager(8, 8, 64))); + sTextureAtlases.push_back(o3tl::make_unique<FixedTextureAtlasManager>(8, 8, 16)); + sTextureAtlases.push_back(o3tl::make_unique<FixedTextureAtlasManager>(8, 8, 24)); + sTextureAtlases.push_back(o3tl::make_unique<FixedTextureAtlasManager>(8, 8, 32)); + sTextureAtlases.push_back(o3tl::make_unique<FixedTextureAtlasManager>(8, 8, 48)); + sTextureAtlases.push_back(o3tl::make_unique<FixedTextureAtlasManager>(8, 8, 64)); } for (std::unique_ptr<FixedTextureAtlasManager> & pTextureAtlas : sTextureAtlases) { diff --git a/xmloff/source/style/impastpl.cxx b/xmloff/source/style/impastpl.cxx index 8d2305a..f35b098 100644 --- a/xmloff/source/style/impastpl.cxx +++ b/xmloff/source/style/impastpl.cxx @@ -508,8 +508,8 @@ bool SvXMLAutoStylePoolP_Impl::Add( if (it2 == rFamily.m_ParentSet.end()) { std::pair<XMLAutoStyleFamily::ParentSetType::iterator,bool> r = - rFamily.m_ParentSet.insert(std::unique_ptr<XMLAutoStylePoolParent>( - new XMLAutoStylePoolParent(rParentName))); + rFamily.m_ParentSet.insert(o3tl::make_unique<XMLAutoStylePoolParent>( + rParentName)); it2 = r.first; } @@ -542,8 +542,8 @@ bool SvXMLAutoStylePoolP_Impl::AddNamed( if (it2 == rFamily.m_ParentSet.end()) { std::pair<XMLAutoStyleFamily::ParentSetType::iterator,bool> r = - rFamily.m_ParentSet.insert(std::unique_ptr<XMLAutoStylePoolParent>( - new XMLAutoStylePoolParent(rParentName))); + rFamily.m_ParentSet.insert(o3tl::make_unique<XMLAutoStylePoolParent>( + rParentName)); it2 = r.first; } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits