This is an automated email from the ASF dual-hosted git repository.
asf-gitbox-commits pushed a commit to branch compilers-101
in repository https://gitbox.apache.org/repos/asf/openoffice.git
The following commit(s) were added to refs/heads/compilers-101 by this push:
new 07b5c4290e C++17 improvements: make_unique and lambda replacements
07b5c4290e is described below
commit 07b5c4290e99e06e0524af2c11bf0f35cb7274d8
Author: Pedro F. Giffuni <[email protected]>
AuthorDate: Thu Nov 5 20:27:22 2026 -0500
C++17 improvements: make_unique and lambda replacements
- Replace std::unique_ptr<T>(new T(...)) with std::make_unique<T>(...)
across 20+ files for exception safety and brevity
- Replace boost::bind with std::bind or C++14 lambdas in:
- sfx2/source/doc/DocumentMetadataAccess.cxx
- sfx2/source/doc/Metadatable.cxx
- sfx2/source/sidebar/SidebarController.cxx
---
main/chart2/source/view/main/ChartView.cxx | 2 +-
main/cui/source/dialogs/scriptdlg.cxx | 10 ++++-----
main/cui/source/dialogs/thesdlg.cxx | 2 +-
main/dbaccess/source/ext/adabas/AdabasNewDb.cxx | 4 ++--
main/dbaccess/source/ui/dlg/UserAdminDlg.cxx | 2 +-
main/dbaccess/source/ui/dlg/advancedsettings.cxx | 2 +-
main/dbaccess/source/ui/dlg/dbadmin.cxx | 2 +-
main/dbaccess/source/ui/dlg/dbwiz.cxx | 2 +-
main/dbaccess/source/ui/dlg/dbwizsetup.cxx | 2 +-
.../source/core/api/FormulaOpCodeMapperObj.cxx | 2 +-
main/sfx2/source/dialog/securitypage.cxx | 2 +-
main/sfx2/source/doc/DocumentMetadataAccess.cxx | 15 +++++++------
main/sfx2/source/doc/Metadatable.cxx | 20 ++++++-----------
main/sfx2/source/sidebar/SidebarController.cxx | 25 +++++++++++++---------
main/svtools/source/brwbox/editbrowsebox.cxx | 2 +-
main/svx/source/tbxctrls/tbcontrl.cxx | 2 +-
main/sw/source/core/doc/docbm.cxx | 2 +-
main/sw/source/core/doc/docnew.cxx | 2 +-
main/sw/source/core/undo/rolbck.cxx | 4 ++--
main/sw/source/ui/dbui/dbinsdlg.cxx | 4 ++--
main/sw/source/ui/uiview/viewling.cxx | 4 ++--
main/sw/source/ui/uno/unomailmerge.cxx | 2 +-
22 files changed, 57 insertions(+), 57 deletions(-)
diff --git a/main/chart2/source/view/main/ChartView.cxx
b/main/chart2/source/view/main/ChartView.cxx
index 12bb723f21..c0dd48acb9 100644
--- a/main/chart2/source/view/main/ChartView.cxx
+++ b/main/chart2/source/view/main/ChartView.cxx
@@ -2224,7 +2224,7 @@ std::unique_ptr<VTitle> lcl_createTitle(
TitleHelper::eTitleType eType
if( !aCompleteString.isEmpty() )
{
//create title
- apVTitle = std::unique_ptr<VTitle>(new VTitle(xTitle));
+ apVTitle = std::make_unique<VTitle>(xTitle);
rtl::OUString aCID(
ObjectIdentifier::createClassifiedIdentifierForObject( xTitle, xChartModel ) );
apVTitle->init(xPageShapes,xShapeFactory,aCID);
apVTitle->createShapes( awt::Point(0,0), rPageSize );
diff --git a/main/cui/source/dialogs/scriptdlg.cxx
b/main/cui/source/dialogs/scriptdlg.cxx
index e375428057..3865e84e1f 100644
--- a/main/cui/source/dialogs/scriptdlg.cxx
+++ b/main/cui/source/dialogs/scriptdlg.cxx
@@ -264,7 +264,7 @@ void SFTreeListBox::Init( const ::rtl::OUString& language )
/*SvLBoxEntry* pBasicManagerRootEntry =*/
insertEntry( uiName, app ? IMG_HARDDISK : IMG_DOCUMENT,
- 0, true, std::unique_ptr< SFEntry >(new SFEntry(
OBJTYPE_SFROOT, langEntries, xDocumentModel )), factoryURL );
+ 0, true, std::make_unique< SFEntry >( OBJTYPE_SFROOT,
langEntries, xDocumentModel ), factoryURL );
}
SetUpdateMode( sal_True );
@@ -350,13 +350,13 @@ void SFTreeListBox:: RequestSubEntries( SvLBoxEntry*
pRootEntry, Reference< ::co
::rtl::OUString name( children[ n ]->getName() );
if ( children[ n ]->getType() != browse::BrowseNodeTypes::SCRIPT)
{
- insertEntry( name, IMG_LIB, pRootEntry, true, std::unique_ptr<
SFEntry >(new SFEntry( OBJTYPE_SCRIPTCONTAINER, children[ n ],model )));
+ insertEntry( name, IMG_LIB, pRootEntry, true, std::make_unique<
SFEntry >( OBJTYPE_SCRIPTCONTAINER, children[ n ],model ));
}
else
{
if ( children[ n ]->getType() == browse::BrowseNodeTypes::SCRIPT )
{
- insertEntry( name, IMG_MACRO, pRootEntry, false,
std::unique_ptr< SFEntry >(new SFEntry( OBJTYPE_METHOD, children[ n ],model )));
+ insertEntry( name, IMG_MACRO, pRootEntry, false,
std::make_unique< SFEntry >( OBJTYPE_METHOD, children[ n ],model ));
}
}
@@ -1056,13 +1056,13 @@ void SvxScriptOrgDialog::createEntry( SvLBoxEntry*
pEntry )
if ( aChildNode->getType() == browse::BrowseNodeTypes::SCRIPT )
{
pNewEntry = aScriptsBox.insertEntry( aChildName,
- IMG_MACRO, pEntry, false, std::unique_ptr< SFEntry >(new
SFEntry( OBJTYPE_METHOD, aChildNode,xDocumentModel ) ) );
+ IMG_MACRO, pEntry, false, std::make_unique< SFEntry >(
OBJTYPE_METHOD, aChildNode,xDocumentModel ) );
}
else
{
pNewEntry = aScriptsBox.insertEntry( aChildName,
- IMG_LIB, pEntry, false, std::unique_ptr< SFEntry >(new
SFEntry( OBJTYPE_SCRIPTCONTAINER, aChildNode,xDocumentModel ) ) );
+ IMG_LIB, pEntry, false, std::make_unique< SFEntry >(
OBJTYPE_SCRIPTCONTAINER, aChildNode,xDocumentModel ) );
// If the Parent is not loaded then set to
// loaded, this will prevent RequestingChilds ( called
// from vcl via RequestingChilds ) from
diff --git a/main/cui/source/dialogs/thesdlg.cxx
b/main/cui/source/dialogs/thesdlg.cxx
index 49d1fd7ee5..a8dc886d75 100644
--- a/main/cui/source/dialogs/thesdlg.cxx
+++ b/main/cui/source/dialogs/thesdlg.cxx
@@ -659,7 +659,7 @@ SvxThesaurusDialog::SvxThesaurusDialog(
SvxStandardDialog( pParent, CUI_RES( RID_SVXDLG_THESAURUS ) )
{
- m_pImpl = std::unique_ptr< SvxThesaurusDialog_Impl >(new
SvxThesaurusDialog_Impl( this ));
+ m_pImpl = std::make_unique< SvxThesaurusDialog_Impl >( this );
m_pImpl->xThesaurus = xThes;
m_pImpl->aLookUpText = OUString( rWord );
diff --git a/main/dbaccess/source/ext/adabas/AdabasNewDb.cxx
b/main/dbaccess/source/ext/adabas/AdabasNewDb.cxx
index 914e5bbed9..1ec14f56fc 100644
--- a/main/dbaccess/source/ext/adabas/AdabasNewDb.cxx
+++ b/main/dbaccess/source/ext/adabas/AdabasNewDb.cxx
@@ -551,8 +551,8 @@ IMPL_LINK( OAdabasNewDbDlg, ImplOKHdl, OKButton*,
/*EMPTYARG*/ )
Disable();
- m_aCreatorWait = ::std::unique_ptr<WaitObject>(new WaitObject(this));
- m_aCreatorThread = ::std::unique_ptr<ODatabaseCreator>(new
ODatabaseCreator(m_xCreateCatalog,this,m_xORB,aCreateArgs));
+ m_aCreatorWait = ::std::make_unique<WaitObject>(this);
+ m_aCreatorThread =
::std::make_unique<ODatabaseCreator>(m_xCreateCatalog,this,m_xORB,aCreateArgs);
m_aCreatorThread->setTerminateHandler(LINK(this,OAdabasNewDbDlg,TerminateHdl));
m_aCreatorThread->create();
diff --git a/main/dbaccess/source/ui/dlg/UserAdminDlg.cxx
b/main/dbaccess/source/ui/dlg/UserAdminDlg.cxx
index e107cf853b..38cfaf0145 100644
--- a/main/dbaccess/source/ui/dlg/UserAdminDlg.cxx
+++ b/main/dbaccess/source/ui/dlg/UserAdminDlg.cxx
@@ -71,7 +71,7 @@ DBG_NAME(OUserAdminDlg)
{
DBG_CTOR(OUserAdminDlg,NULL);
- m_pImpl =
::std::unique_ptr<ODbDataSourceAdministrationHelper>(new
ODbDataSourceAdministrationHelper(_rxORB,_pParent,this));
+ m_pImpl =
::std::make_unique<ODbDataSourceAdministrationHelper>(_rxORB,_pParent,this);
m_pImpl->setDataSourceOrName(_aDataSourceName);
Reference< XPropertySet > xDatasource =
m_pImpl->getCurrentDataSource();
m_pImpl->translateProperties(xDatasource, *_pItems);
diff --git a/main/dbaccess/source/ui/dlg/advancedsettings.cxx
b/main/dbaccess/source/ui/dlg/advancedsettings.cxx
index f7fbe8fbfb..2a595d24c7 100644
--- a/main/dbaccess/source/ui/dlg/advancedsettings.cxx
+++ b/main/dbaccess/source/ui/dlg/advancedsettings.cxx
@@ -464,7 +464,7 @@ namespace dbaui
:SfxTabDialog(_pParent, ModuleRes(DLG_DATABASE_ADVANCED),
_pItems)
,m_pItemSet(_pItems)
{
- m_pImpl =
::std::unique_ptr<ODbDataSourceAdministrationHelper>(new
ODbDataSourceAdministrationHelper(_rxORB,_pParent,this));
+ m_pImpl =
::std::make_unique<ODbDataSourceAdministrationHelper>(_rxORB,_pParent,this);
m_pImpl->setDataSourceOrName(_aDataSourceName);
Reference< XPropertySet > xDatasource =
m_pImpl->getCurrentDataSource();
m_pImpl->translateProperties(xDatasource, *_pItems);
diff --git a/main/dbaccess/source/ui/dlg/dbadmin.cxx
b/main/dbaccess/source/ui/dlg/dbadmin.cxx
index 0d26bfb481..08b764e669 100644
--- a/main/dbaccess/source/ui/dlg/dbadmin.cxx
+++ b/main/dbaccess/source/ui/dlg/dbadmin.cxx
@@ -75,7 +75,7 @@ ODbAdminDialog::ODbAdminDialog(Window* _pParent
{
DBG_CTOR(ODbAdminDialog,NULL);
- m_pImpl = ::std::unique_ptr<ODbDataSourceAdministrationHelper>(new
ODbDataSourceAdministrationHelper(_rxORB,this,this));
+ m_pImpl =
::std::make_unique<ODbDataSourceAdministrationHelper>(_rxORB,this,this);
// add the initial tab page
AddTabPage( m_nMainPageID, String( ModuleRes( STR_PAGETITLE_GENERAL ) ),
OConnectionTabPage::Create, NULL );
diff --git a/main/dbaccess/source/ui/dlg/dbwiz.cxx
b/main/dbaccess/source/ui/dlg/dbwiz.cxx
index f7a16e2aba..4ed4ac1bff 100644
--- a/main/dbaccess/source/ui/dlg/dbwiz.cxx
+++ b/main/dbaccess/source/ui/dlg/dbwiz.cxx
@@ -127,7 +127,7 @@ ODbTypeWizDialog::ODbTypeWizDialog(Window* _pParent
,m_bUIEnabled( sal_True )
{
DBG_CTOR(ODbTypeWizDialog,NULL);
- m_pImpl = ::std::unique_ptr<ODbDataSourceAdministrationHelper>(new
ODbDataSourceAdministrationHelper(_rxORB,this,this));
+ m_pImpl =
::std::make_unique<ODbDataSourceAdministrationHelper>(_rxORB,this,this);
m_pImpl->setDataSourceOrName(_aDataSourceName);
Reference< XPropertySet > xDatasource = m_pImpl->getCurrentDataSource();
m_pOutSet = new SfxItemSet( *_pItems->GetPool(), _pItems->GetRanges() );
diff --git a/main/dbaccess/source/ui/dlg/dbwizsetup.cxx
b/main/dbaccess/source/ui/dlg/dbwizsetup.cxx
index fbf7fa6a64..77185fe4e2 100644
--- a/main/dbaccess/source/ui/dlg/dbwizsetup.cxx
+++ b/main/dbaccess/source/ui/dlg/dbwizsetup.cxx
@@ -240,7 +240,7 @@ ODbTypeWizDialogSetup::ODbTypeWizDialogSetup(Window*
_pParent
FreeResource();
- m_pImpl = ::std::unique_ptr<ODbDataSourceAdministrationHelper>(new
ODbDataSourceAdministrationHelper(_rxORB,this,this));
+ m_pImpl =
::std::make_unique<ODbDataSourceAdministrationHelper>(_rxORB,this,this);
m_pImpl->setDataSourceOrName(_aDataSourceName);
Reference< XPropertySet > xDatasource = m_pImpl->getCurrentDataSource();
m_pOutSet = new SfxItemSet( *_pItems->GetPool(), _pItems->GetRanges() );
diff --git a/main/formula/source/core/api/FormulaOpCodeMapperObj.cxx
b/main/formula/source/core/api/FormulaOpCodeMapperObj.cxx
index 2837d64568..ffac72cd19 100644
--- a/main/formula/source/core/api/FormulaOpCodeMapperObj.cxx
+++ b/main/formula/source/core/api/FormulaOpCodeMapperObj.cxx
@@ -107,7 +107,7 @@ uno::Sequence< rtl::OUString > SAL_CALL
FormulaOpCodeMapperObj::getSupportedServ
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(::std::make_unique<FormulaCompiler>()));
}
//
-----------------------------------------------------------------------------
diff --git a/main/sfx2/source/dialog/securitypage.cxx
b/main/sfx2/source/dialog/securitypage.cxx
index 9b3100a6be..bb8cda1d2f 100644
--- a/main/sfx2/source/dialog/securitypage.cxx
+++ b/main/sfx2/source/dialog/securitypage.cxx
@@ -515,7 +515,7 @@ SfxTabPage* SfxSecurityPage::Create( Window * pParent,
const SfxItemSet & rItemS
SfxSecurityPage::SfxSecurityPage( Window* pParent, const SfxItemSet& rItemSet
) :
SfxTabPage( pParent, SfxResId( TP_DOCINFOSECURITY ), rItemSet )
{
- m_pImpl = std::unique_ptr< SfxSecurityPage_Impl >(new
SfxSecurityPage_Impl( *this, rItemSet ));
+ m_pImpl = std::make_unique< SfxSecurityPage_Impl >( *this, rItemSet );
FreeResource();
}
diff --git a/main/sfx2/source/doc/DocumentMetadataAccess.cxx
b/main/sfx2/source/doc/DocumentMetadataAccess.cxx
index 20044b43e8..d06111e35d 100644
--- a/main/sfx2/source/doc/DocumentMetadataAccess.cxx
+++ b/main/sfx2/source/doc/DocumentMetadataAccess.cxx
@@ -929,9 +929,9 @@ DocumentMetadataAccess::getMetadataGraphsWithType(
getAllParts(*m_pImpl) );
::std::remove_copy_if(parts.begin(), parts.end(),
::std::back_inserter(ret),
- ::boost::bind(
- ::std::logical_not<bool>(),
- ::boost::bind(&isPartOfType, ::boost::ref(*m_pImpl), _1, i_xType)
));
+ [&](const uno::Reference< rdf::XURI >& part) {
+ return !isPartOfType(*m_pImpl, part, i_xType);
+ });
return ret.getAsConstList();
}
@@ -1199,11 +1199,14 @@ void SAL_CALL
DocumentMetadataAccess::loadMetadataFromStorage(
}
std::for_each(StgFiles.begin(), StgFiles.end(),
- boost::bind(addContentOrStylesFileImpl, boost::ref(*m_pImpl), _1));
+ [&](const ::rtl::OUString& file) {
+ addContentOrStylesFileImpl(*m_pImpl, file);
+ });
std::for_each(MfstMetadataFiles.begin(), MfstMetadataFiles.end(),
- boost::bind(importFile, boost::ref(*m_pImpl),
- i_xStorage, baseURI, i_xHandler, _1));
+ [&](const ::rtl::OUString& file) {
+ importFile(*m_pImpl, i_xStorage, baseURI, i_xHandler, file);
+ });
}
void SAL_CALL DocumentMetadataAccess::storeMetadataToStorage(
diff --git a/main/sfx2/source/doc/Metadatable.cxx
b/main/sfx2/source/doc/Metadatable.cxx
index af58e6b50d..9d06bc9c23 100644
--- a/main/sfx2/source/doc/Metadatable.cxx
+++ b/main/sfx2/source/doc/Metadatable.cxx
@@ -526,13 +526,9 @@ XmlIdRegistryDocument::XmlIdRegistry_Impl::LookupElement(
{
const XmlIdList_t::const_iterator iter(
::std::find_if(pList->begin(), pList->end(),
- ::boost::bind(
- ::std::logical_not<bool>(),
- ::boost::bind(
- ::std::logical_or<bool>(),
- ::boost::bind( &Metadatable::IsInUndo, _1 ),
- ::boost::bind( &Metadatable::IsInClipboard, _1
)
- ) ) ) );
+ [](Metadatable* pElem) {
+ return !pElem->IsInUndo() && !pElem->IsInClipboard();
+ } ));
if (iter != pList->end())
{
return *iter;
@@ -587,13 +583,9 @@
XmlIdRegistryDocument::XmlIdRegistry_Impl::TryInsertMetadatable(
// if all elements in the list are deleted (in undo) or
// placeholders, then "steal" the id from them
if ( pList->end() == ::std::find_if(pList->begin(), pList->end(),
- ::boost::bind(
- ::std::logical_not<bool>(),
- ::boost::bind(
- ::std::logical_or<bool>(),
- ::boost::bind( &Metadatable::IsInUndo, _1 ),
- ::boost::bind( &Metadatable::IsInClipboard, _1
)
- ) ) ) )
+ [](Metadatable* pElem) {
+ return !pElem->IsInUndo() && !pElem->IsInClipboard();
+ } ))
{
// ??? this is not undoable
// pList->clear();
diff --git a/main/sfx2/source/sidebar/SidebarController.cxx
b/main/sfx2/source/sidebar/SidebarController.cxx
index c9b2db1692..6e47893076 100644
--- a/main/sfx2/source/sidebar/SidebarController.cxx
+++ b/main/sfx2/source/sidebar/SidebarController.cxx
@@ -114,22 +114,25 @@ SidebarController::SidebarController (
mpTabBar(new TabBar(
mpParentWindow,
rxFrame,
- ::boost::bind(&SidebarController::OpenThenSwitchToDeck, this,
_1),
- ::boost::bind(&SidebarController::ShowPopupMenu, this, _1,_2))),
+ [this](const ::rtl::OUString& rsDeckId) {
OpenThenSwitchToDeck(rsDeckId); },
+ [this](const Rectangle& rButtonBox,
+ const ::std::vector<TabBar::DeckMenuData>& rMenuData) {
+ ShowPopupMenu(rButtonBox, rMenuData);
+ })),
mxFrame(rxFrame),
maCurrentContext(OUString(), OUString()),
maRequestedContext(),
mnRequestedForceFlags(SwitchFlag_NoForce),
msCurrentDeckId(gsDefaultDeckId),
msCurrentDeckTitle(),
-
maPropertyChangeForwarder(::boost::bind(&SidebarController::BroadcastPropertyChange,
this)),
-
maContextChangeUpdate(::boost::bind(&SidebarController::UpdateConfigurations,
this)),
+
maPropertyChangeForwarder(std::bind(&SidebarController::BroadcastPropertyChange,
this)),
+
maContextChangeUpdate(std::bind(&SidebarController::UpdateConfigurations,
this)),
maAsynchronousDeckSwitch(),
mbIsDeckRequestedOpen(),
mbIsDeckOpen(),
mbCanDeckBeOpened(true),
mnSavedSidebarWidth(pParentWindow->GetSizePixel().Width()),
- maFocusManager(::boost::bind(&SidebarController::ShowPanel, this, _1)),
+ maFocusManager(std::bind(&SidebarController::ShowPanel, this,
std::placeholders::_1)),
mxReadOnlyModeDispatch(),
mbIsDocumentReadOnly(false),
mpSplitWindow(NULL),
@@ -497,7 +500,7 @@ void SidebarController::RequestSwitchToDeck (
{
maContextChangeUpdate.CancelRequest();
maAsynchronousDeckSwitch.RequestCall(
- ::boost::bind(&SidebarController::OpenThenSwitchToDeck, this,
rsDeckId));
+ [this, rsDeckId]() { OpenThenSwitchToDeck(rsDeckId); });
}
@@ -579,7 +582,7 @@ void SidebarController::SwitchToDeck (
new Deck(
rDeckDescriptor,
mpParentWindow,
- ::boost::bind(&SidebarController::RequestCloseDeck, this)));
+ [this]() { RequestCloseDeck(); }));
msCurrentDeckTitle = rDeckDescriptor.msTitle;
}
@@ -624,7 +627,9 @@ void SidebarController::SwitchToDeck (
iPanel = ::std::find_if(
rCurrentPanels.begin(),
rCurrentPanels.end(),
- ::boost::bind(&Panel::HasIdPredicate, _1,
::boost::cref(rPanelContexDescriptor.msId)));
+ [&](const SharedPanel& rPanel) {
+ return rPanel->HasIdPredicate(rPanelContexDescriptor.msId);
+ });
}
if (iPanel != rCurrentPanels.end())
{
@@ -701,8 +706,8 @@ SharedPanel SidebarController::CreatePanel (
*pPanelDescriptor,
pParentWindow,
bIsInitiallyExpanded,
- ::boost::bind(&Deck::RequestLayout, mpCurrentDeck.get()),
- ::boost::bind(&SidebarController::GetCurrentContext, this)));
+ [this]() { mpCurrentDeck->RequestLayout(); },
+ [this]() { return GetCurrentContext(); }));
// Create the XUIElement.
Reference<ui::XUIElement> xUIElement (CreateUIElement(
diff --git a/main/svtools/source/brwbox/editbrowsebox.cxx
b/main/svtools/source/brwbox/editbrowsebox.cxx
index 49d3cd13b4..d9c275f390 100644
--- a/main/svtools/source/brwbox/editbrowsebox.cxx
+++ b/main/svtools/source/brwbox/editbrowsebox.cxx
@@ -139,7 +139,7 @@ namespace svt
DBG_NAME(EditBrowseBox);
void EditBrowseBox::impl_construct()
{
- m_aImpl = ::std::unique_ptr<EditBrowseBoxImpl>(new
EditBrowseBoxImpl());
+ m_aImpl = ::std::make_unique<EditBrowseBoxImpl>();
m_aImpl->m_bHiContrast = isHiContrast(&GetDataWindow());
SetCompoundControl(sal_True);
diff --git a/main/svx/source/tbxctrls/tbcontrl.cxx
b/main/svx/source/tbxctrls/tbcontrl.cxx
index 3157ceb16f..f416c44c58 100644
--- a/main/svx/source/tbxctrls/tbcontrl.cxx
+++ b/main/svx/source/tbxctrls/tbcontrl.cxx
@@ -561,7 +561,7 @@ sal_Bool GetDocFontList_Impl( const FontList** ppFontList,
SvxFontNameBox_Impl*
(SvxFontListItem*)pDocSh->GetItem(
SID_ATTR_CHAR_FONTLIST );
else
{
- ::std::unique_ptr<FontList> aFontList(new FontList( pBox ));
+ ::std::unique_ptr<FontList> aFontList = std::make_unique<FontList>(
pBox );
*ppFontList = aFontList.get();
pBox->SetOwnFontList(std::move(aFontList));
bChanged = sal_True;
diff --git a/main/sw/source/core/doc/docbm.cxx
b/main/sw/source/core/doc/docbm.cxx
index 7ac29dca5b..2ae952e9df 100644
--- a/main/sw/source/core/doc/docbm.cxx
+++ b/main/sw/source/core/doc/docbm.cxx
@@ -143,7 +143,7 @@ namespace
return lcl_PositionFromCntntNode( pNode, bPosAtEndOfNode );
}
- return ::std::unique_ptr<SwPosition>(new SwPosition(rOtherPosition));
+ return ::std::make_unique<SwPosition>(rOtherPosition);
};
static IMark* lcl_getMarkAfter(const IDocumentMarkAccess::container_t&
rMarks, const SwPosition& rPos)
diff --git a/main/sw/source/core/doc/docnew.cxx
b/main/sw/source/core/doc/docnew.cxx
index 62a9f3bbbc..ae0c8d160d 100644
--- a/main/sw/source/core/doc/docnew.cxx
+++ b/main/sw/source/core/doc/docnew.cxx
@@ -224,7 +224,7 @@ SwDoc::SwDoc()
pMarkManager(new ::sw::mark::MarkManager(*this)),
m_pMetaFieldManager(new ::sw::MetaFieldManager()),
m_pUndoManager(new ::sw::UndoManager(
- ::std::unique_ptr<SwNodes>(new SwNodes(this)), *this, *this,
*this)),
+ ::std::make_unique<SwNodes>(this), *this, *this, *this)),
pDfltFrmFmt( new SwFrmFmt( GetAttrPool(), sFrmFmtStr, 0 ) ),
pEmptyPageFmt( new SwFrmFmt( GetAttrPool(), sEmptyPageStr, pDfltFrmFmt
) ),
pColumnContFmt( new SwFrmFmt( GetAttrPool(), sColumnCntStr, pDfltFrmFmt
) ),
diff --git a/main/sw/source/core/undo/rolbck.cxx
b/main/sw/source/core/undo/rolbck.cxx
index 8a26769f83..17301a3e45 100644
--- a/main/sw/source/core/undo/rolbck.cxx
+++ b/main/sw/source/core/undo/rolbck.cxx
@@ -640,12 +640,12 @@ void SwHistoryBookmark::SetInDoc( SwDoc* pDoc, bool )
// #111660# don't crash when nNode1 doesn't point to content node.
if(pCntntNd)
- pPam = ::std::unique_ptr<SwPaM>(new SwPaM(*pCntntNd, m_nCntnt));
+ pPam = ::std::make_unique<SwPaM>(*pCntntNd, m_nCntnt);
}
else
{
pMark = pMarkAccess->findMark(m_aName)->get();
- pPam = ::std::unique_ptr<SwPaM>(new SwPaM(pMark->GetMarkPos()));
+ pPam = ::std::make_unique<SwPaM>(pMark->GetMarkPos());
}
if(m_bSaveOtherPos)
diff --git a/main/sw/source/ui/dbui/dbinsdlg.cxx
b/main/sw/source/ui/dbui/dbinsdlg.cxx
index 74c16009d9..09c086d3d3 100644
--- a/main/sw/source/ui/dbui/dbinsdlg.cxx
+++ b/main/sw/source/ui/dbui/dbinsdlg.cxx
@@ -1223,7 +1223,7 @@ void SwInsertDBColAutoPilot::DataToDoc( const
Sequence<Any>& rSelection,
break;
if( 10 == i )
- pWait = ::std::unique_ptr<SwWait>(new SwWait(
*pView->GetDocShell(), true ));
+ pWait = ::std::make_unique<SwWait>(
*pView->GetDocShell(), true );
}
rSh.MoveTable( GetfnTableCurr(), GetfnTableStart() );
@@ -1455,7 +1455,7 @@ void SwInsertDBColAutoPilot::DataToDoc( const
Sequence<Any>& rSelection,
rSh.SwEditShell::SplitNode();
if( 10 == i )
- pWait = ::std::unique_ptr<SwWait>(new
SwWait( *pView->GetDocShell(), true ));
+ pWait = ::std::make_unique<SwWait>(
*pView->GetDocShell(), true );
}
if( !bSetCrsr && pMark != NULL)
diff --git a/main/sw/source/ui/uiview/viewling.cxx
b/main/sw/source/ui/uiview/viewling.cxx
index 9d6afeff33..38be503f93 100644
--- a/main/sw/source/ui/uiview/viewling.cxx
+++ b/main/sw/source/ui/uiview/viewling.cxx
@@ -740,10 +740,10 @@ sal_Bool SwView::ExecSpellPopup(const Point& rPt)
{
sal_Int32 nPos = aPoint.nContent.GetIndex();
(void) nPos;
- pPopup = std::unique_ptr< SwSpellPopup >(new SwSpellPopup(
pWrtShell, aGrammarCheckRes, nErrorInResult, aSuggestions, aParaText ));
+ pPopup = std::make_unique< SwSpellPopup >( pWrtShell,
aGrammarCheckRes, nErrorInResult, aSuggestions, aParaText );
}
else
- pPopup = std::unique_ptr< SwSpellPopup >(new SwSpellPopup(
pWrtShell, xAlt, aParaText ));
+ pPopup = std::make_unique< SwSpellPopup >( pWrtShell,
xAlt, aParaText );
ui::ContextMenuExecuteEvent aEvent;
const Point aPixPos = GetEditWin().LogicToPixel( rPt );
diff --git a/main/sw/source/ui/uno/unomailmerge.cxx
b/main/sw/source/ui/uno/unomailmerge.cxx
index b311ce7ae8..81bab7a69f 100644
--- a/main/sw/source/ui/uno/unomailmerge.cxx
+++ b/main/sw/source/ui/uno/unomailmerge.cxx
@@ -778,7 +778,7 @@ uno::Any SAL_CALL SwXMailMerge::execute(
aMergeDesc.bSendAsAttachment = bSendAsAttachment;
aMergeDesc.bCreateSingleFile = sal_False;
- pMMConfigItem = std::unique_ptr< SwMailMergeConfigItem >(new
SwMailMergeConfigItem);
+ pMMConfigItem = std::make_unique< SwMailMergeConfigItem >();
aMergeDesc.pMailMergeConfigItem = pMMConfigItem.get();
aMergeDesc.xSmtpServer = SwMailMergeHelper::ConnectToSmtpServer(
*pMMConfigItem,