diff options
author | Noel Grandin <noel@peralex.com> | 2015-10-27 12:52:16 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2015-10-27 12:48:50 +0000 |
commit | e25669fcedcb7231254d3ba0e0224b2e3eb901d8 (patch) | |
tree | 05ce242744c88d9efcd5b685720b2178008c2c8c /sfx2 | |
parent | 96d03636a5f932151c7842ae34631258891fe807 (diff) |
don't allocate uno::Reference on the heap
There is no point, since it's the size of a pointer anyway
(found by temporarily making the new operator in uno::Reference
deleted).
Change-Id: I62a8b957fef9184f65d705600acfdab4116dcb34
Reviewed-on: https://gerrit.libreoffice.org/19603
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/control/thumbnailviewacc.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/control/thumbnailviewitem.cxx | 13 |
2 files changed, 7 insertions, 8 deletions
diff --git a/sfx2/source/control/thumbnailviewacc.cxx b/sfx2/source/control/thumbnailviewacc.cxx index 445e703b77e9..30ee8bf6d013 100644 --- a/sfx2/source/control/thumbnailviewacc.cxx +++ b/sfx2/source/control/thumbnailviewacc.cxx @@ -723,7 +723,7 @@ sal_Int32 SAL_CALL ThumbnailViewItemAcc::getAccessibleIndexInParent() } // Do not create an accessible object for the test. - if (pItem != NULL && pItem->mpxAcc != NULL) + if (pItem != NULL && pItem->mxAcc.is()) if (pItem->GetAccessible( mbIsTransientChildrenDisabled ).get() == this ) { nIndexInParent = i; diff --git a/sfx2/source/control/thumbnailviewitem.cxx b/sfx2/source/control/thumbnailviewitem.cxx index 5ddb650018b0..db75ab60cc01 100644 --- a/sfx2/source/control/thumbnailviewitem.cxx +++ b/sfx2/source/control/thumbnailviewitem.cxx @@ -106,7 +106,7 @@ ThumbnailViewItem::ThumbnailViewItem(ThumbnailView &rView, sal_uInt16 nId) , mbVisible(true) , mbSelected(false) , mbHover(false) - , mpxAcc(NULL) + , mxAcc() , mbEditTitle(false) , mpTitleED(NULL) , maTextEditMaxArea() @@ -117,10 +117,9 @@ ThumbnailViewItem::ThumbnailViewItem(ThumbnailView &rView, sal_uInt16 nId) ThumbnailViewItem::~ThumbnailViewItem() { mpTitleED.disposeAndClear(); - if( mpxAcc ) + if( mxAcc.is() ) { - static_cast< ThumbnailViewItemAcc* >( mpxAcc->get() )->ParentDestroyed(); - delete mpxAcc; + static_cast< ThumbnailViewItemAcc* >( mxAcc.get() )->ParentDestroyed(); } } @@ -218,10 +217,10 @@ void ThumbnailViewItem::setTitle (const OUString& rTitle) uno::Reference< accessibility::XAccessible > ThumbnailViewItem::GetAccessible( bool bIsTransientChildrenDisabled ) { - if( !mpxAcc ) - mpxAcc = new uno::Reference< accessibility::XAccessible >( new ThumbnailViewItemAcc( this, bIsTransientChildrenDisabled ) ); + if( !mxAcc.is() ) + mxAcc = new ThumbnailViewItemAcc( this, bIsTransientChildrenDisabled ); - return *mpxAcc; + return mxAcc; } void ThumbnailViewItem::setDrawArea (const Rectangle &area) |