diff options
Diffstat (limited to 'sc')
25 files changed, 53 insertions, 55 deletions
diff --git a/sc/qa/extras/scpdfexport.cxx b/sc/qa/extras/scpdfexport.cxx index 5629ee010b89..070721dcd091 100644 --- a/sc/qa/extras/scpdfexport.cxx +++ b/sc/qa/extras/scpdfexport.cxx @@ -146,7 +146,7 @@ std::shared_ptr<utl::TempFile> ScPDFExportTest::exportToPDF(const uno::Reference<frame::XModel>& xModel, const ScRange& range) { // create temp file name - std::shared_ptr<utl::TempFile> pTempFile(new utl::TempFile()); + auto pTempFile = std::make_shared<utl::TempFile>(); pTempFile->EnableKillingFile(); OUString sFileURL = pTempFile->GetURL(); // Note: under Windows path path should be with "/" delimiters instead of "\\" diff --git a/sc/qa/unit/helper/qahelper.cxx b/sc/qa/unit/helper/qahelper.cxx index 73540c9a4233..cc675cdb593d 100644 --- a/sc/qa/unit/helper/qahelper.cxx +++ b/sc/qa/unit/helper/qahelper.cxx @@ -573,11 +573,11 @@ ScDocShellRef ScBootstrapFixture::load( bool bReadWrite, const OUString& rTypeName, SfxFilterFlags nFilterFlags, SotClipboardFormatId nClipboardID, sal_uIntPtr nFilterVersion, const OUString* pPassword ) { - std::shared_ptr<const SfxFilter> pFilter(new SfxFilter( + auto pFilter = std::make_shared<SfxFilter>( rFilter, OUString(), nFilterFlags, nClipboardID, rTypeName, OUString(), - rUserData, "private:factory/scalc")); - const_cast<SfxFilter*>(pFilter.get())->SetVersion(nFilterVersion); + rUserData, "private:factory/scalc"); + pFilter->SetVersion(nFilterVersion); ScDocShellRef xDocShRef = new ScDocShell; xDocShRef->GetDocument().EnableUserInteraction(false); @@ -668,11 +668,11 @@ ScDocShellRef ScBootstrapFixture::saveAndReload( SotClipboardFormatId nExportFormat = SotClipboardFormatId::NONE; if (nFormatType == ODS_FORMAT_TYPE) nExportFormat = SotClipboardFormatId::STARCHART_8; - std::shared_ptr<const SfxFilter> pExportFilter(new SfxFilter( + auto pExportFilter = std::make_shared<SfxFilter>( rFilter, OUString(), nFormatType, nExportFormat, rTypeName, OUString(), - rUserData, "private:factory/scalc*" )); - const_cast<SfxFilter*>(pExportFilter.get())->SetVersion(SOFFICE_FILEFORMAT_CURRENT); + rUserData, "private:factory/scalc*" ); + pExportFilter->SetVersion(SOFFICE_FILEFORMAT_CURRENT); aStoreMedium.SetFilter(pExportFilter); pShell->DoSaveAs( aStoreMedium ); pShell->DoClose(); @@ -707,18 +707,18 @@ std::shared_ptr<utl::TempFile> ScBootstrapFixture::saveAs( ScDocShell* pShell, s OUString aFilterName(aFileFormats[nFormat].pFilterName, strlen(aFileFormats[nFormat].pFilterName), RTL_TEXTENCODING_UTF8) ; OUString aFilterType(aFileFormats[nFormat].pTypeName, strlen(aFileFormats[nFormat].pTypeName), RTL_TEXTENCODING_UTF8); - std::shared_ptr<utl::TempFile> pTempFile(new utl::TempFile()); + auto pTempFile = std::make_shared<utl::TempFile>(); pTempFile->EnableKillingFile(); SfxMedium aStoreMedium( pTempFile->GetURL(), StreamMode::STD_WRITE ); SotClipboardFormatId nExportFormat = SotClipboardFormatId::NONE; SfxFilterFlags nFormatType = aFileFormats[nFormat].nFormatType; if (nFormatType == ODS_FORMAT_TYPE) nExportFormat = SotClipboardFormatId::STARCHART_8; - std::shared_ptr<SfxFilter> pExportFilter(new SfxFilter( + auto pExportFilter = std::make_shared<SfxFilter>( aFilterName, OUString(), nFormatType, nExportFormat, aFilterType, OUString(), - OUString(), "private:factory/scalc*" )); - pExportFilter.get()->SetVersion(SOFFICE_FILEFORMAT_CURRENT); + OUString(), "private:factory/scalc*" ); + pExportFilter->SetVersion(SOFFICE_FILEFORMAT_CURRENT); aStoreMedium.SetFilter(pExportFilter); pShell->DoSaveAs( aStoreMedium ); diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx index d10dc4244a0e..1fe48fb464c3 100644 --- a/sc/qa/unit/subsequent_export-test.cxx +++ b/sc/qa/unit/subsequent_export-test.cxx @@ -417,11 +417,11 @@ ScDocShellRef ScExportTest::saveAndReloadPassword(ScDocShell* pShell, const OUSt SotClipboardFormatId nExportFormat = SotClipboardFormatId::NONE; if (nFormatType == ODS_FORMAT_TYPE) nExportFormat = SotClipboardFormatId::STARCHART_8; - std::shared_ptr<const SfxFilter> pExportFilter(new SfxFilter( + auto pExportFilter = std::make_shared<SfxFilter>( rFilter, OUString(), nFormatType, nExportFormat, rTypeName, OUString(), - rUserData, "private:factory/scalc*" )); - const_cast<SfxFilter*>(pExportFilter.get())->SetVersion(SOFFICE_FILEFORMAT_CURRENT); + rUserData, "private:factory/scalc*" ); + pExportFilter->SetVersion(SOFFICE_FILEFORMAT_CURRENT); aStoreMedium.SetFilter(pExportFilter); SfxItemSet* pExportSet = aStoreMedium.GetItemSet(); uno::Sequence< beans::NamedValue > aEncryptionData = comphelper::OStorageHelper::CreatePackageEncryptionData( "test" ); diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx index e3c7bfae4d82..5c15ee25b470 100644 --- a/sc/qa/unit/subsequent_filters-test.cxx +++ b/sc/qa/unit/subsequent_filters-test.cxx @@ -1628,13 +1628,13 @@ void ScFiltersTest::testPassword_Impl(const OUString& aFileNameBase) createFileURL(aFileNameBase, aFileExtension, aFileName); OUString aFilterType(getFileFormats()[0].pTypeName, strlen(getFileFormats()[0].pTypeName), RTL_TEXTENCODING_UTF8); - std::shared_ptr<const SfxFilter> pFilter(new SfxFilter( + auto pFilter = std::make_shared<SfxFilter>( aFilterName, OUString(), getFileFormats()[0].nFormatType, SotClipboardFormatId::STARCALC_8, aFilterType, OUString(), - OUString(), "private:factory/scalc*" )); - const_cast<SfxFilter*>(pFilter.get())->SetVersion(SOFFICE_FILEFORMAT_CURRENT); + OUString(), "private:factory/scalc*" ); + pFilter->SetVersion(SOFFICE_FILEFORMAT_CURRENT); ScDocShellRef xDocSh = new ScDocShell; SfxMedium* pMedium = new SfxMedium(aFileName, StreamMode::STD_READWRITE); 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( |