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

AK: Port URL::m_fragment from DeprecatedString to String

This commit is contained in:
Shannon Booth 2023-08-12 16:52:42 +12:00 committed by Andrew Kaster
parent 5663a2d3b4
commit 9d60f23abc
21 changed files with 68 additions and 76 deletions

View file

@ -93,7 +93,7 @@ HelpWindow::HelpWindow(GUI::Window* parent)
return;
}
auto& doc = doc_option.value();
auto name = url.fragment();
auto name = url.fragment().value_or(String {});
auto maybe_example_data = doc.get_object("example_data"sv);
if (!maybe_example_data.has_value()) {

View file

@ -271,7 +271,7 @@ Optional<Position> Sheet::position_from_url(const URL& url) const
// FIXME: Figure out a way to do this cross-process.
VERIFY(url.serialize_path() == DeprecatedString::formatted("/{}", getpid()));
return parse_cell_name(url.fragment());
return parse_cell_name(url.fragment().value_or(String {}));
}
Position Sheet::offset_relative_to(Position const& base, Position const& offset, Position const& offset_base) const
@ -757,7 +757,7 @@ URL Position::to_url(Sheet const& sheet) const
url.set_scheme("spreadsheet"_string);
url.set_host("cell"_string);
url.set_paths({ DeprecatedString::number(getpid()) });
url.set_fragment(to_cell_identifier(sheet));
url.set_fragment(String::from_deprecated_string(to_cell_identifier(sheet)).release_value());
return url;
}