From c55527944cdc46471702063f4eff6f3ed99e7fa7 Mon Sep 17 00:00:00 2001 From: Ben Wiederhake Date: Fri, 15 Oct 2021 23:15:12 +0200 Subject: [PATCH] LibWeb: Convert const pointer to nonnull into a reference --- Userland/Libraries/LibWeb/Layout/FormattingContext.cpp | 2 +- Userland/Libraries/LibWeb/Layout/FormattingContext.h | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Userland/Libraries/LibWeb/Layout/FormattingContext.cpp b/Userland/Libraries/LibWeb/Layout/FormattingContext.cpp index c11c5bb1ca..d6899a790c 100644 --- a/Userland/Libraries/LibWeb/Layout/FormattingContext.cpp +++ b/Userland/Libraries/LibWeb/Layout/FormattingContext.cpp @@ -22,7 +22,7 @@ namespace Web::Layout { FormattingContext::FormattingContext(Type type, Box& context_box, FormattingContext* parent) : m_type(type) , m_parent(parent) - , m_context_box(&context_box) + , m_context_box(context_box) { } diff --git a/Userland/Libraries/LibWeb/Layout/FormattingContext.h b/Userland/Libraries/LibWeb/Layout/FormattingContext.h index d88163b4bd..895bd9ddff 100644 --- a/Userland/Libraries/LibWeb/Layout/FormattingContext.h +++ b/Userland/Libraries/LibWeb/Layout/FormattingContext.h @@ -25,8 +25,8 @@ public: virtual void run(Box&, LayoutMode) = 0; - Box& context_box() { return *m_context_box; } - const Box& context_box() const { return *m_context_box; } + Box& context_box() { return m_context_box; } + const Box& context_box() const { return m_context_box; } FormattingContext* parent() { return m_parent; } const FormattingContext* parent() const { return m_parent; } @@ -69,7 +69,7 @@ protected: Type m_type {}; FormattingContext* m_parent { nullptr }; - Box* m_context_box { nullptr }; + Box& m_context_box; }; }