From 0ac807366dc72f8f51bf62ab1e0a95334c2b971b Mon Sep 17 00:00:00 2001 From: Neil Roberts Date: Fri, 2 Oct 2026 13:57:21 +0200 Subject: [PATCH] redlndlg: Use unique_ptr::get() instead of &*ptr MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Using &* to get the pointer out of a unique_ptr can be problematic if the pointer is null. In this case that probably can’t happen, but either way using get() makes the code easier to understand. This also paves the way for a compiler plugin to detect this in a later patch. Change-Id: Ib5291002581565e227dd6ca30570ecee63ef7cba Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211748 Reviewed-by: Neil Roberts Tested-by: Jenkins --- sw/source/uibase/misc/redlndlg.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sw/source/uibase/misc/redlndlg.cxx b/sw/source/uibase/misc/redlndlg.cxx index cd4674127279..344a8a2628d6 100644 --- a/sw/source/uibase/misc/redlndlg.cxx +++ b/sw/source/uibase/misc/redlndlg.cxx @@ -1147,7 +1147,7 @@ void SwRedlineAcceptDlg::CallAcceptReject( bool bSelect, bool bAccept ) // on the same text range, stored only in OOXML) if ( bMoreRedlines && aRedlines.size() == 1 ) { - std::unique_ptr xChild(rTreeView.make_iterator( &*aRedlines[0] )); + std::unique_ptr xChild(rTreeView.make_iterator( aRedlines[0].get() )); RedlineData* pData = weld::fromId(rTreeView.get_id(*xChild)); if ( pData->bDisabled ) bMoreRedlines = false; @@ -1188,7 +1188,7 @@ void SwRedlineAcceptDlg::CallAcceptReject( bool bSelect, bool bAccept ) // handle redlines of table rows, stored as children of the item associated // to the deleted/inserted table row(s) - std::unique_ptr xChild(rTreeView.make_iterator( &*rRedLine )); + std::unique_ptr xChild(rTreeView.make_iterator( rRedLine.get() )); if ( rTreeView.iter_children(*xChild) ) { RedlineData* pData = weld::fromId(rTreeView.get_id(*xChild)); @@ -1353,7 +1353,7 @@ IMPL_LINK_NOARG(SwRedlineAcceptDlg, GotoHdl, Timer *, void) } // select all redlines of tracked table rows - std::unique_ptr xChild(rTreeView.make_iterator( &*xActEntry )); + std::unique_ptr xChild(rTreeView.make_iterator( xActEntry.get() )); if ( rTreeView.iter_children(*xChild) ) { RedlineData *pData = reinterpret_cast(rTreeView.get_id(*xChild).toInt64());