summaryrefslogtreecommitdiff
path: root/sc/source
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-01-10 12:30:24 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-01-10 13:07:41 +0100
commit175a2063effa1c5a3eab896c6c4b0d07f3588edb (patch)
tree4a252a7e9e6e714343e9ff21c3d78c8e41086009 /sc/source
parentddf901664d3dd12191f98b77182652a6889f2b26 (diff)
use more std::make_shared
found using 'git grep', I tried using clang-tidy, but it only successfully found a tiny fraction of these Change-Id: I61c7d85105ff7a911722750e759d6641d578da33 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86526 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/source')
-rw-r--r--sc/source/core/data/column.cxx3
-rw-r--r--sc/source/core/data/column3.cxx4
-rw-r--r--sc/source/core/data/document.cxx5
-rw-r--r--sc/source/core/data/document10.cxx4
-rw-r--r--sc/source/core/data/dpobject.cxx6
-rw-r--r--sc/source/core/data/dpresfilter.cxx2
-rw-r--r--sc/source/core/data/table4.cxx2
-rw-r--r--sc/source/filter/excel/excdoc.cxx4
-rw-r--r--sc/source/filter/excel/xeescher.cxx4
-rw-r--r--sc/source/filter/excel/xiescher.cxx2
-rw-r--r--sc/source/filter/oox/worksheetbuffer.cxx2
-rw-r--r--sc/source/filter/xcl97/xcl97esc.cxx2
-rw-r--r--sc/source/filter/xcl97/xcl97rec.cxx2
-rw-r--r--sc/source/ui/dataprovider/dataprovider.cxx8
-rw-r--r--sc/source/ui/docshell/docsh4.cxx4
-rw-r--r--sc/source/ui/miscdlgs/optsolver.cxx2
-rw-r--r--sc/source/ui/view/cellsh2.cxx4
-rw-r--r--sc/source/ui/view/gridwin.cxx2
-rw-r--r--sc/source/ui/view/output.cxx2
-rw-r--r--sc/source/ui/view/tabvwsha.cxx4
-rw-r--r--sc/source/ui/view/viewfun5.cxx6
21 files changed, 36 insertions, 38 deletions
diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx
index 268475df4d1c..5d3cbcbd99e7 100644
--- a/sc/source/core/data/column.cxx
+++ b/sc/source/core/data/column.cxx
@@ -2278,8 +2278,7 @@ class UpdateRefOnNonCopy
// Make sure that the start and end listening contexts share the
// same block position set, else an invalid iterator may ensue.
- std::shared_ptr<sc::ColumnBlockPositionSet> pPosSet(
- new sc::ColumnBlockPositionSet(mpCxt->mrDoc));
+ auto pPosSet = std::make_shared<sc::ColumnBlockPositionSet>(mpCxt->mrDoc);
sc::StartListeningContext aStartCxt(mpCxt->mrDoc, pPosSet);
sc::EndListeningContext aEndCxt(mpCxt->mrDoc, pPosSet, pOldCode.get());
diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx
index f417b63d4b0a..29eb7d51a90f 100644
--- a/sc/source/core/data/column3.cxx
+++ b/sc/source/core/data/column3.cxx
@@ -345,7 +345,7 @@ void ScColumn::StartListeningUnshared( const std::vector<SCROW>& rNewSharedRows
ScDocument* pDoc = GetDoc();
if (!rNewSharedRows.empty() && !pDoc->IsDelayedFormulaGrouping())
{
- std::shared_ptr<sc::ColumnBlockPositionSet> pPosSet(new sc::ColumnBlockPositionSet(*pDoc));
+ auto pPosSet = std::make_shared<sc::ColumnBlockPositionSet>(*pDoc);
sc::StartListeningContext aStartCxt(*pDoc, pPosSet);
sc::EndListeningContext aEndCxt(*pDoc, pPosSet);
if (rNewSharedRows.size() >= 2)
@@ -621,7 +621,7 @@ void ScColumn::AttachNewFormulaCell(
{
case sc::ConvertToGroupListening:
{
- std::shared_ptr<sc::ColumnBlockPositionSet> pPosSet(new sc::ColumnBlockPositionSet(*pDocument));
+ auto pPosSet = std::make_shared<sc::ColumnBlockPositionSet>(*pDocument);
sc::StartListeningContext aStartCxt(*pDocument, pPosSet);
sc::EndListeningContext aEndCxt(*pDocument, pPosSet);
SCROW nStartRow, nEndRow;
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index 3f87a7f24a98..a7071416eb6e 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -2576,8 +2576,7 @@ void ScDocument::StartListeningFromClip( SCCOL nCol1, SCROW nRow1,
{
if (nInsFlag & InsertDeleteFlags::CONTENTS)
{
- std::shared_ptr<sc::ColumnBlockPositionSet> pSet(
- new sc::ColumnBlockPositionSet(*this));
+ auto pSet = std::make_shared<sc::ColumnBlockPositionSet>(*this);
sc::StartListeningContext aStartCxt(*this, pSet);
sc::EndListeningContext aEndCxt(*this, pSet, nullptr);
@@ -2701,7 +2700,7 @@ void ScDocument::CopyBlockFromClip(
/* TODO: holding the ColumnSet in a shared_ptr at
* RefUpdateContext would eliminate the need of
* copying it here. */
- std::shared_ptr<const sc::ColumnSet> pColSet( new sc::ColumnSet( aRefCxt.maRegroupCols));
+ auto pColSet = std::make_shared<sc::ColumnSet>( aRefCxt.maRegroupCols);
StartNeededListeners( pColSet);
}
diff --git a/sc/source/core/data/document10.cxx b/sc/source/core/data/document10.cxx
index 2cdc71b3374a..8b1496943081 100644
--- a/sc/source/core/data/document10.cxx
+++ b/sc/source/core/data/document10.cxx
@@ -226,7 +226,7 @@ void ScDocument::SwapNonEmpty( sc::TableValues& rValues )
if (!rRange.IsValid())
return;
- std::shared_ptr<sc::ColumnBlockPositionSet> pPosSet(new sc::ColumnBlockPositionSet(*this));
+ auto pPosSet = std::make_shared<sc::ColumnBlockPositionSet>(*this);
sc::StartListeningContext aStartCxt(*this, pPosSet);
sc::EndListeningContext aEndCxt(*this, pPosSet);
@@ -501,7 +501,7 @@ void ScDocument::StartAllListeners( const ScRange& rRange )
if (IsClipOrUndo() || GetNoListening())
return;
- std::shared_ptr<sc::ColumnBlockPositionSet> pPosSet(new sc::ColumnBlockPositionSet(*this));
+ auto pPosSet = std::make_shared<sc::ColumnBlockPositionSet>(*this);
sc::StartListeningContext aStartCxt(*this, pPosSet);
sc::EndListeningContext aEndCxt(*this, pPosSet);
diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx
index 8f1756b23e1b..73b236df1f48 100644
--- a/sc/source/core/data/dpobject.cxx
+++ b/sc/source/core/data/dpobject.cxx
@@ -717,7 +717,7 @@ ScDPTableData* ScDPObject::GetTableData()
// grouping (for cell or database data)
if (pData && pDimData)
{
- shared_ptr<ScDPGroupTableData> pGroupData(new ScDPGroupTableData(pData, pDoc));
+ auto pGroupData = std::make_shared<ScDPGroupTableData>(pData, pDoc);
pDimData->WriteToData(*pGroupData);
pData = pGroupData;
}
@@ -839,14 +839,14 @@ void ScDPObject::ReloadGroupTableData()
// This is already a group table data. Salvage the source data and
// re-create a new group data.
const shared_ptr<ScDPTableData>& pSource = pData->GetSourceTableData();
- shared_ptr<ScDPGroupTableData> pGroupData(new ScDPGroupTableData(pSource, pDoc));
+ auto pGroupData = std::make_shared<ScDPGroupTableData>(pSource, pDoc);
pDimData->WriteToData(*pGroupData);
mpTableData = pGroupData;
}
else
{
// This is a source data. Create a group data based on it.
- shared_ptr<ScDPGroupTableData> pGroupData(new ScDPGroupTableData(mpTableData, pDoc));
+ auto pGroupData = std::make_shared<ScDPGroupTableData>(mpTableData, pDoc);
pDimData->WriteToData(*pGroupData);
mpTableData = pGroupData;
}
diff --git a/sc/source/core/data/dpresfilter.cxx b/sc/source/core/data/dpresfilter.cxx
index 1e6da5ee3410..6a1cef68b5a9 100644
--- a/sc/source/core/data/dpresfilter.cxx
+++ b/sc/source/core/data/dpresfilter.cxx
@@ -124,7 +124,7 @@ void ScDPResultTree::add(
if (itMem == rMembersValueNames.end())
{
// New member. Insert it.
- std::shared_ptr<MemberNode> pNode( new MemberNode);
+ auto pNode = std::make_shared<MemberNode>();
std::pair<MembersType::iterator, bool> r =
rMembersValueNames.emplace(aUpperName, pNode);
diff --git a/sc/source/core/data/table4.cxx b/sc/source/core/data/table4.cxx
index 5aab834a1fed..b18752ca3a8a 100644
--- a/sc/source/core/data/table4.cxx
+++ b/sc/source/core/data/table4.cxx
@@ -1243,7 +1243,7 @@ void ScTable::FillFormulaVertical(
aCol[nCol].DeleteRanges(aSpans, InsertDeleteFlags::VALUE | InsertDeleteFlags::DATETIME | InsertDeleteFlags::STRING | InsertDeleteFlags::FORMULA | InsertDeleteFlags::OUTLINE);
aCol[nCol].CloneFormulaCell(rSrcCell, sc::CellTextAttr(), aSpans);
- std::shared_ptr<sc::ColumnBlockPositionSet> pSet(new sc::ColumnBlockPositionSet(*pDocument));
+ auto pSet = std::make_shared<sc::ColumnBlockPositionSet>(*pDocument);
sc::StartListeningContext aStartCxt(*pDocument, pSet);
sc::EndListeningContext aEndCxt(*pDocument, pSet);
diff --git a/sc/source/filter/excel/excdoc.cxx b/sc/source/filter/excel/excdoc.cxx
index 4d9975d034cc..35e333fc4a7f 100644
--- a/sc/source/filter/excel/excdoc.cxx
+++ b/sc/source/filter/excel/excdoc.cxx
@@ -431,7 +431,7 @@ void ExcTable::FillAsTableBinary( SCTAB nCodeNameIdx )
}
// WSBOOL needs data from page settings, create it here, add it later
- std::shared_ptr< XclExpPageSettings > xPageSett( new XclExpPageSettings( GetRoot() ) );
+ auto xPageSett = std::make_shared<XclExpPageSettings>( GetRoot() );
bool bFitToPages = xPageSett->GetPageData().mbFitToPages;
if( eBiff <= EXC_BIFF5 )
@@ -572,7 +572,7 @@ void ExcTable::FillAsTableXml()
}
// WSBOOL needs data from page settings, create it here, add it later
- std::shared_ptr< XclExpPageSettings > xPageSett( new XclExpPageSettings( GetRoot() ) );
+ auto xPageSett = std::make_shared<XclExpPageSettings>( GetRoot() );
XclExtLstRef xExtLst( new XclExtLst( GetRoot() ) );
bool bFitToPages = xPageSett->GetPageData().mbFitToPages;
diff --git a/sc/source/filter/excel/xeescher.cxx b/sc/source/filter/excel/xeescher.cxx
index 65fa3f896e31..5bb9d0bb61f8 100644
--- a/sc/source/filter/excel/xeescher.cxx
+++ b/sc/source/filter/excel/xeescher.cxx
@@ -1122,7 +1122,7 @@ void XclExpChartObj::SaveXml( XclExpXmlStream& rStrm )
{
XclObjAny::WriteFromTo( rStrm, mxShape, GetTab() );
ChartExport aChartExport(XML_xdr, pDrawing, mxChartDoc, &rStrm, drawingml::DOCUMENT_XLSX);
- std::shared_ptr<oox::drawingml::URLTransformer> pURLTransformer(new ScURLTransformer(*mpDoc));
+ auto pURLTransformer = std::make_shared<ScURLTransformer>(*mpDoc);
aChartExport.SetURLTranslator(pURLTransformer);
static sal_Int32 nChartCount = 0;
nChartCount++;
@@ -1489,7 +1489,7 @@ XclExpDffAnchorBase* XclExpObjectManager::CreateDffAnchor() const
std::shared_ptr< XclExpRecordBase > XclExpObjectManager::CreateDrawingGroup()
{
- return std::shared_ptr< XclExpRecordBase >( new XclExpMsoDrawingGroup( *mxEscherEx ) );
+ return std::make_shared<XclExpMsoDrawingGroup>( *mxEscherEx );
}
void XclExpObjectManager::StartSheet()
diff --git a/sc/source/filter/excel/xiescher.cxx b/sc/source/filter/excel/xiescher.cxx
index d654f38ab133..82e4ac0ddccb 100644
--- a/sc/source/filter/excel/xiescher.cxx
+++ b/sc/source/filter/excel/xiescher.cxx
@@ -4204,7 +4204,7 @@ void XclImpSheetDrawing::ReadNote( XclImpStream& rStrm )
void XclImpSheetDrawing::ReadTabChart( XclImpStream& rStrm )
{
OSL_ENSURE_BIFF( GetBiff() >= EXC_BIFF5 );
- std::shared_ptr< XclImpChartObj > xChartObj( new XclImpChartObj( GetRoot(), true ) );
+ auto xChartObj = std::make_shared<XclImpChartObj>( GetRoot(), true );
xChartObj->ReadChartSubStream( rStrm );
// insert the chart as raw object without connected DFF data
AppendRawObject( xChartObj );
diff --git a/sc/source/filter/oox/worksheetbuffer.cxx b/sc/source/filter/oox/worksheetbuffer.cxx
index 59872603cb7f..ade90452d21f 100644
--- a/sc/source/filter/oox/worksheetbuffer.cxx
+++ b/sc/source/filter/oox/worksheetbuffer.cxx
@@ -221,7 +221,7 @@ void WorksheetBuffer::insertSheet( const SheetInfoModel& rModel )
{
sal_Int32 nWorksheet = static_cast< sal_Int32 >( maSheetInfos.size() );
IndexNamePair aIndexName = createSheet( rModel.maName, nWorksheet );
- std::shared_ptr< SheetInfo > xSheetInfo( new SheetInfo( rModel, aIndexName.first, aIndexName.second ) );
+ auto xSheetInfo = std::make_shared<SheetInfo>( rModel, aIndexName.first, aIndexName.second );
maSheetInfos.push_back( xSheetInfo );
maSheetInfosByName[ rModel.maName ] = xSheetInfo;
maSheetInfosByName[ lclQuoteName( rModel.maName ) ] = xSheetInfo;
diff --git a/sc/source/filter/xcl97/xcl97esc.cxx b/sc/source/filter/xcl97/xcl97esc.cxx
index 5a58fa68d4bd..3cc4881b23c2 100644
--- a/sc/source/filter/xcl97/xcl97esc.cxx
+++ b/sc/source/filter/xcl97/xcl97esc.cxx
@@ -85,7 +85,7 @@ SvStream* XclEscherExGlobal::ImplQueryPictureStream()
}
XclEscherEx::XclEscherEx( const XclExpRoot& rRoot, XclExpObjectManager& rObjMgr, SvStream& rStrm, const XclEscherEx* pParent ) :
- EscherEx( pParent ? pParent->mxGlobal : std::shared_ptr<EscherExGlobal>( new XclEscherExGlobal( rRoot ) ), &rStrm ),
+ EscherEx( pParent ? pParent->mxGlobal : std::make_shared<XclEscherExGlobal>( rRoot ), &rStrm ),
XclExpRoot( rRoot ),
mrObjMgr( rObjMgr ),
pCurrXclObj( nullptr ),
diff --git a/sc/source/filter/xcl97/xcl97rec.cxx b/sc/source/filter/xcl97/xcl97rec.cxx
index c880da8ab417..dfbe894ab4f8 100644
--- a/sc/source/filter/xcl97/xcl97rec.cxx
+++ b/sc/source/filter/xcl97/xcl97rec.cxx
@@ -1187,7 +1187,7 @@ void XclObjAny::SaveXml( XclExpXmlStream& rStrm )
sax_fastparser::FSHelperPtr pDrawing = rStrm.GetCurrentStream();
ShapeExport aDML(XML_xdr, pDrawing, nullptr, &rStrm, drawingml::DOCUMENT_XLSX);
- std::shared_ptr<oox::drawingml::URLTransformer> pURLTransformer(new ScURLTransformer(*mpDoc));
+ auto pURLTransformer = std::make_shared<ScURLTransformer>(*mpDoc);
aDML.SetURLTranslator(pURLTransformer);
pDrawing->startElement( FSNS( XML_xdr, XML_twoCellAnchor ), // OOXTODO: oneCellAnchor, absoluteAnchor
diff --git a/sc/source/ui/dataprovider/dataprovider.cxx b/sc/source/ui/dataprovider/dataprovider.cxx
index e75fb326a64c..737cbdc0af4d 100644
--- a/sc/source/ui/dataprovider/dataprovider.cxx
+++ b/sc/source/ui/dataprovider/dataprovider.cxx
@@ -279,13 +279,13 @@ std::shared_ptr<DataProvider> DataProviderFactory::getDataProvider(ScDocument* p
if (bInternal)
{
if (rDataProvider == "org.libreoffice.calc.csv")
- return std::shared_ptr<DataProvider>(new CSVDataProvider(pDoc, rDataSource));
+ return std::make_shared<CSVDataProvider>(pDoc, rDataSource);
else if (rDataProvider == "org.libreoffice.calc.html")
- return std::shared_ptr<DataProvider>(new HTMLDataProvider(pDoc, rDataSource));
+ return std::make_shared<HTMLDataProvider>(pDoc, rDataSource);
else if (rDataProvider == "org.libreoffice.calc.xml")
- return std::shared_ptr<DataProvider>(new XMLDataProvider(pDoc, rDataSource));
+ return std::make_shared<XMLDataProvider>(pDoc, rDataSource);
else if (rDataProvider == "org.libreoffice.calc.sql")
- return std::shared_ptr<DataProvider>(new SQLDataProvider(pDoc, rDataSource));
+ return std::make_shared<SQLDataProvider>(pDoc, rDataSource);
}
else
{
diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx
index 9ccbf096fc10..0d7724a97b0a 100644
--- a/sc/source/ui/docshell/docsh4.cxx
+++ b/sc/source/ui/docshell/docsh4.cxx
@@ -1689,7 +1689,7 @@ void ScDocShell::ExecutePageStyle( const SfxViewShell& rCaller,
VclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateScStyleDlg(GetActiveDialogParent(), *pStyleSheet, true));
- std::shared_ptr<SfxRequest> pRequest(new SfxRequest(rReq));
+ auto pRequest = std::make_shared<SfxRequest>(rReq);
rReq.Ignore(); // the 'old' request is not relevant any more
pDlg->StartExecuteAsync([this, pDlg, pRequest, pStyleSheet, aOldData, aOldName, &rStyleSet, nCurTab, &rCaller, bUndo](sal_Int32 nResult){
if ( nResult == RET_OK )
@@ -1849,7 +1849,7 @@ void ScDocShell::ExecutePageStyle( const SfxViewShell& rCaller,
rStyleSet,
aStr,
nResId));
- std::shared_ptr<SfxRequest> xRequest(new SfxRequest(rReq));
+ auto xRequest = std::make_shared<SfxRequest>(rReq);
rReq.Ignore(); // the 'old' request is not relevant any more
pDlg->StartExecuteAsync([this, pDlg, pStyleSheet, xRequest](sal_Int32 nResult){
if ( nResult == RET_OK )
diff --git a/sc/source/ui/miscdlgs/optsolver.cxx b/sc/source/ui/miscdlgs/optsolver.cxx
index ec69d43f0eb8..e99f410b239d 100644
--- a/sc/source/ui/miscdlgs/optsolver.cxx
+++ b/sc/source/ui/miscdlgs/optsolver.cxx
@@ -789,7 +789,7 @@ bool ScOptSolverDlg::CallSolver() // return true -> close dialog after cal
{
// show progress dialog
- std::shared_ptr<ScSolverProgressDialog> xProgress(new ScSolverProgressDialog(m_xDialog.get()));
+ auto xProgress = std::make_shared<ScSolverProgressDialog>(m_xDialog.get());
sal_Int32 nTimeout = 0;
if ( FindTimeout( nTimeout ) )
xProgress->SetTimeLimit( nTimeout );
diff --git a/sc/source/ui/view/cellsh2.cxx b/sc/source/ui/view/cellsh2.cxx
index f0a042a702f3..9095a7aa2c2d 100644
--- a/sc/source/ui/view/cellsh2.cxx
+++ b/sc/source/ui/view/cellsh2.cxx
@@ -888,13 +888,13 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq )
// cell range picker
vcl::Window* pWin = GetViewData()->GetActiveWin();
weld::Window* pParentWin = pWin ? pWin->GetFrameWeld() : nullptr;
- std::shared_ptr<SfxDialogController> xDlg(new ScValidationDlg(pParentWin, &aArgSet, pTabViewShell));
+ auto xDlg = std::make_shared<ScValidationDlg>(pParentWin, &aArgSet, pTabViewShell);
ScValidationRegisteredDlg aRegisterThatDlgExists(pParentWin, xDlg);
short nResult = xDlg->run();
if ( nResult == RET_OK )
{
- const SfxItemSet* pOutSet = static_cast<ScValidationDlg*>(xDlg.get())->GetOutputItemSet();
+ const SfxItemSet* pOutSet = xDlg->GetOutputItemSet();
if ( pOutSet->GetItemState( FID_VALID_MODE, true, &pItem ) == SfxItemState::SET )
eMode = static_cast<ScValidationMode>(static_cast<const SfxUInt16Item*>(pItem)->GetValue());
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index c6833d7fe2aa..cc9c29661cbb 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -5156,7 +5156,7 @@ std::shared_ptr<ScFieldEditEngine> createEditEngine( ScDocShell* pDocSh, const S
{
ScDocument& rDoc = pDocSh->GetDocument();
- std::shared_ptr<ScFieldEditEngine> pEngine(new ScFieldEditEngine(&rDoc, rDoc.GetEditPool()));
+ auto pEngine = std::make_shared<ScFieldEditEngine>(&rDoc, rDoc.GetEditPool());
ScSizeDeviceProvider aProv(pDocSh);
pEngine->SetRefDevice(aProv.GetDevice());
pEngine->SetRefMapMode(MapMode(MapUnit::Map100thMM));
diff --git a/sc/source/ui/view/output.cxx b/sc/source/ui/view/output.cxx
index 9af78a03f5fa..605057ef91e0 100644
--- a/sc/source/ui/view/output.cxx
+++ b/sc/source/ui/view/output.cxx
@@ -1022,7 +1022,7 @@ void ScOutputData::DrawBackground(vcl::RenderContext& rRenderContext)
const svtools::ColorConfig& rColorCfg = SC_MOD()->GetColorConfig();
Color aProtectedColor( rColorCfg.GetColorValue( svtools::CALCPROTECTEDBACKGROUND ).nColor );
- std::shared_ptr<SvxBrushItem> pProtectedBackground( new SvxBrushItem( aProtectedColor, ATTR_BACKGROUND ) );
+ auto pProtectedBackground = std::make_shared<SvxBrushItem>( aProtectedColor, ATTR_BACKGROUND );
// iterate through the rows to show
for (SCSIZE nArrY=1; nArrY+1<nArrCount; nArrY++)
diff --git a/sc/source/ui/view/tabvwsha.cxx b/sc/source/ui/view/tabvwsha.cxx
index 37d7fc1e2100..9ec10e64cbf5 100644
--- a/sc/source/ui/view/tabvwsha.cxx
+++ b/sc/source/ui/view/tabvwsha.cxx
@@ -475,7 +475,7 @@ void ScTabViewShell::ExecuteCellFormatDlg(SfxRequest& rReq, const OString &rName
const ScPatternAttr* pOldAttrs = GetSelectionPattern();
- std::shared_ptr<SfxItemSet> pOldSet(new SfxItemSet(pOldAttrs->GetItemSet()));
+ auto pOldSet = std::make_shared<SfxItemSet>(pOldAttrs->GetItemSet());
std::shared_ptr<SvxNumberInfoItem> pNumberInfoItem;
pOldSet->MergeRange(XATTR_FILLSTYLE, XATTR_FILLCOLOR);
@@ -542,7 +542,7 @@ void ScTabViewShell::ExecuteCellFormatDlg(SfxRequest& rReq, const OString &rName
if (!rName.isEmpty())
pDlg->SetCurPageId(rName);
- std::shared_ptr<SfxRequest> pRequest(new SfxRequest(rReq));
+ auto pRequest = std::make_shared<SfxRequest>(rReq);
rReq.Ignore(); // the 'old' request is not relevant any more
pDlg->StartExecuteAsync([pDlg, pOldSet, pRequest, this](sal_Int32 nResult){
diff --git a/sc/source/ui/view/viewfun5.cxx b/sc/source/ui/view/viewfun5.cxx
index 0e61a2a8a072..a682420fb071 100644
--- a/sc/source/ui/view/viewfun5.cxx
+++ b/sc/source/ui/view/viewfun5.cxx
@@ -295,11 +295,11 @@ bool ScViewFunc::PasteDataFormat( SotClipboardFormatId nFormatId,
else
{
ScAddress aCellPos( nPosX, nPosY, GetViewData().GetTabNo() );
- std::shared_ptr<ScImportExport> pObj(new ScImportExport(GetViewData().GetDocument(), aCellPos));
+ auto pObj = std::make_shared<ScImportExport>(GetViewData().GetDocument(), aCellPos);
pObj->SetOverwriting( true );
- std::shared_ptr<OUString> pStrBuffer(new OUString());
+ auto pStrBuffer = std::make_shared<OUString>();
tools::SvRef<SotStorageStream> xStream;
if ( aDataHelper.GetSotStorageStream( nFormatId, xStream ) && xStream.is() )
{
@@ -341,7 +341,7 @@ bool ScViewFunc::PasteDataFormat( SotClipboardFormatId nFormatId,
{
vcl::Window* pParent = GetActiveWin();
- std::shared_ptr<ScImportStringStream> pStrm(new ScImportStringStream(*pStrBuffer));
+ auto pStrm = std::make_shared<ScImportStringStream>(*pStrBuffer);
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
VclPtr<AbstractScImportAsciiDlg> pDlg(