diff options
author | Noel Grandin <noel@peralex.com> | 2016-05-19 09:10:43 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2016-05-19 08:33:10 +0000 |
commit | d4d2fc24793960a07275e49706b90928b4a0c764 (patch) | |
tree | 3d5bd19190426cee18730893ac9ff292caf2566e /cui | |
parent | 71b74f8fd1fc84cf92dddeab02647b8b765d0d4a (diff) |
clang-tidy modernize-make-unique
Change-Id: I550bb69ddcef69906027516ccde62cf8e87c295b
Reviewed-on: https://gerrit.libreoffice.org/25138
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/dialogs/scriptdlg.cxx | 11 | ||||
-rw-r--r-- | cui/source/options/optaboutconfig.cxx | 12 | ||||
-rw-r--r-- | cui/source/options/optfltr.cxx | 19 |
3 files changed, 22 insertions, 20 deletions
diff --git a/cui/source/dialogs/scriptdlg.cxx b/cui/source/dialogs/scriptdlg.cxx index 7ae62e46f231..ec995eeffaf3 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 3661856620b3..15d354472bf0 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 2bf67f94d639..0602cef6ae78 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 ); |