1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 01:57:44 +00:00

Presenter: Replace uses of JsonObject::get_deprecated()/get_ptr()

This commit is contained in:
Sam Atkins 2022-12-21 19:34:59 +00:00 committed by Tim Flynn
parent c36de98223
commit 74452ffc50
3 changed files with 18 additions and 18 deletions

View file

@ -19,11 +19,11 @@ static DeprecatedString to_css_length(float design_value, Presentation const& pr
ErrorOr<NonnullRefPtr<SlideObject>> SlideObject::parse_slide_object(JsonObject const& slide_object_json)
{
auto const& maybe_type = slide_object_json.get_deprecated("type"sv);
if (!maybe_type.is_string())
auto maybe_type = slide_object_json.get_deprecated_string("type"sv);
if (!maybe_type.has_value())
return Error::from_string_view("Slide object must have a type"sv);
auto type = maybe_type.as_string();
auto type = maybe_type.value();
RefPtr<SlideObject> object;
if (type == "text"sv)
object = TRY(try_make_ref_counted<Text>());