From a01358f015cd8899cde6112bed6224d491829a0f Mon Sep 17 00:00:00 2001 From: Ali Mohammad Pur Date: Wed, 16 Jun 2021 08:35:40 +0430 Subject: [PATCH] Spreadsheet: Correctly resolve nonstandard column names --- Userland/Applications/Spreadsheet/Spreadsheet.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Userland/Applications/Spreadsheet/Spreadsheet.cpp b/Userland/Applications/Spreadsheet/Spreadsheet.cpp index 42186bcebc..df1dc07a12 100644 --- a/Userland/Applications/Spreadsheet/Spreadsheet.cpp +++ b/Userland/Applications/Spreadsheet/Spreadsheet.cpp @@ -209,8 +209,12 @@ Optional Sheet::parse_cell_name(const StringView& name) const Optional Sheet::column_index(const StringView& column_name) const { auto index = convert_from_string(column_name); - if (m_columns.size() <= index || m_columns[index] != column_name) - return {}; + if (m_columns.size() <= index || m_columns[index] != column_name) { + auto it = m_columns.find(column_name); + if (it == m_columns.end()) + return {}; + index = it.index(); + } return index; }