diff options
author | Andreas Kling <kling@serenityos.org> | 2020-06-12 21:07:52 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-06-12 21:28:55 +0200 |
commit | fdfda6dec20101013bb33633e657f06ef2a1ea96 (patch) | |
tree | 2157f8281cd9bc33a6984455c4831c397d2bd30c /Libraries/LibWeb/Layout | |
parent | 15f4043a7a80f52c0fa05c4e69771e758464cd20 (diff) | |
download | serenity-fdfda6dec20101013bb33633e657f06ef2a1ea96.zip |
AK: Make string-to-number conversion helpers return Optional
Get rid of the weird old signature:
- int StringType::to_int(bool& ok) const
And replace it with sensible new signature:
- Optional<int> StringType::to_int() const
Diffstat (limited to 'Libraries/LibWeb/Layout')
-rw-r--r-- | Libraries/LibWeb/Layout/LayoutFrame.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/Libraries/LibWeb/Layout/LayoutFrame.cpp b/Libraries/LibWeb/Layout/LayoutFrame.cpp index 7dbfb75730..94fe436125 100644 --- a/Libraries/LibWeb/Layout/LayoutFrame.cpp +++ b/Libraries/LibWeb/Layout/LayoutFrame.cpp @@ -53,9 +53,8 @@ void LayoutFrame::layout(LayoutMode layout_mode) set_has_intrinsic_width(true); set_has_intrinsic_height(true); // FIXME: Do proper error checking, etc. - bool ok; - set_intrinsic_width(node().attribute(HTML::AttributeNames::width).to_int(ok)); - set_intrinsic_height(node().attribute(HTML::AttributeNames::height).to_int(ok)); + set_intrinsic_width(node().attribute(HTML::AttributeNames::width).to_int().value_or(300)); + set_intrinsic_height(node().attribute(HTML::AttributeNames::height).to_int().value_or(150)); LayoutReplaced::layout(layout_mode); } |