Age | Commit message (Collapse) | Author |
|
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 class had slightly confusing semantics and the added weirdness
doesn't seem worth it just so we can say "." instead of "->" when
iterating over a vector of NNRPs.
This patch replaces NonnullRefPtrVector<T> with Vector<NNRP<T>>.
|
|
Those don't have any non-try counterpart, so we might as well just omit
it.
|
|
Selecting an Outline Item from the Outline view informs via callback the
corresponding Destination that has been selected. This will be used to
move the application to the corresponding page/section/etc.
|
|
This is a nice addition to the outline view, which previously simply
displayed the titles of each section. Pages are shown in the first
column, but the tree is expanded via the second column, where the title
is.
|
|
The previous implementation had some repeated code, and wasn't really
working (because the OutlineItem.parent member was never populated). In
fact, when navigating with the up/down arrows in the associted TreeView
one could experience some funky behavior.
Now that we store OutlineItem's parents, we are fixing the
implementation for parent_index(), which was comparing the parent
siblings against the item's outline item instead of to its parent.
|
|
This follows the same idea that Andreas was doing in this latest videos,
where construction-time TRY()s were not present but should have been.
Like Andreas did, moving the initialisation of such fields to the
factory function, which then returns ErrorOr solves the issue.
|
|
Each of these strings would previously rely on StringView's char const*
constructor overload, which would call __builtin_strlen on the string.
Since we now have operator ""sv, we can replace these with much simpler
versions. This opens the door to being able to remove
StringView(char const*).
No functional changes.
|
|
|
|
|
|
This was used in a lot of places, so this patch makes liberal use of
ErrorOr<T>::release_value_but_fixme_should_propagate_errors().
|
|
Most of the models were just calling did_update anyway, which is
pointless since it can be unified to the base Model class. Instead, code
calling update() will now call invalidate(), which functions identically
and is more obvious in what it does.
Additionally, a default implementation is provided, which removes the
need to add empty implementations of update() for each model subclass.
Co-Authored-By: Ali Mohammad Pur <ali.mpfard@gmail.com>
|
|
Also mark them as [[nodiscard]].
|
|
Outlines are in theory implemented (though I'm having trouble finding
a simple PDF with outlines to test it on), and thumbnails are not.
|