diff options
author | Noel <noel.grandin@collabora.co.uk> | 2021-02-20 12:50:48 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-02-20 19:21:52 +0100 |
commit | d49277fc7c017c5a62a0c28af782cfc04a6460ab (patch) | |
tree | 62029090284267702379cd7b82422597a86561dd /sfx2/source/dialog | |
parent | 7c992bd895574eb1faf473875f8e655e9b73cb79 (diff) |
loplugin:refcounting in sfx2
Change-Id: I22ca5dab32fb4bf9a1ab7d478105db2d12e14b14
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111262
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sfx2/source/dialog')
-rw-r--r-- | sfx2/source/dialog/infobar.cxx | 9 | ||||
-rw-r--r-- | sfx2/source/dialog/mailmodel.cxx | 7 |
2 files changed, 5 insertions, 11 deletions
diff --git a/sfx2/source/dialog/infobar.cxx b/sfx2/source/dialog/infobar.cxx index c37c563567e7..4844e8eb88df 100644 --- a/sfx2/source/dialog/infobar.cxx +++ b/sfx2/source/dialog/infobar.cxx @@ -122,9 +122,7 @@ void SfxInfoBarWindow::SetCloseButtonImage() aPolygon.append(B2DPoint(aRect.Left(), aRect.Bottom())); aPolygon.setClosed(true); - PolyPolygonColorPrimitive2D* pBack - = new PolyPolygonColorPrimitive2D(B2DPolyPolygon(aPolygon), m_aBackgroundColor); - aSeq[0] = pBack; + aSeq[0] = new PolyPolygonColorPrimitive2D(B2DPolyPolygon(aPolygon), m_aBackgroundColor); LineAttribute aLineAttribute(m_aForegroundColor, 2.0); @@ -141,10 +139,7 @@ void SfxInfoBarWindow::SetCloseButtonImage() aLine2.append(B2DPoint(aRect.Left(), aRect.Bottom())); aCross.append(aLine2); - PolyPolygonStrokePrimitive2D* pCross - = new PolyPolygonStrokePrimitive2D(aCross, aLineAttribute, StrokeAttribute()); - - aSeq[1] = pCross; + aSeq[1] = new PolyPolygonStrokePrimitive2D(aCross, aLineAttribute, StrokeAttribute()); pProcessor->process(aSeq); diff --git a/sfx2/source/dialog/mailmodel.cxx b/sfx2/source/dialog/mailmodel.cxx index b468d35988e4..87ad643da40d 100644 --- a/sfx2/source/dialog/mailmodel.cxx +++ b/sfx2/source/dialog/mailmodel.cxx @@ -497,11 +497,10 @@ SfxMailModel::SaveResult SfxMailModel::SaveDocumentAsFormat( xPrepareDispatch.set( xDispatchProvider->queryDispatch( aPrepareURL, OUString(), 0 )); if ( xPrepareDispatch.is() ) { - PrepareListener_Impl* pPrepareListener = new PrepareListener_Impl; - uno::Reference< css::frame::XStatusListener > xStatusListener = pPrepareListener; - xPrepareDispatch->addStatusListener( xStatusListener, aPrepareURL ); + rtl::Reference<PrepareListener_Impl> pPrepareListener = new PrepareListener_Impl; + xPrepareDispatch->addStatusListener( pPrepareListener, aPrepareURL ); bNeedsPreparation = pPrepareListener->IsSet(); - xPrepareDispatch->removeStatusListener( xStatusListener, aPrepareURL ); + xPrepareDispatch->removeStatusListener( pPrepareListener, aPrepareURL ); } } } |