summaryrefslogtreecommitdiffstats
path: root/cui
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-10-27 15:12:58 +0200
committerMichael Stahl <mstahl@redhat.com>2015-10-27 15:35:36 +0000
commit623f5b26ffd77041d0b06d7ce9c3b32d05625440 (patch)
treeecd905d6657147b1c5a074b4d33f914f0039440c /cui
parentAutomating configure choices based on what is installed considered harmful (diff)
downloadcore-623f5b26ffd77041d0b06d7ce9c3b32d05625440.tar.gz
core-623f5b26ffd77041d0b06d7ce9c3b32d05625440.zip
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.cxx16
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 );