]> git.lyx.org Git - lyx.git/commitdiff
Fix coverity-detected issue CID 403672
authorJuergen Spitzmueller <spitz@lyx.org>
Fri, 20 Oct 2023 07:35:55 +0000 (09:35 +0200)
committerJuergen Spitzmueller <spitz@lyx.org>
Fri, 20 Oct 2023 07:35:55 +0000 (09:35 +0200)
Error handling issues  (CHECKED_RETURN)
Calling "translateString" without checking return value
(as is done elsewhere 15 out of 18 times).

AFAICS we do not need the boolean return value in these two cases.

src/insets/InsetInfo.cpp

index 1cb6853a249c68ba7c083dcc1d2487f336429bbb..3048456e84a5d42805d49d4e9f673ec376ac5dac 100644 (file)
@@ -1506,7 +1506,7 @@ void docbookShortcutInfo(XMLStream & xs, const InsetInfoParams & params) {
        for (char_type const c : sequence) {
                const auto keyMapping = keyToString.find(c);
                if (keyMapping != keyToString.end()) {
-                       translateString(from_ascii(keyMapping->second), trans, lcode);
+                       (void) translateString(from_ascii(keyMapping->second), trans, lcode);
 
                        // db:keysym: symbolic name (like Page Up), unlike what is printed on the key (like
                        // ⇞, ↑, ▲, PgUp, Page Up, etc.)
@@ -1584,7 +1584,7 @@ void xhtmlShortcutInfo(XMLStream & xs, const InsetInfoParams & params) {
            char_type const c = sequence[i];
                const auto keyMapping = keyToString.find(c);
                if (keyMapping != keyToString.end()) {
-                       translateString(from_ascii(keyMapping->second), trans, lcode);
+                       (void) translateString(from_ascii(keyMapping->second), trans, lcode);
                        xs << trans;
                } else {
                        xs << c;