mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 10:00:33 +00:00
Modify string list in place instead of copying it
Spotted by Coverity scan.
This commit is contained in:
parent
a086804eb4
commit
1d64dbf543
@ -317,14 +317,10 @@ void GuiBibtex::relAbsPressed()
|
|||||||
QString const new_item = (p == LP_Absolute)
|
QString const new_item = (p == LP_Absolute)
|
||||||
? toqstr(file.relPath(buffer().filePath()))
|
? toqstr(file.relPath(buffer().filePath()))
|
||||||
: toqstr(file.absoluteFilePath());
|
: toqstr(file.absoluteFilePath());
|
||||||
QStringList sb;
|
for (QString & s : selected_bibs_) {
|
||||||
for (QString s : selected_bibs_) {
|
|
||||||
if (s == qf)
|
if (s == qf)
|
||||||
sb << new_item;
|
s = new_item;
|
||||||
else
|
|
||||||
sb << s;
|
|
||||||
}
|
}
|
||||||
selected_bibs_ = sb;
|
|
||||||
setSelectedBibs(selected_bibs_);
|
setSelectedBibs(selected_bibs_);
|
||||||
selectedLV->selectRow(selected_bibs_.indexOf(new_item));
|
selectedLV->selectRow(selected_bibs_.indexOf(new_item));
|
||||||
changed();
|
changed();
|
||||||
|
Loading…
Reference in New Issue
Block a user