diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-07-24 09:12:23 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-07-24 09:13:06 +0200 |
commit | 2196f17c107d9367d6035da53d955b7382594f1e (patch) | |
tree | 37f52d07700ef3cc61761136ed8c41acf6e0bf2f /Libraries/LibGUI/GTextEditor.h | |
parent | 90ea4918d6c8b011710be2c4a1d7756a07cd45c3 (diff) | |
download | serenity-2196f17c107d9367d6035da53d955b7382594f1e.zip |
LibGUI: Convert Vector<OwnPtr> to NonnullOwnPtrVector.
This is turning out really nice so far. :^)
Diffstat (limited to 'Libraries/LibGUI/GTextEditor.h')
-rw-r--r-- | Libraries/LibGUI/GTextEditor.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Libraries/LibGUI/GTextEditor.h b/Libraries/LibGUI/GTextEditor.h index 751b6a5428..fcac07ab15 100644 --- a/Libraries/LibGUI/GTextEditor.h +++ b/Libraries/LibGUI/GTextEditor.h @@ -2,8 +2,9 @@ #include <AK/Function.h> #include <AK/HashMap.h> -#include <LibGUI/GScrollableWidget.h> +#include <AK/NonnullOwnPtrVector.h> #include <LibDraw/TextAlignment.h> +#include <LibGUI/GScrollableWidget.h> class GAction; class GMenu; @@ -193,8 +194,8 @@ private: void update_cursor(); void set_cursor(int line, int column); void set_cursor(const GTextPosition&); - Line& current_line() { return *m_lines[m_cursor.line()]; } - const Line& current_line() const { return *m_lines[m_cursor.line()]; } + Line& current_line() { return m_lines[m_cursor.line()]; } + const Line& current_line() const { return m_lines[m_cursor.line()]; } GTextPosition text_position_at(const Point&) const; void insert_at_cursor(char); void insert_at_cursor(const StringView&); @@ -208,7 +209,7 @@ private: Type m_type { MultiLine }; - Vector<OwnPtr<Line>> m_lines; + NonnullOwnPtrVector<Line> m_lines; GTextPosition m_cursor; TextAlignment m_text_alignment { TextAlignment::CenterLeft }; bool m_cursor_state { true }; |