1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 14:18:12 +00:00

Spreadsheet: Use new format functions.

In a few places I also simplified a few format strings:

    -outln("{} item{}", items, items.size() == 1 ? ' ' : 's');
    +outln("{} item(s)", items);

In my opinion this is more readable and in some places it incorrectly
wrote '0 item' which is "fixed" now. In other places the placeholder
space looked weird.
This commit is contained in:
asynts 2020-10-06 15:02:05 +02:00 committed by Andreas Kling
parent 30ca17e78f
commit f005548d56
5 changed files with 18 additions and 19 deletions

View file

@ -104,7 +104,7 @@ void SpreadsheetWidget::setup_tabs(NonnullRefPtrVector<Sheet> new_sheets)
auto& position = selection.first();
StringBuilder builder;
builder.append(position.column);
builder.appendf("%zu", position.row);
builder.appendff("{}", position.row);
m_current_cell_label->set_enabled(true);
m_current_cell_label->set_text(builder.string_view());
@ -121,7 +121,7 @@ void SpreadsheetWidget::setup_tabs(NonnullRefPtrVector<Sheet> new_sheets)
// There are many cells selected, change all of them.
StringBuilder builder;
builder.appendf("<%zu>", selection.size());
builder.appendff("<{}>", selection.size());
m_current_cell_label->set_enabled(true);
m_current_cell_label->set_text(builder.string_view());
@ -184,7 +184,7 @@ void SpreadsheetWidget::add_sheet()
{
StringBuilder name;
name.append("Sheet");
name.appendf(" %d", m_workbook->sheets().size() + 1);
name.appendff(" {}", m_workbook->sheets().size() + 1);
auto& sheet = m_workbook->add_sheet(name.string_view());