redlndlg: Use unique_ptr::get() instead of &*ptr

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 <nroberts@libreoffice.org>
Tested-by: Jenkins
This commit is contained in:
Neil Roberts
2026-10-07 08:40:25 +02:00
parent f666a74220
commit 0ac807366d
+3 -3
View File
@@ -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<weld::TreeIter> xChild(rTreeView.make_iterator( &*aRedlines[0] ));
std::unique_ptr<weld::TreeIter> xChild(rTreeView.make_iterator( aRedlines[0].get() ));
RedlineData* pData = weld::fromId<RedlineData*>(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<weld::TreeIter> xChild(rTreeView.make_iterator( &*rRedLine ));
std::unique_ptr<weld::TreeIter> xChild(rTreeView.make_iterator( rRedLine.get() ));
if ( rTreeView.iter_children(*xChild) )
{
RedlineData* pData = weld::fromId<RedlineData*>(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<weld::TreeIter> xChild(rTreeView.make_iterator( &*xActEntry ));
std::unique_ptr<weld::TreeIter> xChild(rTreeView.make_iterator( xActEntry.get() ));
if ( rTreeView.iter_children(*xChild) )
{
RedlineData *pData = reinterpret_cast<RedlineData*>(rTreeView.get_id(*xChild).toInt64());