Skip to content

Commit

Permalink
Use prefix increments.
Browse files Browse the repository at this point in the history
  • Loading branch information
przemek83 committed Dec 30, 2024
1 parent 319070a commit c40634d
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/ExportData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ bool ExportData::exportView(const QAbstractItemView& view, QIODevice& ioDevice)
{
if (rowShouldBeSkipped(view, row))
{
skippedRows++;
++skippedRows;
continue;
}
content.append(generateRowContent(*model, row, skippedRows));
Expand Down
12 changes: 6 additions & 6 deletions src/ImportOds.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ std::pair<bool, QStringList> ImportOds::getSheetNames()
const QDomElement root = xmlDocument.documentElement();
const int elementsCount = root.elementsByTagName(configMapNamed).size();
QStringList sheetNames{};
for (int i = 0; i < elementsCount; i++)
for (int i = 0; i < elementsCount; ++i)
{
const QDomElement currentElement =
root.elementsByTagName(configMapNamed).at(i).toElement();
Expand All @@ -48,7 +48,7 @@ std::pair<bool, QStringList> ImportOds::getSheetNames()
{
const int innerElementsCount =
currentElement.elementsByTagName(configMapEntry).size();
for (int j = 0; j < innerElementsCount; j++)
for (int j = 0; j < innerElementsCount; ++j)
{
const QDomElement element =
currentElement.elementsByTagName(configMapEntry)
Expand Down Expand Up @@ -152,15 +152,15 @@ std::pair<bool, QVector<QVector<QVariant>>> ImportOds::getLimitedData(
{
dataContainer[static_cast<int>(rowCounter)] = currentDataRow;
currentDataRow = templateDataRow;
rowCounter++;
++rowCounter;
updateProgress(rowCounter, rowLimit, lastEmittedPercent);
}
rowEmpty = true;
}

if (isCellStart(xmlStreamReader))
{
column++;
++column;
const unsigned int repeats{
getColumnRepeatCount(xmlStreamReader.attributes())};
if (!isOfficeValueTagEmpty(xmlStreamReader))
Expand Down Expand Up @@ -274,7 +274,7 @@ ImportOds::retrieveRowCountAndColumnTypes(const QString& sheetName)

if (isCellStart(xmlStreamReader))
{
column++;
++column;
const QXmlStreamAttributes attributes{xmlStreamReader.attributes()};
const QString xmlColTypeValue =
attributes.value(OFFICE_VALUE_TYPE_TAG).toString();
Expand All @@ -299,7 +299,7 @@ ImportOds::retrieveRowCountAndColumnTypes(const QString& sheetName)
if (isRowEnd(xmlStreamReader))
{
if (!rowEmpty)
rowCounter++;
++rowCounter;
rowEmpty = true;
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/ImportSpreadsheet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ QMap<unsigned int, unsigned int> ImportSpreadsheet::createActiveColumnMapping(
if (!excludedColumns.contains(i))
{
activeColumnsMapping[i] = columnToFill;
columnToFill++;
++columnToFill;
}
}
return activeColumnsMapping;
Expand All @@ -130,7 +130,7 @@ QVector<QVariant> ImportSpreadsheet::createTemplateDataRow(
templateDataRow[columnToFill] =
utilities::getDefaultVariantForFormat(
columnTypes[static_cast<int>(i)]);
columnToFill++;
++columnToFill;
}
}
return templateDataRow;
Expand Down
8 changes: 4 additions & 4 deletions src/ImportXlsx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -299,13 +299,13 @@ std::pair<bool, QStringList> ImportXlsx::retrieveColumnNames(
{
if (isCellStart(xmlStreamReader))
{
columnIndex++;
++columnIndex;
const int currentColumnNumber{
getCurrentColumnNumber(xmlStreamReader, 1)};
while (currentColumnNumber > columnIndex)
{
columnNames << emptyColName_;
columnIndex++;
++columnIndex;
}
currentColType =
xmlStreamReader.attributes().value(T_TAG).toString();
Expand Down Expand Up @@ -350,7 +350,7 @@ ImportXlsx::retrieveRowCountAndColumnTypes(const QString& sheetName)
{
rowCountDigitsInXlsx =
xmlStreamReader.attributes().value(R_TAG).size();
rowCounter++;
++rowCounter;
}

if (isCellStart(xmlStreamReader))
Expand Down Expand Up @@ -625,7 +625,7 @@ std::pair<bool, QVector<QVector<QVariant>>> ImportXlsx::getLimitedData(
}
rowCountDigitsInXlsx =
xmlStreamReader.attributes().value(R_TAG).size();
rowCounter++;
++rowCounter;
updateProgress(rowCounter, rowLimit, lastEmittedPercent);
}

Expand Down

0 comments on commit c40634d

Please sign in to comment.