Skip to content

Commit

Permalink
Refactor getColumnNames method to improve sheet availability checks a…
Browse files Browse the repository at this point in the history
…nd return logic.
  • Loading branch information
przemek83 committed Jan 2, 2025
1 parent da5ee19 commit 2535614
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 @@ -41,14 +41,14 @@ std::pair<bool, QVector<ColumnType>> ImportOds::getColumnTypes(

std::pair<bool, QStringList> ImportOds::getColumnNames(const QString& sheetName)
{
if (!isSheetAvailable(sheetName))
return {false, {}};

if (const auto it{columnNames_.constFind(sheetName)};
(it == columnNames_.constEnd()) && (!analyzeSheet(sheetName)))
return {false, {}};
it != columnNames_.constEnd())
return {true, *it};

if (isSheetAvailable(sheetName) && analyzeSheet(sheetName))
return {true, columnNames_.value(sheetName)};

return {true, columnNames_.value(sheetName)};
return {false, {}};
}

std::pair<bool, QVector<QVector<QVariant>>> ImportOds::getLimitedData(
Expand Down

0 comments on commit 2535614

Please sign in to comment.