Skip to content

Commit

Permalink
Use initializer in if claues.
Browse files Browse the repository at this point in the history
  • Loading branch information
przemek83 committed Dec 31, 2024
1 parent fe5f7d1 commit 4f229ad
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/ImportXlsx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -423,15 +423,14 @@ ColumnType ImportXlsx::recognizeColumnType(
if (ColumnType::STRING == currentType)
return currentType;

const QXmlStreamAttributes xmlStreamAtrributes{
xmlStreamReader.attributes()};
const QString value{xmlStreamAtrributes.value(T_TAG).toString()};
if (value == S_TAG || value == STR_TAG)
const QXmlStreamAttributes attributes{xmlStreamReader.attributes()};
if (const QString value{attributes.value(T_TAG).toString()};
value == S_TAG || value == STR_TAG)
return ColumnType::STRING;

ColumnType detectedType{currentType};
const QString sTagValue{xmlStreamAtrributes.value(S_TAG).toString()};
if (isDateStyle(sTagValue))
if (const QString sTagValue{attributes.value(S_TAG).toString()};
isDateStyle(sTagValue))
{
if (currentType == ColumnType::UNKNOWN)
detectedType = ColumnType::DATE;
Expand Down

0 comments on commit 4f229ad

Please sign in to comment.