diff --git a/src/Mod/Spreadsheet/App/Sheet.cpp b/src/Mod/Spreadsheet/App/Sheet.cpp index 2c8ea5b200..c773a3daca 100644 --- a/src/Mod/Spreadsheet/App/Sheet.cpp +++ b/src/Mod/Spreadsheet/App/Sheet.cpp @@ -1234,7 +1234,7 @@ void Sheet::insertColumns(int col, int count) void Sheet::removeColumns(int col, int count) { // Remove aliases, if defined - for (auto address : cells.getColumns(col, count)) { + for (const auto &address : cells.getColumns(col, count)) { auto cell = getCell(address); std::string aliasStr; if (cell && cell->getAlias(aliasStr)) @@ -1270,7 +1270,7 @@ void Sheet::insertRows(int row, int count) void Sheet::removeRows(int row, int count) { // Remove aliases, if defined - for (auto address : cells.getRows(row, count)) { + for (const auto &address : cells.getRows(row, count)) { auto cell = getCell(address); std::string aliasStr; if (cell && cell->getAlias(aliasStr)) @@ -1573,7 +1573,7 @@ void Sheet::setCopyOrCutRanges(const std::vector &ranges, bool copy) std::set rangeSet(copyCutRanges.begin(), copyCutRanges.end()); copyCutRanges = ranges; rangeSet.insert(copyCutRanges.begin(), copyCutRanges.end()); - for(auto range : rangeSet) + for(const auto &range : rangeSet) rangeUpdated(range); hasCopyRange = copy; } diff --git a/src/Mod/Spreadsheet/Gui/SheetTableView.cpp b/src/Mod/Spreadsheet/Gui/SheetTableView.cpp index de921805c6..bce7a09483 100644 --- a/src/Mod/Spreadsheet/Gui/SheetTableView.cpp +++ b/src/Mod/Spreadsheet/Gui/SheetTableView.cpp @@ -709,7 +709,7 @@ void SheetTableView::pasteClipboard() return; if(!copy) { - for(auto range : ranges) { + for(auto &range : ranges) { do { sheet->clear(*range); } while (range.next());