diff options
author | Noel Grandin <noel@peralex.com> | 2015-10-27 15:12:58 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2015-10-27 15:35:36 +0000 |
commit | 623f5b26ffd77041d0b06d7ce9c3b32d05625440 (patch) | |
tree | ecd905d6657147b1c5a074b4d33f914f0039440c /cui | |
parent | 446f17f6c1f98b17ceb6750f5dc67a27330d1351 (diff) |
don't allocate rtl::Reference or SvRef on the heap
There is no point, since it's the size of a pointer anyway
Found by temporarily making their 'operator new' methods
deleted.
Change-Id: I265e40ce93ad4bad08b4f0bd49db08929e44b7d6
Reviewed-on: https://gerrit.libreoffice.org/19628
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/dialogs/linkdlg.cxx | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/cui/source/dialogs/linkdlg.cxx b/cui/source/dialogs/linkdlg.cxx index ee7fb1f21161..402e20c81b7a 100644 --- a/cui/source/dialogs/linkdlg.cxx +++ b/cui/source/dialogs/linkdlg.cxx @@ -301,7 +301,7 @@ IMPL_LINK_NOARG_TYPED(SvBaseLinksDlg, UpdateNowClickHdl, Button*, void) // first look for the entry in the array for( size_t i = 0; i < pLinkMgr->GetLinks().size(); ++i ) - if( &xLink == *pLinkMgr->GetLinks()[ i ] ) + if( xLink == pLinkMgr->GetLinks()[ i ] ) { xLink->SetUseCache( false ); SetType( *xLink, aPosArr[ n ], xLink->GetUpdateMode() ); @@ -594,15 +594,15 @@ void SvBaseLinksDlg::SetManager( LinkManager* pNewMgr ) SvBaseLinks& rLnks = (SvBaseLinks&)pLinkMgr->GetLinks(); for( size_t n = 0; n < rLnks.size(); ++n ) { - tools::SvRef<SvBaseLink>* pLinkRef = rLnks[ n ]; - if( !pLinkRef->Is() ) + tools::SvRef<SvBaseLink>& rLinkRef = rLnks[ n ]; + if( !rLinkRef.Is() ) { rLnks.erase( rLnks.begin() + n ); --n; continue; } - if( (*pLinkRef)->IsVisible() ) - InsertEntry( **pLinkRef ); + if( rLinkRef->IsVisible() ) + InsertEntry( *rLinkRef ); } if( !rLnks.empty() ) @@ -692,12 +692,12 @@ void SvBaseLinksDlg::SetActLink( SvBaseLink * pLink ) sal_uLong nSelect = 0; for( size_t n = 0; n < rLnks.size(); ++n ) { - tools::SvRef<SvBaseLink>* pLinkRef = rLnks[ n ]; + const tools::SvRef<SvBaseLink>& rLinkRef = rLnks[ n ]; // #109573# only visible links have been inserted into the TreeListBox, // invisible ones have to be skipped here - if( (*pLinkRef)->IsVisible() ) + if( rLinkRef->IsVisible() ) { - if( pLink == *pLinkRef ) + if( pLink == rLinkRef.get() ) { m_pTbLinks->Select( m_pTbLinks->GetEntry( nSelect ) ); LinksSelectHdl( 0 ); |