slideshow/source/engine/activities/activitiesfactory.cxx | 28 +- slideshow/source/engine/animationfactory.cxx | 27 +- slideshow/source/engine/animationnodes/animationbasenode.cxx | 6 slideshow/source/engine/animationnodes/animationcolornode.cxx | 5 slideshow/source/engine/animationnodes/animationnodefactory.cxx | 72 +++--- slideshow/source/engine/animationnodes/setactivity.hxx | 3 slideshow/source/engine/effectrewinder.cxx | 18 - slideshow/source/engine/rehearsetimingsactivity.cxx | 10 slideshow/source/engine/shapes/backgroundshape.cxx | 5 slideshow/source/engine/shapes/drawinglayeranimation.cxx | 4 slideshow/source/engine/shapes/drawshape.cxx | 14 - slideshow/source/engine/shapes/externalshapebase.cxx | 2 slideshow/source/engine/shapes/gdimtftools.cxx | 4 slideshow/source/engine/shapes/intrinsicanimationactivity.cxx | 7 slideshow/source/engine/shapes/shapeimporter.cxx | 4 slideshow/source/engine/shapes/viewshape.cxx | 5 slideshow/source/engine/slide/layermanager.cxx | 2 slideshow/source/engine/slide/slideimpl.cxx | 4 slideshow/source/engine/slide/userpaintoverlay.cxx | 2 slideshow/source/engine/slideshowimpl.cxx | 8 slideshow/source/engine/smilfunctionparser.cxx | 2 slideshow/source/engine/transitions/parametricpolypolygonfactory.cxx | 104 +++------- slideshow/source/engine/transitions/shapetransitionfactory.cxx | 10 slideshow/source/engine/transitions/slidechangebase.cxx | 2 slideshow/source/engine/transitions/slidetransitionfactory.cxx | 35 +-- slideshow/source/engine/usereventqueue.cxx | 20 - slideshow/source/inc/delayevent.hxx | 4 slideshow/source/inc/interruptabledelayevent.hxx | 4 slideshow/test/slidetest.cxx | 6 slideshow/test/testview.cxx | 2 svl/source/items/slstitm.cxx | 8 svl/source/items/style.cxx | 2 svtools/source/table/cellvalueconversion.cxx | 12 - svtools/source/table/tablecontrol.cxx | 2 svtools/source/table/tablecontrol_impl.cxx | 6 svtools/source/uno/svtxgridcontrol.cxx | 2 svtools/source/uno/unocontroltablemodel.cxx | 6 svx/source/customshapes/EnhancedCustomShapeFunctionParser.cxx | 2 svx/source/dialog/framelink.cxx | 8 svx/source/dialog/hdft.cxx | 20 - svx/source/dialog/imapwnd.cxx | 4 svx/source/dialog/srchdlg.cxx | 2 svx/source/form/fmscriptingenv.cxx | 4 svx/source/form/sqlparserclient.cxx | 2 svx/source/sdr/attribute/sdrallfillattributeshelper.cxx | 16 - svx/source/sdr/attribute/sdrtextattribute.cxx | 2 svx/source/sdr/contact/viewobjectcontact.cxx | 6 svx/source/sdr/contact/viewobjectcontactofe3d.cxx | 6 svx/source/sdr/contact/viewobjectcontactofe3dscene.cxx | 6 svx/source/stbctrls/modctrl.cxx | 2 svx/source/svdraw/svdedxv.cxx | 4 svx/source/svdraw/svdomedia.cxx | 6 svx/source/table/tablertfimporter.cxx | 2 svx/source/tbxctrls/tbcontrl.cxx | 6 54 files changed, 254 insertions(+), 301 deletions(-)
New commits: commit a258a043c90eaaa4f6a411318e239e805d087d0c Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Fri Jan 24 13:21:42 2020 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Sat Jan 25 07:06:20 2020 +0100 loplugin:makeshared in svl..svx Change-Id: I067ea2f3cb651fdc5c3d1a09b0c55583618b9d1f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87355 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/svl/source/items/slstitm.cxx b/svl/source/items/slstitm.cxx index 95de93e7b635..05e5401db18e 100644 --- a/svl/source/items/slstitm.cxx +++ b/svl/source/items/slstitm.cxx @@ -41,7 +41,7 @@ SfxStringListItem::SfxStringListItem( sal_uInt16 which, const std::vector<OUStri // Therefore the query after the count is commented out if( pList /*!!! && pList->Count() */ ) { - mpList.reset(new std::vector<OUString>); + mpList = std::make_shared<std::vector<OUString>>(); *mpList = *pList; } } @@ -55,7 +55,7 @@ SfxStringListItem::~SfxStringListItem() std::vector<OUString>& SfxStringListItem::GetList() { if( !mpList ) - mpList.reset( new std::vector<OUString> ); + mpList = std::make_shared<std::vector<OUString>>(); return *mpList; } @@ -95,7 +95,7 @@ SfxStringListItem* SfxStringListItem::Clone( SfxItemPool *) const void SfxStringListItem::SetString( const OUString& rStr ) { - mpList.reset( new std::vector<OUString> ); + mpList = std::make_shared<std::vector<OUString>>(); sal_Int32 nStart = 0; OUString aStr(convertLineEnd(rStr, LINEEND_CR)); @@ -143,7 +143,7 @@ OUString SfxStringListItem::GetString() void SfxStringListItem::SetStringList( const css::uno::Sequence< OUString >& rList ) { - mpList.reset(new std::vector<OUString>); + mpList = std::make_shared<std::vector<OUString>>(); // String belongs to the list comphelper::sequenceToContainer(*mpList, rList); diff --git a/svl/source/items/style.cxx b/svl/source/items/style.cxx index f1463d501c3e..6d2095ad93b3 100644 --- a/svl/source/items/style.cxx +++ b/svl/source/items/style.cxx @@ -98,7 +98,7 @@ public: std::shared_ptr<svl::IndexedStyleSheets> mxIndexedStyleSheets; SfxStyleSheetBasePool_Impl() : - mxIndexedStyleSheets(new svl::IndexedStyleSheets) {} + mxIndexedStyleSheets(std::make_shared<svl::IndexedStyleSheets>()) {} }; diff --git a/svtools/source/table/cellvalueconversion.cxx b/svtools/source/table/cellvalueconversion.cxx index 6219eee3efc5..2ca15c7ca514 100644 --- a/svtools/source/table/cellvalueconversion.cxx +++ b/svtools/source/table/cellvalueconversion.cxx @@ -340,25 +340,25 @@ namespace svt if ( sTypeName == ::cppu::UnoType< DateTime >::get().getTypeName() ) { - o_formatter.reset( new DateTimeNormalization( io_data.xNumberFormatter ) ); + o_formatter = std::make_shared<DateTimeNormalization>( io_data.xNumberFormatter ); } else if ( sTypeName == ::cppu::UnoType< css::util::Date >::get().getTypeName() ) { - o_formatter.reset( new DateNormalization( io_data.xNumberFormatter ) ); + o_formatter = std::make_shared<DateNormalization>( io_data.xNumberFormatter ); } else if ( sTypeName == ::cppu::UnoType< css::util::Time >::get().getTypeName() ) { - o_formatter.reset( new TimeNormalization( io_data.xNumberFormatter ) ); + o_formatter = std::make_shared<TimeNormalization>( io_data.xNumberFormatter ); } else if ( sTypeName == ::cppu::UnoType< sal_Bool >::get().getTypeName() ) { - o_formatter.reset( new BooleanNormalization( io_data.xNumberFormatter ) ); + o_formatter = std::make_shared<BooleanNormalization>( io_data.xNumberFormatter ); } else if ( sTypeName == ::cppu::UnoType< double >::get().getTypeName() || sTypeName == ::cppu::UnoType< float >::get().getTypeName() ) { - o_formatter.reset( new DoubleNormalization( io_data.xNumberFormatter ) ); + o_formatter = std::make_shared<DoubleNormalization>( io_data.xNumberFormatter ); } else if ( ( eTypeClass == TypeClass_BYTE ) || ( eTypeClass == TypeClass_SHORT ) @@ -368,7 +368,7 @@ namespace svt || ( eTypeClass == TypeClass_HYPER ) ) { - o_formatter.reset( new IntegerNormalization( io_data.xNumberFormatter ) ); + o_formatter = std::make_shared<IntegerNormalization>( io_data.xNumberFormatter ); } else { diff --git a/svtools/source/table/tablecontrol.cxx b/svtools/source/table/tablecontrol.cxx index 175d711d4704..dda4d974dabe 100644 --- a/svtools/source/table/tablecontrol.cxx +++ b/svtools/source/table/tablecontrol.cxx @@ -49,7 +49,7 @@ namespace svt { namespace table TableControl::TableControl( vcl::Window* _pParent, WinBits _nStyle ) :Control( _pParent, _nStyle ) - ,m_pImpl( new TableControl_Impl( *this ) ) + ,m_pImpl( std::make_shared<TableControl_Impl>( *this ) ) { TableDataWindow& rDataWindow = m_pImpl->getDataWindow(); rDataWindow.SetSelectHdl( LINK( this, TableControl, ImplSelectHdl ) ); diff --git a/svtools/source/table/tablecontrol_impl.cxx b/svtools/source/table/tablecontrol_impl.cxx index 42e65a02b7a4..d413f9e28b69 100644 --- a/svtools/source/table/tablecontrol_impl.cxx +++ b/svtools/source/table/tablecontrol_impl.cxx @@ -218,7 +218,7 @@ namespace svt { namespace table TableControl_Impl::TableControl_Impl( TableControl& _rAntiImpl ) :m_rAntiImpl ( _rAntiImpl ) - ,m_pModel ( new EmptyTableModel ) + ,m_pModel ( std::make_shared<EmptyTableModel>() ) ,m_pInputHandler ( ) ,m_nRowHeightPixel ( 15 ) ,m_nColHeaderHeightPixel( 0 ) @@ -265,7 +265,7 @@ namespace svt { namespace table m_pModel = _pModel; if ( !m_pModel) - m_pModel.reset( new EmptyTableModel ); + m_pModel = std::make_shared<EmptyTableModel>(); m_pModel->addTableModelListener( shared_from_this() ); @@ -563,7 +563,7 @@ namespace svt { namespace table { m_pInputHandler = m_pModel->getInputHandler(); if ( !m_pInputHandler ) - m_pInputHandler.reset( new DefaultInputHandler ); + m_pInputHandler = std::make_shared<DefaultInputHandler>(); m_nColumnCount = m_pModel->getColumnCount(); if ( m_nLeftColumn >= m_nColumnCount ) diff --git a/svtools/source/uno/svtxgridcontrol.cxx b/svtools/source/uno/svtxgridcontrol.cxx index 31f46d0d9d7a..0526b2e4f680 100644 --- a/svtools/source/uno/svtxgridcontrol.cxx +++ b/svtools/source/uno/svtxgridcontrol.cxx @@ -70,7 +70,7 @@ using namespace ::svt::table; SVTXGridControl::SVTXGridControl() - :m_xTableModel( new UnoControlTableModel() ) + :m_xTableModel( std::make_shared<UnoControlTableModel>() ) ,m_bTableModelInitCompleted( false ) ,m_aSelectionListeners( *this ) { diff --git a/svtools/source/uno/unocontroltablemodel.cxx b/svtools/source/uno/unocontroltablemodel.cxx index dce3b908d320..12b48d129e33 100644 --- a/svtools/source/uno/unocontroltablemodel.cxx +++ b/svtools/source/uno/unocontroltablemodel.cxx @@ -123,8 +123,8 @@ namespace svt { namespace table m_pImpl->bHasColumnHeaders = true; m_pImpl->bHasRowHeaders = false; m_pImpl->bEnabled = true; - m_pImpl->pRenderer.reset( new GridTableRenderer( *this ) ); - m_pImpl->pInputHandler.reset( new DefaultInputHandler ); + m_pImpl->pRenderer = std::make_shared<GridTableRenderer>( *this ); + m_pImpl->pInputHandler = std::make_shared<DefaultInputHandler>(); } @@ -217,7 +217,7 @@ namespace svt { namespace table ENSURE_OR_RETURN_VOID( ( i_position >= 0 ) && ( size_t( i_position ) <= m_pImpl->aColumns.size() ), "UnoControlTableModel::insertColumn: illegal position!" ); - const PColumnModel pColumn( new UnoGridColumnFacade( *this, i_column ) ); + const PColumnModel pColumn = std::make_shared<UnoGridColumnFacade>( *this, i_column ); m_pImpl->aColumns.insert( m_pImpl->aColumns.begin() + i_position, pColumn ); // notify listeners diff --git a/svx/source/customshapes/EnhancedCustomShapeFunctionParser.cxx b/svx/source/customshapes/EnhancedCustomShapeFunctionParser.cxx index 4d15cfce2905..2c761e9d7360 100644 --- a/svx/source/customshapes/EnhancedCustomShapeFunctionParser.cxx +++ b/svx/source/customshapes/EnhancedCustomShapeFunctionParser.cxx @@ -1104,7 +1104,7 @@ private: const ParserContextSharedPtr& getParserContext() { - static ParserContextSharedPtr lcl_parserContext( new ParserContext ); + static ParserContextSharedPtr lcl_parserContext = std::make_shared<ParserContext>(); // clear node stack (since we reuse the static object, that's // the whole point here) diff --git a/svx/source/dialog/framelink.cxx b/svx/source/dialog/framelink.cxx index dd6d410532bf..21eea0663987 100644 --- a/svx/source/dialog/framelink.cxx +++ b/svx/source/dialog/framelink.cxx @@ -34,7 +34,7 @@ void Style::implEnsureImplStyle() { if(!maImplStyle) { - maImplStyle.reset(new implStyle()); + maImplStyle = std::make_shared<implStyle>(); } } @@ -44,7 +44,7 @@ Style::Style() : } Style::Style( double nP, double nD, double nS, SvxBorderLineStyle nType, double fScale ) : - maImplStyle(new implStyle()) + maImplStyle(std::make_shared<implStyle>()) { maImplStyle->mnType = nType; maImplStyle->mfPatternScale = fScale; @@ -52,7 +52,7 @@ Style::Style( double nP, double nD, double nS, SvxBorderLineStyle nType, double } Style::Style( const Color& rColorPrim, const Color& rColorSecn, const Color& rColorGap, bool bUseGapColor, double nP, double nD, double nS, SvxBorderLineStyle nType, double fScale ) : - maImplStyle(new implStyle()) + maImplStyle(std::make_shared<implStyle>()) { maImplStyle->mnType = nType; maImplStyle->mfPatternScale = fScale; @@ -64,7 +64,7 @@ Style::Style( const editeng::SvxBorderLine* pBorder, double fScale ) : { if(nullptr != pBorder) { - maImplStyle.reset(new implStyle()); + maImplStyle = std::make_shared<implStyle>(); maImplStyle->mfPatternScale = fScale; Set( pBorder, fScale ); } diff --git a/svx/source/dialog/hdft.cxx b/svx/source/dialog/hdft.cxx index 2d718523bd26..cf3f9f259b94 100644 --- a/svx/source/dialog/hdft.cxx +++ b/svx/source/dialog/hdft.cxx @@ -636,8 +636,8 @@ IMPL_LINK_NOARG(SvxHFPage, BackgroundHdl, weld::Button&, void) if (mbEnableDrawingLayerFillStyles) { // create FillAttributes directly from DrawingLayer FillStyle entries - aFillAttributes.reset( - new drawinglayer::attribute::SdrAllFillAttributesHelper(*pBBSet)); + aFillAttributes = + std::make_shared<drawinglayer::attribute::SdrAllFillAttributesHelper>(*pBBSet); } else { @@ -652,8 +652,8 @@ IMPL_LINK_NOARG(SvxHFPage, BackgroundHdl, weld::Button&, void) svl::Items<XATTR_FILL_FIRST, XATTR_FILL_LAST>{}); setSvxBrushItemAsFillAttributesToTargetSet(rItem, aTempSet); - aFillAttributes.reset( - new drawinglayer::attribute::SdrAllFillAttributesHelper(aTempSet)); + aFillAttributes = + std::make_shared<drawinglayer::attribute::SdrAllFillAttributesHelper>(aTempSet); } } @@ -712,7 +712,7 @@ void SvxHFPage::ResetBackground_Impl( const SfxItemSet& rSet ) if(mbEnableDrawingLayerFillStyles) { // create FillAttributes directly from DrawingLayer FillStyle entries - aHeaderFillAttributes.reset(new drawinglayer::attribute::SdrAllFillAttributesHelper(rTmpSet)); + aHeaderFillAttributes = std::make_shared<drawinglayer::attribute::SdrAllFillAttributesHelper>(rTmpSet); } else { @@ -725,7 +725,7 @@ void SvxHFPage::ResetBackground_Impl( const SfxItemSet& rSet ) SfxItemSet aTempSet(*rTmpSet.GetPool(), svl::Items<XATTR_FILL_FIRST, XATTR_FILL_LAST>{}); setSvxBrushItemAsFillAttributesToTargetSet(rItem, aTempSet); - aHeaderFillAttributes.reset(new drawinglayer::attribute::SdrAllFillAttributesHelper(aTempSet)); + aHeaderFillAttributes = std::make_shared<drawinglayer::attribute::SdrAllFillAttributesHelper>(aTempSet); } } @@ -748,7 +748,7 @@ void SvxHFPage::ResetBackground_Impl( const SfxItemSet& rSet ) if(mbEnableDrawingLayerFillStyles) { // create FillAttributes directly from DrawingLayer FillStyle entries - aFooterFillAttributes.reset(new drawinglayer::attribute::SdrAllFillAttributesHelper(rTmpSet)); + aFooterFillAttributes = std::make_shared<drawinglayer::attribute::SdrAllFillAttributesHelper>(rTmpSet); } else { @@ -761,7 +761,7 @@ void SvxHFPage::ResetBackground_Impl( const SfxItemSet& rSet ) SfxItemSet aTempSet(*rTmpSet.GetPool(), svl::Items<XATTR_FILL_FIRST, XATTR_FILL_LAST>{}); setSvxBrushItemAsFillAttributesToTargetSet(rItem, aTempSet); - aFooterFillAttributes.reset(new drawinglayer::attribute::SdrAllFillAttributesHelper(aTempSet)); + aFooterFillAttributes = std::make_shared<drawinglayer::attribute::SdrAllFillAttributesHelper>(aTempSet); } } @@ -774,7 +774,7 @@ void SvxHFPage::ResetBackground_Impl( const SfxItemSet& rSet ) if(mbEnableDrawingLayerFillStyles) { // create FillAttributes directly from DrawingLayer FillStyle entries - aPageFillAttributes.reset(new drawinglayer::attribute::SdrAllFillAttributesHelper(rSet)); + aPageFillAttributes = std::make_shared<drawinglayer::attribute::SdrAllFillAttributesHelper>(rSet); } else { @@ -787,7 +787,7 @@ void SvxHFPage::ResetBackground_Impl( const SfxItemSet& rSet ) SfxItemSet aTempSet(*rSet.GetPool(), svl::Items<XATTR_FILL_FIRST, XATTR_FILL_LAST>{}); setSvxBrushItemAsFillAttributesToTargetSet(rItem, aTempSet); - aPageFillAttributes.reset(new drawinglayer::attribute::SdrAllFillAttributesHelper(aTempSet)); + aPageFillAttributes = std::make_shared<drawinglayer::attribute::SdrAllFillAttributesHelper>(aTempSet); } } diff --git a/svx/source/dialog/imapwnd.cxx b/svx/source/dialog/imapwnd.cxx index 377ea12907dd..2cf21a5652b5 100644 --- a/svx/source/dialog/imapwnd.cxx +++ b/svx/source/dialog/imapwnd.cxx @@ -372,8 +372,8 @@ void IMapWindow::SdrObjChanged( const SdrObject& rObj ) { case OBJ_RECT: { - pUserData->ReplaceObject( IMapObjectPtr(new IMapRectangleObject( static_cast<const SdrRectObj&>(rObj).GetLogicRect(), - aURL, aAltText, aDesc, aTarget, "", bActive, false ) ) ); + pUserData->ReplaceObject( std::make_shared<IMapRectangleObject>( static_cast<const SdrRectObj&>(rObj).GetLogicRect(), + aURL, aAltText, aDesc, aTarget, "", bActive, false ) ); } break; diff --git a/svx/source/dialog/srchdlg.cxx b/svx/source/dialog/srchdlg.cxx index bba78509188c..23d21ede6a8b 100644 --- a/svx/source/dialog/srchdlg.cxx +++ b/svx/source/dialog/srchdlg.cxx @@ -2351,7 +2351,7 @@ SvxSearchDialogWrapper::SvxSearchDialogWrapper( vcl::Window* _pParent, sal_uInt1 SfxBindings* pBindings, SfxChildWinInfo const * pInfo ) : SfxChildWindow( _pParent, nId ) - , dialog(new SvxSearchDialog(_pParent->GetFrameWeld(), this, *pBindings)) + , dialog(std::make_shared<SvxSearchDialog>(_pParent->GetFrameWeld(), this, *pBindings)) { SetController(dialog); dialog->Initialize( pInfo ); diff --git a/svx/source/form/fmscriptingenv.cxx b/svx/source/form/fmscriptingenv.cxx index 4dcae395248b..91760b358ebf 100644 --- a/svx/source/form/fmscriptingenv.cxx +++ b/svx/source/form/fmscriptingenv.cxx @@ -970,7 +970,7 @@ namespace svxform if ( _rEvent.ScriptType != "StarBasic" ) { - pScript.reset( new NewStyleUNOScript( *xObjectShell, _rEvent.ScriptCode ) ); + pScript = std::make_shared<NewStyleUNOScript>( *xObjectShell, _rEvent.ScriptCode ); } else { @@ -1007,7 +1007,7 @@ namespace svxform "?language=Basic&location=" + sMacroLocation; - pScript.reset( new NewStyleUNOScript( *xObjectShell, sScriptURI ) ); + pScript = std::make_shared<NewStyleUNOScript>( *xObjectShell, sScriptURI ); } assert(pScript && "FormScriptingEnvironment::doFireScriptEvent: no script to execute!"); diff --git a/svx/source/form/sqlparserclient.cxx b/svx/source/form/sqlparserclient.cxx index f1cd230a8e0d..e350dc1f1c3a 100644 --- a/svx/source/form/sqlparserclient.cxx +++ b/svx/source/form/sqlparserclient.cxx @@ -32,7 +32,7 @@ namespace svxform using namespace ::com::sun::star::lang; OSQLParserClient::OSQLParserClient(const Reference< XComponentContext >& rxContext) - : m_pParser(new OSQLParser(rxContext, getParseContext())) + : m_pParser(std::make_shared<OSQLParser>(rxContext, getParseContext())) { } diff --git a/svx/source/sdr/attribute/sdrallfillattributeshelper.cxx b/svx/source/sdr/attribute/sdrallfillattributeshelper.cxx index 7fe63399e16c..36587b8761a8 100644 --- a/svx/source/sdr/attribute/sdrallfillattributeshelper.cxx +++ b/svx/source/sdr/attribute/sdrallfillattributeshelper.cxx @@ -59,23 +59,23 @@ namespace drawinglayer::attribute maFillGradientAttribute(), maPrimitives() { - maFillAttribute.reset( - new drawinglayer::attribute::SdrFillAttribute( + maFillAttribute = + std::make_shared<drawinglayer::attribute::SdrFillAttribute>( 0.0, rColor.GetRGBColor().getBColor(), drawinglayer::attribute::FillGradientAttribute(), drawinglayer::attribute::FillHatchAttribute(), - drawinglayer::attribute::SdrFillGraphicAttribute())); + drawinglayer::attribute::SdrFillGraphicAttribute()); } SdrAllFillAttributesHelper::SdrAllFillAttributesHelper(const SfxItemSet& rSet) : maLastPaintRange(), maLastDefineRange(), maFillAttribute( - new drawinglayer::attribute::SdrFillAttribute( + std::make_shared<drawinglayer::attribute::SdrFillAttribute>( drawinglayer::primitive2d::createNewSdrFillAttribute(rSet))), maFillGradientAttribute( - new drawinglayer::attribute::FillGradientAttribute( + std::make_shared<drawinglayer::attribute::FillGradientAttribute>( drawinglayer::primitive2d::createNewTransparenceGradientAttribute(rSet))), maPrimitives() { @@ -117,7 +117,8 @@ namespace drawinglayer::attribute { if(!maFillAttribute.get()) { - const_cast< SdrAllFillAttributesHelper* >(this)->maFillAttribute.reset(new drawinglayer::attribute::SdrFillAttribute()); + const_cast< SdrAllFillAttributesHelper* >(this)->maFillAttribute = + std::make_shared<drawinglayer::attribute::SdrFillAttribute>(); } return *maFillAttribute; @@ -127,7 +128,8 @@ namespace drawinglayer::attribute { if(!maFillGradientAttribute.get()) { - const_cast< SdrAllFillAttributesHelper* >(this)->maFillGradientAttribute.reset(new drawinglayer::attribute::FillGradientAttribute()); + const_cast< SdrAllFillAttributesHelper* >(this)->maFillGradientAttribute = + std::make_shared<drawinglayer::attribute::FillGradientAttribute>(); } return *maFillGradientAttribute; diff --git a/svx/source/sdr/attribute/sdrtextattribute.cxx b/svx/source/sdr/attribute/sdrtextattribute.cxx index cb0c88d845a4..fb0826b4ebe5 100644 --- a/svx/source/sdr/attribute/sdrtextattribute.cxx +++ b/svx/source/sdr/attribute/sdrtextattribute.cxx @@ -89,7 +89,7 @@ namespace drawinglayer::attribute bool bWrongSpell, bool bChainable) : mpSdrText(pSdrText), - mxOutlinerParaObject(new OutlinerParaObject(rOutlinerParaObject)), + mxOutlinerParaObject(std::make_shared<OutlinerParaObject>(rOutlinerParaObject)), maSdrFormTextAttribute(), maTextLeftDistance(aTextLeftDistance), maTextUpperDistance(aTextUpperDistance), diff --git a/svx/source/sdr/contact/viewobjectcontact.cxx b/svx/source/sdr/contact/viewobjectcontact.cxx index 4a7adf2c61b0..ded29812eae6 100644 --- a/svx/source/sdr/contact/viewobjectcontact.cxx +++ b/svx/source/sdr/contact/viewobjectcontact.cxx @@ -319,10 +319,10 @@ drawinglayer::primitive2d::Primitive2DContainer ViewObjectContact::createPrimiti if(isPrimitiveGhosted(rDisplayInfo)) { const basegfx::BColor aRGBWhite(1.0, 1.0, 1.0); - const basegfx::BColorModifierSharedPtr aBColorModifier( - new basegfx::BColorModifier_interpolate( + const basegfx::BColorModifierSharedPtr aBColorModifier = + std::make_shared<basegfx::BColorModifier_interpolate>( aRGBWhite, - 0.5)); + 0.5); const drawinglayer::primitive2d::Primitive2DReference xReference( new drawinglayer::primitive2d::ModifiedColorPrimitive2D( xRetval, diff --git a/svx/source/sdr/contact/viewobjectcontactofe3d.cxx b/svx/source/sdr/contact/viewobjectcontactofe3d.cxx index 64ba2bbd0631..88fe38ca3c01 100644 --- a/svx/source/sdr/contact/viewobjectcontactofe3d.cxx +++ b/svx/source/sdr/contact/viewobjectcontactofe3d.cxx @@ -46,10 +46,10 @@ namespace sdr::contact if(isPrimitiveGhosted(rDisplayInfo)) { const ::basegfx::BColor aRGBWhite(1.0, 1.0, 1.0); - const ::basegfx::BColorModifierSharedPtr aBColorModifier( - new basegfx::BColorModifier_interpolate( + const ::basegfx::BColorModifierSharedPtr aBColorModifier = + std::make_shared<basegfx::BColorModifier_interpolate>( aRGBWhite, - 0.5)); + 0.5); const drawinglayer::primitive3d::Primitive3DReference xReference( new drawinglayer::primitive3d::ModifiedColorPrimitive3D( xRetval, diff --git a/svx/source/sdr/contact/viewobjectcontactofe3dscene.cxx b/svx/source/sdr/contact/viewobjectcontactofe3dscene.cxx index 72a8043e70bc..aa7eb9058c05 100644 --- a/svx/source/sdr/contact/viewobjectcontactofe3dscene.cxx +++ b/svx/source/sdr/contact/viewobjectcontactofe3dscene.cxx @@ -103,10 +103,10 @@ namespace sdr::contact if(isPrimitiveGhosted(rDisplayInfo)) { const ::basegfx::BColor aRGBWhite(1.0, 1.0, 1.0); - const ::basegfx::BColorModifierSharedPtr aBColorModifier( - new basegfx::BColorModifier_interpolate( + const ::basegfx::BColorModifierSharedPtr aBColorModifier = + std::make_shared<basegfx::BColorModifier_interpolate>( aRGBWhite, - 0.5)); + 0.5); const drawinglayer::primitive2d::Primitive2DReference xReference( new drawinglayer::primitive2d::ModifiedColorPrimitive2D( xRetval, diff --git a/svx/source/stbctrls/modctrl.cxx b/svx/source/stbctrls/modctrl.cxx index 1faddf461c23..634781f11956 100644 --- a/svx/source/stbctrls/modctrl.cxx +++ b/svx/source/stbctrls/modctrl.cxx @@ -68,7 +68,7 @@ struct SvxModifyControl::ImplData SvxModifyControl::SvxModifyControl( sal_uInt16 _nSlotId, sal_uInt16 _nId, StatusBar& rStb ) : SfxStatusBarControl( _nSlotId, _nId, rStb ), - mxImpl(new ImplData) + mxImpl(std::make_shared<ImplData>()) { mxImpl->maIdle.SetInvokeHandler( LINK(this, SvxModifyControl, OnTimer) ); } diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx index 5e6eb95bad8d..2908d7edcf7b 100644 --- a/svx/source/svdraw/svdedxv.cxx +++ b/svx/source/svdraw/svdedxv.cxx @@ -2644,8 +2644,8 @@ void SdrObjEditView::TakeFormatPaintBrush(std::shared_ptr<SfxItemSet>& rFormatSe { OutlinerView* pOLV = GetTextEditOutlinerView(); - rFormatSet.reset( - new SfxItemSet(GetModel()->GetItemPool(), GetFormatRangeImpl(pOLV != nullptr))); + rFormatSet = std::make_shared<SfxItemSet>(GetModel()->GetItemPool(), + GetFormatRangeImpl(pOLV != nullptr)); if (pOLV) { rFormatSet->Put(pOLV->GetAttribs()); diff --git a/svx/source/svdraw/svdomedia.cxx b/svx/source/svdraw/svdomedia.cxx index abb8a70fa8a9..2389504217f2 100644 --- a/svx/source/svdraw/svdomedia.cxx +++ b/svx/source/svdraw/svdomedia.cxx @@ -275,7 +275,7 @@ void SdrMediaObj::SetInputStream(uno::Reference<io::XInputStream> const& xStream if (bSuccess) { - m_xImpl->m_pTempFile.reset(new ::avmedia::MediaTempFile(tempFileURL)); + m_xImpl->m_pTempFile = std::make_shared<::avmedia::MediaTempFile>(tempFileURL); #if HAVE_FEATURE_AVMEDIA m_xImpl->m_MediaProperties.setURL( m_xImpl->m_LastFailedPkgURL, tempFileURL, ""); @@ -353,8 +353,8 @@ void SdrMediaObj::mediaPropertiesChanged( const ::avmedia::MediaItem& rNewProper if (bSuccess) { - m_xImpl->m_pTempFile.reset( - new ::avmedia::MediaTempFile(tempFileURL)); + m_xImpl->m_pTempFile = + std::make_shared<::avmedia::MediaTempFile>(tempFileURL); m_xImpl->m_MediaProperties.setURL(url, tempFileURL, ""); } else // this case is for Clone via operator= diff --git a/svx/source/table/tablertfimporter.cxx b/svx/source/table/tablertfimporter.cxx index d342856bedee..2bbef503ae94 100644 --- a/svx/source/table/tablertfimporter.cxx +++ b/svx/source/table/tablertfimporter.cxx @@ -216,7 +216,7 @@ void SdrTableRTFParser::NextRow() void SdrTableRTFParser::InsertCell( RtfImportInfo const * pInfo ) { - RTFCellInfoPtr xCellInfo( new RTFCellInfo(mrItemPool) ); + RTFCellInfoPtr xCellInfo = std::make_shared<RTFCellInfo>(mrItemPool); xCellInfo->mnStartPara = mnStartPara; xCellInfo->mnParaCount = pInfo->aSelection.nEndPara - 1 - mnStartPara; diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx index cb718f018be6..7aee71bb5d81 100644 --- a/svx/source/tbxctrls/tbcontrl.cxx +++ b/svx/source/tbxctrls/tbcontrl.cxx @@ -3399,7 +3399,7 @@ void SvxColorToolBoxControl::EnsurePaletteManager() { if (!m_xPaletteManager) { - m_xPaletteManager.reset(new PaletteManager); + m_xPaletteManager = std::make_shared<PaletteManager>(); m_xPaletteManager->SetBtnUpdater(m_xBtnUpdater.get()); } } @@ -4031,7 +4031,7 @@ void SvxColorListBox::EnsurePaletteManager() { if (!m_xPaletteManager) { - m_xPaletteManager.reset(new PaletteManager); + m_xPaletteManager = std::make_shared<PaletteManager>(); m_xPaletteManager->SetColorSelectFunction(std::ref(m_aColorWrapper)); } } @@ -4040,7 +4040,7 @@ void ColorListBox::EnsurePaletteManager() { if (!m_xPaletteManager) { - m_xPaletteManager.reset(new PaletteManager); + m_xPaletteManager = std::make_shared<PaletteManager>(); m_xPaletteManager->SetColorSelectFunction(std::ref(m_aColorWrapper)); } } commit cee62b1068775b7d0bcd2875e9789c8c36c22057 Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Fri Jan 24 13:21:10 2020 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Sat Jan 25 07:06:10 2020 +0100 loplugin:makeshared in slideshow Change-Id: I87dead1ed09aa50c939c03ae8ed3faf9300a8b4a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87354 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/slideshow/source/engine/activities/activitiesfactory.cxx b/slideshow/source/engine/activities/activitiesfactory.cxx index eee0f55cda2d..63b39d2d23d5 100644 --- a/slideshow/source/engine/activities/activitiesfactory.cxx +++ b/slideshow/source/engine/activities/activitiesfactory.cxx @@ -420,15 +420,14 @@ AnimationActivitySharedPtr createFromToByActivity( aBy = aTmpValue; } - return AnimationActivitySharedPtr( - new FromToByActivity<BaseType, AnimationType>( + return std::make_shared<FromToByActivity<BaseType, AnimationType>>( aFrom, aTo, aBy, rParms, rAnim, rInterpolator, - bCumulative ) ); + bCumulative ); } /* The following table shows which animator combines with @@ -630,13 +629,12 @@ AnimationActivitySharedPtr createValueListActivity( aValueVector.push_back( aValue ); } - return AnimationActivitySharedPtr( - new ValuesActivity<BaseType, AnimationType>( + return std::make_shared<ValuesActivity<BaseType, AnimationType>>( aValueVector, rParms, rAnim, rInterpolator, - bCumulative ) ); + bCumulative ); } /** Generate Activity for given XAnimate, corresponding to given Value vector @@ -741,10 +739,10 @@ AnimationActivitySharedPtr createActivity( { // since DiscreteActivityBase suspends itself // between the frames, create a WakeupEvent for it. - aActivityParms.mpWakeupEvent.reset( - new WakeupEvent( + aActivityParms.mpWakeupEvent = + std::make_shared<WakeupEvent>( rParms.mrEventQueue.getTimer(), - rParms.mrActivitiesQueue ) ); + rParms.mrActivitiesQueue ); AnimationActivitySharedPtr pActivity( createValueListActivity< DiscreteActivityBase >( @@ -805,10 +803,10 @@ AnimationActivitySharedPtr createActivity( // since DiscreteActivityBase suspends itself // between the frames, create a WakeupEvent for it. - aActivityParms.mpWakeupEvent.reset( - new WakeupEvent( + aActivityParms.mpWakeupEvent = + std::make_shared<WakeupEvent>( rParms.mrEventQueue.getTimer(), - rParms.mrActivitiesQueue ) ); + rParms.mrActivitiesQueue ); AnimationActivitySharedPtr pActivity( createFromToByActivity< DiscreteActivityBase >( @@ -1008,11 +1006,9 @@ AnimationActivitySharedPtr ActivitiesFactory::createSimpleActivity( rParms.mbAutoReverse ); if( bDirectionForward ) - return AnimationActivitySharedPtr( - new SimpleActivity<1>( aActivityParms, rAnim ) ); + return std::make_shared<SimpleActivity<1>>( aActivityParms, rAnim ); else - return AnimationActivitySharedPtr( - new SimpleActivity<0>( aActivityParms, rAnim ) ); + return std::make_shared<SimpleActivity<0>>( aActivityParms, rAnim ); } } // namespace internal diff --git a/slideshow/source/engine/animationfactory.cxx b/slideshow/source/engine/animationfactory.cxx index 4d42fb45a425..ce831d2a4aaf 100644 --- a/slideshow/source/engine/animationfactory.cxx +++ b/slideshow/source/engine/animationfactory.cxx @@ -592,9 +592,8 @@ namespace slideshow typename AnimationBase::ValueType (ShapeAttributeLayer::*pGetValue)() const, void (ShapeAttributeLayer::*pSetValue)( const typename AnimationBase::ValueType& ) ) { - return ::std::shared_ptr< AnimationBase >( - new GenericAnimation< AnimationBase, - SGI_identity< typename AnimationBase::ValueType > >( + return std::make_shared<GenericAnimation< AnimationBase, + SGI_identity< typename AnimationBase::ValueType > >>( rShapeManager, nFlags, pIsValid, @@ -603,7 +602,7 @@ namespace slideshow pSetValue, // no modification necessary, use identity functor here SGI_identity< typename AnimationBase::ValueType >(), - SGI_identity< typename AnimationBase::ValueType >() ) ); + SGI_identity< typename AnimationBase::ValueType >() ); } class Scaler @@ -633,15 +632,14 @@ namespace slideshow void (ShapeAttributeLayer::*pSetValue)( const double& ), double nScaleValue ) { - return NumberAnimationSharedPtr( - new GenericAnimation< NumberAnimation, Scaler >( rShapeManager, + return std::make_shared<GenericAnimation< NumberAnimation, Scaler >>( rShapeManager, nFlags, pIsValid, nDefaultValue / nScaleValue, pGetValue, pSetValue, Scaler( 1.0/nScaleValue ), - Scaler( nScaleValue ) ) ); + Scaler( nScaleValue ) ); } @@ -1077,8 +1075,7 @@ namespace slideshow switch( nTransformType ) { case animations::AnimationTransformType::SCALE: - return PairAnimationSharedPtr( - new TupleAnimation< ::basegfx::B2DSize >( + return std::make_shared<TupleAnimation< ::basegfx::B2DSize >>( rShapeManager, nFlags, &ShapeAttributeLayer::isWidthValid, @@ -1091,11 +1088,10 @@ namespace slideshow rBounds.getRange(), &ShapeAttributeLayer::getWidth, &ShapeAttributeLayer::getHeight, - &ShapeAttributeLayer::setSize ) ); + &ShapeAttributeLayer::setSize ); case animations::AnimationTransformType::TRANSLATE: - return PairAnimationSharedPtr( - new TupleAnimation< ::basegfx::B2DPoint >( + return std::make_shared<TupleAnimation< ::basegfx::B2DPoint >>( rShapeManager, nFlags, &ShapeAttributeLayer::isPosXValid, @@ -1108,7 +1104,7 @@ namespace slideshow rSlideSize, &ShapeAttributeLayer::getPosX, &ShapeAttributeLayer::getPosY, - &ShapeAttributeLayer::setPosition ) ); + &ShapeAttributeLayer::setPosition ); default: ENSURE_OR_THROW( false, @@ -1231,11 +1227,10 @@ namespace slideshow const ::basegfx::B2DVector& rSlideSize, int nFlags ) { - return NumberAnimationSharedPtr( - new PathAnimation( rSVGDPath, nAdditive, + return std::make_shared<PathAnimation>( rSVGDPath, nAdditive, rShapeManager, rSlideSize, - nFlags ) ); + nFlags ); } } diff --git a/slideshow/source/engine/animationnodes/animationbasenode.cxx b/slideshow/source/engine/animationnodes/animationbasenode.cxx index a26f840e1017..ef12aa97e104 100644 --- a/slideshow/source/engine/animationnodes/animationbasenode.cxx +++ b/slideshow/source/engine/animationnodes/animationbasenode.cxx @@ -142,10 +142,10 @@ AnimationBaseNode::AnimationBaseNode( // Slide::prefetchShow() initializes shape // attributes right after animation import (or // the Slide class must be changed). - mpShapeSubset.reset( - new ShapeSubset( mpShape, + mpShapeSubset = + std::make_shared<ShapeSubset>( mpShape, rTreeNode, - mpSubsetManager )); + mpSubsetManager ); // Override NodeContext, and flag this node as // a special independent subset one. This is diff --git a/slideshow/source/engine/animationnodes/animationcolornode.cxx b/slideshow/source/engine/animationnodes/animationcolornode.cxx index 4d6daeec3a05..ac3450ea55e3 100644 --- a/slideshow/source/engine/animationnodes/animationcolornode.cxx +++ b/slideshow/source/engine/animationnodes/animationcolornode.cxx @@ -101,13 +101,12 @@ AnimationActivitySharedPtr AnimationColorNode::createActivity() const // interface, and internally converts HSL to RGB color return ActivitiesFactory::createAnimateActivity( aParms, - HSLColorAnimationSharedPtr( - new HSLWrapper( + std::make_shared<HSLWrapper>( AnimationFactory::createColorPropertyAnimation( mxColorNode->getAttributeName(), getShape(), getContext().mpSubsettableShapeManager, - getSlideSize() ))), + getSlideSize() )), mxColorNode ); default: diff --git a/slideshow/source/engine/animationnodes/animationnodefactory.cxx b/slideshow/source/engine/animationnodes/animationnodefactory.cxx index 7589ce03ae85..e39b268991ee 100644 --- a/slideshow/source/engine/animationnodes/animationnodefactory.cxx +++ b/slideshow/source/engine/animationnodes/animationnodefactory.cxx @@ -133,8 +133,8 @@ public: // normalize things, which does the right thing // here: the subset is only removed after _the // last_ animation node releases the shared ptr. - aContext.mpMasterShapeSubset.reset( - new ShapeSubset( *aContext.mpMasterShapeSubset ) ); + aContext.mpMasterShapeSubset = + std::make_shared<ShapeSubset>( *aContext.mpMasterShapeSubset ); createChild( xChildNode, aContext ); } @@ -233,15 +233,15 @@ bool implCreateIteratedNodes( DocTreeNode::NodeType::LogicalParagraph ) > aTarget.Paragraph, "implCreateIteratedNodes(): paragraph index out of range" ); - pTargetSubset.reset( - new ShapeSubset( + pTargetSubset = + std::make_shared<ShapeSubset>( pTargetShape, // retrieve index aTarget.Paragraph of // type PARAGRAPH from this shape rTreeNodeSupplier.getTreeNode( aTarget.Paragraph, DocTreeNode::NodeType::LogicalParagraph ), - rContext.maContext.mpSubsettableShapeManager ) ); + rContext.maContext.mpSubsettableShapeManager ); // iterate target is not the whole shape, but only // the selected paragraph - subset _must_ be @@ -263,9 +263,9 @@ bool implCreateIteratedNodes( } else { - pTargetSubset.reset( - new ShapeSubset( pTargetShape, - rContext.maContext.mpSubsettableShapeManager )); + pTargetSubset = + std::make_shared<ShapeSubset>( pTargetShape, + rContext.maContext.mpSubsettableShapeManager ); } aContext.mpMasterShapeSubset = pTargetSubset; @@ -397,22 +397,22 @@ bool implCreateIteratedNodes( if( bParagraphTarget ) { // create subsets relative to paragraph subset - aContext.mpMasterShapeSubset.reset( - new ShapeSubset( + aContext.mpMasterShapeSubset = + std::make_shared<ShapeSubset>( pTargetSubset, rTreeNodeSupplier.getSubsetTreeNode( pTargetSubset->getSubset(), i, - eIterateNodeType ) ) ); + eIterateNodeType ) ); } else { // create subsets from main shape - aContext.mpMasterShapeSubset.reset( - new ShapeSubset( pTargetSubset, + aContext.mpMasterShapeSubset = + std::make_shared<ShapeSubset>( pTargetSubset, rTreeNodeSupplier.getTreeNode( i, - eIterateNodeType ) ) ); + eIterateNodeType ) ); } CloningNodeCreator aCreator( rParent, aContext ); @@ -452,61 +452,61 @@ BaseNodeSharedPtr implCreateAnimationNode( return pCreatedNode; case animations::AnimationNodeType::PAR: - pCreatedNode = pCreatedContainer = BaseContainerNodeSharedPtr( - new ParallelTimeContainer( xNode, rParent, rContext ) ); + pCreatedNode = pCreatedContainer = + std::make_shared<ParallelTimeContainer>( xNode, rParent, rContext ); break; case animations::AnimationNodeType::ITERATE: // map iterate container to ParallelTimeContainer. // the iterating functionality is to be found // below, (see method implCreateIteratedNodes) - pCreatedNode = pCreatedContainer = BaseContainerNodeSharedPtr( - new ParallelTimeContainer( xNode, rParent, rContext ) ); + pCreatedNode = pCreatedContainer = + std::make_shared<ParallelTimeContainer>( xNode, rParent, rContext ); break; case animations::AnimationNodeType::SEQ: - pCreatedNode = pCreatedContainer = BaseContainerNodeSharedPtr( - new SequentialTimeContainer( xNode, rParent, rContext ) ); + pCreatedNode = pCreatedContainer = + std::make_shared<SequentialTimeContainer>( xNode, rParent, rContext ); break; case animations::AnimationNodeType::ANIMATE: - pCreatedNode.reset( new PropertyAnimationNode( - xNode, rParent, rContext ) ); + pCreatedNode = std::make_shared<PropertyAnimationNode>( + xNode, rParent, rContext ); break; case animations::AnimationNodeType::SET: - pCreatedNode.reset( new AnimationSetNode( - xNode, rParent, rContext ) ); + pCreatedNode = std::make_shared<AnimationSetNode>( + xNode, rParent, rContext ); break; case animations::AnimationNodeType::ANIMATEMOTION: - pCreatedNode.reset( new AnimationPathMotionNode( - xNode, rParent, rContext ) ); + pCreatedNode = std::make_shared<AnimationPathMotionNode>( + xNode, rParent, rContext ); break; case animations::AnimationNodeType::ANIMATECOLOR: - pCreatedNode.reset( new AnimationColorNode( - xNode, rParent, rContext ) ); + pCreatedNode = std::make_shared<AnimationColorNode>( + xNode, rParent, rContext ); break; case animations::AnimationNodeType::ANIMATETRANSFORM: - pCreatedNode.reset( new AnimationTransformNode( - xNode, rParent, rContext ) ); + pCreatedNode = std::make_shared<AnimationTransformNode>( + xNode, rParent, rContext ); break; case animations::AnimationNodeType::TRANSITIONFILTER: - pCreatedNode.reset( new AnimationTransitionFilterNode( - xNode, rParent, rContext ) ); + pCreatedNode = std::make_shared<AnimationTransitionFilterNode>( + xNode, rParent, rContext ); break; case animations::AnimationNodeType::AUDIO: - pCreatedNode.reset( new AnimationAudioNode( - xNode, rParent, rContext ) ); + pCreatedNode = std::make_shared<AnimationAudioNode>( + xNode, rParent, rContext ); break; case animations::AnimationNodeType::COMMAND: - pCreatedNode.reset( new AnimationCommandNode( - xNode, rParent, rContext ) ); + pCreatedNode = std::make_shared<AnimationCommandNode>( + xNode, rParent, rContext ); break; default: diff --git a/slideshow/source/engine/animationnodes/setactivity.hxx b/slideshow/source/engine/animationnodes/setactivity.hxx index fbe6e3a11397..37e3ff3a53b4 100644 --- a/slideshow/source/engine/animationnodes/setactivity.hxx +++ b/slideshow/source/engine/animationnodes/setactivity.hxx @@ -133,8 +133,7 @@ template <class AnimationT> AnimationActivitySharedPtr makeSetActivity( const ::std::shared_ptr< AnimationT >& rAnimation, const typename AnimationT::ValueType& rToValue ) { - return AnimationActivitySharedPtr( - new SetActivity<AnimationT>(rParms,rAnimation,rToValue) ); + return std::make_shared<SetActivity<AnimationT>>(rParms,rAnimation,rToValue); } } // namespace internal diff --git a/slideshow/source/engine/effectrewinder.cxx b/slideshow/source/engine/effectrewinder.cxx index 41f6976fc6ed..729dc2198db1 100644 --- a/slideshow/source/engine/effectrewinder.cxx +++ b/slideshow/source/engine/effectrewinder.cxx @@ -96,20 +96,20 @@ void EffectRewinder::initialize() // b,c) a slide was started or ended (in which case the effect counter // is reset. - mpAnimationStartHandler.reset( - new RewinderAnimationEventHandler( + mpAnimationStartHandler = + std::make_shared<RewinderAnimationEventHandler>( [this]( const AnimationNodeSharedPtr& pNode) - { return this->notifyAnimationStart( pNode ); } ) ); + { return this->notifyAnimationStart( pNode ); } ); mrEventMultiplexer.addAnimationStartHandler(mpAnimationStartHandler); - mpSlideStartHandler.reset( - new RewinderEventHandler( - [this]() { return this->resetEffectCount(); } ) ); + mpSlideStartHandler = + std::make_shared<RewinderEventHandler>( + [this]() { return this->resetEffectCount(); } ); mrEventMultiplexer.addSlideStartHandler(mpSlideStartHandler); - mpSlideEndHandler.reset( - new RewinderEventHandler( - [this]() { return this->resetEffectCount(); } ) ); + mpSlideEndHandler = + std::make_shared<RewinderEventHandler>( + [this]() { return this->resetEffectCount(); } ); mrEventMultiplexer.addSlideEndHandler(mpSlideEndHandler); } diff --git a/slideshow/source/engine/rehearsetimingsactivity.cxx b/slideshow/source/engine/rehearsetimingsactivity.cxx index ce07413054a4..48920bae0e51 100644 --- a/slideshow/source/engine/rehearsetimingsactivity.cxx +++ b/slideshow/source/engine/rehearsetimingsactivity.cxx @@ -189,12 +189,12 @@ std::shared_ptr<RehearseTimingsActivity> RehearseTimingsActivity::create( std::shared_ptr<RehearseTimingsActivity> pActivity( new RehearseTimingsActivity( rContext )); - pActivity->mpMouseHandler.reset( - new MouseHandler(*pActivity) ); - pActivity->mpWakeUpEvent.reset( - new WakeupEvent( rContext.mrEventQueue.getTimer(), + pActivity->mpMouseHandler = + std::make_shared<MouseHandler>(*pActivity); + pActivity->mpWakeUpEvent = + std::make_shared<WakeupEvent>( rContext.mrEventQueue.getTimer(), pActivity, - rContext.mrActivitiesQueue )); + rContext.mrActivitiesQueue ); rContext.mrEventMultiplexer.addViewHandler( pActivity ); diff --git a/slideshow/source/engine/shapes/backgroundshape.cxx b/slideshow/source/engine/shapes/backgroundshape.cxx index adc550662298..dde159ca477f 100644 --- a/slideshow/source/engine/shapes/backgroundshape.cxx +++ b/slideshow/source/engine/shapes/backgroundshape.cxx @@ -288,11 +288,10 @@ namespace slideshow const uno::Reference< drawing::XDrawPage >& xMasterPage, const SlideShowContext& rContext ) { - return ShapeSharedPtr( - new BackgroundShape( + return std::make_shared<BackgroundShape>( xDrawPage, xMasterPage, - rContext )); + rContext ); } } } diff --git a/slideshow/source/engine/shapes/drawinglayeranimation.cxx b/slideshow/source/engine/shapes/drawinglayeranimation.cxx index 0e377c8b855b..46bbb7efd2cb 100644 --- a/slideshow/source/engine/shapes/drawinglayeranimation.cxx +++ b/slideshow/source/engine/shapes/drawinglayeranimation.cxx @@ -713,7 +713,7 @@ ActivityImpl::ActivityImpl( : maContext(rContext), mpWakeupEvent(pWakeupEvent), mpParentDrawShape(pParentDrawShape), - mpListener( new IntrinsicAnimationListener(*this) ), + mpListener( std::make_shared<IntrinsicAnimationListener>(*this) ), maTimer(rContext.mrEventQueue.getTimer()), mfRotationAngle(0.0), mbIsShapeAnimated(false), @@ -912,7 +912,7 @@ std::shared_ptr<Activity> createDrawingLayerAnimActivity( { auto const pWakeupEvent = std::make_shared<WakeupEvent>( rContext.mrEventQueue.getTimer(), rContext.mrActivitiesQueue ); - pActivity.reset( new ActivityImpl( rContext, pWakeupEvent, pDrawShape ) ); + pActivity = std::make_shared<ActivityImpl>( rContext, pWakeupEvent, pDrawShape ); pWakeupEvent->setActivity( pActivity ); } catch( uno::RuntimeException& ) diff --git a/slideshow/source/engine/shapes/drawshape.cxx b/slideshow/source/engine/shapes/drawshape.cxx index a09dd07e19f0..f4a541ecd907 100644 --- a/slideshow/source/engine/shapes/drawshape.cxx +++ b/slideshow/source/engine/shapes/drawshape.cxx @@ -69,7 +69,7 @@ namespace slideshow mxComponentContext); if (!mpCurrMtf) - mpCurrMtf.reset( new GDIMetaFile ); + mpCurrMtf = std::make_shared<GDIMetaFile>(); // TODO(F1): Currently, the scroll metafile will // never contain any verbose text comments. Thus, @@ -387,7 +387,7 @@ namespace slideshow xContainingPage, mnCurrMtfLoadFlags, mxComponentContext ); if (!mpCurrMtf) - mpCurrMtf.reset(new GDIMetaFile); + mpCurrMtf = std::make_shared<GDIMetaFile>(); maSubsetting.reset( mpCurrMtf ); @@ -547,9 +547,9 @@ namespace slideshow std::back_insert_iterator< std::vector<double> >( aTimeout ), std::mem_fn(&MtfAnimationFrame::getDuration) ); - WakeupEventSharedPtr pWakeupEvent( - new WakeupEvent( rContext.mrEventQueue.getTimer(), - rContext.mrActivitiesQueue ) ); + WakeupEventSharedPtr pWakeupEvent = + std::make_shared<WakeupEvent>( rContext.mrEventQueue.getTimer(), + rContext.mrActivitiesQueue ); ActivitySharedPtr pActivity = createIntrinsicAnimationActivity( @@ -604,7 +604,7 @@ namespace slideshow return; } - ViewShapeSharedPtr pNewShape( new ViewShape( rNewLayer ) ); + ViewShapeSharedPtr pNewShape = std::make_shared<ViewShape>( rNewLayer ); maViewShapes.push_back( pNewShape ); @@ -1015,7 +1015,7 @@ namespace slideshow ShapeAttributeLayerSharedPtr DrawShape::createAttributeLayer() { // create new layer, with last as its new child - mpAttributeLayer.reset( new ShapeAttributeLayer( mpAttributeLayer ) ); + mpAttributeLayer = std::make_shared<ShapeAttributeLayer>( mpAttributeLayer ); // Update the local state ids to reflect those of the new layer. updateStateIds(); diff --git a/slideshow/source/engine/shapes/externalshapebase.cxx b/slideshow/source/engine/shapes/externalshapebase.cxx index fef7cef6d5d4..52b617ebf8c3 100644 --- a/slideshow/source/engine/shapes/externalshapebase.cxx +++ b/slideshow/source/engine/shapes/externalshapebase.cxx @@ -83,7 +83,7 @@ namespace slideshow const SlideShowContext& rContext ) : mxComponentContext( rContext.mxComponentContext ), mxShape( xShape ), - mpListener( new ExternalShapeBaseListener(*this) ), + mpListener( std::make_shared<ExternalShapeBaseListener>(*this) ), mpShapeManager( rContext.mpSubsettableShapeManager ), mrEventMultiplexer( rContext.mrEventMultiplexer ), mnPriority( nPrio ), // TODO(F1): When ZOrder someday becomes usable: make this ( getAPIShapePrio( xShape ) ), diff --git a/slideshow/source/engine/shapes/gdimtftools.cxx b/slideshow/source/engine/shapes/gdimtftools.cxx index 2a7bb51a4ae8..3a06b8002dd7 100644 --- a/slideshow/source/engine/shapes/gdimtftools.cxx +++ b/slideshow/source/engine/shapes/gdimtftools.cxx @@ -131,7 +131,7 @@ public: hasUnsupportedActions(aGraphic.GetGDIMetaFile()) ) ) { // wrap bitmap into GDIMetafile - GDIMetaFileSharedPtr xMtf(new GDIMetaFile); + GDIMetaFileSharedPtr xMtf = std::make_shared<GDIMetaFile>(); ::BitmapEx aBmpEx( aGraphic.GetBitmapEx() ); @@ -346,7 +346,7 @@ bool getAnimationFromGraphic( VectorOfMtfAnimationFrames& o_rFrames, // extract current aVDev content into a new animation // frame - GDIMetaFileSharedPtr pMtf( new GDIMetaFile() ); + GDIMetaFileSharedPtr pMtf = std::make_shared<GDIMetaFile>(); pMtf->AddAction( new MetaBmpExAction( aEmptyPoint, BitmapEx( diff --git a/slideshow/source/engine/shapes/intrinsicanimationactivity.cxx b/slideshow/source/engine/shapes/intrinsicanimationactivity.cxx index de0bc4e5a2ea..3fe1d59ce8d7 100644 --- a/slideshow/source/engine/shapes/intrinsicanimationactivity.cxx +++ b/slideshow/source/engine/shapes/intrinsicanimationactivity.cxx @@ -118,7 +118,7 @@ namespace slideshow maContext( rContext ), mpDrawShape( rDrawShape ), mpWakeupEvent( rWakeupEvent ), - mpListener( new IntrinsicAnimationListener(*this) ), + mpListener( std::make_shared<IntrinsicAnimationListener>(*this) ), maTimeouts( rTimeouts ), mnCurrIndex(0), mnNumLoops(nNumLoops), @@ -240,12 +240,11 @@ namespace slideshow const ::std::vector<double>& rTimeouts, sal_uInt32 nNumLoops) { - return ActivitySharedPtr( - new IntrinsicAnimationActivity(rContext, + return std::make_shared<IntrinsicAnimationActivity>(rContext, rDrawShape, rWakeupEvent, rTimeouts, - nNumLoops) ); + nNumLoops); } } } diff --git a/slideshow/source/engine/shapes/shapeimporter.cxx b/slideshow/source/engine/shapes/shapeimporter.cxx index c3b681017106..06ac4275af1d 100644 --- a/slideshow/source/engine/shapes/shapeimporter.cxx +++ b/slideshow/source/engine/shapes/shapeimporter.cxx @@ -477,10 +477,10 @@ ShapeSharedPtr ShapeImporter::importShape() // throw (ShapeLoadFailedException) if( rTop.mpGroupShape ) // in group particle mode? { - pRet.reset( new ShapeOfGroup( + pRet = std::make_shared<ShapeOfGroup>( rTop.mpGroupShape /* container shape */, xCurrShape, xPropSet, - mnAscendingPrio ) ); + mnAscendingPrio ); } else { diff --git a/slideshow/source/engine/shapes/viewshape.cxx b/slideshow/source/engine/shapes/viewshape.cxx index 8426503671f1..5df9650b4cc7 100644 --- a/slideshow/source/engine/shapes/viewshape.cxx +++ b/slideshow/source/engine/shapes/viewshape.cxx @@ -353,10 +353,9 @@ namespace slideshow const ::basegfx::B2DSize& rSpriteSizePixel(rSpriteBoundsPixel.getRange()); if( !mpSprite ) { - mpSprite.reset( - new AnimatedSprite( mpViewLayer, + mpSprite = std::make_shared<AnimatedSprite>( mpViewLayer, rSpriteSizePixel, - nPrio )); + nPrio ); } else { diff --git a/slideshow/source/engine/slide/layermanager.cxx b/slideshow/source/engine/slide/layermanager.cxx index 543308ef5496..eb97b32da11d 100644 --- a/slideshow/source/engine/slide/layermanager.cxx +++ b/slideshow/source/engine/slide/layermanager.cxx @@ -611,7 +611,7 @@ namespace slideshow bool LayerManager::renderTo( const ::cppcanvas::CanvasSharedPtr& rTargetCanvas ) const { bool bRet( true ); - ViewLayerSharedPtr pTmpLayer( new DummyLayer( rTargetCanvas ) ); + ViewLayerSharedPtr pTmpLayer = std::make_shared<DummyLayer>( rTargetCanvas ); for( const auto& rShape : maAllShapes ) { diff --git a/slideshow/source/engine/slide/slideimpl.cxx b/slideshow/source/engine/slide/slideimpl.cxx index f58cca2128e6..ebd16911d2c0 100644 --- a/slideshow/source/engine/slide/slideimpl.cxx +++ b/slideshow/source/engine/slide/slideimpl.cxx @@ -307,10 +307,10 @@ SlideImpl::SlideImpl( const uno::Reference< drawing::XDrawPage >& xDra mxDrawPage( xDrawPage ), mxDrawPagesSupplier( xDrawPages ), mxRootNode( xRootNode ), - mpLayerManager( new LayerManager( + mpLayerManager( std::make_shared<LayerManager>( rViewContainer, bDisableAnimationZOrder) ), - mpShapeManager( new ShapeManagerImpl( + mpShapeManager( std::make_shared<ShapeManagerImpl>( rEventMultiplexer, mpLayerManager, rCursorManager, diff --git a/slideshow/source/engine/slide/userpaintoverlay.cxx b/slideshow/source/engine/slide/userpaintoverlay.cxx index e3f1954557b5..179b937d874a 100644 --- a/slideshow/source/engine/slide/userpaintoverlay.cxx +++ b/slideshow/source/engine/slide/userpaintoverlay.cxx @@ -443,7 +443,7 @@ namespace slideshow const SlideShowContext& rContext, const PolyPolygonVector& rPolygons, bool bActive ) : - mpHandler( new PaintOverlayHandler( rStrokeColor, + mpHandler( std::make_shared<PaintOverlayHandler>( rStrokeColor, nStrokeWidth, rContext.mrScreenUpdater, rContext.mrViewContainer, diff --git a/slideshow/source/engine/slideshowimpl.cxx b/slideshow/source/engine/slideshowimpl.cxx index 9e9893ffdbba..0e3d0f87e927 100644 --- a/slideshow/source/engine/slideshowimpl.cxx +++ b/slideshow/source/engine/slideshowimpl.cxx @@ -534,7 +534,7 @@ SlideShowImpl::SlideShowImpl( maShapeCursors(), maUserPaintColor(), maUserPaintStrokeWidth(4.0), - mpPresTimer( new canvas::tools::ElapsedTime ), + mpPresTimer( std::make_shared<canvas::tools::ElapsedTime>() ), maScreenUpdater(maViewContainer), maEventQueue( mpPresTimer ), maEventMultiplexer( maEventQueue, @@ -593,10 +593,10 @@ SlideShowImpl::SlideShowImpl( } } - mpListener.reset( new SeparateListenerImpl( + mpListener = std::make_shared<SeparateListenerImpl>( *this, maScreenUpdater, - maEventQueue )); + maEventQueue ); maEventMultiplexer.addSlideAnimationsEndHandler( mpListener ); maEventMultiplexer.addViewRepaintHandler( mpListener ); maEventMultiplexer.addHyperlinkHandler( mpListener, 0.0 ); @@ -2332,7 +2332,7 @@ std::shared_ptr<avmedia::MediaTempFile> SlideShowImpl::getMediaTempFile(const OU OUString sTempUrl; if (::avmedia::CreateMediaTempFile(xInStream, sTempUrl, sDesiredExtension)) - aRet.reset(new avmedia::MediaTempFile(sTempUrl)); + aRet = std::make_shared<avmedia::MediaTempFile>(sTempUrl); xInStream->closeInput(); } diff --git a/slideshow/source/engine/smilfunctionparser.cxx b/slideshow/source/engine/smilfunctionparser.cxx index a2da99a4f29e..4953ccde2fcc 100644 --- a/slideshow/source/engine/smilfunctionparser.cxx +++ b/slideshow/source/engine/smilfunctionparser.cxx @@ -509,7 +509,7 @@ namespace slideshow const ParserContextSharedPtr& getParserContext() { - static ParserContextSharedPtr lcl_parserContext( new ParserContext ); + static ParserContextSharedPtr lcl_parserContext = std::make_shared<ParserContext>(); // clear node stack (since we reuse the static object, that's // the whole point here) diff --git a/slideshow/source/engine/transitions/parametricpolypolygonfactory.cxx b/slideshow/source/engine/transitions/parametricpolypolygonfactory.cxx index 2f190257902d..94ee99cecd48 100644 --- a/slideshow/source/engine/transitions/parametricpolypolygonfactory.cxx +++ b/slideshow/source/engine/transitions/parametricpolypolygonfactory.cxx @@ -61,61 +61,46 @@ namespace slideshow switch (nType) { case BARWIPE: - return ParametricPolyPolygonSharedPtr( - new BarWipePolyPolygon ); + return std::make_shared<BarWipePolyPolygon>(); case BLINDSWIPE: - return ParametricPolyPolygonSharedPtr( - new BarWipePolyPolygon( 6 ) ); + return std::make_shared<BarWipePolyPolygon>( 6 ); case BOXWIPE: - return ParametricPolyPolygonSharedPtr( - new BoxWipe( nSubType == LEFTCENTER || + return std::make_shared<BoxWipe>( nSubType == LEFTCENTER || nSubType == TOPCENTER || nSubType == RIGHTCENTER|| - nSubType == BOTTOMCENTER ) ); + nSubType == BOTTOMCENTER ); case FOURBOXWIPE: - return ParametricPolyPolygonSharedPtr( - new FourBoxWipe( nSubType == CORNERSOUT ) ); + return std::make_shared<FourBoxWipe>( nSubType == CORNERSOUT ); case BARNDOORWIPE: - return ParametricPolyPolygonSharedPtr( - new BarnDoorWipe ); + return std::make_shared<BarnDoorWipe>(); case DIAGONALWIPE: - return ParametricPolyPolygonSharedPtr( - new BarWipePolyPolygon ); + return std::make_shared<BarWipePolyPolygon>(); case VEEWIPE: - return ParametricPolyPolygonSharedPtr( - new VeeWipe ); + return std::make_shared<VeeWipe>(); case IRISWIPE: - return ParametricPolyPolygonSharedPtr( - new IrisWipe ); + return std::make_shared<IrisWipe>(); case ELLIPSEWIPE: - return ParametricPolyPolygonSharedPtr( - new EllipseWipe(nSubType) ); + return std::make_shared<EllipseWipe>(nSubType); case CHECKERBOARDWIPE: - return ParametricPolyPolygonSharedPtr( - new CheckerBoardWipe ); + return std::make_shared<CheckerBoardWipe>(); case RANDOMBARWIPE: - return ParametricPolyPolygonSharedPtr( - new RandomWipe( 128, true /* bars */ ) ); + return std::make_shared<RandomWipe>( 128, true /* bars */ ); case DISSOLVE: - return ParametricPolyPolygonSharedPtr( - new RandomWipe( 16 * 16, // for now until dxcanvas is faster + return std::make_shared<RandomWipe>( 16 * 16, // for now until dxcanvas is faster // 64 * 64 /* elements */, - false /* dissolve */ ) ); + false /* dissolve */ ); case WATERFALLWIPE: - return ParametricPolyPolygonSharedPtr( - new WaterfallWipe( + return std::make_shared<WaterfallWipe>( 128, // flipOnYAxis: nSubType == VERTICALRIGHT || - nSubType == HORIZONTALLEFT ) ); + nSubType == HORIZONTALLEFT ); case CLOCKWIPE: - return ParametricPolyPolygonSharedPtr( - new ClockWipe ); + return std::make_shared<ClockWipe>(); case FANWIPE: - return ParametricPolyPolygonSharedPtr( - new FanWipe( // center: + return std::make_shared<FanWipe>( // center: nSubType == CENTERTOP || - nSubType == CENTERRIGHT ) ); + nSubType == CENTERRIGHT ); case PINWHEELWIPE: { sal_Int32 blades; switch (nSubType) { @@ -135,12 +120,10 @@ namespace slideshow blades = 2; break; } - return ParametricPolyPolygonSharedPtr( - new PinWheelWipe( blades ) ); + return std::make_shared<PinWheelWipe>( blades ); } case SNAKEWIPE: - return ParametricPolyPolygonSharedPtr( - new SnakeWipe( + return std::make_shared<SnakeWipe>( // elements: 8 * 8, // diagonal: @@ -152,10 +135,9 @@ namespace slideshow nSubType == TOPLEFTVERTICAL || nSubType == TOPRIGHTDIAGONAL || nSubType == BOTTOMLEFTDIAGONAL - ) ); + ); case PARALLELSNAKESWIPE: - return ParametricPolyPolygonSharedPtr( - new ParallelSnakesWipe( + return std::make_shared<ParallelSnakesWipe>( // elements: 8 * 8, // diagonal: @@ -172,28 +154,25 @@ namespace slideshow nSubType == HORIZONTALTOPRIGHTOPPOSITE || nSubType == DIAGONALBOTTOMLEFTOPPOSITE || nSubType == DIAGONALTOPLEFTOPPOSITE - ) ); + ); case SPIRALWIPE: - return ParametricPolyPolygonSharedPtr( - new SpiralWipe( + return std::make_shared<SpiralWipe>( // elements: 8 * 8, // flipOnYAxis: nSubType == TOPLEFTCOUNTERCLOCKWISE || nSubType == TOPRIGHTCOUNTERCLOCKWISE || nSubType == BOTTOMRIGHTCOUNTERCLOCKWISE || - nSubType == BOTTOMLEFTCOUNTERCLOCKWISE ) ); + nSubType == BOTTOMLEFTCOUNTERCLOCKWISE ); case BOXSNAKESWIPE: - return ParametricPolyPolygonSharedPtr( - new BoxSnakesWipe( + return std::make_shared<BoxSnakesWipe>( // elements: 8 * 8, // fourBox: nSubType == FOURBOXVERTICAL || - nSubType == FOURBOXHORIZONTAL ) ); + nSubType == FOURBOXHORIZONTAL ); case SINGLESWEEPWIPE: - return ParametricPolyPolygonSharedPtr( - new SweepWipe( + return std::make_shared<SweepWipe>( // center: nSubType == CLOCKWISETOP || nSubType == CLOCKWISERIGHT || @@ -206,10 +185,9 @@ namespace slideshow // flipOnYAxis: nSubType == COUNTERCLOCKWISEBOTTOMLEFT || nSubType == COUNTERCLOCKWISETOPRIGHT - ) ); + ); case DOUBLESWEEPWIPE: - return ParametricPolyPolygonSharedPtr( - new SweepWipe( + return std::make_shared<SweepWipe>( // center: nSubType == PARALLELVERTICAL || nSubType == PARALLELDIAGONAL || @@ -221,17 +199,16 @@ namespace slideshow nSubType == OPPOSITEVERTICAL || nSubType == OPPOSITEHORIZONTAL, // flipOnYAxis: - false ) ); + false ); case DOUBLEFANWIPE: - return ParametricPolyPolygonSharedPtr( - new FanWipe( + return std::make_shared<FanWipe>( //center: true, // single: false, // fanIn: nSubType == FANINVERTICAL || - nSubType == FANINHORIZONTAL ) ); + nSubType == FANINHORIZONTAL ); case TRIANGLEWIPE: return ParametricPolyPolygonSharedPtr( FigureWipe::createTriangleWipe() ); @@ -263,18 +240,16 @@ namespace slideshow case MISCDIAGONALWIPE: { switch (nSubType) { case DOUBLEBARNDOOR: - return ParametricPolyPolygonSharedPtr( - new BarnDoorWipe( true /* doubled */ ) ); + return std::make_shared<BarnDoorWipe>( true /* doubled */ ); case DOUBLEDIAMOND: - return ParametricPolyPolygonSharedPtr( - new DoubleDiamondWipe ); + return std::make_shared<DoubleDiamondWipe>(); } break; } case ZIGZAGWIPE: - return ParametricPolyPolygonSharedPtr( new ZigZagWipe(5) ); + return std::make_shared<ZigZagWipe>(5); case BARNZIGZAGWIPE: - return ParametricPolyPolygonSharedPtr( new BarnZigZagWipe(5) ); + return std::make_shared<BarnZigZagWipe>(5); case BOWTIEWIPE: case BARNVEEWIPE: @@ -284,8 +259,7 @@ namespace slideshow case SALOONDOORWIPE: case WINDSHIELDWIPE: // for now, map to barwipe transition - return ParametricPolyPolygonSharedPtr( - new BarWipePolyPolygon ); + return std::make_shared<BarWipePolyPolygon>(); default: case PUSHWIPE: diff --git a/slideshow/source/engine/transitions/shapetransitionfactory.cxx b/slideshow/source/engine/transitions/shapetransitionfactory.cxx index 666ce116b6be..ce4da4cb1611 100644 --- a/slideshow/source/engine/transitions/shapetransitionfactory.cxx +++ b/slideshow/source/engine/transitions/shapetransitionfactory.cxx @@ -219,13 +219,12 @@ AnimationActivitySharedPtr createShapeTransitionByType( // create a clip activity from that pGeneratedActivity = ActivitiesFactory::createSimpleActivity( rParms, - NumberAnimationSharedPtr( - new ClippingAnimation( + std::make_shared<ClippingAnimation>( pPoly, rShapeManager, *pTransitionInfo, xTransition->getDirection(), - xTransition->getMode() ) ), + xTransition->getMode() ), true ); } break; @@ -302,14 +301,13 @@ AnimationActivitySharedPtr createShapeTransitionByType( // create a clip activity from that pGeneratedActivity = ActivitiesFactory::createSimpleActivity( rParms, - NumberAnimationSharedPtr( - new ClippingAnimation( + std::make_shared<ClippingAnimation>( pPoly, rShapeManager, *getTransitionInfo( animations::TransitionType::BARWIPE, nBarWipeSubType ), bDirectionForward, - xTransition->getMode() ) ), + xTransition->getMode() ), true ); } break; diff --git a/slideshow/source/engine/transitions/slidechangebase.cxx b/slideshow/source/engine/transitions/slidechangebase.cxx index 6c53690017cc..e0ef0b060b1f 100644 --- a/slideshow/source/engine/transitions/slidechangebase.cxx +++ b/slideshow/source/engine/transitions/slidechangebase.cxx @@ -125,7 +125,7 @@ SlideBitmapSharedPtr SlideChangeBase::createBitmap( const UnoViewSharedPtr& slideSizePixel.getY() ), 0x000000FFU ); - pRet.reset( new SlideBitmap( pBitmap )); + pRet = std::make_shared<SlideBitmap>( pBitmap ); } else { diff --git a/slideshow/source/engine/transitions/slidetransitionfactory.cxx b/slideshow/source/engine/transitions/slidetransitionfactory.cxx index 30724effa283..52b2bdc0b105 100644 --- a/slideshow/source/engine/transitions/slidetransitionfactory.cxx +++ b/slideshow/source/engine/transitions/slidetransitionfactory.cxx @@ -730,27 +730,25 @@ NumberAnimationSharedPtr createPushWipeTransition( if( bComb ) { - return NumberAnimationSharedPtr( - new CombTransition( leavingSlide, + return std::make_shared<CombTransition>( leavingSlide, pEnteringSlide, pSoundPlayer, rViewContainer, rScreenUpdater, rEventMultiplexer, aDirection, - 24 /* comb with 12 stripes */ )); + 24 /* comb with 12 stripes */ ); } else { - return NumberAnimationSharedPtr( - new MovingSlideChange( leavingSlide, + return std::make_shared<MovingSlideChange>( leavingSlide, pEnteringSlide, pSoundPlayer, rViewContainer, rScreenUpdater, rEventMultiplexer, aDirection, - aDirection )); + aDirection ); } } @@ -816,8 +814,7 @@ NumberAnimationSharedPtr createSlideWipeTransition( // the 'leaving' slide. - return NumberAnimationSharedPtr( - new MovingSlideChange( + return std::make_shared<MovingSlideChange>( o3tl::optional<SlideSharedPtr>() /* no slide */, pEnteringSlide, pSoundPlayer, @@ -825,7 +822,7 @@ NumberAnimationSharedPtr createSlideWipeTransition( rScreenUpdater, rEventMultiplexer, basegfx::B2DVector(), - aInDirection )); + aInDirection ); } else { @@ -834,15 +831,14 @@ NumberAnimationSharedPtr createSlideWipeTransition( // and the old one is moving off in the foreground. - return NumberAnimationSharedPtr( - new MovingSlideChange( leavingSlide, + return std::make_shared<MovingSlideChange>( leavingSlide, pEnteringSlide, pSoundPlayer, rViewContainer, rScreenUpdater, rEventMultiplexer, aInDirection, - basegfx::B2DVector() )); + basegfx::B2DVector() ); } } @@ -953,15 +949,14 @@ NumberAnimationSharedPtr TransitionFactory::createSlideTransition( nTransitionType, nTransitionSubType ) ); // create a clip transition from that - return NumberAnimationSharedPtr( - new ClippedSlideChange( pEnteringSlide, + return std::make_shared<ClippedSlideChange>( pEnteringSlide, pPoly, *pTransitionInfo, rViewContainer, rScreenUpdater, rEventMultiplexer, bTransitionDirection, - pSoundPlayer )); + pSoundPlayer ); } case TransitionInfo::TRANSITION_SPECIAL: @@ -1070,25 +1065,23 @@ NumberAnimationSharedPtr TransitionFactory::createSlideTransition( } if( nTransitionType == animations::TransitionType::FADE ) - return NumberAnimationSharedPtr( - new FadingSlideChange( + return std::make_shared<FadingSlideChange>( leavingSlide, pEnteringSlide, aFadeColor, pSoundPlayer, rViewContainer, rScreenUpdater, - rEventMultiplexer )); + rEventMultiplexer ); else - return NumberAnimationSharedPtr( - new CutSlideChange( + return std::make_shared<CutSlideChange>( leavingSlide, pEnteringSlide, rTransitionFadeColor, pSoundPlayer, rViewContainer, rScreenUpdater, - rEventMultiplexer )); + rEventMultiplexer ); } } } diff --git a/slideshow/source/engine/usereventqueue.cxx b/slideshow/source/engine/usereventqueue.cxx index 44078a390cb4..51a725fa7de7 100644 --- a/slideshow/source/engine/usereventqueue.cxx +++ b/slideshow/source/engine/usereventqueue.cxx @@ -495,7 +495,7 @@ void UserEventQueue::registerEvent( if( !rHandler ) { // create handler - rHandler.reset( new Handler( mrEventQueue ) ); + rHandler = std::make_shared<Handler>( mrEventQueue ); // register handler on EventMultiplexer rRegistrationFunctor( rHandler ); } @@ -515,7 +515,7 @@ void UserEventQueue::registerEvent( if( !rHandler ) { // create handler - rHandler.reset( new Handler( mrEventQueue ) ); + rHandler = std::make_shared<Handler>( mrEventQueue ); // register handler on EventMultiplexer rRegistrationFunctor( rHandler ); @@ -659,9 +659,9 @@ void UserEventQueue::registerShapeClickEvent( const EventSharedPtr& rEvent, if( !mpShapeClickEventHandler ) { // create handler - mpShapeClickEventHandler.reset( - new ShapeClickEventHandler(mrCursorManager, - mrEventQueue) ); + mpShapeClickEventHandler = + std::make_shared<ShapeClickEventHandler>(mrCursorManager, + mrEventQueue); // register handler on EventMultiplexer mrMultiplexer.addClickHandler( mpShapeClickEventHandler, 1.0 ); @@ -722,8 +722,8 @@ void UserEventQueue::registerSkipEffectEvent( { if(!mpSkipEffectEventHandler) { - mpSkipEffectEventHandler.reset( - new SkipEffectEventHandler( mrEventQueue, mrMultiplexer ) ); + mpSkipEffectEventHandler = + std::make_shared<SkipEffectEventHandler>( mrEventQueue, mrMultiplexer ); // register the handler on _two_ sources: we want the // nextEffect events, e.g. space bar, to trigger clicks, as well! mrMultiplexer.addClickHandler( mpSkipEffectEventHandler, @@ -750,9 +750,9 @@ void UserEventQueue::registerShapeDoubleClickEvent( if( !mpShapeDoubleClickEventHandler ) { // create handler - mpShapeDoubleClickEventHandler.reset( - new ShapeClickEventHandler(mrCursorManager, - mrEventQueue) ); + mpShapeDoubleClickEventHandler = + std::make_shared<ShapeClickEventHandler>(mrCursorManager, + mrEventQueue); // register handler on EventMultiplexer mrMultiplexer.addDoubleClickHandler( mpShapeDoubleClickEventHandler, diff --git a/slideshow/source/inc/delayevent.hxx b/slideshow/source/inc/delayevent.hxx index 1389b806885e..9585910bf689 100644 --- a/slideshow/source/inc/delayevent.hxx +++ b/slideshow/source/inc/delayevent.hxx @@ -78,7 +78,7 @@ private: template <typename FuncT> inline EventSharedPtr makeDelay_( FuncT const& func, double nTimeout, OUString const& rsDescription ) { - return EventSharedPtr( new Delay( func, nTimeout, rsDescription ) ); + return std::make_shared<Delay>( func, nTimeout, rsDescription ); } /** Generate immediate event @@ -91,7 +91,7 @@ inline EventSharedPtr makeDelay_( FuncT const& func, double nTimeout, OUString c template <typename FuncT> inline EventSharedPtr makeEvent_( FuncT const& func, OUString const& rsDescription) { - return EventSharedPtr( new Delay( func, 0.0, rsDescription ) ); + return std::make_shared<Delay>( func, 0.0, rsDescription ); } diff --git a/slideshow/source/inc/interruptabledelayevent.hxx b/slideshow/source/inc/interruptabledelayevent.hxx index 2d79625ee897..ee2ae17dfb15 100644 --- a/slideshow/source/inc/interruptabledelayevent.hxx +++ b/slideshow/source/inc/interruptabledelayevent.hxx @@ -129,8 +129,8 @@ namespace slideshow InterruptableEventPair aRes; aRes.mpImmediateEvent = makeEvent( rFunctor, "makeInterruptableDelay"); - aRes.mpTimeoutEvent.reset( new DelayFacade( aRes.mpImmediateEvent, - nTimeout ) ); + aRes.mpTimeoutEvent = std::make_shared<DelayFacade>( aRes.mpImmediateEvent, + nTimeout ); return aRes; } diff --git a/slideshow/test/slidetest.cxx b/slideshow/test/slidetest.cxx index e47d4a749dbf..1ba6e71638d1 100644 --- a/slideshow/test/slidetest.cxx +++ b/slideshow/test/slidetest.cxx @@ -51,10 +51,10 @@ public: mpTestView = createTestView(); maViews.addView( mpTestView ); - mpLayerManager.reset( - new target::LayerManager( + mpLayerManager = + std::make_shared<target::LayerManager>( maViews, - false )); + false ); } void tearDown() override diff --git a/slideshow/test/testview.cxx b/slideshow/test/testview.cxx index c4884516d490..237fb3d386b4 100644 --- a/slideshow/test/testview.cxx +++ b/slideshow/test/testview.cxx @@ -213,7 +213,7 @@ public: virtual target::ViewLayerSharedPtr createViewLayer( const basegfx::B2DRange& rLayerBounds ) const override { - maViewLayers.push_back( TestViewSharedPtr(new ImplTestView())); + maViewLayers.push_back( std::make_shared<ImplTestView>()); maViewLayers.back()->resize( rLayerBounds ); return maViewLayers.back(); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits