]> git.lyx.org Git - lyx.git/commitdiff
GuiWorkArea: pass KeySymbol parameters as const references
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 12 Sep 2024 15:52:57 +0000 (17:52 +0200)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 12 Sep 2024 15:52:57 +0000 (17:52 +0200)
Spotted by Coverity scan.

src/frontends/qt/GuiWorkArea.cpp
src/frontends/qt/GuiWorkArea.h

index c643a301922de05029fe43991580750be62503d0..0535ee70d105ff2eab5934326c19647b73e6f6e0 100644 (file)
@@ -1037,7 +1037,7 @@ bool CompressorProxy::emitCheck(bool isAutoRepeat)
 }
 
 
-void CompressorProxy::slot(KeySymbol sym, KeyModifier mod, bool isAutoRepeat)
+void CompressorProxy::slot(KeySymbol const & sym, KeyModifier mod, bool isAutoRepeat)
 {
        if (emitCheck(isAutoRepeat))
                Q_EMIT signal(sym, mod);
index 4d9e64d53f61f96e259e4f5a8367fef4a5f84a91..391c31124306be2099fa5e3fec3608401142bc8c 100644 (file)
@@ -102,7 +102,7 @@ Q_SIGNALS:
        ///
        void bufferViewChanged();
        /// send key event to CompressorProxy
-       void compressKeySym(KeySymbol sym, KeyModifier mod, bool isAutoRepeat);
+       void compressKeySym(KeySymbol const & sym, KeyModifier mod, bool isAutoRepeat);
 
 private Q_SLOTS:
        /// Scroll the BufferView.
@@ -170,9 +170,9 @@ class CompressorProxy : public QObject
        bool emitCheck(bool isAutoRepeat);
        bool flag_;
        // input: event to compress
-       Q_SLOT void slot(KeySymbol sym, KeyModifier mod, bool isAutoRepeat);
+       Q_SLOT void slot(KeySymbol const & sym, KeyModifier mod, bool isAutoRepeat);
        // output: compressed event
-    Q_SIGNAL void signal(KeySymbol sym, KeyModifier mod);
+    Q_SIGNAL void signal(KeySymbol const & sym, KeyModifier mod);
 public:
     // No default constructor, since the proxy must be a child of the
     // target object.