commit 7946dfacfa57f031ec5de9a03e63937578fe9430
Author: Jean-Marc Lasgouttes <lasgout...@lyx.org>
Date:   Thu Sep 12 16:54:02 2024 +0200

    TransState::addkey() pass parameter by const reference
    
    Spotted by Coverity scan.
---
 src/Trans.cpp |  6 +++---
 src/Trans.h   | 10 +++++-----
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/Trans.cpp b/src/Trans.cpp
index 28a05f05f9..774c7ac7ce 100644
--- a/src/Trans.cpp
+++ b/src/Trans.cpp
@@ -451,7 +451,7 @@ docstring const TransInitState::normalkey(char_type c)
 }
 
 
-docstring const TransInitState::deadkey(char_type c, KmodInfo d)
+docstring const TransInitState::deadkey(char_type c, KmodInfo const & d)
 {
        deadkey_ = c;
        deadkey_info_ = d;
@@ -488,7 +488,7 @@ docstring const TransDeadkeyState::normalkey(char_type c)
 }
 
 
-docstring const TransDeadkeyState::deadkey(char_type c, KmodInfo d)
+docstring const TransDeadkeyState::deadkey(char_type c, KmodInfo const & d)
 {
        docstring res;
 
@@ -548,7 +548,7 @@ docstring const TransCombinedState::normalkey(char_type c)
 }
 
 
-docstring const TransCombinedState::deadkey(char_type c, KmodInfo d)
+docstring const TransCombinedState::deadkey(char_type c, KmodInfo const & d)
 {
        // Third key in a row. Output the first one and
        // reenter with shifted deadkeys
diff --git a/src/Trans.h b/src/Trans.h
index 61a57b8e1e..aefb4adff0 100644
--- a/src/Trans.h
+++ b/src/Trans.h
@@ -197,7 +197,7 @@ public:
        ///
        virtual bool backspace() = 0;
        ///
-       virtual docstring const deadkey(char_type, KmodInfo) = 0;
+       virtual docstring const deadkey(char_type, KmodInfo const &) = 0;
        ///
        static char_type const TOKEN_SEP;
 };
@@ -243,7 +243,7 @@ public:
        ///
        bool backspace() override { return true; }
        ///
-       docstring const deadkey(char_type, KmodInfo) override;
+       docstring const deadkey(char_type, KmodInfo const &) override;
 };
 
 
@@ -260,7 +260,7 @@ public:
                return false;
        }
        ///
-       docstring const deadkey(char_type, KmodInfo) override;
+       docstring const deadkey(char_type, KmodInfo const &) override;
 };
 
 
@@ -281,7 +281,7 @@ public:
                return false;
        }
        ///
-       docstring const deadkey(char_type, KmodInfo) override;
+       docstring const deadkey(char_type, KmodInfo const &) override;
 };
 
 
@@ -335,7 +335,7 @@ public:
        ///
        void translateAndInsert(char_type, Text *, Cursor &);
        ///
-       docstring const deadkey(char_type c, KmodInfo t)
+       docstring const deadkey(char_type c, KmodInfo const & t)
                { return trans_fsm_.currentState->deadkey(c, t); }
        ///
        docstring const normalkey(char_type c)
-- 
lyx-cvs mailing list
lyx-cvs@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to