linkdlg: Use SvRef::get() instead of &*
Using &* can be problematic if the pointer is null. In this case it probably doesn’t matter, but using SvRef::get() is probably easier to understand anyway. This also paves the way for a later compiler plugin to check for this. Change-Id: I26aa62d78454d11c9912bdd3e9ab9db2d93293a7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211847 Reviewed-by: Neil Roberts <nroberts@libreoffice.org> Tested-by: Jenkins
This commit is contained in:
@@ -481,7 +481,7 @@ IMPL_LINK( SvBaseLinksDlg, EndEditHdl, sfx2::SvBaseLink&, _rLink, void )
|
||||
// edited link needs to be refreshed.
|
||||
bool bLinkFnd = false;
|
||||
for( size_t n = pLinkMgr->GetLinks().size(); n; )
|
||||
if( &_rLink == &(*pLinkMgr->GetLinks()[ --n ]) )
|
||||
if( &_rLink == pLinkMgr->GetLinks()[ --n ].get() )
|
||||
{
|
||||
bLinkFnd = true;
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user