From 0c9a505ad1b2db91555b12766d4d10bbf28d2987 Mon Sep 17 00:00:00 2001 From: Ali Mohammad Pur Date: Wed, 16 Jun 2021 15:16:40 +0430 Subject: [PATCH] Spreadsheet: Remove 'return (...)' workaround in conditional formatting Now that LibJS can evaluate expressions correctly, that workaround was breaking conditional formatting. --- Userland/Applications/Spreadsheet/Cell.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/Userland/Applications/Spreadsheet/Cell.cpp b/Userland/Applications/Spreadsheet/Cell.cpp index 55eb795c45..0bdf19f127 100644 --- a/Userland/Applications/Spreadsheet/Cell.cpp +++ b/Userland/Applications/Spreadsheet/Cell.cpp @@ -113,14 +113,9 @@ void Cell::update_data(Badge) m_evaluated_formats.background_color.clear(); m_evaluated_formats.foreground_color.clear(); if (!m_js_exception) { - StringBuilder builder; for (auto& fmt : m_conditional_formats) { if (!fmt.condition.is_empty()) { - builder.clear(); - builder.append("return ("); - builder.append(fmt.condition); - builder.append(')'); - auto [value, exception] = m_sheet->evaluate(builder.string_view(), this); + auto [value, exception] = m_sheet->evaluate(fmt.condition, this); if (exception) { m_js_exception = move(exception); } else {