mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-30 20:59:16 +00:00
Spreadsheet: Add conditional formatting
Currently only supports setting the foregound and the background colours. This patch also unifies `foreground_color' and `background_color' used throughout to a `Format' struct, in hopes of getting more formatting options one day :P
This commit is contained in:
parent
6902a09e47
commit
395df7b27d
Notes:
sideshowbarker
2024-07-19 02:14:06 +09:00
Author: https://github.com/alimpfard
Commit: 395df7b27d
Pull-request: https://github.com/SerenityOS/serenity/pull/3592
Reviewed-by: https://github.com/awesomekling
13 changed files with 401 additions and 28 deletions
|
@ -46,6 +46,12 @@ SheetGlobalObject::~SheetGlobalObject()
|
|||
JS::Value SheetGlobalObject::get(const JS::PropertyName& name, JS::Value receiver) const
|
||||
{
|
||||
if (name.is_string()) {
|
||||
if (name.as_string() == "value") {
|
||||
if (auto cell = m_sheet.current_evaluated_cell())
|
||||
return cell->js_data();
|
||||
|
||||
return JS::js_undefined();
|
||||
}
|
||||
if (auto pos = Sheet::parse_cell_name(name.as_string()); pos.has_value()) {
|
||||
auto& cell = m_sheet.ensure(pos.value());
|
||||
cell.reference_from(m_sheet.current_evaluated_cell());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue