commit 95a10146fecdd0b3f9892d585d82b0742f1afd72
Author: Jean-Marc Lasgouttes <lasgout...@lyx.org>
Date:   Sun Feb 16 21:00:14 2025 +0100

    Replace a badly named temp variable by a reptition.
    
    Pleases Coverity Scan.
    
    Fix some spacing.
---
 src/frontends/qt/GuiSpellchecker.cpp | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/src/frontends/qt/GuiSpellchecker.cpp 
b/src/frontends/qt/GuiSpellchecker.cpp
index 66952eb7dc..06e391edef 100644
--- a/src/frontends/qt/GuiSpellchecker.cpp
+++ b/src/frontends/qt/GuiSpellchecker.cpp
@@ -251,12 +251,14 @@ void SpellcheckerWidget::Private::updateView()
        ui.replaceAllPB->setEnabled(can_replace);
 }
 
+
 DocIterator const SpellcheckerWidget::Private::cursor() const
 {
        BufferView * bv = gv_->documentBufferView();
        return bv ? bv->cursor() : DocIterator();
 }
 
+
 bool SpellcheckerWidget::Private::continueFromBeginning()
 {
        DocIterator const current_ = cursor();
@@ -291,11 +293,13 @@ bool SpellcheckerWidget::Private::continueFromBeginning()
        return true;
 }
 
+
 bool SpellcheckerWidget::Private::isCurrentBuffer(DocIterator const & cursor) 
const
 {
        return start_.buffer() == cursor.buffer();
 }
 
+
 bool SpellcheckerWidget::Private::atLastPos(DocIterator const & cursor) const
 {
        bool const valid_end = !end_.empty();
@@ -304,17 +308,18 @@ bool SpellcheckerWidget::Private::atLastPos(DocIterator 
const & cursor) const
                (valid_end && isCurrentBuffer(cursor) && cursor >= end_));
 }
 
+
 bool SpellcheckerWidget::Private::isWrapAround(DocIterator const & cursor) 
const
 {
        return wrap_around_ && isCurrentBuffer(cursor) && start_ < cursor;
 }
 
+
 void SpellcheckerWidget::Private::fixPositionsIfBroken()
 {
-       DocIterator const current_ = cursor();
-       if (!isCurrentBuffer(current_)) {
+       if (!isCurrentBuffer(cursor())) {
                LYXERR(Debug::GUI, "wrong document of current cursor position " 
<< start_);
-               start_ = current_;
+               start_ = cursor();
                begin_ = DocIterator();
                end_   = DocIterator();
        }
@@ -329,6 +334,7 @@ void SpellcheckerWidget::Private::fixPositionsIfBroken()
                LYXERR(Debug::GUI, "broken selection end position fixed " << 
end_);
 }
 
+
 void SpellcheckerWidget::Private::hide() const
 {
        BufferView * bv = gv_->documentBufferView();
@@ -347,6 +353,7 @@ void SpellcheckerWidget::Private::hide() const
        }
 }
 
+
 void SpellcheckerWidget::Private::forward()
 {
        DocIterator const from = cursor();
-- 
lyx-cvs mailing list
lyx-cvs@lists.lyx.org
https://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to