Skip to content

Commit

Permalink
Convert ternary operator usage to an "if"/"else" structure.
Browse files Browse the repository at this point in the history
  • Loading branch information
przemek83 committed Dec 29, 2024
1 parent 09522a3 commit 5356a54
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/ImportOds.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#include <QXmlStreamReader>
#include <QtXml/QDomDocument>


ImportOds::ImportOds(QIODevice& ioDevice) : ImportSpreadsheet(ioDevice) {}

std::pair<bool, QStringList> ImportOds::getSheetNames()
Expand Down Expand Up @@ -306,9 +305,8 @@ ImportOds::retrieveRowCountAndColumnTypes(const QString& sheetName)
}

std::replace_if(
columnTypes.begin(), columnTypes.end(),
[](ColumnType columnType) { return columnType == ColumnType::UNKNOWN; },
ColumnType::STRING);
columnTypes.begin(), columnTypes.end(), [](ColumnType columnType)
{ return columnType == ColumnType::UNKNOWN; }, ColumnType::STRING);

return {true, rowCounter, columnTypes};
}
Expand Down Expand Up @@ -458,8 +456,10 @@ QVariant ImportOds::retrieveValueFromField(QXmlStreamReader& xmlStreamReader,
else
{
const QStringView stringView = xmlStreamReader.text();
value = QVariant(stringView.isNull() ? emptyString
: stringView.toString());
if (stringView.isNull())
value = QVariant(emptyString);
else
value = stringView.toString();
}
break;
}
Expand Down

0 comments on commit 5356a54

Please sign in to comment.