1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 13:37:44 +00:00

Spreadsheet: Show the error (if any) in csv import dialog's preview

...and don't try to read from a CSV that has errors.
Fixes #5942.
This commit is contained in:
AnotherTest 2021-03-25 10:25:24 +04:30 committed by Andreas Kling
parent bbf6847d50
commit 102065a8a9
6 changed files with 43 additions and 14 deletions

View file

@ -105,6 +105,8 @@ Vector<XSV::Field> XSV::read_row(bool header_row)
if (!header_row && (m_behaviours & ParserBehaviour::ReadHeaders) != ParserBehaviour::None && row.size() != m_names.size())
set_error(ReadError::NonConformingColumnCount);
else if (!header_row && !has_explicit_headers() && !m_rows.is_empty() && m_rows.first().size() != row.size())
set_error(ReadError::NonConformingColumnCount);
return row;
}