sw/source/ui/misc/insfnote.cxx | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-)
New commits: commit c8afec430a8156e524043e10e8bc81dd5e69bc5d Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Tue Nov 12 12:17:31 2024 +0000 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Thu Nov 14 16:20:08 2024 +0100 cid#1634638 Use of auto that causes a copy and cid#1634639 Missing move assignment operator Change-Id: Icfc8f958dccae87fd646404c3a5a3772362bcc13 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176573 Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> Tested-by: Jenkins diff --git a/sw/source/ui/misc/insfnote.cxx b/sw/source/ui/misc/insfnote.cxx index e4509d8fbaf9..07e6bc8bf823 100644 --- a/sw/source/ui/misc/insfnote.cxx +++ b/sw/source/ui/misc/insfnote.cxx @@ -240,15 +240,17 @@ void SwInsFootNoteDlg::Init() // outside of a table to inside of it could be possible, which would fail. // bNext and bPrev are only false (simultaneously) for single-footnote documents, because // GotoNextFootnoteAnchor / GotoPrevFootnoteAnchor may wrap. - const auto anchorPos = *m_rSh.GetCursor()->GetPoint(); - SwCursor test(anchorPos, nullptr); - bool bNext = test.GotoNextFootnoteAnchor() && *test.GetPoint() != anchorPos; - - test = SwCursor(anchorPos, nullptr); - bool bPrev = test.GotoPrevFootnoteAnchor() && *test.GetPoint() != anchorPos; - - m_xPrevBT->set_sensitive(bPrev); - m_xNextBT->set_sensitive(bNext); + const SwPosition& anchorPos = *m_rSh.GetCursor()->GetPoint(); + { + SwCursor test(anchorPos, nullptr); + bool bNext = test.GotoNextFootnoteAnchor() && *test.GetPoint() != anchorPos; + m_xNextBT->set_sensitive(bNext); + } + { + SwCursor test(anchorPos, nullptr); + const bool bPrev = test.GotoPrevFootnoteAnchor() && *test.GetPoint() != anchorPos; + m_xPrevBT->set_sensitive(bPrev); + } m_rSh.Right(SwCursorSkipMode::Chars, true, 1, false );