mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-26 04:35:41 +03:00
HackStudio+LibGUI: Remove TextDocument::is_code_document()
The same thing can be accomplished with `is` and `verify_cast`, without making LibGUI care about HackStudio internals.
This commit is contained in:
parent
63d14a7e6e
commit
d832f3a887
Notes:
sideshowbarker
2024-07-17 11:30:54 +09:00
Author: https://github.com/AtkinsSJ Commit: https://github.com/SerenityOS/serenity/commit/d832f3a887 Pull-request: https://github.com/SerenityOS/serenity/pull/20105 Reviewed-by: https://github.com/linusg
@ -29,8 +29,6 @@ public:
|
||||
DeprecatedString const& file_path() const { return m_file_path; }
|
||||
Optional<Syntax::Language> const& language() const { return m_language; }
|
||||
|
||||
virtual bool is_code_document() const override final { return true; }
|
||||
|
||||
enum class DiffType {
|
||||
None,
|
||||
AddedLine,
|
||||
|
@ -456,9 +456,7 @@ Gfx::Bitmap const& Editor::current_position_icon_bitmap()
|
||||
|
||||
CodeDocument const& Editor::code_document() const
|
||||
{
|
||||
auto const& doc = document();
|
||||
VERIFY(doc.is_code_document());
|
||||
return static_cast<CodeDocument const&>(doc);
|
||||
return verify_cast<CodeDocument const>(document());
|
||||
}
|
||||
|
||||
CodeDocument& Editor::code_document()
|
||||
@ -471,7 +469,7 @@ void Editor::set_document(GUI::TextDocument& doc)
|
||||
if (has_document() && &document() == &doc)
|
||||
return;
|
||||
|
||||
VERIFY(doc.is_code_document());
|
||||
VERIFY(is<CodeDocument>(doc));
|
||||
GUI::TextEditor::set_document(doc);
|
||||
|
||||
set_override_cursor(Gfx::StandardCursor::IBeam);
|
||||
|
@ -150,8 +150,6 @@ public:
|
||||
TextPosition insert_at(TextPosition const&, StringView, Client const* = nullptr);
|
||||
void remove(TextRange const&);
|
||||
|
||||
virtual bool is_code_document() const { return false; }
|
||||
|
||||
bool is_empty() const;
|
||||
bool is_modified() const { return m_undo_stack.is_current_modified(); }
|
||||
void set_unmodified();
|
||||
|
Loading…
Reference in New Issue
Block a user