Sheet: modernize C++: use range-based for loop

This commit is contained in:
wmayer
2023-08-15 18:50:26 +02:00
committed by wwmayer
parent 6bb6c0c886
commit a49e104993
6 changed files with 104 additions and 94 deletions

View File

@@ -615,8 +615,8 @@ void CmdSpreadsheetStyleBold::activated(int iMsg)
if (!selection.empty()) {
bool allBold = true;
for (QModelIndexList::const_iterator it = selection.cbegin(); it != selection.cend(); ++it) {
const Cell * cell = sheet->getCell(CellAddress((*it).row(), (*it).column()));
for (const auto& it : selection) {
const Cell * cell = sheet->getCell(CellAddress(it.row(), it.column()));
if (cell) {
std::set<std::string> style;
@@ -689,8 +689,8 @@ void CmdSpreadsheetStyleItalic::activated(int iMsg)
if (!selection.empty()) {
bool allItalic = true;
for (QModelIndexList::const_iterator it = selection.cbegin(); it != selection.cend(); ++it) {
const Cell * cell = sheet->getCell(CellAddress((*it).row(), (*it).column()));
for (const auto& it : selection) {
const Cell * cell = sheet->getCell(CellAddress(it.row(), it.column()));
if (cell) {
std::set<std::string> style;
@@ -763,8 +763,8 @@ void CmdSpreadsheetStyleUnderline::activated(int iMsg)
if (!selection.empty()) {
bool allUnderline = true;
for (QModelIndexList::const_iterator it = selection.cbegin(); it != selection.cend(); ++it) {
const Cell * cell = sheet->getCell(CellAddress((*it).row(), (*it).column()));
for (const auto& it : selection) {
const Cell * cell = sheet->getCell(CellAddress(it.row(), it.column()));
if (cell) {
std::set<std::string> style;