mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-22 02:49:29 +03:00
PDFViewer: Create OutlineModel items with the correct pointer
This fixes a bug where we would construct a ModelIndex with a pointer to NonnullRefPtr<OutlineItem>, instead of a pointer to the underlying OutlineItem, which caused a crash later on when we would try to dereference that pointer.
This commit is contained in:
parent
fcd4e68959
commit
0d46c27741
Notes:
sideshowbarker
2024-07-17 09:49:33 +09:00
Author: https://github.com/janso3 Commit: https://github.com/SerenityOS/serenity/commit/0d46c27741 Pull-request: https://github.com/SerenityOS/serenity/pull/17990
@ -130,8 +130,8 @@ GUI::ModelIndex OutlineModel::parent_index(const GUI::ModelIndex& index) const
|
||||
GUI::ModelIndex OutlineModel::index(int row, int column, const GUI::ModelIndex& parent) const
|
||||
{
|
||||
if (!parent.is_valid())
|
||||
return create_index(row, column, &m_outline->children[row]);
|
||||
return create_index(row, column, m_outline->children[row].ptr());
|
||||
|
||||
auto parent_outline_item = static_cast<PDF::OutlineItem*>(parent.internal_data());
|
||||
return create_index(row, column, &parent_outline_item->children[row]);
|
||||
return create_index(row, column, parent_outline_item->children[row].ptr());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user