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:
parent
c36de98223
commit
74452ffc50
3 changed files with 18 additions and 18 deletions
|
@ -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>());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue