MacPDF: Unbreak Go to Next/Previous Page after #22768

This commit is contained in:
Nico Weber 2024-01-15 21:54:45 -05:00 committed by Andrew Kaster
parent eb305c6974
commit a4b5b9e82a
Notes: sideshowbarker 2024-07-17 10:31:19 +09:00

View file

@ -161,6 +161,10 @@ static NSBitmapImageRep* ns_from_gfx(NonnullRefPtr<Gfx::Bitmap> bitmap_p)
- (BOOL)validateMenuItem:(NSMenuItem*)item
{
if ([item action] == @selector(goToNextPage:))
return _doc ? (_page_index < (int)_doc->get_page_count() - 1) : NO;
if ([item action] == @selector(goToPreviousPage:))
return _doc ? (_page_index > 0) : NO;
if ([item action] == @selector(toggleShowClippingPaths:)) {
[item setState:_preferences.show_clipping_paths ? NSControlStateValueOn : NSControlStateValueOff];
return _doc ? YES : NO;