mirror of
https://github.com/RGBCube/serenity
synced 2025-06-01 05:48:12 +00: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
3 changed files with 2 additions and 8 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue