mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-26 09:30:24 +00:00
Spreadsheet: Treat an empty format string as "default"
This commit is contained in:
parent
e250591ff3
commit
a2efff9287
Notes:
sideshowbarker
2024-07-19 02:13:54 +09:00
Author: https://github.com/alimpfard Commit: https://github.com/SerenityOS/serenity/commit/a2efff9287c Pull-request: https://github.com/SerenityOS/serenity/pull/3592 Reviewed-by: https://github.com/awesomekling
2 changed files with 3 additions and 3 deletions
|
@ -44,7 +44,7 @@ String NumericCell::display(Cell& cell, const CellTypeMetadata& metadata) const
|
|||
{
|
||||
auto value = js_value(cell, metadata);
|
||||
String string;
|
||||
if (metadata.format.is_null())
|
||||
if (metadata.format.is_empty())
|
||||
string = value.to_string_without_side_effects();
|
||||
else
|
||||
string = format_double(metadata.format.characters(), value.to_double(cell.sheet->interpreter()));
|
||||
|
|
|
@ -198,9 +198,9 @@ void CellTypeDialog::setup_tabs(GUI::TabWidget& tabs, const Vector<Position>& po
|
|||
{
|
||||
auto& checkbox = right_side.add<GUI::CheckBox>("Override display format");
|
||||
auto& editor = right_side.add<GUI::TextEditor>();
|
||||
checkbox.set_checked(!m_format.is_null());
|
||||
checkbox.set_checked(!m_format.is_empty());
|
||||
editor.set_should_hide_unnecessary_scrollbars(true);
|
||||
editor.set_enabled(!m_format.is_null());
|
||||
editor.set_enabled(!m_format.is_empty());
|
||||
editor.set_text(m_format);
|
||||
|
||||
checkbox.set_preferred_size(0, 20);
|
||||
|
|
Loading…
Reference in a new issue