1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 12:07:45 +00:00

HexEditor: Replace DeprecatedString in SearchResultsModel

Except one instance where it is required for interfacing with LibGUI

Also changed an instance of west const to east because the clang-format
commit hook required it.
This commit is contained in:
kamp 2023-08-16 00:54:43 +03:00 committed by Andrew Kaster
parent 81afa029ac
commit 4b87714700
2 changed files with 6 additions and 6 deletions

View file

@ -660,7 +660,7 @@ void HexEditor::paint_event(GUI::PaintEvent& event)
line_height() line_height()
}; };
const u8 cell_value = m_document->get(byte_position).value; u8 const cell_value = m_document->get(byte_position).value;
auto line = DeprecatedString::formatted("{:02X}", cell_value); auto line = DeprecatedString::formatted("{:02X}", cell_value);
Gfx::Color background_color = palette().color(background_role()); Gfx::Color background_color = palette().color(background_role());
@ -804,7 +804,7 @@ Vector<Match> HexEditor::find_all(ByteBuffer& needle, size_t start)
} }
} }
if (found) { if (found) {
matches.append({ i, DeprecatedString::formatted("{}", StringView { needle }.to_deprecated_string().characters()) }); matches.append({ i, String::formatted("{}", StringView { needle }).release_value_but_fixme_should_propagate_errors() });
i += needle.size() - 1; i += needle.size() - 1;
} }
} }
@ -814,7 +814,7 @@ Vector<Match> HexEditor::find_all(ByteBuffer& needle, size_t start)
return {}; return {};
auto first_match = matches.at(0); auto first_match = matches.at(0);
highlight(first_match.offset, first_match.offset + first_match.value.length()); highlight(first_match.offset, first_match.offset + first_match.value.bytes().size());
return matches; return matches;
} }
@ -839,7 +839,7 @@ Vector<Match> HexEditor::find_all_strings(size_t min_length)
builder.append(c); builder.append(c);
} else { } else {
if (builder.length() >= min_length) if (builder.length() >= min_length)
matches.append({ offset, builder.to_deprecated_string() }); matches.append({ offset, builder.to_string().release_value_but_fixme_should_propagate_errors() });
builder.clear(); builder.clear();
found_string = false; found_string = false;
} }
@ -849,7 +849,7 @@ Vector<Match> HexEditor::find_all_strings(size_t min_length)
return {}; return {};
auto first_match = matches.at(0); auto first_match = matches.at(0);
highlight(first_match.offset, first_match.offset + first_match.value.length()); highlight(first_match.offset, first_match.offset + first_match.value.bytes().size());
return matches; return matches;
} }

View file

@ -15,7 +15,7 @@
struct Match { struct Match {
u64 offset; u64 offset;
DeprecatedString value; String value;
}; };
class SearchResultsModel final : public GUI::Model { class SearchResultsModel final : public GUI::Model {