mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 23:07:35 +00:00
AK: Rename downcast<T> => verify_cast<T>
This makes it much clearer what this cast actually does: it will VERIFY that the thing we're casting is a T (using is<T>()).
This commit is contained in:
parent
6215a9c2cb
commit
ee3a73ddbb
61 changed files with 262 additions and 262 deletions
|
@ -39,8 +39,8 @@ void EditEventHandler::handle_delete_character_after(const DOM::Position& cursor
|
|||
// This method is quite convoluted but this is necessary to make editing feel intuitive.
|
||||
void EditEventHandler::handle_delete(DOM::Range& range)
|
||||
{
|
||||
auto* start = downcast<DOM::Text>(range.start_container());
|
||||
auto* end = downcast<DOM::Text>(range.end_container());
|
||||
auto* start = verify_cast<DOM::Text>(range.start_container());
|
||||
auto* end = verify_cast<DOM::Text>(range.end_container());
|
||||
|
||||
if (start == end) {
|
||||
StringBuilder builder;
|
||||
|
@ -100,7 +100,7 @@ void EditEventHandler::handle_delete(DOM::Range& range)
|
|||
void EditEventHandler::handle_insert(DOM::Position position, u32 code_point)
|
||||
{
|
||||
if (is<DOM::Text>(*position.node())) {
|
||||
auto& node = downcast<DOM::Text>(*position.node());
|
||||
auto& node = verify_cast<DOM::Text>(*position.node());
|
||||
|
||||
StringBuilder builder;
|
||||
builder.append(node.data().substring_view(0, position.offset()));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue