Fix coverity-detected issue CID 403672

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.
This commit is contained in:
Juergen Spitzmueller 2023-10-20 09:35:55 +02:00
parent 99ecdd6ceb
commit 33da28e5a5

View 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;