HexEditor: Replace DeprecatedString in HexEditor.cpp

This commit is contained in:
kamp 2023-08-16 21:04:42 +03:00 committed by Andrew Kaster
parent 7a2ad83c07
commit 74d15195a4
Notes: sideshowbarker 2024-07-17 06:24:08 +09:00

View file

@ -626,7 +626,7 @@ void HexEditor::paint_event(GUI::PaintEvent& event)
};
bool is_current_line = (m_position / bytes_per_row()) == i;
auto line = DeprecatedString::formatted("{:#08X}", i * bytes_per_row());
auto line = String::formatted("{:#08X}", i * bytes_per_row()).release_value_but_fixme_should_propagate_errors();
painter.draw_text(
side_offset_rect,
line,
@ -661,7 +661,7 @@ void HexEditor::paint_event(GUI::PaintEvent& event)
};
u8 const cell_value = m_document->get(byte_position).value;
auto line = DeprecatedString::formatted("{:02X}", cell_value);
auto line = String::formatted("{:02X}", cell_value).release_value_but_fixme_should_propagate_errors();
Gfx::Color background_color = palette().color(background_role());
Gfx::Color text_color = [&]() -> Gfx::Color {
@ -726,7 +726,8 @@ void HexEditor::paint_event(GUI::PaintEvent& event)
}
painter.fill_rect(text_background_rect, background_color);
painter.draw_text(text_display_rect, DeprecatedString::formatted("{:c}", isprint(cell_value) ? cell_value : '.'), Gfx::TextAlignment::TopLeft, text_color);
auto character = String::formatted("{:c}", isprint(cell_value) ? cell_value : '.').release_value_but_fixme_should_propagate_errors();
painter.draw_text(text_display_rect, character, Gfx::TextAlignment::TopLeft, text_color);
if (m_edit_mode == EditMode::Text) {
if (byte_position == m_position && m_cursor_blink_active) {