From 175a2063effa1c5a3eab896c6c4b0d07f3588edb Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 10 Jan 2020 12:30:24 +0200 Subject: 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 --- basctl/source/basicide/basides1.cxx | 4 +-- basctl/source/basicide/moduldl2.cxx | 4 +-- basctl/source/dlged/managelang.cxx | 2 +- basic/source/runtime/runtime.cxx | 4 +-- canvas/source/directx/dx_9rm.cxx | 5 ++- canvas/source/tools/surfaceproxymanager.cxx | 6 ++-- chart2/source/controller/dialogs/DataBrowser.cxx | 4 +-- chart2/source/controller/main/UndoActions.cxx | 2 +- .../view/axes/VCartesianCoordinateSystem.cxx | 2 +- chart2/source/view/main/VLegend.cxx | 2 +- configmgr/source/lock.cxx | 2 +- .../source/commontools/RowFunctionParser.cxx | 8 ++--- connectivity/source/commontools/TTableHelper.cxx | 2 +- cppcanvas/source/mtfrenderer/bitmapaction.cxx | 15 ++++---- cppcanvas/source/mtfrenderer/lineaction.cxx | 8 ++--- cppcanvas/source/mtfrenderer/pointaction.cxx | 4 +-- cppcanvas/source/mtfrenderer/polypolyaction.cxx | 24 ++++++------- cppcanvas/source/mtfrenderer/textaction.cxx | 42 +++++++++++----------- .../source/mtfrenderer/transparencygroupaction.cxx | 12 +++---- cppuhelper/source/servicemanager.cxx | 10 +++--- cui/source/dialogs/cuigaldlg.cxx | 4 +-- cui/source/options/optaboutconfig.cxx | 2 +- dbaccess/source/ui/tabledesign/TableController.cxx | 4 +-- desktop/source/deployment/misc/dp_misc.cxx | 3 +- editeng/source/editeng/eerdll.cxx | 2 +- emfio/source/reader/mtftools.cxx | 4 +-- extensions/source/scanner/scanunx.cxx | 2 +- filter/source/msfilter/msdffimp.cxx | 10 +++--- include/oox/ole/axcontrol.hxx | 4 +-- include/oox/vml/vmlshapecontainer.hxx | 2 +- linguistic/source/hyphdsp.cxx | 2 +- linguistic/source/spelldsp.cxx | 2 +- linguistic/source/thesdsp.cxx | 2 +- .../drawingml/diagram/constraintlistcontext.cxx | 2 +- oox/source/drawingml/textbody.cxx | 2 +- oox/source/drawingml/textbodycontext.cxx | 2 +- oox/source/ppt/pptshapegroupcontext.cxx | 2 +- oox/source/shape/ShapeContextHandler.cxx | 10 +++--- oox/source/vml/vmlshapecontainer.cxx | 2 +- reportdesign/source/core/sdr/RptObject.cxx | 12 +++---- .../source/ui/inspection/DataProviderHandler.cxx | 2 +- reportdesign/source/ui/misc/FunctionHelper.cxx | 2 +- reportdesign/source/ui/misc/UITools.cxx | 2 +- reportdesign/source/ui/report/ReportController.cxx | 2 +- sax/source/tools/fastserializer.cxx | 4 +-- sc/qa/extras/scpdfexport.cxx | 2 +- sc/qa/unit/helper/qahelper.cxx | 20 +++++------ sc/qa/unit/subsequent_export-test.cxx | 6 ++-- sc/qa/unit/subsequent_filters-test.cxx | 6 ++-- sc/source/core/data/column.cxx | 3 +- sc/source/core/data/column3.cxx | 4 +-- sc/source/core/data/document.cxx | 5 ++- sc/source/core/data/document10.cxx | 4 +-- sc/source/core/data/dpobject.cxx | 6 ++-- sc/source/core/data/dpresfilter.cxx | 2 +- sc/source/core/data/table4.cxx | 2 +- sc/source/filter/excel/excdoc.cxx | 4 +-- sc/source/filter/excel/xeescher.cxx | 4 +-- sc/source/filter/excel/xiescher.cxx | 2 +- sc/source/filter/oox/worksheetbuffer.cxx | 2 +- sc/source/filter/xcl97/xcl97esc.cxx | 2 +- sc/source/filter/xcl97/xcl97rec.cxx | 2 +- sc/source/ui/dataprovider/dataprovider.cxx | 8 ++--- sc/source/ui/docshell/docsh4.cxx | 4 +-- sc/source/ui/miscdlgs/optsolver.cxx | 2 +- sc/source/ui/view/cellsh2.cxx | 4 +-- sc/source/ui/view/gridwin.cxx | 2 +- sc/source/ui/view/output.cxx | 2 +- sc/source/ui/view/tabvwsha.cxx | 4 +-- sc/source/ui/view/viewfun5.cxx | 6 ++-- sd/qa/unit/filters-test.cxx | 6 ++-- sd/qa/unit/sdmodeltestbase.hxx | 24 ++++++------- sd/source/ui/animations/CustomAnimationPane.cxx | 2 +- .../ui/framework/factories/BasicViewFactory.cxx | 2 +- sd/source/ui/func/futransf.cxx | 2 +- sd/source/ui/presenter/PresenterPreviewCache.cxx | 2 +- sd/source/ui/remotecontrol/Server.cxx | 6 ++-- sd/source/ui/sidebar/AllMasterPagesSelector.cxx | 2 +- .../ui/sidebar/CurrentMasterPagesSelector.cxx | 6 ++-- sd/source/ui/sidebar/MasterPageContainer.cxx | 2 +- sd/source/ui/sidebar/MasterPageContainerFiller.cxx | 13 +++---- sd/source/ui/sidebar/MasterPageDescriptor.cxx | 2 +- sd/source/ui/sidebar/RecentMasterPagesSelector.cxx | 2 +- sd/source/ui/sidebar/RecentlyUsedMasterPages.cxx | 9 ++--- .../ui/slidesorter/cache/SlsBitmapCompressor.cxx | 2 +- .../ui/slidesorter/controller/SlsAnimator.cxx | 6 ++-- .../ui/slidesorter/controller/SlsClipboard.cxx | 6 ++-- .../ui/slidesorter/controller/SlsPageSelector.cxx | 2 +- .../controller/SlsSelectionFunction.cxx | 9 ++--- .../slidesorter/controller/SlsTransferableData.cxx | 2 +- .../ui/slidesorter/view/SlsViewCacheContext.cxx | 2 +- sd/source/ui/view/DocumentRenderer.cxx | 30 +++++++--------- sd/source/ui/view/drviews2.cxx | 2 +- sd/source/ui/view/drviews3.cxx | 2 +- sdext/source/pdfimport/pdfiadaptor.cxx | 3 +- sdext/source/pdfimport/test/tests.cxx | 2 +- sdext/source/pdfimport/tree/treevisitorfactory.cxx | 22 +++++------- .../presenter/PresenterPaneBorderPainter.cxx | 3 +- sdext/source/presenter/PresenterTheme.cxx | 12 +++---- sfx2/source/doc/objcont.cxx | 2 +- sfx2/source/doc/sfxbasemodel.cxx | 2 +- slideshow/source/engine/expressionnodefactory.cxx | 16 ++++----- slideshow/source/engine/screenupdater.cxx | 2 +- slideshow/source/engine/shapes/appletshape.cxx | 7 ++-- .../source/engine/shapes/drawinglayeranimation.cxx | 5 ++- slideshow/source/engine/shapes/gdimtftools.cxx | 2 +- slideshow/source/engine/shapes/mediashape.cxx | 5 +-- slideshow/source/engine/slide/slideimpl.cxx | 18 +++++----- slideshow/source/engine/slideview.cxx | 10 +++--- slideshow/source/engine/smilfunctionparser.cxx | 5 ++- starmath/qa/extras/mmlimport-test.cxx | 4 +-- svtools/source/uno/wizard/wizardshell.cxx | 2 +- .../EnhancedCustomShapeFunctionParser.cxx | 20 +++++------ svx/source/dialog/charmap.cxx | 4 +-- svx/source/dialog/rubydialog.cxx | 2 +- svx/source/dialog/searchcharmap.cxx | 4 +-- svx/source/unodraw/unobrushitemhelper.cxx | 12 +++---- svx/source/unodraw/unoshape.cxx | 4 +-- sw/qa/core/filters-test.cxx | 6 ++-- sw/qa/core/filters-test2.cxx | 7 ++-- sw/qa/core/uwriter.cxx | 4 +-- sw/source/core/tox/ToxTextGenerator.cxx | 2 +- sw/source/core/undo/untbl.cxx | 7 ++-- sw/source/core/undo/untblk.cxx | 4 +-- sw/source/core/unocore/unodraw.cxx | 2 +- sw/source/core/unocore/unostyle.cxx | 2 +- sw/source/filter/docx/swdocxreader.cxx | 2 +- sw/source/filter/html/htmltab.cxx | 4 +-- sw/source/filter/rtf/swparrtf.cxx | 4 +-- sw/source/filter/ww8/wrtw8esh.cxx | 2 +- sw/source/filter/ww8/wrtw8sty.cxx | 2 +- sw/source/filter/ww8/ww8par.cxx | 4 +-- sw/source/ui/dbui/mmresultdialogs.cxx | 2 +- sw/source/ui/vba/vbadocumentproperties.cxx | 4 +-- sw/source/uibase/app/docsh2.cxx | 10 +++--- sw/source/uibase/app/docst.cxx | 2 +- sw/source/uibase/shells/tabsh.cxx | 2 +- sw/source/uibase/shells/textsh1.cxx | 6 ++-- sw/source/uibase/shells/txtnum.cxx | 2 +- unoxml/source/rdf/librdf_repository.cxx | 6 ++-- vcl/qt5/Qt5Menu.cxx | 2 +- vcl/source/font/PhysicalFontCollection.cxx | 2 +- writerfilter/source/dmapper/DomainMapper.cxx | 10 +++--- writerfilter/source/dmapper/GraphicImport.cxx | 4 +-- writerfilter/source/dmapper/PageBordersHandler.cxx | 2 +- writerfilter/source/dmapper/StyleSheetTable.cxx | 6 ++-- .../source/dmapper/TablePropertiesHandler.cxx | 12 +++---- writerfilter/source/dmapper/TblStylePrHandler.cxx | 2 +- writerperfect/qa/unit/WPXSvStreamTest.cxx | 2 +- .../source/impress/KeynoteImportFilter.cxx | 3 +- xmloff/source/table/XMLTableExport.cxx | 2 +- xmloff/source/table/XMLTableImport.cxx | 4 +-- xmlscript/source/xmldlg_imexp/xmldlg_import.cxx | 4 +-- 153 files changed, 381 insertions(+), 428 deletions(-) diff --git a/basctl/source/basicide/basides1.cxx b/basctl/source/basicide/basides1.cxx index 79c809927fb2..d614dfc560ce 100644 --- a/basctl/source/basicide/basides1.cxx +++ b/basctl/source/basicide/basides1.cxx @@ -745,9 +745,9 @@ void Shell::ExecuteGlobal( SfxRequest& rReq ) case SID_BASICIDE_MANAGE_LANG: { - std::shared_ptr pRequest(new SfxRequest(rReq)); + auto pRequest = std::make_shared(rReq); rReq.Ignore(); // the 'old' request is not relevant any more - std::shared_ptr xDlg(new ManageLanguageDialog(pCurWin ? pCurWin->GetFrameWeld() : nullptr, m_pCurLocalizationMgr)); + auto xDlg = std::make_shared(pCurWin ? pCurWin->GetFrameWeld() : nullptr, m_pCurLocalizationMgr); weld::DialogController::runAsync(xDlg, [=](sal_Int32 /*nResult*/){ pRequest->Done(); }); diff --git a/basctl/source/basicide/moduldl2.cxx b/basctl/source/basicide/moduldl2.cxx index 0783d697b1ba..48bbe0838f37 100644 --- a/basctl/source/basicide/moduldl2.cxx +++ b/basctl/source/basicide/moduldl2.cxx @@ -595,8 +595,8 @@ void LibPage::InsertLib() // file URLs Sequence< OUString > aFiles = xFP->getSelectedFiles(); INetURLObject aURLObj( aFiles[0] ); - std::shared_ptr xModURLObj(new INetURLObject(aURLObj)); - std::shared_ptr xDlgURLObj(new INetURLObject(aURLObj)); + auto xModURLObj = std::make_shared(aURLObj); + auto xDlgURLObj = std::make_shared(aURLObj); OUString aBase = aURLObj.getBase(); OUString aModBase( "script" ); diff --git a/basctl/source/dlged/managelang.cxx b/basctl/source/dlged/managelang.cxx index 1d87ab94039f..193dce11dd68 100644 --- a/basctl/source/dlged/managelang.cxx +++ b/basctl/source/dlged/managelang.cxx @@ -138,7 +138,7 @@ void ManageLanguageDialog::ClearLanguageBox() IMPL_LINK_NOARG(ManageLanguageDialog, AddHdl, weld::Button&, void) { - std::shared_ptr xDlg(new SetDefaultLanguageDialog(m_xDialog.get(), m_xLocalizationMgr)); + auto xDlg = std::make_shared(m_xDialog.get(), m_xLocalizationMgr); weld::DialogController::runAsync(xDlg, [xDlg,this](sal_Int32 nResult) { if (!nResult ) diff --git a/basic/source/runtime/runtime.cxx b/basic/source/runtime/runtime.cxx index 3a9cb95264d5..0f9f3dfc4fc1 100644 --- a/basic/source/runtime/runtime.cxx +++ b/basic/source/runtime/runtime.cxx @@ -405,8 +405,8 @@ std::shared_ptr SbiInstance::PrepareNumberFormatter( sal_uInt eDate = aSysLocale.GetLocaleData().getDateOrder(); } - std::shared_ptr pNumberFormatter( - new SvNumberFormatter( comphelper::getProcessComponentContext(), eLangType )); + std::shared_ptr pNumberFormatter = + std::make_shared( comphelper::getProcessComponentContext(), eLangType ); // Several parser methods pass SvNumberFormatter::IsNumberFormat() a number // format index to parse against. Tell the formatter the proper date diff --git a/canvas/source/directx/dx_9rm.cxx b/canvas/source/directx/dx_9rm.cxx index ea650b9f9f5f..7f058a2a45bc 100644 --- a/canvas/source/directx/dx_9rm.cxx +++ b/canvas/source/directx/dx_9rm.cxx @@ -471,8 +471,7 @@ namespace dxcanvas ::basegfx::B2IVector aPageSize(maPageSize); while(true) { - mpTexture = std::shared_ptr( - new DXSurface(*this,aPageSize)); + mpTexture = std::make_shared(*this,aPageSize); if(mpTexture->isValid()) break; @@ -950,7 +949,7 @@ namespace dxcanvas if(mpTexture.use_count() == 1) return mpTexture; - return std::shared_ptr( new DXSurface(*this,aSize) ); + return std::make_shared(*this,aSize); } diff --git a/canvas/source/tools/surfaceproxymanager.cxx b/canvas/source/tools/surfaceproxymanager.cxx index ef70b824e9e0..126e1bd8c2ad 100644 --- a/canvas/source/tools/surfaceproxymanager.cxx +++ b/canvas/source/tools/surfaceproxymanager.cxx @@ -55,7 +55,7 @@ namespace canvas // not much to do for now, simply allocate a new surface // proxy from our internal pool and initialize this thing // properly. we *don't* create a hardware surface for now. - return std::shared_ptr(new SurfaceProxy(pBuffer,mpPageManager)); + return std::make_shared(pBuffer,mpPageManager); } private: @@ -66,9 +66,7 @@ namespace canvas std::shared_ptr createSurfaceProxyManager( const std::shared_ptr& rRenderModule ) { - return std::shared_ptr( - new SurfaceProxyManager( - rRenderModule)); + return std::make_shared(rRenderModule); } } diff --git a/chart2/source/controller/dialogs/DataBrowser.cxx b/chart2/source/controller/dialogs/DataBrowser.cxx index d5146749cd4d..7d293852857f 100644 --- a/chart2/source/controller/dialogs/DataBrowser.cxx +++ b/chart2/source/controller/dialogs/DataBrowser.cxx @@ -652,7 +652,7 @@ void DataBrowser::RenewTable() for (auto const& elemHeader : aHeaders) { - std::shared_ptr< impl::SeriesHeader > spHeader( new impl::SeriesHeader( m_pColumnsWin, m_pColorsWin )); + auto spHeader = std::make_shared( m_pColumnsWin, m_pColorsWin ); Reference< beans::XPropertySet > xSeriesProp( elemHeader.m_xDataSeries, uno::UNO_QUERY ); sal_Int32 nColor = 0; // @todo: Set "DraftColor", i.e. interpolated colors for gradients, bitmaps, etc. @@ -1287,7 +1287,7 @@ void DataBrowser::RenewSeriesHeaders() for (auto const& elemHeader : aHeaders) { - std::shared_ptr< impl::SeriesHeader > spHeader( new impl::SeriesHeader( m_pColumnsWin, m_pColorsWin )); + auto spHeader = std::make_shared( m_pColumnsWin, m_pColorsWin ); Reference< beans::XPropertySet > xSeriesProp(elemHeader.m_xDataSeries, uno::UNO_QUERY); sal_Int32 nColor = 0; if( xSeriesProp.is() && diff --git a/chart2/source/controller/main/UndoActions.cxx b/chart2/source/controller/main/UndoActions.cxx index 812e059e7980..301bef28279c 100644 --- a/chart2/source/controller/main/UndoActions.cxx +++ b/chart2/source/controller/main/UndoActions.cxx @@ -65,7 +65,7 @@ OUString SAL_CALL UndoElement::getTitle() void UndoElement::impl_toggleModelState() { // get a snapshot of the current state of our model - std::shared_ptr< ChartModelClone > pNewClone( new ChartModelClone( m_xDocumentModel, m_pModelClone->getFacet() ) ); + auto pNewClone = std::make_shared( m_xDocumentModel, m_pModelClone->getFacet() ); // apply the previous snapshot to our model m_pModelClone->applyToModel( m_xDocumentModel ); // remember the new snapshot, for the next toggle diff --git a/chart2/source/view/axes/VCartesianCoordinateSystem.cxx b/chart2/source/view/axes/VCartesianCoordinateSystem.cxx index 61050a12500f..e7fe42a87124 100644 --- a/chart2/source/view/axes/VCartesianCoordinateSystem.cxx +++ b/chart2/source/view/axes/VCartesianCoordinateSystem.cxx @@ -156,7 +156,7 @@ void VCartesianCoordinateSystem::createVAxisList( if(aAxisProperties.m_bDisplayLabels) aAxisProperties.m_nNumberFormatKey = getNumberFormatKeyForAxis(xAxis, xChartDoc); - std::shared_ptr< VAxisBase > apVAxis( new VCartesianAxis(aAxisProperties,xNumberFormatsSupplier,nDimensionIndex,nDimensionCount) ); + auto apVAxis = std::make_shared(aAxisProperties,xNumberFormatsSupplier,nDimensionIndex,nDimensionCount); tFullAxisIndex aFullAxisIndex( nDimensionIndex, nAxisIndex ); m_aAxisMap[aFullAxisIndex] = apVAxis; apVAxis->set3DWallPositions( m_eLeftWallPos, m_eBackWallPos, m_eBottomPos ); diff --git a/chart2/source/view/main/VLegend.cxx b/chart2/source/view/main/VLegend.cxx index df5ca49cea74..54958c11281e 100644 --- a/chart2/source/view/main/VLegend.cxx +++ b/chart2/source/view/main/VLegend.cxx @@ -796,7 +796,7 @@ std::vector> lcl_createButtons( const css::uno::Sequence aPivotFieldEntries = xPivotTableDataProvider->getColumnFields(); for (chart2::data::PivotTableFieldEntry const & sColumnFieldEntry : aPivotFieldEntries) { - std::shared_ptr pButton(new VButton); + auto pButton = std::make_shared(); aButtons.push_back(pButton); pButton->init(xLegendContainer, xShapeFactory); awt::Point aNewPosition(x, y); diff --git a/configmgr/source/lock.cxx b/configmgr/source/lock.cxx index 3c0e25d432c5..40a7536b8ab7 100644 --- a/configmgr/source/lock.cxx +++ b/configmgr/source/lock.cxx @@ -27,7 +27,7 @@ namespace configmgr { std::shared_ptr const & lock() { - static std::shared_ptr theLock(new osl::Mutex); + static std::shared_ptr theLock = std::make_shared(); return theLock; } diff --git a/connectivity/source/commontools/RowFunctionParser.cxx b/connectivity/source/commontools/RowFunctionParser.cxx index d158994d5b5a..b970d93f5a9a 100644 --- a/connectivity/source/commontools/RowFunctionParser.cxx +++ b/connectivity/source/commontools/RowFunctionParser.cxx @@ -157,7 +157,7 @@ public: void operator()( StringIteratorT rFirst,StringIteratorT rSecond) const { OUString sVal( rFirst, rSecond - rFirst, RTL_TEXTENCODING_UTF8 ); - mpContext->maOperandStack.push( std::shared_ptr( new ConstantValueExpression( new ORowSetValueDecorator( sVal ) ) ) ); + mpContext->maOperandStack.push( std::make_shared( new ORowSetValueDecorator( sVal ) ) ); } }; @@ -174,7 +174,7 @@ public: } void operator()( sal_Int32 n ) const { - mpContext->maOperandStack.push( std::shared_ptr( new ConstantValueExpression( new ORowSetValueDecorator( n ) ) ) ); + mpContext->maOperandStack.push( std::make_shared( new ORowSetValueDecorator( n ) ) ); } }; @@ -212,7 +212,7 @@ public: rNodeStack.pop(); // create combined ExpressionNode - std::shared_ptr pNode( new BinaryFunctionExpression( meFunct, pFirstArg, pSecondArg ) ); + auto pNode = std::make_shared( meFunct, pFirstArg, pSecondArg ); // check for constness rNodeStack.push( pNode ); } @@ -260,7 +260,7 @@ public: std::shared_ptr pArg( std::move(rNodeStack.top()) ); rNodeStack.pop(); - rNodeStack.push( std::shared_ptr( new UnaryFunctionExpression( pArg ) ) ); + rNodeStack.push( std::make_shared( pArg ) ); } }; diff --git a/connectivity/source/commontools/TTableHelper.cxx b/connectivity/source/commontools/TTableHelper.cxx index f9e91f180763..5086f7e8500a 100644 --- a/connectivity/source/commontools/TTableHelper.cxx +++ b/connectivity/source/commontools/TTableHelper.cxx @@ -317,7 +317,7 @@ void OTableHelper::refreshPrimaryKeys(::std::vector< OUString>& _rNames) if ( xResult.is() ) { - std::shared_ptr pKeyProps(new sdbcx::KeyProperties(OUString(),KeyType::PRIMARY,0,0)); + auto pKeyProps = std::make_shared(OUString(),KeyType::PRIMARY,0,0); OUString aPkName; bool bAlreadyFetched = false; const Reference< XRow > xRow(xResult,UNO_QUERY); diff --git a/cppcanvas/source/mtfrenderer/bitmapaction.cxx b/cppcanvas/source/mtfrenderer/bitmapaction.cxx index 94489145faed..84946014ef0b 100644 --- a/cppcanvas/source/mtfrenderer/bitmapaction.cxx +++ b/cppcanvas/source/mtfrenderer/bitmapaction.cxx @@ -201,10 +201,7 @@ namespace cppcanvas const CanvasSharedPtr& rCanvas, const OutDevState& rState ) { - return std::shared_ptr( new BitmapAction(rBmpEx, - rDstPoint, - rCanvas, - rState ) ); + return std::make_shared(rBmpEx, rDstPoint, rCanvas, rState ); } std::shared_ptr BitmapActionFactory::createBitmapAction( const ::BitmapEx& rBmpEx, @@ -213,11 +210,11 @@ namespace cppcanvas const CanvasSharedPtr& rCanvas, const OutDevState& rState ) { - return std::shared_ptr( new BitmapAction(rBmpEx, - rDstPoint, - rDstSize, - rCanvas, - rState ) ); + return std::make_shared(rBmpEx, + rDstPoint, + rDstSize, + rCanvas, + rState ); } } } diff --git a/cppcanvas/source/mtfrenderer/lineaction.cxx b/cppcanvas/source/mtfrenderer/lineaction.cxx index 7b0ba2080cf3..e032432e6848 100644 --- a/cppcanvas/source/mtfrenderer/lineaction.cxx +++ b/cppcanvas/source/mtfrenderer/lineaction.cxx @@ -145,10 +145,10 @@ namespace cppcanvas const CanvasSharedPtr& rCanvas, const OutDevState& rState ) { - return std::shared_ptr( new LineAction( rStartPoint, - rEndPoint, - rCanvas, - rState) ); + return std::make_shared( rStartPoint, + rEndPoint, + rCanvas, + rState); } } diff --git a/cppcanvas/source/mtfrenderer/pointaction.cxx b/cppcanvas/source/mtfrenderer/pointaction.cxx index 03000f85b329..38896151b52e 100644 --- a/cppcanvas/source/mtfrenderer/pointaction.cxx +++ b/cppcanvas/source/mtfrenderer/pointaction.cxx @@ -160,7 +160,7 @@ namespace cppcanvas const CanvasSharedPtr& rCanvas, const OutDevState& rState ) { - return std::shared_ptr( new PointAction( rPoint, rCanvas, rState ) ); + return std::make_shared( rPoint, rCanvas, rState ); } std::shared_ptr PointActionFactory::createPointAction( const ::basegfx::B2DPoint& rPoint, @@ -168,7 +168,7 @@ namespace cppcanvas const OutDevState& rState, const ::Color& rColor ) { - return std::shared_ptr( new PointAction( rPoint, rCanvas, rState, rColor ) ); + return std::make_shared( rPoint, rCanvas, rState, rColor ); } } } diff --git a/cppcanvas/source/mtfrenderer/polypolyaction.cxx b/cppcanvas/source/mtfrenderer/polypolyaction.cxx index 8fa1582b82c9..15fa4f5bc776 100644 --- a/cppcanvas/source/mtfrenderer/polypolyaction.cxx +++ b/cppcanvas/source/mtfrenderer/polypolyaction.cxx @@ -454,9 +454,9 @@ namespace cppcanvas { OSL_ENSURE( rState.isLineColorSet || rState.isFillColorSet, "PolyPolyActionFactory::createPolyPolyAction() with empty line and fill color" ); - return std::shared_ptr( new PolyPolyAction( rPoly, rCanvas, rState, - rState.isFillColorSet, - rState.isLineColorSet ) ); + return std::make_shared( rPoly, rCanvas, rState, + rState.isFillColorSet, + rState.isLineColorSet ); } std::shared_ptr PolyPolyActionFactory::createPolyPolyAction( const ::basegfx::B2DPolyPolygon& rPoly, @@ -464,7 +464,7 @@ namespace cppcanvas const OutDevState& rState, const rendering::Texture& rTexture ) { - return std::shared_ptr( new TexturedPolyPolyAction( rPoly, rCanvas, rState, rTexture ) ); + return std::make_shared( rPoly, rCanvas, rState, rTexture ); } std::shared_ptr PolyPolyActionFactory::createLinePolyPolyAction( const ::basegfx::B2DPolyPolygon& rPoly, @@ -474,9 +474,9 @@ namespace cppcanvas OSL_ENSURE( rState.isLineColorSet, "PolyPolyActionFactory::createLinePolyPolyAction() called with empty line color" ); - return std::shared_ptr( new PolyPolyAction( rPoly, rCanvas, rState, - false, - rState.isLineColorSet ) ); + return std::make_shared( rPoly, rCanvas, rState, + false, + rState.isLineColorSet ); } std::shared_ptr PolyPolyActionFactory::createPolyPolyAction( const ::basegfx::B2DPolyPolygon& rPoly, @@ -486,7 +486,7 @@ namespace cppcanvas { OSL_ENSURE( rState.isLineColorSet, "PolyPolyActionFactory::createPolyPolyAction() for strokes called with empty line color" ); - return std::shared_ptr( new StrokedPolyPolyAction( rPoly, rCanvas, rState, rStrokeAttributes ) ); + return std::make_shared( rPoly, rCanvas, rState, rStrokeAttributes ); } std::shared_ptr PolyPolyActionFactory::createPolyPolyAction( const ::basegfx::B2DPolyPolygon& rPoly, @@ -496,10 +496,10 @@ namespace cppcanvas { OSL_ENSURE( rState.isLineColorSet || rState.isFillColorSet, "PolyPolyActionFactory::createPolyPolyAction() with empty line and fill color" ); - return std::shared_ptr( new PolyPolyAction( rPoly, rCanvas, rState, - rState.isFillColorSet, - rState.isLineColorSet, - nTransparency ) ); + return std::make_shared( rPoly, rCanvas, rState, + rState.isFillColorSet, + rState.isLineColorSet, + nTransparency ); } } diff --git a/cppcanvas/source/mtfrenderer/textaction.cxx b/cppcanvas/source/mtfrenderer/textaction.cxx index f2b50e198606..93e54c11dba5 100644 --- a/cppcanvas/source/mtfrenderer/textaction.cxx +++ b/cppcanvas/source/mtfrenderer/textaction.cxx @@ -2075,8 +2075,7 @@ namespace cppcanvas if( rParms.maTextTransformation ) { - return std::shared_ptr( - new OutlineAction( + return std::make_shared( rStartPoint, rReliefOffset, rReliefColor, @@ -2088,12 +2087,11 @@ namespace cppcanvas rVDev, rCanvas, rState, - *rParms.maTextTransformation ) ); + *rParms.maTextTransformation ); } else { - return std::shared_ptr( - new OutlineAction( + return std::make_shared( rStartPoint, rReliefOffset, rReliefColor, @@ -2104,7 +2102,7 @@ namespace cppcanvas aCharWidthSeq, rVDev, rCanvas, - rState ) ); + rState ); } } @@ -2192,31 +2190,31 @@ namespace cppcanvas // nope if( rParms.maTextTransformation ) { - ret = std::shared_ptr( new TextAction( + ret = std::make_shared( aStartPoint, rText, nStartPos, nLen, rCanvas, rState, - *rParms.maTextTransformation ) ); + *rParms.maTextTransformation ); } else { - ret = std::shared_ptr( new TextAction( + ret = std::make_shared( aStartPoint, rText, nStartPos, nLen, rCanvas, - rState ) ); + rState ); } } else { // at least one of the effects requested if( rParms.maTextTransformation ) - ret = std::shared_ptr( new EffectTextAction( + ret = std::make_shared( aStartPoint, aReliefOffset, rReliefColor, @@ -2229,9 +2227,9 @@ namespace cppcanvas rVDev, rCanvas, rState, - *rParms.maTextTransformation ) ); + *rParms.maTextTransformation ); else - ret = std::shared_ptr( new EffectTextAction( + ret = std::make_shared( aStartPoint, aReliefOffset, rReliefColor, @@ -2243,7 +2241,7 @@ namespace cppcanvas nLen, rVDev, rCanvas, - rState ) ); + rState ); } } else @@ -2258,7 +2256,7 @@ namespace cppcanvas { // nope if( rParms.maTextTransformation ) - ret = std::shared_ptr( new TextArrayAction( + ret = std::make_shared( aStartPoint, rText, nStartPos, @@ -2266,22 +2264,22 @@ namespace cppcanvas aCharWidths, rCanvas, rState, - *rParms.maTextTransformation ) ); + *rParms.maTextTransformation ); else - ret = std::shared_ptr( new TextArrayAction( + ret = std::make_shared( aStartPoint, rText, nStartPos, nLen, aCharWidths, rCanvas, - rState ) ); + rState ); } else { // at least one of the effects requested if( rParms.maTextTransformation ) - ret = std::shared_ptr( new EffectTextArrayAction( + ret = std::make_shared( aStartPoint, aReliefOffset, rReliefColor, @@ -2295,9 +2293,9 @@ namespace cppcanvas rVDev, rCanvas, rState, - *rParms.maTextTransformation ) ); + *rParms.maTextTransformation ); else - ret = std::shared_ptr( new EffectTextArrayAction( + ret = std::make_shared( aStartPoint, aReliefOffset, rReliefColor, @@ -2310,7 +2308,7 @@ namespace cppcanvas aCharWidths, rVDev, rCanvas, - rState ) ); + rState ); } } return ret; diff --git a/cppcanvas/source/mtfrenderer/transparencygroupaction.cxx b/cppcanvas/source/mtfrenderer/transparencygroupaction.cxx index 09e5c200d04d..48be63ed8702 100644 --- a/cppcanvas/source/mtfrenderer/transparencygroupaction.cxx +++ b/cppcanvas/source/mtfrenderer/transparencygroupaction.cxx @@ -465,12 +465,12 @@ namespace cppcanvas const CanvasSharedPtr& rCanvas, const OutDevState& rState ) { - return std::shared_ptr( new TransparencyGroupAction(std::move(rGroupMtf), - std::move(rAlphaGradient), - rDstPoint, - rDstSize, - rCanvas, - rState ) ); + return std::make_shared(std::move(rGroupMtf), + std::move(rAlphaGradient), + rDstPoint, + rDstSize, + rCanvas, + rState ); } } diff --git a/cppuhelper/source/servicemanager.cxx b/cppuhelper/source/servicemanager.cxx index 9f4f541b1388..e9c0ce9907f2 100644 --- a/cppuhelper/source/servicemanager.cxx +++ b/cppuhelper/source/servicemanager.cxx @@ -1391,11 +1391,11 @@ bool cppuhelper::ServiceManager::readLegacyRdbFile(OUString const & uri) { assert(implKey.getName().match("/IMPLEMENTATIONS/")); OUString name( implKey.getName().copy(RTL_CONSTASCII_LENGTH("/IMPLEMENTATIONS/"))); - std::shared_ptr< Data::Implementation > impl( - new Data::Implementation( + std::shared_ptr< Data::Implementation > impl = + std::make_shared( name, readLegacyRdbString(uri, implKey, "UNO/ACTIVATOR"), readLegacyRdbString(uri, implKey, "UNO/LOCATION"), "", "", "", - css::uno::Reference< css::uno::XComponentContext >(), uri)); + css::uno::Reference< css::uno::XComponentContext >(), uri); if (!data_.namedImplementations.emplace(name, impl).second) { throw css::registry::InvalidRegistryException( @@ -1520,8 +1520,8 @@ void cppuhelper::ServiceManager::insertLegacyFactory( } css::uno::Reference< css::lang::XComponent > comp( factoryInfo, css::uno::UNO_QUERY); - std::shared_ptr< Data::Implementation > impl( - new Data::Implementation(name, f1, f2, comp)); + std::shared_ptr< Data::Implementation > impl = + std::make_shared(name, f1, f2, comp); Data extra; if (!name.isEmpty()) { extra.namedImplementations.emplace(name, impl); diff --git a/cui/source/dialogs/cuigaldlg.cxx b/cui/source/dialogs/cuigaldlg.cxx index 265ee489912e..21726bb73c7c 100644 --- a/cui/source/dialogs/cuigaldlg.cxx +++ b/cui/source/dialogs/cuigaldlg.cxx @@ -793,7 +793,7 @@ IMPL_LINK_NOARG(TPGalleryThemeProperties, SelectFileTypeHdl, weld::ComboBox&, vo void TPGalleryThemeProperties::SearchFiles() { - std::shared_ptr xProgress(new SearchProgress(GetFrameWeld(), this, aURL)); + auto xProgress = std::make_shared(GetFrameWeld(), this, aURL); aFoundList.clear(); m_xLbxFound->clear(); @@ -846,7 +846,7 @@ void TPGalleryThemeProperties::TakeFiles() { if (m_xLbxFound->count_selected_rows() || (bTakeAll && bEntriesFound)) { - std::shared_ptr xTakeProgress(new TakeProgress(GetFrameWeld(), this)); + auto xTakeProgress = std::make_shared(GetFrameWeld(), this); xTakeProgress->LaunchThread(); weld::DialogController::runAsync(xTakeProgress, [=](sal_Int32 /*nResult*/) { /* no postprocessing needed, pTakeProgress diff --git a/cui/source/options/optaboutconfig.cxx b/cui/source/options/optaboutconfig.cxx index 728c3c68d258..bb1b4fbc196b 100644 --- a/cui/source/options/optaboutconfig.cxx +++ b/cui/source/options/optaboutconfig.cxx @@ -577,7 +577,7 @@ IMPL_LINK_NOARG( CuiAboutConfigTabPage, StandardHdl_Impl, weld::Button&, void ) OUString sPropertyType = m_xPrefBox->get_text(*m_xScratchIter, 2); OUString sPropertyValue = m_xPrefBox->get_text(*m_xScratchIter, 3); - std::shared_ptr< Prop_Impl > pProperty (new Prop_Impl( pUserData->sPropertyPath, sPropertyName, Any( sPropertyValue ) ) ); + auto pProperty = std::make_shared( pUserData->sPropertyPath, sPropertyName, Any( sPropertyValue ) ); bool bSaveChanges = false; bool bOpenDialog = true; diff --git a/dbaccess/source/ui/tabledesign/TableController.cxx b/dbaccess/source/ui/tabledesign/TableController.cxx index 06e7b1c9976a..17cd3780ee77 100644 --- a/dbaccess/source/ui/tabledesign/TableController.cxx +++ b/dbaccess/source/ui/tabledesign/TableController.cxx @@ -927,7 +927,7 @@ bool OTableController::checkColumns(bool _bNew) { case RET_YES: { - std::shared_ptr pNewRow(new OTableRow()); + auto pNewRow = std::make_shared(); TOTypeInfoSP pTypeInfo = ::dbaui::queryPrimaryKeyType(m_aTypeInfo); if ( !pTypeInfo.get() ) break; @@ -1503,7 +1503,7 @@ sal_Int32 OTableController::getFirstEmptyRowPosition() if (!bFoundElem) { bool bReadRow = !isAddAllowed(); - std::shared_ptr pTabEdRow(new OTableRow()); + auto pTabEdRow = std::make_shared(); pTabEdRow->SetReadOnly(bReadRow); nRet = m_vRowList.size(); m_vRowList.push_back( pTabEdRow); diff --git a/desktop/source/deployment/misc/dp_misc.cxx b/desktop/source/deployment/misc/dp_misc.cxx index 7b4aafb3b083..baa5e716f4bd 100644 --- a/desktop/source/deployment/misc/dp_misc.cxx +++ b/desktop/source/deployment/misc/dp_misc.cxx @@ -78,8 +78,7 @@ struct UnoRc : public rtl::StaticWithInit< std::shared_ptr operator () () { OUString unorc( "$BRAND_BASE_DIR/" LIBO_ETC_FOLDER "/" SAL_CONFIGFILE("louno") ); ::rtl::Bootstrap::expandMacros( unorc ); - std::shared_ptr< ::rtl::Bootstrap > ret( - new ::rtl::Bootstrap( unorc ) ); + auto ret = std::make_shared<::rtl::Bootstrap>( unorc ); OSL_ASSERT( ret->getHandle() != nullptr ); return ret; } diff --git a/editeng/source/editeng/eerdll.cxx b/editeng/source/editeng/eerdll.cxx index 9d49d871193c..c2fda0f6c0cf 100644 --- a/editeng/source/editeng/eerdll.cxx +++ b/editeng/source/editeng/eerdll.cxx @@ -218,7 +218,7 @@ std::shared_ptr EditDLL::GetSharedVclResources() SolarMutexGuard g; auto pLocked(pSharedVcl.lock()); if(!pLocked) - pSharedVcl = pLocked = std::shared_ptr(new editeng::SharedVclResources()); + pSharedVcl = pLocked = std::make_shared(); return pLocked; } diff --git a/emfio/source/reader/mtftools.cxx b/emfio/source/reader/mtftools.cxx index f50f41a83717..669585526918 100644 --- a/emfio/source/reader/mtftools.cxx +++ b/emfio/source/reader/mtftools.cxx @@ -2109,7 +2109,7 @@ namespace emfio void MtfTools::Push() // !! to be able to access the original ClipRegion it { // is not allowed to use the MetaPushAction() UpdateClipRegion(); // (the original clip region is on top of the stack) (SJ) - std::shared_ptr pSave( new SaveStruct ); + auto pSave = std::make_shared(); pSave->aLineStyle = maLineStyle; pSave->aFillStyle = maFillStyle; @@ -2149,7 +2149,7 @@ namespace emfio if( !mvSaveStack.empty() ) { // Backup the current data on the stack - std::shared_ptr pSave( mvSaveStack.back() ); + std::shared_ptr& pSave( mvSaveStack.back() ); maLineStyle = pSave->aLineStyle; maFillStyle = pSave->aFillStyle; diff --git a/extensions/source/scanner/scanunx.cxx b/extensions/source/scanner/scanunx.cxx index 83df6c32d5d2..bd261d694c85 100644 --- a/extensions/source/scanner/scanunx.cxx +++ b/extensions/source/scanner/scanunx.cxx @@ -217,7 +217,7 @@ Sequence< ScannerContext > ScannerManager::getAvailableScanners() if( rSanes.empty() ) { - std::shared_ptr pSaneHolder(new SaneHolder); + auto pSaneHolder = std::make_shared(); if( Sane::IsSane() ) rSanes.push_back( pSaneHolder ); } diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx index 97577199628c..dca72ee06689 100644 --- a/filter/source/msfilter/msdffimp.cxx +++ b/filter/source/msfilter/msdffimp.cxx @@ -4962,8 +4962,8 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r // otherwise, just finalize here if (size_t(nCalledByGroup) > maPendingGroupData.size()) { - std::shared_ptr rHdClone(new DffRecordHeader(aObjData.rSpHd)); - maPendingGroupData.emplace_back(DffObjData(rHdClone, aObjData), rHdClone ); + auto xHdClone = std::make_shared(aObjData.rSpHd); + maPendingGroupData.emplace_back(DffObjData(xHdClone, aObjData), xHdClone ); } else { @@ -5374,8 +5374,7 @@ SdrObject* SvxMSDffManager::ProcessObj(SvStream& rSt, // the object with a frame, otherwise if( bTextFrame ) { - std::shared_ptr const pTmpRec( - new SvxMSDffShapeInfo(0, pImpRec->nShapeId)); + auto const pTmpRec = std::make_shared(0, pImpRec->nShapeId); SvxMSDffShapeInfos_ById::const_iterator const it = m_xShapeInfosById->find(pTmpRec); @@ -6374,8 +6373,7 @@ bool SvxMSDffManager::GetShapeContainerData( SvStream& rSt, bool SvxMSDffManager::GetShape(sal_uLong nId, SdrObject*& rpShape, SvxMSDffImportData& rData) { - std::shared_ptr const pTmpRec( - new SvxMSDffShapeInfo(0, nId)); + auto const pTmpRec = std::make_shared(0, nId); SvxMSDffShapeInfos_ById::const_iterator const it = m_xShapeInfosById->find(pTmpRec); diff --git a/include/oox/ole/axcontrol.hxx b/include/oox/ole/axcontrol.hxx index 0be97b5043f3..ec2555a4dfed 100644 --- a/include/oox/ole/axcontrol.hxx +++ b/include/oox/ole/axcontrol.hxx @@ -938,7 +938,7 @@ private: template< typename ModelType > inline ModelType& EmbeddedControl::createModel() { - std::shared_ptr< ModelType > xModel( new ModelType ); + auto xModel = std::make_shared(); mxModel = xModel; xModel->setFormComponentMode(); return *xModel; @@ -947,7 +947,7 @@ inline ModelType& EmbeddedControl::createModel() template< typename ModelType, typename ParamType > inline ModelType& EmbeddedControl::createModel( const ParamType& rParam ) { - std::shared_ptr< ModelType > xModel( new ModelType( rParam ) ); + auto xModel = std::make_shared( rParam ); mxModel = xModel; xModel->setFormComponentMode(); return *xModel; diff --git a/include/oox/vml/vmlshapecontainer.hxx b/include/oox/vml/vmlshapecontainer.hxx index ff39d5f7212c..6be9020051c2 100644 --- a/include/oox/vml/vmlshapecontainer.hxx +++ b/include/oox/vml/vmlshapecontainer.hxx @@ -125,7 +125,7 @@ private: template< typename ShapeT > std::shared_ptr ShapeContainer::createShape() { - std::shared_ptr< ShapeT > xShape( new ShapeT( mrDrawing ) ); + auto xShape = std::make_shared( mrDrawing ); maShapes.push_back( xShape ); return xShape; } diff --git a/linguistic/source/hyphdsp.cxx b/linguistic/source/hyphdsp.cxx index f86847008cab..6ede806a526e 100644 --- a/linguistic/source/hyphdsp.cxx +++ b/linguistic/source/hyphdsp.cxx @@ -678,7 +678,7 @@ void HyphenatorDispatcher::SetServiceList( const Locale &rLocale, } else { - std::shared_ptr< LangSvcEntries_Hyph > pTmpEntry( new LangSvcEntries_Hyph( rSvcImplNames[0] ) ); + auto pTmpEntry = std::make_shared( rSvcImplNames[0] ); pTmpEntry->aSvcRefs = Sequence< Reference < XHyphenator > >( 1 ); aSvcMap[ nLanguage ] = pTmpEntry; } diff --git a/linguistic/source/spelldsp.cxx b/linguistic/source/spelldsp.cxx index 42ae281fd917..a1390c916c77 100644 --- a/linguistic/source/spelldsp.cxx +++ b/linguistic/source/spelldsp.cxx @@ -779,7 +779,7 @@ void SpellCheckerDispatcher::SetServiceList( const Locale &rLocale, } else { - std::shared_ptr< LangSvcEntries_Spell > pTmpEntry( new LangSvcEntries_Spell( rSvcImplNames ) ); + auto pTmpEntry = std::make_shared( rSvcImplNames ); pTmpEntry->aSvcRefs = Sequence< Reference < XSpellChecker > >( nLen ); m_aSvcMap[ nLanguage ] = pTmpEntry; } diff --git a/linguistic/source/thesdsp.cxx b/linguistic/source/thesdsp.cxx index 968136898cc0..284673d641a7 100644 --- a/linguistic/source/thesdsp.cxx +++ b/linguistic/source/thesdsp.cxx @@ -212,7 +212,7 @@ void ThesaurusDispatcher::SetServiceList( const Locale &rLocale, } else { - std::shared_ptr< LangSvcEntries_Thes > pTmpEntry( new LangSvcEntries_Thes( rSvcImplNames ) ); + auto pTmpEntry = std::make_shared( rSvcImplNames ); pTmpEntry->aSvcRefs = Sequence< Reference < XThesaurus > >( nLen ); aSvcMap[ nLanguage ] = pTmpEntry; } diff --git a/oox/source/drawingml/diagram/constraintlistcontext.cxx b/oox/source/drawingml/diagram/constraintlistcontext.cxx index cc71c89b226a..42cefee41d28 100644 --- a/oox/source/drawingml/diagram/constraintlistcontext.cxx +++ b/oox/source/drawingml/diagram/constraintlistcontext.cxx @@ -49,7 +49,7 @@ ConstraintListContext::onCreateContext( ::sal_Int32 aElement, { case DGM_TOKEN( constr ): { - std::shared_ptr< ConstraintAtom > pNode( new ConstraintAtom(mpNode->getLayoutNode()) ); + auto pNode = std::make_shared(mpNode->getLayoutNode()); LayoutAtom::connect(mpNode, pNode); Constraint& rConstraint = pNode->getConstraint(); diff --git a/oox/source/drawingml/textbody.cxx b/oox/source/drawingml/textbody.cxx index ab1659d8ada9..219128c7f6e0 100644 --- a/oox/source/drawingml/textbody.cxx +++ b/oox/source/drawingml/textbody.cxx @@ -45,7 +45,7 @@ TextBody::TextBody( const TextBodyPtr& pBody ) TextParagraph& TextBody::addParagraph() { - std::shared_ptr< TextParagraph > xPara( new TextParagraph ); + auto xPara = std::make_shared(); maParagraphs.push_back( xPara ); return *xPara; } diff --git a/oox/source/drawingml/textbodycontext.cxx b/oox/source/drawingml/textbodycontext.cxx index 0f8c90ab4c89..d0f8769cc962 100644 --- a/oox/source/drawingml/textbodycontext.cxx +++ b/oox/source/drawingml/textbodycontext.cxx @@ -84,7 +84,7 @@ ContextHandlerRef TextParagraphContext::onCreateContext( sal_Int32 aElementToken } case A_TOKEN( fld ): // "CT_TextField" Text Field. { - std::shared_ptr< TextField > pField( new TextField ); + auto pField = std::make_shared(); mrParagraph.addRun( pField ); return new TextFieldContext( *this, rAttribs, *pField ); } diff --git a/oox/source/ppt/pptshapegroupcontext.cxx b/oox/source/ppt/pptshapegroupcontext.cxx index 251fff8ab78e..b445a3eec703 100644 --- a/oox/source/ppt/pptshapegroupcontext.cxx +++ b/oox/source/ppt/pptshapegroupcontext.cxx @@ -101,7 +101,7 @@ ContextHandlerRef PPTShapeGroupContext::onCreateContext( sal_Int32 aElementToken return new PPTShapeGroupContext( *this, mpSlidePersistPtr, meShapeLocation, mpGroupShapePtr, oox::drawingml::ShapePtr( new PPTShape( meShapeLocation, "com.sun.star.drawing.GroupShape" ) ) ); case PPT_TOKEN( sp ): // Shape { - std::shared_ptr pShape( new PPTShape( meShapeLocation, "com.sun.star.drawing.CustomShape" ) ); + auto pShape = std::make_shared( meShapeLocation, "com.sun.star.drawing.CustomShape" ); bool bUseBgFill = rAttribs.getBool(XML_useBgFill, false); pShape->setUseBgFill(bUseBgFill); if (bUseBgFill) diff --git a/oox/source/shape/ShapeContextHandler.cxx b/oox/source/shape/ShapeContextHandler.cxx index 23041d6cee48..acc8624af602 100644 --- a/oox/source/shape/ShapeContextHandler.cxx +++ b/oox/source/shape/ShapeContextHandler.cxx @@ -123,9 +123,8 @@ uno::Reference const & ShapeContextHandler::getWp *rFragmentHandler, xShape, pMasterShape, - ShapePtr( - new oox::drawingml::Shape( - "com.sun.star.drawing.CustomShape")))); + std::make_shared( + "com.sun.star.drawing.CustomShape"))); break; default: break; @@ -160,8 +159,7 @@ ShapeContextHandler::getGraphicShapeContext(::sal_Int32 Element ) { if (! mxGraphicShapeContext.is()) { - std::shared_ptr pFragmentHandler - (new ShapeFragmentHandler(*mxFilterBase, msRelationFragmentPath)); + auto pFragmentHandler = std::make_shared(*mxFilterBase, msRelationFragmentPath); ShapePtr pMasterShape; switch (Element & 0xffff) @@ -216,7 +214,7 @@ ShapeContextHandler::getDiagramShapeContext() { if (!mxDiagramShapeContext.is()) { - std::shared_ptr pFragmentHandler(new ShapeFragmentHandler(*mxFilterBase, msRelationFragmentPath)); + auto pFragmentHandler = std::make_shared(*mxFilterBase, msRelationFragmentPath); mpShape.reset(new Shape()); mxDiagramShapeContext.set(new DiagramGraphicDataContext(*pFragmentHandler, mpShape)); } diff --git a/oox/source/vml/vmlshapecontainer.cxx b/oox/source/vml/vmlshapecontainer.cxx index e8008a1f4638..71713d3e7120 100644 --- a/oox/source/vml/vmlshapecontainer.cxx +++ b/oox/source/vml/vmlshapecontainer.cxx @@ -61,7 +61,7 @@ ShapeContainer::~ShapeContainer() std::shared_ptr ShapeContainer::createShapeType() { - std::shared_ptr< ShapeType > xShape( new ShapeType( mrDrawing ) ); + auto xShape = std::make_shared( mrDrawing ); maTypes.push_back( xShape ); return xShape; } diff --git a/reportdesign/source/core/sdr/RptObject.cxx b/reportdesign/source/core/sdr/RptObject.cxx index 0c132a93be48..64399bd9117c 100644 --- a/reportdesign/source/core/sdr/RptObject.cxx +++ b/reportdesign/source/core/sdr/RptObject.cxx @@ -251,7 +251,7 @@ const TPropertyNamePair& getPropertyNameMap(sal_uInt16 _nObjectId) { static TPropertyNamePair s_aNameMap = [&]() { - std::shared_ptr aNoConverter(new AnyConverter); + auto aNoConverter = std::make_shared(); TPropertyNamePair tmp; tmp.emplace(PROPERTY_CONTROLBACKGROUND,TPropertyConverter(PROPERTY_BACKGROUNDCOLOR,aNoConverter)); tmp.emplace(PROPERTY_CONTROLBORDER,TPropertyConverter(PROPERTY_BORDER,aNoConverter)); @@ -265,7 +265,7 @@ const TPropertyNamePair& getPropertyNameMap(sal_uInt16 _nObjectId) { static TPropertyNamePair s_aNameMap = [&]() { - std::shared_ptr aNoConverter(new AnyConverter); + auto aNoConverter = std::make_shared(); TPropertyNamePair tmp; tmp.emplace(PROPERTY_CHARCOLOR,TPropertyConverter(PROPERTY_TEXTCOLOR,aNoConverter)); tmp.emplace(PROPERTY_CONTROLBACKGROUND,TPropertyConverter(PROPERTY_BACKGROUNDCOLOR,aNoConverter)); @@ -277,7 +277,7 @@ const TPropertyNamePair& getPropertyNameMap(sal_uInt16 _nObjectId) tmp.emplace(PROPERTY_CONTROLBORDER,TPropertyConverter(PROPERTY_BORDER,aNoConverter)); tmp.emplace(PROPERTY_CONTROLBORDERCOLOR,TPropertyConverter(PROPERTY_BORDERCOLOR,aNoConverter)); - std::shared_ptr aParaAdjust(new ParaAdjust); + auto aParaAdjust = std::make_shared(); tmp.emplace(PROPERTY_PARAADJUST,TPropertyConverter(PROPERTY_ALIGN,aParaAdjust)); return tmp; }(); @@ -287,7 +287,7 @@ const TPropertyNamePair& getPropertyNameMap(sal_uInt16 _nObjectId) { static TPropertyNamePair s_aNameMap = [&]() { - std::shared_ptr aNoConverter(new AnyConverter); + auto aNoConverter = std::make_shared(); TPropertyNamePair tmp; tmp.emplace(PROPERTY_CHARCOLOR,TPropertyConverter(PROPERTY_TEXTCOLOR,aNoConverter)); tmp.emplace(PROPERTY_CONTROLBACKGROUND,TPropertyConverter(PROPERTY_BACKGROUNDCOLOR,aNoConverter)); @@ -298,7 +298,7 @@ const TPropertyNamePair& getPropertyNameMap(sal_uInt16 _nObjectId) tmp.emplace(PROPERTY_CONTROLTEXTEMPHASISMARK,TPropertyConverter(PROPERTY_FONTEMPHASISMARK,aNoConverter)); tmp.emplace(PROPERTY_CONTROLBORDER,TPropertyConverter(PROPERTY_BORDER,aNoConverter)); tmp.emplace(PROPERTY_CONTROLBORDERCOLOR,TPropertyConverter(PROPERTY_BORDERCOLOR,aNoConverter)); - std::shared_ptr aParaAdjust(new ParaAdjust); + auto aParaAdjust = std::make_shared(); tmp.emplace(PROPERTY_PARAADJUST,TPropertyConverter(PROPERTY_ALIGN,aParaAdjust)); return tmp; }(); @@ -309,7 +309,7 @@ const TPropertyNamePair& getPropertyNameMap(sal_uInt16 _nObjectId) { static TPropertyNamePair s_aNameMap = [&]() { - std::shared_ptr aNoConverter(new AnyConverter); + auto aNoConverter = std::make_shared(); TPropertyNamePair tmp; tmp.emplace(OUString("FillColor"),TPropertyConverter(PROPERTY_CONTROLBACKGROUND,aNoConverter)); tmp.emplace(PROPERTY_PARAADJUST,TPropertyConverter(PROPERTY_ALIGN,aNoConverter)); diff --git a/reportdesign/source/ui/inspection/DataProviderHandler.cxx b/reportdesign/source/ui/inspection/DataProviderHandler.cxx index 90123eef170e..c6ed5b1836d9 100644 --- a/reportdesign/source/ui/inspection/DataProviderHandler.cxx +++ b/reportdesign/source/ui/inspection/DataProviderHandler.cxx @@ -146,7 +146,7 @@ void SAL_CALL DataProviderHandler::inspect(const uno::Reference< uno::XInterface m_xReportComponent.set( xNameCont->getByName("ReportComponent"), uno::UNO_QUERY ); if ( m_xDataProvider.is() ) { - std::shared_ptr aNoConverter(new AnyConverter); + auto aNoConverter = std::make_shared(); TPropertyNamePair aPropertyMediation; aPropertyMediation.emplace( PROPERTY_MASTERFIELDS, TPropertyConverter(PROPERTY_MASTERFIELDS,aNoConverter) ); aPropertyMediation.emplace( PROPERTY_DETAILFIELDS, TPropertyConverter(PROPERTY_DETAILFIELDS,aNoConverter) ); diff --git a/reportdesign/source/ui/misc/FunctionHelper.cxx b/reportdesign/source/ui/misc/FunctionHelper.cxx index 9002e4b8cfb1..f42e65cc204b 100644 --- a/reportdesign/source/ui/misc/FunctionHelper.cxx +++ b/reportdesign/source/ui/misc/FunctionHelper.cxx @@ -63,7 +63,7 @@ const formula::IFunctionCategory* FunctionManager::getCategory(sal_uInt32 _nPos) if ( _nPos >= m_aCategoryIndex.size() ) { uno::Reference< report::meta::XFunctionCategory> xCategory = m_xMgr->getCategory(_nPos); - std::shared_ptr< FunctionCategory > pCategory(new FunctionCategory(this,_nPos + 1,xCategory)); + auto pCategory = std::make_shared(this,_nPos + 1,xCategory); m_aCategoryIndex.push_back( m_aCategories.emplace(xCategory->getName(),pCategory).first ); } return m_aCategoryIndex[_nPos]->second.get(); diff --git a/reportdesign/source/ui/misc/UITools.cxx b/reportdesign/source/ui/misc/UITools.cxx index dd938af56233..1fe36c88effb 100644 --- a/reportdesign/source/ui/misc/UITools.cxx +++ b/reportdesign/source/ui/misc/UITools.cxx @@ -1077,7 +1077,7 @@ bool openDialogFormula_nothrow( OUString& _in_out_rFormula uno::Reference< report::meta::XFunctionManager> xMgr(xFactory->createInstanceWithContext("org.libreoffice.report.pentaho.SOFunctionManager",_xContext),uno::UNO_QUERY); if ( xMgr.is() ) { - std::shared_ptr< formula::IFunctionManager > pFormulaManager(new FunctionManager(xMgr) ); + auto pFormulaManager = std::make_shared(xMgr); ReportFormula aFormula( _in_out_rFormula ); LanguageTag aLangTag(LANGUAGE_SYSTEM); diff --git a/reportdesign/source/ui/report/ReportController.cxx b/reportdesign/source/ui/report/ReportController.cxx index 231898b54b4e..21f1a1021a9f 100644 --- a/reportdesign/source/ui/report/ReportController.cxx +++ b/reportdesign/source/ui/report/ReportController.cxx @@ -2953,7 +2953,7 @@ uno::Reference< sdbc::XRowSet > const & OReportController::getRowSet() xRowSetProp->setPropertyValue( PROPERTY_ACTIVECONNECTION, uno::makeAny( getConnection() ) ); xRowSetProp->setPropertyValue( PROPERTY_APPLYFILTER, uno::makeAny( true ) ); - std::shared_ptr aNoConverter(new AnyConverter); + auto aNoConverter = std::make_shared(); TPropertyNamePair aPropertyMediation; aPropertyMediation.emplace( PROPERTY_COMMAND, TPropertyConverter(PROPERTY_COMMAND,aNoConverter) ); aPropertyMediation.emplace( PROPERTY_COMMANDTYPE, TPropertyConverter(PROPERTY_COMMANDTYPE,aNoConverter) ); diff --git a/sax/source/tools/fastserializer.cxx b/sax/source/tools/fastserializer.cxx index cd07e7425c71..5a846cf516b7 100644 --- a/sax/source/tools/fastserializer.cxx +++ b/sax/source/tools/fastserializer.cxx @@ -478,13 +478,13 @@ namespace sax_fastparser { { if (rOrder.hasElements()) { - std::shared_ptr< ForMerge > pSort( new ForSort(nTag, rOrder) ); + auto pSort = std::make_shared(nTag, rOrder); maMarkStack.push( pSort ); maCachedOutputStream.setOutput( pSort ); } else { - std::shared_ptr< ForMerge > pMerge( new ForMerge(nTag) ); + auto pMerge = std::make_shared(nTag); maMarkStack.push( pMerge ); maCachedOutputStream.setOutput( pMerge ); } 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 ScPDFExportTest::exportToPDF(const uno::Reference& xModel, const ScRange& range) { // create temp file name - std::shared_ptr pTempFile(new utl::TempFile()); + auto pTempFile = std::make_shared(); 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 pFilter(new SfxFilter( + auto pFilter = std::make_shared( rFilter, OUString(), nFilterFlags, nClipboardID, rTypeName, OUString(), - rUserData, "private:factory/scalc")); - const_cast(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 pExportFilter(new SfxFilter( + auto pExportFilter = std::make_shared( rFilter, OUString(), nFormatType, nExportFormat, rTypeName, OUString(), - rUserData, "private:factory/scalc*" )); - const_cast(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 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 pTempFile(new utl::TempFile()); + auto pTempFile = std::make_shared(); 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 pExportFilter(new SfxFilter( + auto pExportFilter = std::make_shared( 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 pExportFilter(new SfxFilter( + auto pExportFilter = std::make_shared( rFilter, OUString(), nFormatType, nExportFormat, rTypeName, OUString(), - rUserData, "private:factory/scalc*" )); - const_cast(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 pFilter(new SfxFilter( + auto pFilter = std::make_shared( aFilterName, OUString(), getFileFormats()[0].nFormatType, SotClipboardFormatId::STARCALC_8, aFilterType, OUString(), - OUString(), "private:factory/scalc*" )); - const_cast(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 pPosSet( - new sc::ColumnBlockPositionSet(mpCxt->mrDoc)); + auto pPosSet = std::make_shared(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& rNewSharedRows ScDocument* pDoc = GetDoc(); if (!rNewSharedRows.empty() && !pDoc->IsDelayedFormulaGrouping()) { - std::shared_ptr pPosSet(new sc::ColumnBlockPositionSet(*pDoc)); + auto pPosSet = std::make_shared(*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 pPosSet(new sc::ColumnBlockPositionSet(*pDocument)); + auto pPosSet = std::make_shared(*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 pSet( - new sc::ColumnBlockPositionSet(*this)); + auto pSet = std::make_shared(*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 pColSet( new sc::ColumnSet( aRefCxt.maRegroupCols)); + auto pColSet = std::make_shared( 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 pPosSet(new sc::ColumnBlockPositionSet(*this)); + auto pPosSet = std::make_shared(*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 pPosSet(new sc::ColumnBlockPositionSet(*this)); + auto pPosSet = std::make_shared(*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 pGroupData(new ScDPGroupTableData(pData, pDoc)); + auto pGroupData = std::make_shared(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& pSource = pData->GetSourceTableData(); - shared_ptr pGroupData(new ScDPGroupTableData(pSource, pDoc)); + auto pGroupData = std::make_shared(pSource, pDoc); pDimData->WriteToData(*pGroupData); mpTableData = pGroupData; } else { // This is a source data. Create a group data based on it. - shared_ptr pGroupData(new ScDPGroupTableData(mpTableData, pDoc)); + auto pGroupData = std::make_shared(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 pNode( new MemberNode); + auto pNode = std::make_shared(); std::pair 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 pSet(new sc::ColumnBlockPositionSet(*pDocument)); + auto pSet = std::make_shared(*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( 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( 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 pURLTransformer(new ScURLTransformer(*mpDoc)); + auto pURLTransformer = std::make_shared(*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( *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( 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( 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( new XclEscherExGlobal( rRoot ) ), &rStrm ), + EscherEx( pParent ? pParent->mxGlobal : std::make_shared( 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 pURLTransformer(new ScURLTransformer(*mpDoc)); + auto pURLTransformer = std::make_shared(*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 DataProviderFactory::getDataProvider(ScDocument* p if (bInternal) { if (rDataProvider == "org.libreoffice.calc.csv") - return std::shared_ptr(new CSVDataProvider(pDoc, rDataSource)); + return std::make_shared(pDoc, rDataSource); else if (rDataProvider == "org.libreoffice.calc.html") - return std::shared_ptr(new HTMLDataProvider(pDoc, rDataSource)); + return std::make_shared(pDoc, rDataSource); else if (rDataProvider == "org.libreoffice.calc.xml") - return std::shared_ptr(new XMLDataProvider(pDoc, rDataSource)); + return std::make_shared(pDoc, rDataSource); else if (rDataProvider == "org.libreoffice.calc.sql") - return std::shared_ptr(new SQLDataProvider(pDoc, rDataSource)); + return std::make_shared(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 pDlg(pFact->CreateScStyleDlg(GetActiveDialogParent(), *pStyleSheet, true)); - std::shared_ptr pRequest(new SfxRequest(rReq)); + auto pRequest = std::make_shared(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 xRequest(new SfxRequest(rReq)); + auto xRequest = std::make_shared(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 xProgress(new ScSolverProgressDialog(m_xDialog.get())); + auto xProgress = std::make_shared(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 xDlg(new ScValidationDlg(pParentWin, &aArgSet, pTabViewShell)); + auto xDlg = std::make_shared(pParentWin, &aArgSet, pTabViewShell); ScValidationRegisteredDlg aRegisterThatDlgExists(pParentWin, xDlg); short nResult = xDlg->run(); if ( nResult == RET_OK ) { - const SfxItemSet* pOutSet = static_cast(xDlg.get())->GetOutputItemSet(); + const SfxItemSet* pOutSet = xDlg->GetOutputItemSet(); if ( pOutSet->GetItemState( FID_VALID_MODE, true, &pItem ) == SfxItemState::SET ) eMode = static_cast(static_cast(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 createEditEngine( ScDocShell* pDocSh, const S { ScDocument& rDoc = pDocSh->GetDocument(); - std::shared_ptr pEngine(new ScFieldEditEngine(&rDoc, rDoc.GetEditPool())); + auto pEngine = std::make_shared(&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 pProtectedBackground( new SvxBrushItem( aProtectedColor, ATTR_BACKGROUND ) ); + auto pProtectedBackground = std::make_shared( aProtectedColor, ATTR_BACKGROUND ); // iterate through the rows to show for (SCSIZE nArrY=1; nArrY+1 pOldSet(new SfxItemSet(pOldAttrs->GetItemSet())); + auto pOldSet = std::make_shared(pOldAttrs->GetItemSet()); std::shared_ptr 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 pRequest(new SfxRequest(rReq)); + auto pRequest = std::make_shared(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 pObj(new ScImportExport(GetViewData().GetDocument(), aCellPos)); + auto pObj = std::make_shared(GetViewData().GetDocument(), aCellPos); pObj->SetOverwriting( true ); - std::shared_ptr pStrBuffer(new OUString()); + auto pStrBuffer = std::make_shared(); tools::SvRef xStream; if ( aDataHelper.GetSotStorageStream( nFormatId, xStream ) && xStream.is() ) { @@ -341,7 +341,7 @@ bool ScViewFunc::PasteDataFormat( SotClipboardFormatId nFormatId, { vcl::Window* pParent = GetActiveWin(); - std::shared_ptr pStrm(new ScImportStringStream(*pStrBuffer)); + auto pStrm = std::make_shared(*pStrBuffer); ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); VclPtr pDlg( diff --git a/sd/qa/unit/filters-test.cxx b/sd/qa/unit/filters-test.cxx index 52fc6f9d7050..707f8c85110e 100644 --- a/sd/qa/unit/filters-test.cxx +++ b/sd/qa/unit/filters-test.cxx @@ -51,11 +51,11 @@ bool SdFiltersTest::load(const OUString &rFilter, const OUString &rURL, const OUString &rUserData, SfxFilterFlags nFilterFlags, SotClipboardFormatId nClipboardID, unsigned int nFilterVersion) { - std::shared_ptr pFilter(new SfxFilter( + auto pFilter = std::make_shared( rFilter, OUString(), nFilterFlags, nClipboardID, OUString(), OUString(), - rUserData, OUString() )); - const_cast(pFilter.get())->SetVersion(nFilterVersion); + rUserData, OUString() ); + pFilter->SetVersion(nFilterVersion); ::sd::DrawDocShellRef xDocShRef = new ::sd::DrawDocShell(SfxObjectCreateMode::EMBEDDED, false, DocumentType::Impress); SfxMedium* pSrcMed = new SfxMedium(rURL, StreamMode::STD_READ); diff --git a/sd/qa/unit/sdmodeltestbase.hxx b/sd/qa/unit/sdmodeltestbase.hxx index 8fef3182ee3e..bdb800953e01 100644 --- a/sd/qa/unit/sdmodeltestbase.hxx +++ b/sd/qa/unit/sdmodeltestbase.hxx @@ -207,15 +207,15 @@ protected: SotClipboardFormatId nExportFormat = SotClipboardFormatId::NONE; if (pFormat->nFormatType == ODG_FORMAT_TYPE) nExportFormat = SotClipboardFormatId::STARDRAW_8; - std::shared_ptr pExportFilter(new SfxFilter( + auto pExportFilter = std::make_shared( OUString::createFromAscii(pFormat->pFilterName), OUString(), pFormat->nFormatType, nExportFormat, OUString::createFromAscii(pFormat->pTypeName), OUString(), OUString::createFromAscii(pFormat->pUserData), - "private:factory/sdraw*" )); + "private:factory/sdraw*" ); - const_cast(pExportFilter.get())->SetVersion(SOFFICE_FILEFORMAT_CURRENT); + pExportFilter->SetVersion(SOFFICE_FILEFORMAT_CURRENT); aStoreMedium.SetFilter(pExportFilter); } else // Impress @@ -223,15 +223,15 @@ protected: SotClipboardFormatId nExportFormat = SotClipboardFormatId::NONE; if (pFormat->nFormatType == ODP_FORMAT_TYPE) nExportFormat = SotClipboardFormatId::STARIMPRESS_8; - std::shared_ptr pExportFilter(new SfxFilter( + auto pExportFilter = std::make_shared( OUString::createFromAscii(pFormat->pFilterName), OUString(), pFormat->nFormatType, nExportFormat, OUString::createFromAscii(pFormat->pTypeName), OUString(), OUString::createFromAscii(pFormat->pUserData), - "private:factory/simpress*" )); + "private:factory/simpress*" ); - const_cast(pExportFilter.get())->SetVersion(SOFFICE_FILEFORMAT_CURRENT); + pExportFilter->SetVersion(SOFFICE_FILEFORMAT_CURRENT); aStoreMedium.SetFilter(pExportFilter); } pShell->ConvertTo(aStoreMedium); @@ -247,14 +247,14 @@ protected: SotClipboardFormatId nExportFormat = SotClipboardFormatId::NONE; if (pFormat->nFormatType == ODG_FORMAT_TYPE) nExportFormat = SotClipboardFormatId::STARDRAW_8; - std::shared_ptr pExportFilter(new SfxFilter( + auto pExportFilter = std::make_shared( OUString::createFromAscii(pFormat->pFilterName), OUString(), pFormat->nFormatType, nExportFormat, OUString::createFromAscii(pFormat->pTypeName), OUString(), OUString::createFromAscii(pFormat->pUserData), - "private:factory/sdraw*" )); - const_cast(pExportFilter.get())->SetVersion(SOFFICE_FILEFORMAT_CURRENT); + "private:factory/sdraw*" ); + pExportFilter->SetVersion(SOFFICE_FILEFORMAT_CURRENT); aStoreMedium.SetFilter(pExportFilter); } else // Impress @@ -262,14 +262,14 @@ protected: SotClipboardFormatId nExportFormat = SotClipboardFormatId::NONE; if (pFormat->nFormatType == ODP_FORMAT_TYPE) nExportFormat = SotClipboardFormatId::STARCHART_8; - std::shared_ptr pExportFilter(new SfxFilter( + auto pExportFilter = std::make_shared( OUString::createFromAscii(pFormat->pFilterName), OUString(), pFormat->nFormatType, nExportFormat, OUString::createFromAscii(pFormat->pTypeName), OUString(), OUString::createFromAscii(pFormat->pUserData), - "private:factory/simpress*" )); - const_cast(pExportFilter.get())->SetVersion(SOFFICE_FILEFORMAT_CURRENT); + "private:factory/simpress*" ); + pExportFilter->SetVersion(SOFFICE_FILEFORMAT_CURRENT); aStoreMedium.SetFilter(pExportFilter); } pShell->DoSaveAs(aStoreMedium); diff --git a/sd/source/ui/animations/CustomAnimationPane.cxx b/sd/source/ui/animations/CustomAnimationPane.cxx index f4de034d7877..32c8a3e1d1df 100644 --- a/sd/source/ui/animations/CustomAnimationPane.cxx +++ b/sd/source/ui/animations/CustomAnimationPane.cxx @@ -1636,7 +1636,7 @@ void CustomAnimationPane::showOptions(const OString& rPage) { std::unique_ptr xSet = createSelectionSet(); - std::shared_ptr xDlg(new CustomAnimationDialog(GetFrameWeld(), std::move(xSet), rPage)); + auto xDlg = std::make_shared(GetFrameWeld(), std::move(xSet), rPage); weld::DialogController::runAsync(xDlg, [xDlg, this](sal_Int32 nResult){ if (nResult ) diff --git a/sd/source/ui/framework/factories/BasicViewFactory.cxx b/sd/source/ui/framework/factories/BasicViewFactory.cxx index 6cd3de93bfa7..a60238eb9273 100644 --- a/sd/source/ui/framework/factories/BasicViewFactory.cxx +++ b/sd/source/ui/framework/factories/BasicViewFactory.cxx @@ -275,7 +275,7 @@ std::shared_ptr BasicViewFactory::CreateView ( FrameView* pFrameView, const bool bIsCenterPane) { - std::shared_ptr pDescriptor (new ViewDescriptor); + auto pDescriptor = std::make_shared(); pDescriptor->mpViewShell = CreateViewShell( rxViewId, diff --git a/sd/source/ui/func/futransf.cxx b/sd/source/ui/func/futransf.cxx index 96a805040cb9..4984c675ec4c 100644 --- a/sd/source/ui/func/futransf.cxx +++ b/sd/source/ui/func/futransf.cxx @@ -109,7 +109,7 @@ void FuTransform::DoExecute( SfxRequest& rReq ) if (!pDlg) return; - std::shared_ptr pRequest(new SfxRequest(rReq)); + auto pRequest = std::make_shared(rReq); rReq.Ignore(); // the 'old' request is not relevant any more pDlg->StartExecuteAsync([bWelded, pDlg, pRequest, this](sal_Int32 nResult){ diff --git a/sd/source/ui/presenter/PresenterPreviewCache.cxx b/sd/source/ui/presenter/PresenterPreviewCache.cxx index 42617e9bd133..b62794a7e929 100644 --- a/sd/source/ui/presenter/PresenterPreviewCache.cxx +++ b/sd/source/ui/presenter/PresenterPreviewCache.cxx @@ -277,7 +277,7 @@ const SdrPage* PresenterPreviewCache::PresenterCacheContext::GetPage (CacheKey a std::shared_ptr > PresenterPreviewCache::PresenterCacheContext::GetEntryList (bool bVisible) { - std::shared_ptr > pKeys (new std::vector); + auto pKeys = std::make_shared>(); if ( ! mxSlides.is()) return pKeys; diff --git a/sd/source/ui/remotecontrol/Server.cxx b/sd/source/ui/remotecontrol/Server.cxx index bf5d0fdc5392..1828b72960b5 100644 --- a/sd/source/ui/remotecontrol/Server.cxx +++ b/sd/source/ui/remotecontrol/Server.cxx @@ -128,10 +128,10 @@ void RemoteServer::execute() pSocket->getPeerAddr( aClientAddr ); MutexGuard aGuard( sDataMutex ); - std::shared_ptr< ClientInfoInternal > pClient( - new ClientInfoInternal( + std::shared_ptr< ClientInfoInternal > pClient = + std::make_shared( OStringToOUString( aName, RTL_TEXTENCODING_UTF8 ), - pSocket, OStringToOUString( aPin, RTL_TEXTENCODING_UTF8 ) ) ); + pSocket, OStringToOUString( aPin, RTL_TEXTENCODING_UTF8 ) ); mAvailableClients.push_back( pClient ); // Read off any additional non-empty lines diff --git a/sd/source/ui/sidebar/AllMasterPagesSelector.cxx b/sd/source/ui/sidebar/AllMasterPagesSelector.cxx index 1020cde8a4e8..725cc61a6dad 100644 --- a/sd/source/ui/sidebar/AllMasterPagesSelector.cxx +++ b/sd/source/ui/sidebar/AllMasterPagesSelector.cxx @@ -83,7 +83,7 @@ VclPtr AllMasterPagesSelector::Create ( if (pDocument == nullptr) return nullptr; - std::shared_ptr pContainer (new MasterPageContainer()); + auto pContainer = std::make_shared(); VclPtrInstance pSelector( pParent, diff --git a/sd/source/ui/sidebar/CurrentMasterPagesSelector.cxx b/sd/source/ui/sidebar/CurrentMasterPagesSelector.cxx index 835a4532a294..013f84516ebe 100644 --- a/sd/source/ui/sidebar/CurrentMasterPagesSelector.cxx +++ b/sd/source/ui/sidebar/CurrentMasterPagesSelector.cxx @@ -46,7 +46,7 @@ VclPtr CurrentMasterPagesSelector::Create ( if (pDocument == nullptr) return nullptr; - std::shared_ptr pContainer (new MasterPageContainer()); + auto pContainer = std::make_shared(); VclPtrInstance pSelector( pParent, @@ -137,8 +137,8 @@ void CurrentMasterPagesSelector::Fill (ItemList& rItemList) pMasterPage->GetName(), OUString(), pMasterPage->IsPrecious(), - std::shared_ptr(new ExistingPageProvider(pMasterPage)), - std::shared_ptr(new PagePreviewProvider()))); + std::make_shared(pMasterPage), + std::make_shared())); aToken = mpContainer->PutMasterPage(pDescriptor); } diff --git a/sd/source/ui/sidebar/MasterPageContainer.cxx b/sd/source/ui/sidebar/MasterPageContainer.cxx index 18ad57d14a3c..95f68f316ca6 100644 --- a/sd/source/ui/sidebar/MasterPageContainer.cxx +++ b/sd/source/ui/sidebar/MasterPageContainer.cxx @@ -521,7 +521,7 @@ void MasterPageContainer::Implementation::LateInit() std::shared_ptr(Instance()))); mpFillerTask = ::sd::tools::TimerBasedTaskExecution::Create( - std::shared_ptr(new MasterPageContainerFiller(*this)), + std::make_shared(*this), 5, 50); diff --git a/sd/source/ui/sidebar/MasterPageContainerFiller.cxx b/sd/source/ui/sidebar/MasterPageContainerFiller.cxx index d007e524f969..5dc90ac29491 100644 --- a/sd/source/ui/sidebar/MasterPageContainerFiller.cxx +++ b/sd/source/ui/sidebar/MasterPageContainerFiller.cxx @@ -46,8 +46,8 @@ MasterPageContainerFiller::MasterPageContainerFiller (ContainerAdapter& rpAdapte OUString(), OUString(), false, - std::shared_ptr(new DefaultPageObjectProvider()), - std::shared_ptr(new PagePreviewProvider()))); + std::make_shared(), + std::make_shared())); mrContainerAdapter.PutMasterPage(pDescriptor); } @@ -147,18 +147,15 @@ MasterPageContainerFiller::State MasterPageContainerFiller::AddTemplate() mpLastAddedEntry->msTitle, OUString(), false, - std::shared_ptr( - new TemplatePageObjectProvider(mpLastAddedEntry->msPath)), - std::shared_ptr( - new TemplatePreviewProvider(mpLastAddedEntry->msPath)))); + std::make_shared(mpLastAddedEntry->msPath), + std::make_shared(mpLastAddedEntry->msPath))); // For user supplied templates we use a different preview provider: // The preview in the document shows not only shapes on the master // page but also shapes on the foreground. This is misleading and // therefore these previews are discarded and created directly from // the page objects. if (pDescriptor->GetURLClassification() == MasterPageDescriptor::URLCLASS_USER) - pDescriptor->mpPreviewProvider = std::shared_ptr( - new PagePreviewProvider()); + pDescriptor->mpPreviewProvider = std::make_shared(); mrContainerAdapter.PutMasterPage(pDescriptor); ++mnIndex; diff --git a/sd/source/ui/sidebar/MasterPageDescriptor.cxx b/sd/source/ui/sidebar/MasterPageDescriptor.cxx index 0f9d21a81c2c..2d77511f067e 100644 --- a/sd/source/ui/sidebar/MasterPageDescriptor.cxx +++ b/sd/source/ui/sidebar/MasterPageDescriptor.cxx @@ -176,7 +176,7 @@ int MasterPageDescriptor::UpdatePageObject ( // will create the real one. maSmallPreview = Image(); maLargePreview = Image(); - mpPreviewProvider = std::shared_ptr(new PagePreviewProvider()); + mpPreviewProvider = std::make_shared(); } else { diff --git a/sd/source/ui/sidebar/RecentMasterPagesSelector.cxx b/sd/source/ui/sidebar/RecentMasterPagesSelector.cxx index 4e846dad20aa..7a2568375f99 100644 --- a/sd/source/ui/sidebar/RecentMasterPagesSelector.cxx +++ b/sd/source/ui/sidebar/RecentMasterPagesSelector.cxx @@ -37,7 +37,7 @@ VclPtr RecentMasterPagesSelector::Create ( if (pDocument == nullptr) return nullptr; - std::shared_ptr pContainer (new MasterPageContainer()); + auto pContainer = std::make_shared(); VclPtrInstance pSelector( pParent, diff --git a/sd/source/ui/sidebar/RecentlyUsedMasterPages.cxx b/sd/source/ui/sidebar/RecentlyUsedMasterPages.cxx index c6f0b02b07a4..d1f4ab532d82 100644 --- a/sd/source/ui/sidebar/RecentlyUsedMasterPages.cxx +++ b/sd/source/ui/sidebar/RecentlyUsedMasterPages.cxx @@ -144,10 +144,8 @@ void RecentlyUsedMasterPages::LoadPersistentValues() OUString(), sName, false, - std::shared_ptr( - new TemplatePageObjectProvider(sURL)), - std::shared_ptr( - new TemplatePreviewProvider(sURL)))); + std::make_shared(sURL), + std::make_shared(sURL))); // For user supplied templates we use a different // preview provider: The preview in the document shows // not only shapes on the master page but also shapes on @@ -155,8 +153,7 @@ void RecentlyUsedMasterPages::LoadPersistentValues() // these previews are discarded and created directly // from the page objects. if (pDescriptor->GetURLClassification() == MasterPageDescriptor::URLCLASS_USER) - pDescriptor->mpPreviewProvider = std::shared_ptr( - new PagePreviewProvider()); + pDescriptor->mpPreviewProvider = std::make_shared(); MasterPageContainer::Token aToken (mpContainer->PutMasterPage(pDescriptor)); mvMasterPages.emplace_back(aToken,sURL,sName); } diff --git a/sd/source/ui/slidesorter/cache/SlsBitmapCompressor.cxx b/sd/source/ui/slidesorter/cache/SlsBitmapCompressor.cxx index d276384985c9..a117b33e0ecc 100644 --- a/sd/source/ui/slidesorter/cache/SlsBitmapCompressor.cxx +++ b/sd/source/ui/slidesorter/cache/SlsBitmapCompressor.cxx @@ -44,7 +44,7 @@ public: std::shared_ptr NoBitmapCompression::Compress (const BitmapEx& rBitmap) const { - return std::shared_ptr(new DummyReplacement(rBitmap)); + return std::make_shared(rBitmap); } BitmapEx NoBitmapCompression::Decompress (const BitmapReplacement& rBitmapData) const diff --git a/sd/source/ui/slidesorter/controller/SlsAnimator.cxx b/sd/source/ui/slidesorter/controller/SlsAnimator.cxx index d6ed54ad5d33..ce7d0533085e 100644 --- a/sd/source/ui/slidesorter/controller/SlsAnimator.cxx +++ b/sd/source/ui/slidesorter/controller/SlsAnimator.cxx @@ -104,14 +104,14 @@ Animator::AnimationId Animator::AddAnimation ( if (mbIsDisposed) return -1; - std::shared_ptr pAnimation ( - new Animation( + std::shared_ptr pAnimation = + std::make_shared( rAnimation, 0, 300 / 1000.0, maElapsedTime.getElapsedTime(), ++mnNextAnimationId, - rFinishFunctor)); + rFinishFunctor); maAnimations.push_back(pAnimation); RequestNextFrame(); diff --git a/sd/source/ui/slidesorter/controller/SlsClipboard.cxx b/sd/source/ui/slidesorter/controller/SlsClipboard.cxx index 94a17a4dd903..133be4020ec7 100644 --- a/sd/source/ui/slidesorter/controller/SlsClipboard.cxx +++ b/sd/source/ui/slidesorter/controller/SlsClipboard.cxx @@ -539,10 +539,10 @@ std::shared_ptr Clipboard::CreateTransferableUserData rOtherClipboard.maPagesToRemove.push_back(pDescriptor->GetPage()); // Create the new transferable. - std::shared_ptr pNewTransferable ( - new TransferableData( + std::shared_ptr pNewTransferable = + std::make_shared( pSlideSorterViewShell, - aRepresentatives)); + aRepresentatives); pTransferable->SetWorkDocument(pTreeListBoxTransferable->GetSourceDoc()->AllocSdDrawDocument()); // pTransferable->SetView(&mrSlideSorter.GetView()); diff --git a/sd/source/ui/slidesorter/controller/SlsPageSelector.cxx b/sd/source/ui/slidesorter/controller/SlsPageSelector.cxx index f169c205f810..26498f913979 100644 --- a/sd/source/ui/slidesorter/controller/SlsPageSelector.cxx +++ b/sd/source/ui/slidesorter/controller/SlsPageSelector.cxx @@ -263,7 +263,7 @@ void PageSelector::DisableBroadcasting() std::shared_ptr PageSelector::GetPageSelection() const { - std::shared_ptr pSelection (new PageSelection); + auto pSelection = std::make_shared(); pSelection->reserve(GetSelectedPageCount()); int nPageCount = GetPageCount(); diff --git a/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx b/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx index d54b09a91a90..162053697bf5 100644 --- a/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx +++ b/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx @@ -655,8 +655,7 @@ static bool Match ( void SelectionFunction::SwitchToNormalMode() { if (mpModeHandler->GetMode() != NormalMode) - SwitchMode(std::shared_ptr( - new NormalModeHandler(mrSlideSorter, *this))); + SwitchMode(std::make_shared(mrSlideSorter, *this)); } void SelectionFunction::SwitchToDragAndDropMode (const Point& rMousePosition) @@ -664,8 +663,7 @@ void SelectionFunction::SwitchToDragAndDropMode (const Point& rMousePosition) if (mpModeHandler->GetMode() == DragAndDropMode) return; - SwitchMode(std::shared_ptr( - new DragAndDropModeHandler(mrSlideSorter, *this, rMousePosition, mpWindow))); + SwitchMode(std::make_shared(mrSlideSorter, *this, rMousePosition, mpWindow)); } void SelectionFunction::SwitchToMultiSelectionMode ( @@ -673,8 +671,7 @@ void SelectionFunction::SwitchToMultiSelectionMode ( const sal_uInt32 nEventCode) { if (mpModeHandler->GetMode() != MultiSelectionMode) - SwitchMode(std::shared_ptr( - new MultiSelectionModeHandler(mrSlideSorter, *this, rMousePosition, nEventCode))); + SwitchMode(std::make_shared(mrSlideSorter, *this, rMousePosition, nEventCode)); } void SelectionFunction::SwitchMode (const std::shared_ptr& rpHandler) diff --git a/sd/source/ui/slidesorter/controller/SlsTransferableData.cxx b/sd/source/ui/slidesorter/controller/SlsTransferableData.cxx index 5017cf9b5bec..14762979466f 100644 --- a/sd/source/ui/slidesorter/controller/SlsTransferableData.cxx +++ b/sd/source/ui/slidesorter/controller/SlsTransferableData.cxx @@ -29,7 +29,7 @@ SdTransferable* TransferableData::CreateTransferable ( const ::std::vector& rRepresentatives) { SdTransferable* pTransferable = new SdTransferable (pSrcDoc, nullptr, false/*bInitOnGetData*/); - std::shared_ptr pData (new TransferableData(pViewShell, rRepresentatives)); + auto pData = std::make_shared(pViewShell, rRepresentatives); pTransferable->AddUserData(pData); return pTransferable; } diff --git a/sd/source/ui/slidesorter/view/SlsViewCacheContext.cxx b/sd/source/ui/slidesorter/view/SlsViewCacheContext.cxx index 0202b4d8b798..578a611a8f2c 100644 --- a/sd/source/ui/slidesorter/view/SlsViewCacheContext.cxx +++ b/sd/source/ui/slidesorter/view/SlsViewCacheContext.cxx @@ -77,7 +77,7 @@ const SdrPage* ViewCacheContext::GetPage (cache::CacheKey aKey) std::shared_ptr > ViewCacheContext::GetEntryList (bool bVisible) { - std::shared_ptr > pKeys (new std::vector); + auto pKeys = std::make_shared>(); model::PageEnumeration aPageEnumeration ( bVisible diff --git a/sd/source/ui/view/DocumentRenderer.cxx b/sd/source/ui/view/DocumentRenderer.cxx index 17e225e7c1c8..b649c4c22484 100644 --- a/sd/source/ui/view/DocumentRenderer.cxx +++ b/sd/source/ui/view/DocumentRenderer.cxx @@ -1745,15 +1745,14 @@ private: if ( CheckForFrontBackPages( nIndex ) ) { maPrinterPages.push_back( - std::shared_ptr( - new OutlinerPrinterPage( + std::make_shared( pOutliner->CreateParaObject(), aMap, rInfo.msTimeDate, aPageOfs, rInfo.mnDrawMode, rInfo.meOrientation, - rInfo.mpPrinter->GetPaperBin()))); + rInfo.mpPrinter->GetPaperBin())); } } @@ -1863,8 +1862,7 @@ private: && (aPageIndices.size() == nShapeCount || bLastLoop) ) { maPrinterPages.push_back( - std::shared_ptr( - new HandoutPrinterPage( + std::make_shared( nPrinterPageIndex++, aPageIndices, aMap, @@ -1872,7 +1870,7 @@ private: aPageOfs, rInfo.mnDrawMode, rInfo.meOrientation, - nPaperBin))); + nPaperBin)); aPageIndices.clear(); } } @@ -2090,8 +2088,7 @@ private: else aSecondOffset.AdjustY( aAdjustedPrintSize.Height() / 2 ); maPrinterPages.push_back( - std::shared_ptr( - new BookletPrinterPage( + std::make_shared( aPair.first, aPair.second, aOffset, @@ -2101,7 +2098,7 @@ private: rInfo.mbPrintMarkedOnly, rInfo.mnDrawMode, rInfo.meOrientation, - rInfo.mpPrinter->GetPaperBin()))); + rInfo.mpPrinter->GetPaperBin())); } } @@ -2126,8 +2123,7 @@ private: return; maPrinterPages.push_back( - std::shared_ptr( - new TiledPrinterPage( + std::make_shared( sal::static_int_cast(nPageIndex), ePageKind, rInfo.mbPrintMarkedOnly, @@ -2135,7 +2131,7 @@ private: rInfo.mpPrinter->GetPageOffset(), rInfo.mnDrawMode, rInfo.meOrientation, - nPaperBin))); + nPaperBin)); } /** Print one standard slide or notes page on one to many printer @@ -2173,8 +2169,7 @@ private: // if CutPage is set then do not move it, otherwise move the // scaled page to printable area maPrinterPages.push_back( - std::shared_ptr( - new RegularPrinterPage( + std::make_shared( sal::static_int_cast(nPageIndex), ePageKind, aMap, @@ -2183,7 +2178,7 @@ private: aPageOffset, rInfo.mnDrawMode, rInfo.meOrientation, - nPaperBin))); + nPaperBin)); } else { @@ -2211,8 +2206,7 @@ private: { aMap.SetOrigin(aPageOrigin); maPrinterPages.push_back( - std::shared_ptr( - new RegularPrinterPage( + std::make_shared( sal::static_int_cast(nPageIndex), ePageKind, aMap, @@ -2221,7 +2215,7 @@ private: aPageOffset, rInfo.mnDrawMode, rInfo.meOrientation, - nPaperBin))); + nPaperBin)); } } } diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx index 6970fe0aeb28..248092c06416 100644 --- a/sd/source/ui/view/drviews2.cxx +++ b/sd/source/ui/view/drviews2.cxx @@ -1608,7 +1608,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) case SID_CLASSIFICATION_DIALOG: { - std::shared_ptr xDialog(new svx::ClassificationDialog(GetFrameWeld(), false, [](){} )); + auto xDialog = std::make_shared(GetFrameWeld(), false, [](){} ); ClassificationCollector aCollector(*this); aCollector.collect(); diff --git a/sd/source/ui/view/drviews3.cxx b/sd/source/ui/view/drviews3.cxx index c5e1450f70e2..6f1607aefc10 100644 --- a/sd/source/ui/view/drviews3.cxx +++ b/sd/source/ui/view/drviews3.cxx @@ -294,7 +294,7 @@ void DrawViewShell::ExecCtrl(SfxRequest& rReq) SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create(); vcl::Window* pWin = GetActiveWindow(); VclPtr pDlg(pFact->CreateHeaderFooterDialog(this, pWin ? pWin->GetFrameWeld() : nullptr, GetDoc(), mpActualPage)); - std::shared_ptr xRequest(new SfxRequest(rReq)); + auto xRequest = std::make_shared(rReq); rReq.Ignore(); // the 'old' request is not relevant any more pDlg->StartExecuteAsync([this, pDlg, xRequest](sal_Int32 /*nResult*/){ GetActiveWindow()->Invalidate(); diff --git a/sdext/source/pdfimport/pdfiadaptor.cxx b/sdext/source/pdfimport/pdfiadaptor.cxx index 4d12474f0edf..a496736dca78 100644 --- a/sdext/source/pdfimport/pdfiadaptor.cxx +++ b/sdext/source/pdfimport/pdfiadaptor.cxx @@ -227,8 +227,7 @@ bool PDFIRawAdaptor::parse( const uno::Reference& xInput const OUString& rFilterOptions ) { // container for metaformat - std::shared_ptr pSink( - new PDFIProcessor(xStatus, m_xContext)); + auto pSink = std::make_shared(xStatus, m_xContext); bool bSuccess=false; diff --git a/sdext/source/pdfimport/test/tests.cxx b/sdext/source/pdfimport/test/tests.cxx index 0cf64eeec424..128352ad2e72 100644 --- a/sdext/source/pdfimport/test/tests.cxx +++ b/sdext/source/pdfimport/test/tests.cxx @@ -450,7 +450,7 @@ namespace void testXPDFParser() { #if HAVE_FEATURE_POPPLER - std::shared_ptr pSink( new TestSink() ); + auto pSink = std::make_shared(); CPPUNIT_ASSERT( pdfi::xpdf_ImportFromFile( m_directories.getURLFromSrc("/sdext/source/pdfimport/test/testinput.pdf"), diff --git a/sdext/source/pdfimport/tree/treevisitorfactory.cxx b/sdext/source/pdfimport/tree/treevisitorfactory.cxx index a9cf73cc2aa8..6131014e92bd 100644 --- a/sdext/source/pdfimport/tree/treevisitorfactory.cxx +++ b/sdext/source/pdfimport/tree/treevisitorfactory.cxx @@ -32,19 +32,19 @@ namespace pdfi virtual std::shared_ptr createOptimizingVisitor(PDFIProcessor& rProc) const override { - return std::shared_ptr(new WriterXmlOptimizer(rProc)); + return std::make_shared(rProc); } virtual std::shared_ptr createStyleCollectingVisitor( StyleContainer& rStyles, PDFIProcessor& rProc ) const override { - return std::shared_ptr(new WriterXmlFinalizer(rStyles,rProc)); + return std::make_shared(rStyles,rProc); } virtual std::shared_ptr createEmittingVisitor(EmitContext& rEmitContext) const override { - return std::shared_ptr(new WriterXmlEmitter(rEmitContext)); + return std::make_shared(rEmitContext); } }; @@ -54,21 +54,19 @@ namespace pdfi virtual std::shared_ptr createOptimizingVisitor(PDFIProcessor& rProc) const override { - return std::shared_ptr(new DrawXmlOptimizer(rProc)); + return std::make_shared(rProc); } virtual std::shared_ptr createStyleCollectingVisitor( StyleContainer& rStyles, PDFIProcessor& rProc ) const override { - return std::shared_ptr(new DrawXmlFinalizer(rStyles,rProc)); + return std::make_shared(rStyles,rProc); } virtual std::shared_ptr createEmittingVisitor(EmitContext& rEmitContext) const override { - return std::shared_ptr(new DrawXmlEmitter(rEmitContext, - DrawXmlEmitter::IMPRESS_DOC - )); + return std::make_shared(rEmitContext, DrawXmlEmitter::IMPRESS_DOC); } }; @@ -78,21 +76,19 @@ namespace pdfi virtual std::shared_ptr createOptimizingVisitor(PDFIProcessor& rProc) const override { - return std::shared_ptr(new DrawXmlOptimizer(rProc)); + return std::make_shared(rProc); } virtual std::shared_ptr createStyleCollectingVisitor( StyleContainer& rStyles, PDFIProcessor& rProc ) const override { - return std::shared_ptr(new DrawXmlFinalizer(rStyles,rProc)); + return std::make_shared(rStyles,rProc); } virtual std::shared_ptr createEmittingVisitor(EmitContext& rEmitContext) const override { - return std::shared_ptr(new DrawXmlEmitter(rEmitContext, - DrawXmlEmitter::DRAW_DOC - )); + return std::make_shared(rEmitContext, DrawXmlEmitter::DRAW_DOC); } }; diff --git a/sdext/source/presenter/PresenterPaneBorderPainter.cxx b/sdext/source/presenter/PresenterPaneBorderPainter.cxx index e8ff0a50958d..d729ee06bae5 100644 --- a/sdext/source/presenter/PresenterPaneBorderPainter.cxx +++ b/sdext/source/presenter/PresenterPaneBorderPainter.cxx @@ -563,8 +563,7 @@ std::shared_ptr sPaneStyleName = sStyleName; // Create a new pane style object and initialize it with bitmaps. - std::shared_ptr pStyle ( - new RendererPaneStyle(mpTheme,sPaneStyleName)); + auto pStyle = std::make_shared(mpTheme,sPaneStyleName); iStyle = maRendererPaneStyles.emplace(rsResourceURL, pStyle).first; } if (iStyle != maRendererPaneStyles.end()) diff --git a/sdext/source/presenter/PresenterTheme.cxx b/sdext/source/presenter/PresenterTheme.cxx index cd82d1dcd90d..6c512fce61a8 100644 --- a/sdext/source/presenter/PresenterTheme.cxx +++ b/sdext/source/presenter/PresenterTheme.cxx @@ -339,11 +339,10 @@ std::shared_ptr PresenterTheme::GetNodeForViewStyl return std::shared_ptr(); // Open configuration for writing. - std::shared_ptr pConfiguration ( - new PresenterConfigurationAccess( + auto pConfiguration = std::make_shared( mxContext, "/org.openoffice.Office.PresenterScreen/", - PresenterConfigurationAccess::READ_WRITE)); + PresenterConfigurationAccess::READ_WRITE); // Get configuration node for the view style container of the current // theme. @@ -700,8 +699,7 @@ PresenterTheme::SharedFontDescriptor ReadContext::ReadFont ( const Reference& rxProperties, const PresenterTheme::SharedFontDescriptor& rpDefault) { - std::shared_ptr pDescriptor ( - new PresenterTheme::FontDescriptor(rpDefault)); + auto pDescriptor = std::make_shared(rpDefault); PresenterConfigurationAccess::GetProperty(rxProperties, "FamilyName") >>= pDescriptor->msFamilyName; PresenterConfigurationAccess::GetProperty(rxProperties, "Style") >>= pDescriptor->msStyleName; @@ -831,7 +829,7 @@ void PaneStyleContainer::ProcessPaneStyle( if (rValues.size() != 6) return; - std::shared_ptr pStyle (new PaneStyle()); + auto pStyle = std::make_shared(); rValues[0] >>= pStyle->msStyleName; @@ -946,7 +944,7 @@ void ViewStyleContainer::ProcessViewStyle( ReadContext const & rReadContext, const Reference& rxProperties) { - std::shared_ptr pStyle (new ViewStyle()); + auto pStyle = std::make_shared(); PresenterConfigurationAccess::GetProperty(rxProperties, "StyleName") >>= pStyle->msStyleName; diff --git a/sfx2/source/doc/objcont.cxx b/sfx2/source/doc/objcont.cxx index f5675528a956..4adfe5986c70 100644 --- a/sfx2/source/doc/objcont.cxx +++ b/sfx2/source/doc/objcont.cxx @@ -130,7 +130,7 @@ SfxObjectShell::CreatePreviewMetaFile_Impl( bool bFullContent ) const pFrame->GetViewShell()->GetPrinter()->IsPrinting() ) return std::shared_ptr(); - std::shared_ptr xFile(new GDIMetaFile); + auto xFile = std::make_shared(); ScopedVclPtrInstance< VirtualDevice > pDevice; pDevice->EnableOutput( false ); diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx index 85a708de3290..3d531a91ce90 100644 --- a/sfx2/source/doc/sfxbasemodel.cxx +++ b/sfx2/source/doc/sfxbasemodel.cxx @@ -3760,7 +3760,7 @@ void SAL_CALL SfxBaseModel::storeToStorage( const Reference< embed::XStorage >& if ( !m_pData->m_pObjectShell.is() ) throw io::IOException(); // TODO: - std::shared_ptr xSet( new SfxAllItemSet(m_pData->m_pObjectShell->GetPool()) ); + auto xSet = std::make_shared(m_pData->m_pObjectShell->GetPool()); TransformParameters( SID_SAVEASDOC, aMediaDescriptor, *xSet ); // TODO/LATER: maybe a special URL "private:storage" should be used diff --git a/slideshow/source/engine/expressionnodefactory.cxx b/slideshow/source/engine/expressionnodefactory.cxx index 74cfd96f8406..f82e09ac2f7e 100644 --- a/slideshow/source/engine/expressionnodefactory.cxx +++ b/slideshow/source/engine/expressionnodefactory.cxx @@ -192,48 +192,48 @@ namespace slideshow std::shared_ptr ExpressionNodeFactory::createConstantValueExpression( double rConstantValue ) { - return std::shared_ptr( new ConstantValueExpression(rConstantValue) ); + return std::make_shared(rConstantValue); } std::shared_ptr ExpressionNodeFactory::createValueTExpression() { - return std::shared_ptr( new TValueExpression() ); + return std::make_shared(); } std::shared_ptr ExpressionNodeFactory::createPlusExpression( const std::shared_ptr& rLHS, const std::shared_ptr& rRHS ) { - return std::shared_ptr( new PlusExpression(rLHS, rRHS) ); + return std::make_shared(rLHS, rRHS); } std::shared_ptr ExpressionNodeFactory::createMinusExpression( const std::shared_ptr& rLHS, const std::shared_ptr& rRHS ) { - return std::shared_ptr( new MinusExpression(rLHS, rRHS) ); + return std::make_shared(rLHS, rRHS); } std::shared_ptr ExpressionNodeFactory::createMultipliesExpression( const std::shared_ptr& rLHS, const std::shared_ptr& rRHS ) { - return std::shared_ptr( new MultipliesExpression(rLHS, rRHS) ); + return std::make_shared(rLHS, rRHS); } std::shared_ptr ExpressionNodeFactory::createDividesExpression( const std::shared_ptr& rLHS, const std::shared_ptr& rRHS ) { - return std::shared_ptr( new DividesExpression(rLHS, rRHS) ); + return std::make_shared(rLHS, rRHS); } std::shared_ptr ExpressionNodeFactory::createMinExpression ( const std::shared_ptr& rOuterFunction, const std::shared_ptr& rInnerFunction ) { - return std::shared_ptr( new MinExpression(rOuterFunction, rInnerFunction) ); + return std::make_shared(rOuterFunction, rInnerFunction); } std::shared_ptr ExpressionNodeFactory::createMaxExpression ( const std::shared_ptr& rOuterFunction, const std::shared_ptr& rInnerFunction ) { - return std::shared_ptr( new MaxExpression(rOuterFunction, rInnerFunction) ); + return std::make_shared(rOuterFunction, rInnerFunction); } } diff --git a/slideshow/source/engine/screenupdater.cxx b/slideshow/source/engine/screenupdater.cxx index cc609fecf97d..1053770d5b5c 100644 --- a/slideshow/source/engine/screenupdater.cxx +++ b/slideshow/source/engine/screenupdater.cxx @@ -213,7 +213,7 @@ namespace internal ::std::shared_ptr ScreenUpdater::createLock() { - return ::std::shared_ptr(new ::UpdateLock(*this)); + return ::std::make_shared<::UpdateLock>(*this); } diff --git a/slideshow/source/engine/shapes/appletshape.cxx b/slideshow/source/engine/shapes/appletshape.cxx index f3b8edc9c02c..37f7b22be047 100644 --- a/slideshow/source/engine/shapes/appletshape.cxx +++ b/slideshow/source/engine/shapes/appletshape.cxx @@ -275,15 +275,12 @@ namespace slideshow std::size_t nNumPropEntries, const SlideShowContext& rContext ) { - std::shared_ptr< AppletShape > pAppletShape( - new AppletShape(xShape, + return std::make_shared(xShape, nPrio, rServiceName, pPropCopyTable, nNumPropEntries, - rContext) ); - - return pAppletShape; + rContext); } } } diff --git a/slideshow/source/engine/shapes/drawinglayeranimation.cxx b/slideshow/source/engine/shapes/drawinglayeranimation.cxx index b8b500936557..0e377c8b855b 100644 --- a/slideshow/source/engine/shapes/drawinglayeranimation.cxx +++ b/slideshow/source/engine/shapes/drawinglayeranimation.cxx @@ -910,9 +910,8 @@ std::shared_ptr createDrawingLayerAnimActivity( try { - std::shared_ptr const pWakeupEvent( - new WakeupEvent( rContext.mrEventQueue.getTimer(), - rContext.mrActivitiesQueue ) ); + auto const pWakeupEvent = std::make_shared( rContext.mrEventQueue.getTimer(), + rContext.mrActivitiesQueue ); pActivity.reset( new ActivityImpl( rContext, pWakeupEvent, pDrawShape ) ); pWakeupEvent->setActivity( pActivity ); } diff --git a/slideshow/source/engine/shapes/gdimtftools.cxx b/slideshow/source/engine/shapes/gdimtftools.cxx index a85a9cdc796c..19ea3d4f51b7 100644 --- a/slideshow/source/engine/shapes/gdimtftools.cxx +++ b/slideshow/source/engine/shapes/gdimtftools.cxx @@ -142,7 +142,7 @@ public: return xMtf; } - return GDIMetaFileSharedPtr(new GDIMetaFile(aGraphic.GetGDIMetaFile())); + return std::make_shared(aGraphic.GetGDIMetaFile()); } private: diff --git a/slideshow/source/engine/shapes/mediashape.cxx b/slideshow/source/engine/shapes/mediashape.cxx index 9aa9009a9002..bd2522899156 100644 --- a/slideshow/source/engine/shapes/mediashape.cxx +++ b/slideshow/source/engine/shapes/mediashape.cxx @@ -241,10 +241,7 @@ namespace slideshow double nPrio, const SlideShowContext& rContext) { - std::shared_ptr< MediaShape > pMediaShape( - new MediaShape(xShape, nPrio, rContext)); - - return pMediaShape; + return std::make_shared(xShape, nPrio, rContext); } } diff --git a/slideshow/source/engine/slide/slideimpl.cxx b/slideshow/source/engine/slide/slideimpl.cxx index c164f1e82a61..f58cca2128e6 100644 --- a/slideshow/source/engine/slide/slideimpl.cxx +++ b/slideshow/source/engine/slide/slideimpl.cxx @@ -1087,15 +1087,15 @@ SlideSharedPtr createSlide( const uno::Reference< drawing::XDrawPage >& bool bIntrinsicAnimationsAllowed, bool bDisableAnimationZOrder ) { - std::shared_ptr pRet( new SlideImpl( xDrawPage, xDrawPages, xRootNode, rEventQueue, - rEventMultiplexer, rScreenUpdater, - rActivitiesQueue, rUserEventQueue, - rCursorManager, rMediaFileManager, rViewContainer, - xComponentContext, rShapeListenerMap, - rShapeCursorMap, rPolyPolygonVector, rUserPaintColor, - dUserPaintStrokeWidth, bUserPaintEnabled, - bIntrinsicAnimationsAllowed, - bDisableAnimationZOrder )); + auto pRet = std::make_shared( xDrawPage, xDrawPages, xRootNode, rEventQueue, + rEventMultiplexer, rScreenUpdater, + rActivitiesQueue, rUserEventQueue, + rCursorManager, rMediaFileManager, rViewContainer, + xComponentContext, rShapeListenerMap, + rShapeCursorMap, rPolyPolygonVector, rUserPaintColor, + dUserPaintStrokeWidth, bUserPaintEnabled, + bIntrinsicAnimationsAllowed, + bDisableAnimationZOrder ); rEventMultiplexer.addViewHandler( pRet ); diff --git a/slideshow/source/engine/slideview.cxx b/slideshow/source/engine/slideview.cxx index 9878bab7797f..21f382220eb9 100644 --- a/slideshow/source/engine/slideview.cxx +++ b/slideshow/source/engine/slideview.cxx @@ -823,11 +823,11 @@ ViewLayerSharedPtr SlideView::createViewLayer( const basegfx::B2DRange& rLayerBo if( nNumLayers > LAYER_ULLAGE ) pruneLayers(); - std::shared_ptr xViewLayer( new SlideViewLayer(mpCanvas, - getTransformation(), - rLayerBounds, - maUserSize, - this) ); + auto xViewLayer = std::make_shared(mpCanvas, + getTransformation(), + rLayerBounds, + maUserSize, + this); maViewLayers.push_back(xViewLayer); return xViewLayer; diff --git a/slideshow/source/engine/smilfunctionparser.cxx b/slideshow/source/engine/smilfunctionparser.cxx index 2ec3d8dc4d3c..a2da99a4f29e 100644 --- a/slideshow/source/engine/smilfunctionparser.cxx +++ b/slideshow/source/engine/smilfunctionparser.cxx @@ -247,10 +247,9 @@ namespace slideshow { // push complex node, that calcs the value on demand rNodeStack.push( - std::shared_ptr( - new UnaryFunctionExpression( + std::make_shared( maFunctor, - pArg ) ) ); + pArg ) ); } } diff --git a/starmath/qa/extras/mmlimport-test.cxx b/starmath/qa/extras/mmlimport-test.cxx index ac9649258054..e455e60d84db 100644 --- a/starmath/qa/extras/mmlimport-test.cxx +++ b/starmath/qa/extras/mmlimport-test.cxx @@ -56,14 +56,14 @@ private: { // Cf. // filter/source/config/fragments/filters/MathML_XML__Math_.xcu - std::shared_ptr pFilter(new SfxFilter(MATHML_XML, + auto pFilter = std::make_shared(MATHML_XML, OUString(), SfxFilterFlags::IMPORT | SfxFilterFlags::EXPORT | SfxFilterFlags::TEMPLATE, SotClipboardFormatId::STARCALC_8, "MathML 2.0", OUString(), OUString(), - "private:factory/smath*")); + "private:factory/smath*"); pFilter->SetVersion(SOFFICE_FILEFORMAT_60); mxDocShell = new SmDocShell(SfxModelFlags::EMBEDDED_OBJECT | diff --git a/svtools/source/uno/wizard/wizardshell.cxx b/svtools/source/uno/wizard/wizardshell.cxx index 6d72a1219a50..ea3007e502d5 100644 --- a/svtools/source/uno/wizard/wizardshell.cxx +++ b/svtools/source/uno/wizard/wizardshell.cxx @@ -191,7 +191,7 @@ namespace svt { namespace uno weld::Container* pPageContainer = m_xAssistant->append_page(sIdent); auto xPage = std::make_unique(pPageContainer, this); - std::shared_ptr< WizardPageController > pController(new WizardPageController(xPage->GetContainer(), m_xController, nPageId)); + auto pController = std::make_shared(xPage->GetContainer(), m_xController, nPageId); m_aPageControllers[xPage.get()] = pController; diff --git a/svx/source/customshapes/EnhancedCustomShapeFunctionParser.cxx b/svx/source/customshapes/EnhancedCustomShapeFunctionParser.cxx index 9f92a93ae909..a4d2ee39b2c2 100644 --- a/svx/source/customshapes/EnhancedCustomShapeFunctionParser.cxx +++ b/svx/source/customshapes/EnhancedCustomShapeFunctionParser.cxx @@ -763,7 +763,7 @@ public: } void operator()( double n ) const { - mxContext->maOperandStack.push( std::shared_ptr( new ConstantValueExpression( n ) ) ); + mxContext->maOperandStack.push( std::make_shared( n ) ); } }; @@ -787,17 +787,17 @@ public: case ExpressionFunct::EnumAdjustment : { OUString aVal( rFirst + 1, rSecond - rFirst, RTL_TEXTENCODING_UTF8 ); - mxContext->maOperandStack.push( std::shared_ptr( new AdjustmentExpression( *mxContext->mpCustoShape, aVal.toInt32() ) ) ); + mxContext->maOperandStack.push( std::make_shared( *mxContext->mpCustoShape, aVal.toInt32() ) ); } break; case ExpressionFunct::EnumEquation : { OUString aVal( rFirst + 1, rSecond - rFirst, RTL_TEXTENCODING_UTF8 ); - mxContext->maOperandStack.push( std::shared_ptr( new EquationExpression( *mxContext->mpCustoShape, aVal.toInt32() ) ) ); + mxContext->maOperandStack.push( std::make_shared( *mxContext->mpCustoShape, aVal.toInt32() ) ); } break; default: - mxContext->maOperandStack.push( std::shared_ptr( new EnumValueExpression( *mxContext->mpCustoShape, meFunct ) ) ); + mxContext->maOperandStack.push( std::make_shared( *mxContext->mpCustoShape, meFunct ) ); } } }; @@ -826,9 +826,9 @@ public: rNodeStack.pop(); if( pArg->isConstant() ) // check for constness - rNodeStack.push( std::shared_ptr( new ConstantValueExpression( UnaryFunctionExpression::getValue( meFunct, pArg ) ) ) ); + rNodeStack.push( std::make_shared( UnaryFunctionExpression::getValue( meFunct, pArg ) ) ); else // push complex node, that calcs the value on demand - rNodeStack.push( std::shared_ptr( new UnaryFunctionExpression( meFunct, pArg ) ) ); + rNodeStack.push( std::make_shared( meFunct, pArg ) ); } }; @@ -866,10 +866,10 @@ public: rNodeStack.pop(); // create combined ExpressionNode - std::shared_ptr pNode( new BinaryFunctionExpression( meFunct, pFirstArg, pSecondArg ) ); + auto pNode = std::make_shared( meFunct, pFirstArg, pSecondArg ); // check for constness if( pFirstArg->isConstant() && pSecondArg->isConstant() ) // call the operator() at pNode, store result in constant value ExpressionNode. - rNodeStack.push( std::shared_ptr( new ConstantValueExpression( (*pNode)() ) ) ); + rNodeStack.push( std::make_shared( (*pNode)() ) ); else // push complex node, that calcs the value on demand rNodeStack.push( pNode ); } @@ -901,10 +901,10 @@ public: rNodeStack.pop(); // create combined ExpressionNode - std::shared_ptr pNode( new IfExpression( pFirstArg, pSecondArg, pThirdArg ) ); + auto pNode = std::make_shared( pFirstArg, pSecondArg, pThirdArg ); // check for constness if( pFirstArg->isConstant() && pSecondArg->isConstant() && pThirdArg->isConstant() ) - rNodeStack.push( std::shared_ptr( new ConstantValueExpression( (*pNode)() ) ) ); // call the operator() at pNode, store result in constant value ExpressionNode. + rNodeStack.push( std::make_shared( (*pNode)() ) ); // call the operator() at pNode, store result in constant value ExpressionNode. else rNodeStack.push( pNode ); // push complex node, that calcs the value on demand } diff --git a/svx/source/dialog/charmap.cxx b/svx/source/dialog/charmap.cxx index d136104b5e50..ff323461cfa5 100644 --- a/svx/source/dialog/charmap.cxx +++ b/svx/source/dialog/charmap.cxx @@ -827,8 +827,8 @@ svx::SvxShowCharSetItem* SvxShowCharSet::ImplGetItem( int _nPos ) if ( aFind == m_aItems.end() ) { OSL_ENSURE(m_xAccessible.is(), "Who wants to create a child of my table without a parent?"); - std::shared_ptr xItem(new svx::SvxShowCharSetItem(*this, - m_xAccessible.get(), sal::static_int_cast< sal_uInt16 >(_nPos))); + auto xItem = std::make_shared(*this, + m_xAccessible.get(), sal::static_int_cast< sal_uInt16 >(_nPos)); aFind = m_aItems.emplace(_nPos, xItem).first; OUStringBuffer buf; buf.appendUtf32( mxFontCharMap->GetCharFromIndex( _nPos ) ); diff --git a/svx/source/dialog/rubydialog.cxx b/svx/source/dialog/rubydialog.cxx index f8224e3d75b8..5bb302707769 100644 --- a/svx/source/dialog/rubydialog.cxx +++ b/svx/source/dialog/rubydialog.cxx @@ -71,7 +71,7 @@ static const char cRubyCharStyleName[] = "RubyCharStyleName"; SvxRubyChildWindow::SvxRubyChildWindow(vcl::Window* _pParent, sal_uInt16 nId,SfxBindings* pBindings, SfxChildWinInfo const * pInfo) : SfxChildWindow(_pParent, nId) { - std::shared_ptr xDlg(new SvxRubyDialog(pBindings, this, _pParent->GetFrameWeld())); + auto xDlg = std::make_shared(pBindings, this, _pParent->GetFrameWeld()); SetController(xDlg); xDlg->Initialize(pInfo); } diff --git a/svx/source/dialog/searchcharmap.cxx b/svx/source/dialog/searchcharmap.cxx index 115ca8b36ba7..09868195aa66 100644 --- a/svx/source/dialog/searchcharmap.cxx +++ b/svx/source/dialog/searchcharmap.cxx @@ -404,8 +404,8 @@ svx::SvxShowCharSetItem* SvxSearchCharSet::ImplGetItem( int _nPos ) if ( aFind == m_aItems.end() ) { OSL_ENSURE(m_xAccessible.is(), "Who wants to create a child of my table without a parent?"); - std::shared_ptr xItem(new svx::SvxShowCharSetItem(*this, - m_xAccessible.get(), sal::static_int_cast< sal_uInt16 >(_nPos))); + auto xItem = std::make_shared(*this, + m_xAccessible.get(), sal::static_int_cast< sal_uInt16 >(_nPos)); aFind = m_aItems.emplace(_nPos, xItem).first; OUStringBuffer buf; std::unordered_map::const_iterator got = m_aItemList.find (_nPos); diff --git a/svx/source/unodraw/unobrushitemhelper.cxx b/svx/source/unodraw/unobrushitemhelper.cxx index d465036d1edf..b8856fdd53b1 100644 --- a/svx/source/unodraw/unobrushitemhelper.cxx +++ b/svx/source/unodraw/unobrushitemhelper.cxx @@ -189,7 +189,7 @@ static std::shared_ptr getSvxBrushItemForSolid(const SfxItemSet& r aFillColor.SetTransparency(aTargetTrans); } - return std::shared_ptr(new SvxBrushItem(aFillColor, nBackgroundID)); + return std::make_shared(aFillColor, nBackgroundID); } std::shared_ptr getSvxBrushItemFromSourceSet(const SfxItemSet& rSourceSet, sal_uInt16 nBackgroundID, bool bSearchInParents, bool bXMLImportHack) @@ -207,10 +207,10 @@ std::shared_ptr getSvxBrushItemFromSourceSet(const SfxItemSet& rSo aFillColor.SetTransparency(0xff); - return std::shared_ptr(new SvxBrushItem(aFillColor, nBackgroundID)); + return std::make_shared(aFillColor, nBackgroundID); } - std::shared_ptr aRetval(new SvxBrushItem(nBackgroundID)); + auto aRetval = std::make_shared(nBackgroundID); switch(pXFillStyleItem->GetValue()) { @@ -249,7 +249,7 @@ std::shared_ptr getSvxBrushItemFromSourceSet(const SfxItemSet& rSo aMixedColor.SetTransparency(aTargetTrans); } - aRetval = std::shared_ptr(new SvxBrushItem(aMixedColor, nBackgroundID)); + aRetval = std::make_shared(aMixedColor, nBackgroundID); break; } case drawing::FillStyle_HATCH: @@ -281,7 +281,7 @@ std::shared_ptr getSvxBrushItemFromSourceSet(const SfxItemSet& rSo const sal_uInt8 aTargetTrans(std::min(sal_uInt8(0xfe), static_cast< sal_uInt8 >((nFillTransparence * 254) / 100))); aHatchColor.SetTransparency(aTargetTrans); - aRetval = std::shared_ptr(new SvxBrushItem(aHatchColor, nBackgroundID)); + aRetval = std::make_shared(aHatchColor, nBackgroundID); } break; @@ -324,7 +324,7 @@ std::shared_ptr getSvxBrushItemFromSourceSet(const SfxItemSet& rSo } // create with given graphic and position - aRetval = std::shared_ptr(new SvxBrushItem(aGraphic, aSvxGraphicPosition, nBackgroundID)); + aRetval = std::make_shared(aGraphic, aSvxGraphicPosition, nBackgroundID); // get evtl. mixed transparence const sal_uInt16 nFillTransparence(getTransparenceForSvxBrushItem(rSourceSet, bSearchInParents)); diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx index 37283fa085f6..835c2e61d6d6 100644 --- a/svx/source/unodraw/unoshape.cxx +++ b/svx/source/unodraw/unoshape.cxx @@ -320,9 +320,9 @@ svx::PropertyChangeNotifier& SvxShape::getShapePropertyChangeNotifier() void SvxShape::impl_construct() { mpImpl->maPropertyNotifier.registerProvider( svx::ShapeProperty::Position, - std::shared_ptr( new ShapePositionProvider( *mpImpl ) ) ); + std::make_shared( *mpImpl ) ); mpImpl->maPropertyNotifier.registerProvider( svx::ShapeProperty::Size, - std::shared_ptr( new ShapeSizeProvider( *mpImpl ) ) ); + std::make_shared( *mpImpl ) ); if ( HasSdrObject() ) { diff --git a/sw/qa/core/filters-test.cxx b/sw/qa/core/filters-test.cxx index 14aa0aa39c56..5db4e52fcb9e 100644 --- a/sw/qa/core/filters-test.cxx +++ b/sw/qa/core/filters-test.cxx @@ -75,11 +75,11 @@ bool SwFiltersTest::filter(const OUString &rFilter, const OUString &rURL, const OUString &rUserData, SfxFilterFlags nFilterFlags, SotClipboardFormatId nClipboardID, unsigned int nFilterVersion, bool bExport) { - std::shared_ptr pFilter(new SfxFilter( + auto pFilter = std::make_shared( rFilter, OUString(), nFilterFlags, nClipboardID, OUString(), OUString(), - rUserData, OUString())); - const_cast(pFilter.get())->SetVersion(nFilterVersion); + rUserData, OUString()); + pFilter->SetVersion(nFilterVersion); SwDocShellRef xDocShRef = new SwDocShell; SfxMedium* pSrcMed = new SfxMedium(rURL, StreamMode::STD_READ); diff --git a/sw/qa/core/filters-test2.cxx b/sw/qa/core/filters-test2.cxx index 6ce9376f681c..e2c3e7e7766f 100644 --- a/sw/qa/core/filters-test2.cxx +++ b/sw/qa/core/filters-test2.cxx @@ -74,10 +74,9 @@ bool SwFiltersTest2::filter(const OUString& rFilter, const OUString& rURL, SotClipboardFormatId nClipboardID, unsigned int nFilterVersion, bool bExport) { - std::shared_ptr pFilter(new SfxFilter(rFilter, OUString(), nFilterFlags, - nClipboardID, OUString(), OUString(), - rUserData, OUString())); - const_cast(pFilter.get())->SetVersion(nFilterVersion); + auto pFilter = std::make_shared(rFilter, OUString(), nFilterFlags, nClipboardID, + OUString(), OUString(), rUserData, OUString()); + pFilter->SetVersion(nFilterVersion); SwDocShellRef xDocShRef = new SwDocShell; SfxMedium* pSrcMed = new SfxMedium(rURL, StreamMode::STD_READ); diff --git a/sw/qa/core/uwriter.cxx b/sw/qa/core/uwriter.cxx index 22cd289c7f27..1d7c131c4d5a 100644 --- a/sw/qa/core/uwriter.cxx +++ b/sw/qa/core/uwriter.cxx @@ -208,10 +208,10 @@ void SwDocTest::testFileNameFields() OUString sFileURL = aTempFileURL.GetMainURL(INetURLObject::DecodeMechanism::NONE); SfxMedium aDstMed(sFileURL, StreamMode::STD_READWRITE); - std::shared_ptr pFilter(new SfxFilter( + auto pFilter = std::make_shared( "Text", OUString(), SfxFilterFlags::NONE, SotClipboardFormatId::NONE, OUString(), OUString(), - "TEXT", OUString() )); + "TEXT", OUString() ); aDstMed.SetFilter(pFilter); m_xDocShRef->DoSaveAs(aDstMed); diff --git a/sw/source/core/tox/ToxTextGenerator.cxx b/sw/source/core/tox/ToxTextGenerator.cxx index d5795458ca8f..67887904e891 100644 --- a/sw/source/core/tox/ToxTextGenerator.cxx +++ b/sw/source/core/tox/ToxTextGenerator.cxx @@ -275,7 +275,7 @@ ToxTextGenerator::GenerateText(SwDoc* pDoc, const std::vector ToxTextGenerator::CollectAttributesForTox(const SwTextAttr& hint, SwAttrPool& pool) { - std::shared_ptr retval(new SfxItemSet(pool)); + auto retval = std::make_shared(pool); if (hint.Which() != RES_TXTATR_AUTOFMT) { return retval; } diff --git a/sw/source/core/undo/untbl.cxx b/sw/source/core/undo/untbl.cxx index a5b68cd902d6..8c212feb8962 100644 --- a/sw/source/core/undo/untbl.cxx +++ b/sw/source/core/undo/untbl.cxx @@ -891,8 +891,8 @@ sal_uInt16 SaveTable::AddFormat( SwFrameFormat* pFormat, bool bIsLine ) if( SIZE_MAX == nRet ) { // Create copy of ItemSet - std::shared_ptr pSet( new SfxItemSet( *pFormat->GetAttrSet().GetPool(), - bIsLine ? aTableLineSetRange : aTableBoxSetRange ) ); + auto pSet = std::make_shared( *pFormat->GetAttrSet().GetPool(), + bIsLine ? aTableLineSetRange : aTableBoxSetRange ); pSet->Put( pFormat->GetAttrSet() ); // When a formula is set, never save the value. It possibly must be // recalculated. @@ -1418,8 +1418,7 @@ SwUndoTableAutoFormat::~SwUndoTableAutoFormat() void SwUndoTableAutoFormat::SaveBoxContent( const SwTableBox& rBox ) { - std::shared_ptr const p(new SwUndoTableNumFormat(rBox)); - m_Undos.push_back(p); + m_Undos.push_back(std::make_shared(rBox)); } void diff --git a/sw/source/core/undo/untblk.cxx b/sw/source/core/undo/untblk.cxx index 365736807059..cd1315b59cd0 100644 --- a/sw/source/core/undo/untblk.cxx +++ b/sw/source/core/undo/untblk.cxx @@ -142,8 +142,8 @@ void SwUndoInserts::SetInsertRange( const SwPaM& rPam, bool bScanFlys, if( !m_pFrameFormats || m_pFrameFormats->end() == ( it = std::find( m_pFrameFormats->begin(), m_pFrameFormats->end(), pFormat ) ) ) { - std::shared_ptr const pFlyUndo( - new SwUndoInsLayFormat(pFormat, 0, 0)); + std::shared_ptr const pFlyUndo = + std::make_shared(pFormat, 0, 0); m_FlyUndos.push_back(pFlyUndo); } else diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx index e6a7cfa6c3ea..685f29fbd1da 100644 --- a/sw/source/core/unocore/unodraw.cxx +++ b/sw/source/core/unocore/unodraw.cxx @@ -865,7 +865,7 @@ namespace { void lcl_addShapePropertyEventFactories( SdrObject& _rObj, SwXShape& _rShape ) { - std::shared_ptr pProvider( new svx::PropertyValueProvider( _rShape, "AnchorType" ) ); + auto pProvider = std::make_shared( _rShape, "AnchorType" ); _rObj.getShapePropertyChangeNotifier().registerProvider( svx::ShapeProperty::TextDocAnchor, pProvider ); } } diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx index 6793e74602f0..0b0e1536f34a 100644 --- a/sw/source/core/unocore/unostyle.cxx +++ b/sw/source/core/unocore/unostyle.cxx @@ -3782,7 +3782,7 @@ SwAutoStylesEnumImpl::SwAutoStylesEnumImpl( SwDoc* pInitDoc, IStyleAccess::SwAut std::pair< sal_uInt16, text::RubyAdjust > aPair( pRubyItem->GetPosition(), pRubyItem->GetAdjustment() ); if ( aRubyMap.insert( aPair ).second ) { - std::shared_ptr pItemSet( new SfxItemSet( rAttrPool, svl::Items{} ) ); + auto pItemSet = std::make_shared( rAttrPool, svl::Items{} ); pItemSet->Put( *pRubyItem ); mAutoStyles.push_back( pItemSet ); } diff --git a/sw/source/filter/docx/swdocxreader.cxx b/sw/source/filter/docx/swdocxreader.cxx index 93cda1a66982..f13127fcabd7 100644 --- a/sw/source/filter/docx/swdocxreader.cxx +++ b/sw/source/filter/docx/swdocxreader.cxx @@ -50,7 +50,7 @@ ErrCode SwDOCXReader::Read(SwDoc& rDoc, const OUString& /* rBaseURL */, SwPaM& r return ERR_SWG_READ_ERROR; // We want to work in an empty paragraph. - std::shared_ptr pSttNdIdx(new SwNodeIndex(rDoc.GetNodes())); + auto pSttNdIdx = std::make_shared(rDoc.GetNodes()); const SwPosition* pPos = rPam.GetPoint(); rDoc.getIDocumentContentOperations().SplitNode(*pPos, false); rDoc.SetTextFormatColl(rPam, rDoc.getIDocumentStylePoolAccess().GetTextCollFromPool(RES_POOLCOLL_STANDARD, false)); diff --git a/sw/source/filter/html/htmltab.cxx b/sw/source/filter/html/htmltab.cxx index 6d5fadbde1a6..dc9c5a7e9180 100644 --- a/sw/source/filter/html/htmltab.cxx +++ b/sw/source/filter/html/htmltab.cxx @@ -1616,8 +1616,8 @@ SwTableLine *HTMLTable::MakeTableLine( SwTableBox *pUpper, const SwStartNode* pPrevStartNd = GetPrevBoxStartNode( nTopRow, nStartCol ); - std::shared_ptr xCnts(new HTMLTableCnts( - m_pParser->InsertTableSection(pPrevStartNd))); + auto xCnts = std::make_shared( + m_pParser->InsertTableSection(pPrevStartNd)); const std::shared_ptr xCntsLayoutInfo = xCnts->CreateLayoutInfo(); diff --git a/sw/source/filter/rtf/swparrtf.cxx b/sw/source/filter/rtf/swparrtf.cxx index 394da93ad3a0..11fa1ea8744b 100644 --- a/sw/source/filter/rtf/swparrtf.cxx +++ b/sw/source/filter/rtf/swparrtf.cxx @@ -60,7 +60,7 @@ ErrCode SwRTFReader::Read(SwDoc& rDoc, const OUString& /*rBaseURL*/, SwPaM& rPam // the end position. const uno::Reference xInsertPosition = SwXTextRange::CreateXTextRange(rDoc, *rPam.GetPoint(), nullptr); - std::shared_ptr pSttNdIdx(new SwNodeIndex(rDoc.GetNodes())); + auto pSttNdIdx = std::make_shared(rDoc.GetNodes()); const SwPosition* pPos = rPam.GetPoint(); // Step 2: Split once and remember the node that has been split. @@ -69,7 +69,7 @@ ErrCode SwRTFReader::Read(SwDoc& rDoc, const OUString& /*rBaseURL*/, SwPaM& rPam // Step 3: Split again. rDoc.getIDocumentContentOperations().SplitNode(*pPos, false); - std::shared_ptr pSttNdIdx2(new SwNodeIndex(rDoc.GetNodes())); + auto pSttNdIdx2 = std::make_shared(rDoc.GetNodes()); *pSttNdIdx2 = pPos->nNode.GetIndex(); // Step 4: Insert all content into the new node diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx index 4001977502c3..b01944d89467 100644 --- a/sw/source/filter/ww8/wrtw8esh.cxx +++ b/sw/source/filter/ww8/wrtw8esh.cxx @@ -1513,7 +1513,7 @@ SvStream* SwEscherExGlobal::ImplQueryPictureStream() } SwBasicEscherEx::SwBasicEscherEx(SvStream* pStrm, WW8Export& rWW8Wrt) - : EscherEx( std::shared_ptr( new SwEscherExGlobal ), pStrm), rWrt(rWW8Wrt), pEscherStrm(pStrm) + : EscherEx( std::make_shared(), pStrm), rWrt(rWW8Wrt), pEscherStrm(pStrm) { Init(); } diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx index b0dd924a1aa7..40a4729a2286 100644 --- a/sw/source/filter/ww8/wrtw8sty.cxx +++ b/sw/source/filter/ww8/wrtw8sty.cxx @@ -1792,7 +1792,7 @@ bool WW8_WrPlcSepx::WriteKFText( WW8Export& rWrt ) for (const WW8_SepInfo & rSepInfo : aSects) { - std::shared_ptr const pAttrDesc(new WW8_PdAttrDesc); + auto pAttrDesc = std::make_shared(); m_SectionAttributes.push_back(pAttrDesc); rWrt.SectionProperties( rSepInfo, pAttrDesc.get() ); diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index 97dd8ae286d2..12315b438d3e 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -801,8 +801,8 @@ SdrObject* SwMSDffManager::ProcessObj(SvStream& rSt, // with a Frame, else if( bIsSimpleDrawingTextBox ) { - std::shared_ptr const xTmpRec( - new SvxMSDffShapeInfo(0, pImpRec->nShapeId)); + std::shared_ptr const xTmpRec = + std::make_shared(0, pImpRec->nShapeId); SvxMSDffShapeInfos_ById::const_iterator const it = GetShapeInfos()->find(xTmpRec); diff --git a/sw/source/ui/dbui/mmresultdialogs.cxx b/sw/source/ui/dbui/mmresultdialogs.cxx index 19047d79f974..c271f1435632 100644 --- a/sw/source/ui/dbui/mmresultdialogs.cxx +++ b/sw/source/ui/dbui/mmresultdialogs.cxx @@ -619,7 +619,7 @@ IMPL_LINK_NOARG(SwMMResultSaveDialog, SaveOutputHdl_Impl, weld::Button&, void) } SwView* pSourceView = xConfigItem->GetSourceView(); - std::shared_ptr xSaveMonitor(new SaveMonitor(m_xDialog.get())); + auto xSaveMonitor = std::make_shared(m_xDialog.get()); xSaveMonitor->m_xDocName->set_label(pSourceView->GetDocShell()->GetTitle(22)); xSaveMonitor->m_xPrinter->set_label( INetURLObject( sPath ).getFSysPath( FSysStyle::Detect ) ); m_bCancelSaving = false; diff --git a/sw/source/ui/vba/vbadocumentproperties.cxx b/sw/source/ui/vba/vbadocumentproperties.cxx index c784e0bb6b99..cb6f6ea800be 100644 --- a/sw/source/ui/vba/vbadocumentproperties.cxx +++ b/sw/source/ui/vba/vbadocumentproperties.cxx @@ -401,8 +401,8 @@ class BuiltInIndexHelper public: explicit BuiltInIndexHelper( const uno::Reference< frame::XModel >& xModel ) { - std::shared_ptr< PropertGetSetHelper > aStandardHelper( new BuiltinPropertyGetSetHelper( xModel ) ); - std::shared_ptr< PropertGetSetHelper > aUsingStatsHelper( new StatisticPropertyGetSetHelper( xModel ) ); + auto aStandardHelper = std::make_shared( xModel ); + auto aUsingStatsHelper = std::make_shared( xModel ); m_docPropInfoMap[ word::WdBuiltInProperty::wdPropertyTitle ] = DocPropInfo::createDocPropInfo( "Title", "Title", aStandardHelper ); m_docPropInfoMap[ word::WdBuiltInProperty::wdPropertySubject ] = DocPropInfo::createDocPropInfo( "Subject", "Subject", aStandardHelper ); diff --git a/sw/source/uibase/app/docsh2.cxx b/sw/source/uibase/app/docsh2.cxx index d20e923f2584..95f13f4cfd03 100644 --- a/sw/source/uibase/app/docsh2.cxx +++ b/sw/source/uibase/app/docsh2.cxx @@ -1211,7 +1211,7 @@ void SwDocShell::Execute(SfxRequest& rReq) break; case SID_CLASSIFICATION_DIALOG: { - std::shared_ptr xDialog(new svx::ClassificationDialog(GetView()->GetFrameWeld(), false)); + auto xDialog = std::make_shared(GetView()->GetFrameWeld(), false); SwWrtShell* pShell = GetWrtShell(); std::vector aInput = pShell->CollectAdvancedClassification(); @@ -1226,10 +1226,10 @@ void SwDocShell::Execute(SfxRequest& rReq) case SID_PARAGRAPH_SIGN_CLASSIFY_DLG: { SwWrtShell* pShell = GetWrtShell(); - std::shared_ptr xDialog(new svx::ClassificationDialog(GetView()->GetFrameWeld(), true, [pShell]() + auto xDialog = std::make_shared(GetView()->GetFrameWeld(), true, [pShell]() { pShell->SignParagraph(); - })); + }); std::vector aInput = pShell->CollectParagraphClassification(); xDialog->setupValues(aInput); @@ -1265,8 +1265,8 @@ void SwDocShell::Execute(SfxRequest& rReq) { SfxViewShell* pViewShell = GetView() ? GetView() : SfxViewShell::Current(); SfxBindings& rBindings( pViewShell->GetViewFrame()->GetBindings() ); - std::shared_ptr xDlg(new SwWatermarkDialog(pViewShell->GetViewFrame()->GetWindow().GetFrameWeld(), - rBindings)); + auto xDlg = std::make_shared(pViewShell->GetViewFrame()->GetWindow().GetFrameWeld(), + rBindings); weld::DialogController::runAsync(xDlg, [](sal_Int32 /*nResult*/){}); } } diff --git a/sw/source/uibase/app/docst.cxx b/sw/source/uibase/app/docst.cxx index 61cb6a0df6cd..249b549dcb0e 100644 --- a/sw/source/uibase/app/docst.cxx +++ b/sw/source/uibase/app/docst.cxx @@ -890,7 +890,7 @@ void SwDocShell::Edit( SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); VclPtr pDlg(pFact->CreateTemplateDialog(GetView()->GetFrameWeld(), *xTmp, nFamily, sPage, pCurrShell, bNew)); - std::shared_ptr pApplyStyleHelper(new ApplyStyle(*this, bNew, xTmp, nFamily, pDlg.get(), m_xBasePool, bModified)); + auto pApplyStyleHelper = std::make_shared(*this, bNew, xTmp, nFamily, pDlg.get(), m_xBasePool, bModified); pDlg->SetApplyHdl(LINK(pApplyStyleHelper.get(), ApplyStyle, ApplyHdl)); std::shared_ptr pRequest; diff --git a/sw/source/uibase/shells/tabsh.cxx b/sw/source/uibase/shells/tabsh.cxx index 9ee2f5784703..c6e1ae74877f 100644 --- a/sw/source/uibase/shells/tabsh.cxx +++ b/sw/source/uibase/shells/tabsh.cxx @@ -593,7 +593,7 @@ void SwTableShell::Execute(SfxRequest &rReq) if (pItem) pDlg->SetCurPageId(OUStringToOString(static_cast(pItem)->GetValue(), RTL_TEXTENCODING_UTF8)); - std::shared_ptr pRequest(new SfxRequest(rReq)); + auto pRequest = std::make_shared(rReq); rReq.Ignore(); // the 'old' request is not relevant any more pDlg->StartExecuteAsync([pDlg, pRequest, pTableRep, &rBindings, &rSh](sal_Int32 nResult){ diff --git a/sw/source/uibase/shells/textsh1.cxx b/sw/source/uibase/shells/textsh1.cxx index 08097faf0205..ee09143f510e 100644 --- a/sw/source/uibase/shells/textsh1.cxx +++ b/sw/source/uibase/shells/textsh1.cxx @@ -113,7 +113,7 @@ static void sw_CharDialog(SwWrtShell &rWrtSh, bool bUseDialog, sal_uInt16 nSlot, { FieldUnit eMetric = ::GetDfltMetric(dynamic_cast( &rWrtSh.GetView()) != nullptr ); SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< sal_uInt16 >(eMetric))); - std::shared_ptr pCoreSet(new SfxItemSet( + auto pCoreSet = std::make_shared( rWrtSh.GetView().GetPool(), svl::Items< RES_CHRATR_BEGIN, RES_CHRATR_END - 1, @@ -123,7 +123,7 @@ static void sw_CharDialog(SwWrtShell &rWrtSh, bool bUseDialog, sal_uInt16 nSlot, SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER, SID_HTML_MODE, SID_HTML_MODE, SID_ATTR_CHAR_WIDTH_FIT_TO_LINE, SID_ATTR_CHAR_WIDTH_FIT_TO_LINE, - FN_PARAM_SELECTION, FN_PARAM_SELECTION>{})); + FN_PARAM_SELECTION, FN_PARAM_SELECTION>{}); rWrtSh.GetCurAttr(*pCoreSet); bool bSel = rWrtSh.HasSelection(); @@ -1069,7 +1069,7 @@ void SwTextShell::Execute(SfxRequest &rReq) } else if (pDlg) { - std::shared_ptr pRequest(new SfxRequest(rReq)); + auto pRequest = std::make_shared(rReq); rReq.Ignore(); // the 'old' request is not relevant any more pDlg->StartExecuteAsync([pDlg, &rWrtSh, pRequest, nDefDist](sal_Int32 nResult){ diff --git a/sw/source/uibase/shells/txtnum.cxx b/sw/source/uibase/shells/txtnum.cxx index 3b2fb5ab1457..aadc698ac024 100644 --- a/sw/source/uibase/shells/txtnum.cxx +++ b/sw/source/uibase/shells/txtnum.cxx @@ -185,7 +185,7 @@ void SwTextShell::ExecEnterNum(SfxRequest &rReq) if ( pPageItem ) pDlg->SetCurPageId( OUStringToOString( pPageItem->GetValue(), RTL_TEXTENCODING_UTF8 ) ); - std::shared_ptr pRequest(new SfxRequest(rReq)); + auto pRequest = std::make_shared(rReq); rReq.Ignore(); // the 'old' request is not relevant any more pDlg->StartExecuteAsync([aSet, pDlg, pNumRuleAtCurrentSelection, pRequest, this](sal_Int32 nResult){ diff --git a/unoxml/source/rdf/librdf_repository.cxx b/unoxml/source/rdf/librdf_repository.cxx index 2eb278b0ea4d..39db47b51b99 100644 --- a/unoxml/source/rdf/librdf_repository.cxx +++ b/unoxml/source/rdf/librdf_repository.cxx @@ -2137,12 +2137,12 @@ librdf_TypeConverter::extractResource_NoLock( const OString label( OUStringToOString(xBlankNode->getStringValue(), RTL_TEXTENCODING_UTF8) ); - return std::shared_ptr(new BlankNode(label)); + return std::make_shared(label); } else { // assumption: everything else is URI const OString uri( OUStringToOString(i_xResource->getStringValue(), RTL_TEXTENCODING_UTF8) ); - return std::shared_ptr(new URI(uri)); + return std::make_shared(uri); } } @@ -2225,7 +2225,7 @@ librdf_TypeConverter::extractNode_NoLock( type = OUStringToOString(xType->getStringValue(), RTL_TEXTENCODING_UTF8); } - return std::shared_ptr(new Literal(val, lang, type)); + return std::make_shared(val, lang, type); } // extract blank or URI or literal node - call without Mutex locked diff --git a/vcl/qt5/Qt5Menu.cxx b/vcl/qt5/Qt5Menu.cxx index dd5c9895273e..e2ccd1ffc6af 100644 --- a/vcl/qt5/Qt5Menu.cxx +++ b/vcl/qt5/Qt5Menu.cxx @@ -195,7 +195,7 @@ void Qt5Menu::ReinitializeActionGroup(unsigned nPos) && (pPrevItem->mpActionGroup == pNextItem->mpActionGroup)) { std::shared_ptr pFirstActionGroup = pPrevItem->mpActionGroup; - std::shared_ptr pSecondActionGroup(new QActionGroup(nullptr)); + auto pSecondActionGroup = std::make_shared(nullptr); pSecondActionGroup->setExclusive(true); auto actions = pFirstActionGroup->actions(); diff --git a/vcl/source/font/PhysicalFontCollection.cxx b/vcl/source/font/PhysicalFontCollection.cxx index 9fbcabb95cc1..43ca203ff2d2 100644 --- a/vcl/source/font/PhysicalFontCollection.cxx +++ b/vcl/source/font/PhysicalFontCollection.cxx @@ -870,7 +870,7 @@ PhysicalFontFamily* PhysicalFontCollection::ImplFindFontFamilyOfDefaultFont() co std::shared_ptr PhysicalFontCollection::Clone() const { - std::shared_ptr xClonedCollection(new PhysicalFontCollection); + auto xClonedCollection = std::make_shared(); xClonedCollection->mpPreMatchHook = mpPreMatchHook; xClonedCollection->mpFallbackHook = mpFallbackHook; diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx index f5f70e30e725..d02a73016cd1 100644 --- a/writerfilter/source/dmapper/DomainMapper.cxx +++ b/writerfilter/source/dmapper/DomainMapper.cxx @@ -1345,7 +1345,7 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, const PropertyMapPtr& rContext ) writerfilter::Reference::Pointer_t pProperties = rSprm.getProps(); if( pProperties.get()) { - std::shared_ptr pBorderHandler( new BorderHandler( true ) ); + auto pBorderHandler = std::make_shared( true ); pProperties->resolve(*pBorderHandler); PropertyIds eBorderId = PropertyIds( 0 ); PropertyIds eBorderDistId = PropertyIds( 0 ); @@ -1400,7 +1400,7 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, const PropertyMapPtr& rContext ) writerfilter::Reference::Pointer_t pProperties = rSprm.getProps(); if( pProperties.get()) { - std::shared_ptr pCellColorHandler( new CellColorHandler ); + auto pCellColorHandler = std::make_shared(); pCellColorHandler->setOutputFormat( CellColorHandler::Paragraph ); bool bEnableTempGrabBag = !pCellColorHandler->isInteropGrabBagEnabled(); if( bEnableTempGrabBag ) @@ -1797,7 +1797,7 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, const PropertyMapPtr& rContext ) writerfilter::Reference::Pointer_t pProperties = rSprm.getProps(); if( pProperties.get()) { - std::shared_ptr pCellColorHandler( new CellColorHandler ); + auto pCellColorHandler = std::make_shared(); pCellColorHandler->setOutputFormat( CellColorHandler::Character ); pProperties->resolve(*pCellColorHandler); rContext->InsertProps(pCellColorHandler->getProperties().get()); @@ -1900,7 +1900,7 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, const PropertyMapPtr& rContext ) writerfilter::Reference::Pointer_t pProperties = rSprm.getProps(); if( pProperties.get()) { - std::shared_ptr pBorderHandler( new BorderHandler( true ) ); + auto pBorderHandler = std::make_shared( true ); pProperties->resolve(*pBorderHandler); rContext->Insert( PROP_CHAR_TOP_BORDER, uno::makeAny( pBorderHandler->getBorderLine())); @@ -2397,7 +2397,7 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, const PropertyMapPtr& rContext ) writerfilter::Reference::Pointer_t pProperties = rSprm.getProps(); if( pProperties.get( ) ) { - std::shared_ptr pOLEHandler( new OLEHandler(*this) ); + auto pOLEHandler = std::make_shared(*this); pProperties->resolve(*pOLEHandler); if ( pOLEHandler->isOLEObject( ) ) { diff --git a/writerfilter/source/dmapper/GraphicImport.cxx b/writerfilter/source/dmapper/GraphicImport.cxx index 63a0e7491fb4..bf2ffb859ab6 100644 --- a/writerfilter/source/dmapper/GraphicImport.cxx +++ b/writerfilter/source/dmapper/GraphicImport.cxx @@ -1080,7 +1080,7 @@ void GraphicImport::lcl_sprm(Sprm& rSprm) case NS_ooxml::LN_CT_Anchor_positionH: // 90976; { // Use a special handler for the positioning - std::shared_ptr pHandler( new PositionHandler( m_pImpl->m_rPositionOffsets, m_pImpl->m_rAligns )); + auto pHandler = std::make_shared( m_pImpl->m_rPositionOffsets, m_pImpl->m_rAligns ); writerfilter::Reference::Pointer_t pProperties = rSprm.getProps(); if( pProperties.get( ) ) { @@ -1107,7 +1107,7 @@ void GraphicImport::lcl_sprm(Sprm& rSprm) case NS_ooxml::LN_CT_Anchor_positionV: // 90977; { // Use a special handler for the positioning - std::shared_ptr pHandler( new PositionHandler( m_pImpl->m_rPositionOffsets, m_pImpl->m_rAligns)); + auto pHandler = std::make_shared( m_pImpl->m_rPositionOffsets, m_pImpl->m_rAligns); writerfilter::Reference::Pointer_t pProperties = rSprm.getProps(); if( pProperties.get( ) ) { diff --git a/writerfilter/source/dmapper/PageBordersHandler.cxx b/writerfilter/source/dmapper/PageBordersHandler.cxx index 585e9619f710..1cecd891e738 100644 --- a/writerfilter/source/dmapper/PageBordersHandler.cxx +++ b/writerfilter/source/dmapper/PageBordersHandler.cxx @@ -94,7 +94,7 @@ void PageBordersHandler::lcl_sprm( Sprm& rSprm ) writerfilter::Reference::Pointer_t pProperties = rSprm.getProps(); if( pProperties.get()) { - std::shared_ptr pBorderHandler( new BorderHandler( true ) ); + auto pBorderHandler = std::make_shared( true ); pProperties->resolve(*pBorderHandler); BorderPosition ePos = BorderPosition( 0 ); switch( rSprm.getId( ) ) diff --git a/writerfilter/source/dmapper/StyleSheetTable.cxx b/writerfilter/source/dmapper/StyleSheetTable.cxx index 034807149afb..9927f253ed4d 100644 --- a/writerfilter/source/dmapper/StyleSheetTable.cxx +++ b/writerfilter/source/dmapper/StyleSheetTable.cxx @@ -578,7 +578,7 @@ void StyleSheetTable::lcl_sprm(Sprm & rSprm) writerfilter::Reference::Pointer_t pProperties = rSprm.getProps(); if( pProperties.get() && m_pImpl->m_pCurrentEntry->nStyleTypeCode == STYLE_TYPE_TABLE) { - std::shared_ptr pTblStylePrHandler(new TblStylePrHandler(m_pImpl->m_rDMapper)); + auto pTblStylePrHandler = std::make_shared(m_pImpl->m_rDMapper); pProperties->resolve(*pTblStylePrHandler); StyleSheetEntry* pEntry = m_pImpl->m_pCurrentEntry.get(); TableStyleSheetEntry& rTableEntry = dynamic_cast(*pEntry); @@ -652,7 +652,7 @@ void StyleSheetTable::lcl_sprm(Sprm & rSprm) writerfilter::Reference::Pointer_t pProperties = rSprm.getProps(); if( pProperties.get()) { - std::shared_ptr pTblStylePrHandler( new TblStylePrHandler( m_pImpl->m_rDMapper ) ); + auto pTblStylePrHandler = std::make_shared( m_pImpl->m_rDMapper ); pProperties->resolve( *pTblStylePrHandler ); // Add the properties to the table style @@ -716,7 +716,7 @@ void StyleSheetTable::lcl_sprm(Sprm & rSprm) writerfilter::Reference::Pointer_t pProperties = rSprm.getProps(); if( pProperties.get()) { - std::shared_ptr pBorderHandler( new BorderHandler(m_pImpl->m_rDMapper.IsOOXMLImport()) ); + auto pBorderHandler = std::make_shared(m_pImpl->m_rDMapper.IsOOXMLImport()); pProperties->resolve(*pBorderHandler); m_pImpl->m_pCurrentEntry->pProperties->InsertProps( pBorderHandler->getProperties()); diff --git a/writerfilter/source/dmapper/TablePropertiesHandler.cxx b/writerfilter/source/dmapper/TablePropertiesHandler.cxx index 339727689782..91a31800c740 100644 --- a/writerfilter/source/dmapper/TablePropertiesHandler.cxx +++ b/writerfilter/source/dmapper/TablePropertiesHandler.cxx @@ -101,7 +101,7 @@ namespace dmapper { nToken = XML_tableRowDelete; break; } - std::shared_ptr pTrackChangesHandler( new TrackChangesHandler( nToken ) ); + auto pTrackChangesHandler = std::make_shared( nToken ); pProperties->resolve(*pTrackChangesHandler); TablePropertyMapPtr pPropMap( new TablePropertyMap ); @@ -132,7 +132,7 @@ namespace dmapper { throw lang::IllegalArgumentException("illegal redline token type", nullptr, 0); break; } - std::shared_ptr pTrackChangesHandler( new TrackChangesHandler( nToken ) ); + auto pTrackChangesHandler = std::make_shared( nToken ); pProperties->resolve(*pTrackChangesHandler); TablePropertyMapPtr pPropMap( new TablePropertyMap ); @@ -190,7 +190,7 @@ namespace dmapper { writerfilter::Reference::Pointer_t pProperties = rSprm.getProps(); if( pProperties.get()) { - std::shared_ptr pBorderHandler(new BorderHandler(true)); + auto pBorderHandler = std::make_shared(true); if (m_pCurrentInteropGrabBag) pBorderHandler->enableInteropGrabBag("tblBorders"); pProperties->resolve(*pBorderHandler); @@ -238,7 +238,7 @@ namespace dmapper { writerfilter::Reference::Pointer_t pProperties = rSprm.getProps(); if (pProperties.get()) { - std::shared_ptr pCellMarginHandler(new CellMarginHandler); + auto pCellMarginHandler = std::make_shared(); if (m_pCurrentInteropGrabBag) pCellMarginHandler->enableInteropGrabBag("tcMar"); pProperties->resolve(*pCellMarginHandler); @@ -278,7 +278,7 @@ namespace dmapper { writerfilter::Reference::Pointer_t pProperties = rSprm.getProps(); if( pProperties.get()) { - std::shared_ptr pCellColorHandler( new CellColorHandler ); + auto pCellColorHandler = std::make_shared(); pCellColorHandler->enableInteropGrabBag("shd"); //enable to store shd unsupported props in grab bag pProperties->resolve( *pCellColorHandler ); TablePropertyMapPtr pPropertyMap = pCellColorHandler->getProperties(); @@ -298,7 +298,7 @@ namespace dmapper { writerfilter::Reference::Pointer_t pProperties = rSprm.getProps(); if( pProperties.get()) { - std::shared_ptr pCellMarginHandler( new CellMarginHandler ); + auto pCellMarginHandler = std::make_shared(); if (m_pCurrentInteropGrabBag) pCellMarginHandler->enableInteropGrabBag("tblCellMar"); pProperties->resolve( *pCellMarginHandler ); diff --git a/writerfilter/source/dmapper/TblStylePrHandler.cxx b/writerfilter/source/dmapper/TblStylePrHandler.cxx index beff017d19a8..3d403d483b55 100644 --- a/writerfilter/source/dmapper/TblStylePrHandler.cxx +++ b/writerfilter/source/dmapper/TblStylePrHandler.cxx @@ -175,7 +175,7 @@ void TblStylePrHandler::lcl_sprm(Sprm & rSprm) writerfilter::Reference::Pointer_t pProperties = rSprm.getProps(); if ( pProperties.get() ) { - std::shared_ptr pCellMarginHandler(new CellMarginHandler); + auto pCellMarginHandler = std::make_shared(); pCellMarginHandler->enableInteropGrabBag("tblCellMar"); pProperties->resolve( *pCellMarginHandler ); m_aInteropGrabBag.push_back(pCellMarginHandler->getInteropGrabBag()); diff --git a/writerperfect/qa/unit/WPXSvStreamTest.cxx b/writerperfect/qa/unit/WPXSvStreamTest.cxx index b13fc91e0e7c..cbd0899b54bd 100644 --- a/writerperfect/qa/unit/WPXSvStreamTest.cxx +++ b/writerperfect/qa/unit/WPXSvStreamTest.cxx @@ -97,7 +97,7 @@ shared_ptr lcl_createStreamForURL(const OUString& rURL) const Reference xInputStream(xFileAccess->openFileRead(rURL), css::uno::UNO_SET_THROW); - return shared_ptr(new WPXSvInputStream(xInputStream)); + return std::make_shared(xInputStream); } void lcl_testSubStreams(const shared_ptr& pInput) diff --git a/writerperfect/source/impress/KeynoteImportFilter.cxx b/writerperfect/source/impress/KeynoteImportFilter.cxx index ec4a4f18af2c..d83f8acea431 100644 --- a/writerperfect/source/impress/KeynoteImportFilter.cxx +++ b/writerperfect/source/impress/KeynoteImportFilter.cxx @@ -105,7 +105,8 @@ KeynoteImportFilter::detect(css::uno::Sequence& Descr if (!xInputStream.is()) return OUString(); - std::shared_ptr input(new WPXSvInputStream(xInputStream)); + std::shared_ptr input + = std::make_shared(xInputStream); /* Apple Keynote documents come in two variants: * * actual files (zip), only produced by Keynote 5 (at least with diff --git a/xmloff/source/table/XMLTableExport.cxx b/xmloff/source/table/XMLTableExport.cxx index 2b9480a96842..db34766a09cb 100644 --- a/xmloff/source/table/XMLTableExport.cxx +++ b/xmloff/source/table/XMLTableExport.cxx @@ -209,7 +209,7 @@ static bool has_states( const std::vector< XMLPropertyState >& xPropStates ) if( !mbExportTables ) return; - std::shared_ptr< XMLTableInfo > xTableInfo( new XMLTableInfo ); + auto xTableInfo = std::make_shared(); maTableInfoMap[xColumnRowRange] = xTableInfo; try diff --git a/xmloff/source/table/XMLTableImport.cxx b/xmloff/source/table/XMLTableImport.cxx index 0da1812c7d58..6caa85c9afbb 100644 --- a/xmloff/source/table/XMLTableImport.cxx +++ b/xmloff/source/table/XMLTableImport.cxx @@ -237,7 +237,7 @@ SvXMLStyleContext* XMLTableImport::CreateTableTemplateContext( sal_uInt16 nPrfx, void XMLTableImport::addTableTemplate( const OUString& rsStyleName, XMLTableTemplate& xTableTemplate ) { - std::shared_ptr< XMLTableTemplate > xPtr( new XMLTableTemplate ); + auto xPtr = std::make_shared(); xPtr->swap( xTableTemplate ); maTableTemplates[rsStyleName] = xPtr; } @@ -370,7 +370,7 @@ SvXMLImportContextRef XMLTableImportContext::ImportColumn( sal_uInt16 nPrefix, c { if( mxColumns.is() && (mnCurrentRow == -1) ) try { - std::shared_ptr< ColumnInfo > xInfo ( new ColumnInfo ); + auto xInfo = std::make_shared(); sal_Int32 nRepeated = 1; diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx index ee6a32f031b8..791976b55c5e 100644 --- a/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx +++ b/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx @@ -1762,8 +1762,8 @@ Reference< xml::sax::XDocumentHandler > importDialogModel( Reference< XModel > const & xDocument ) { // single set of styles and stylenames apply to all containers - std::shared_ptr< std::vector< OUString > > pStyleNames( new std::vector< OUString > ); - std::shared_ptr< std::vector< css::uno::Reference< css::xml::input::XElement > > > pStyles( new std::vector< css::uno::Reference< css::xml::input::XElement > > ); + auto pStyleNames = std::make_shared>(); + auto pStyles = std::make_shared >>(); return ::xmlscript::createDocumentHandler( new DialogImport(xContext, xDialogModel, pStyleNames, pStyles, xDocument)); } -- cgit