Compare commits

...

4 Commits

Author SHA1 Message Date
Juergen Spitzmueller
d3123c16f7 initialize boolean (reported by coverity) 2024-09-07 12:55:10 +02:00
Juergen Spitzmueller
e685d31f5a use std::move() instead of copying when value is no longer used
This is mainly to shut down coverity which nowadays nags on this.
I am not sure whether we really gain something in these cases.
2024-09-07 12:50:27 +02:00
Juergen Spitzmueller
458f39cc43 Fix cut and past error (reported by coverity) 2024-09-07 12:39:45 +02:00
Juergen Spitzmueller
35b832f344 fix potential null pointer (reported by coverity) 2024-09-07 12:36:23 +02:00
7 changed files with 8 additions and 6 deletions

View File

@ -1707,7 +1707,7 @@ void BufferView::dispatch(FuncRequest const & cmd, DispatchResult & dr)
string label = dit.innerParagraph().getLabelForXRef();
if (!label.empty()) {
// if the paragraph has a label, we refer to this
string const arg = (type.empty()) ? label : label + " " + type;
string const arg = (type.empty()) ? move(label) : move(label) + " " + type;
lyx::dispatch(FuncRequest(LFUN_REFERENCE_INSERT, arg));
break;
} else {

View File

@ -798,7 +798,7 @@ docstring Encodings::convertLaTeXCommands(docstring const & str, bool const lite
if (!cnvtd.empty()) {
// it did, so we'll take that bit and proceed with what's left
ret += cnvtd;
val = rem;
val = move(rem);
continue;
}
// it's a command of some sort

View File

@ -55,7 +55,7 @@ private:
void update(Paragraph const & par, pos_type from = 0, pos_type to = -1);
// Indicate whether parts that produce no output should be counted.
bool skip_no_output_;
bool skip_no_output_ = false;
// Used in the code to track status
bool inword_ = false;
// The buffer id at last statistics computation.

View File

@ -1128,7 +1128,7 @@ bool TextClass::readCiteEngine(Lexer & lexrc, ReadType rt, bool const add)
if (numerical)
numerical = getCiteStyles(ENGINE_TYPE_NUMERICAL).empty();
if (notes)
numerical = getCiteStyles(ENGINE_TYPE_NOTES).empty();
notes = getCiteStyles(ENGINE_TYPE_NOTES).empty();
if (defce)
defce = getCiteStyles(ENGINE_TYPE_DEFAULT).empty();
}

View File

@ -278,6 +278,8 @@ bool GuiLog::initialiseParams(string const & sdata)
continue;
}
Index const * index = indiceslist.findShortcut(ci);
if (!index)
continue;
string const name = to_utf8(index->index());
logTypeCO->addItem(qt_(name), toqstr("index:" + stmp.absFileName()));
}

View File

@ -440,7 +440,7 @@ docstring nomenclWidest(Buffer const & buffer)
msymb.size();
if (wx > w) {
w = wx;
symb = symbol;
symb = move(symbol);
}
}
}