mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 03:47:35 +00:00
Spreadsheet: Correctly resolve nonstandard column names
This commit is contained in:
parent
b11b3c2f1c
commit
a01358f015
1 changed files with 6 additions and 2 deletions
|
@ -209,8 +209,12 @@ Optional<Position> Sheet::parse_cell_name(const StringView& name) const
|
||||||
Optional<size_t> Sheet::column_index(const StringView& column_name) const
|
Optional<size_t> Sheet::column_index(const StringView& column_name) const
|
||||||
{
|
{
|
||||||
auto index = convert_from_string(column_name);
|
auto index = convert_from_string(column_name);
|
||||||
if (m_columns.size() <= index || m_columns[index] != column_name)
|
if (m_columns.size() <= index || m_columns[index] != column_name) {
|
||||||
return {};
|
auto it = m_columns.find(column_name);
|
||||||
|
if (it == m_columns.end())
|
||||||
|
return {};
|
||||||
|
index = it.index();
|
||||||
|
}
|
||||||
|
|
||||||
return index;
|
return index;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue