Skip to content

Commit

Permalink
Refactor date format condition checks for clarity.
Browse files Browse the repository at this point in the history
  • Loading branch information
przemek83 committed Dec 31, 2024
1 parent c53c9b5 commit 89e1abd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/ImportXlsx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,11 @@ QList<int> ImportXlsx::retrieveDateStyles(const QDomNodeList& sheetNodes)
const bool gotY{
formatCode.contains(QStringLiteral("y"), Qt::CaseInsensitive)};

if ((gotD && gotY) || (gotD && gotM) || (gotM && gotY))
const bool dayAndYearFormat{gotD && gotY};
const bool dayAndMonthFormat{gotD && gotM};
const bool monthAndYearFormat{gotM && gotY};

if (dayAndYearFormat || dayAndMonthFormat || monthAndYearFormat)
dateStyles.push_back(
sheet.attribute(QStringLiteral("numFmtId")).toInt());
}
Expand Down

0 comments on commit 89e1abd

Please sign in to comment.