From 77b311f00a8de15323d715e17f92b4cd75f6a106 Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Sun, 23 Jul 2023 10:29:46 -0400 Subject: [PATCH] MacPDF: FixedPoint hack fix courtesy of trflynn Also some minor cleanups, and pick a different default document. --- Meta/Lagom/Contrib/MacPDF/LagomPDFView.h | 3 +++ Meta/Lagom/Contrib/MacPDF/LagomPDFView.mm | 6 +----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Meta/Lagom/Contrib/MacPDF/LagomPDFView.h b/Meta/Lagom/Contrib/MacPDF/LagomPDFView.h index 27ac77c0d5..cf8c08d579 100644 --- a/Meta/Lagom/Contrib/MacPDF/LagomPDFView.h +++ b/Meta/Lagom/Contrib/MacPDF/LagomPDFView.h @@ -7,7 +7,10 @@ #pragma once +// Several AK types conflict with MacOS types. +#define FixedPoint FixedPointMacOS #import +#undef FixedPoint @interface LagomPDFView : NSView { diff --git a/Meta/Lagom/Contrib/MacPDF/LagomPDFView.mm b/Meta/Lagom/Contrib/MacPDF/LagomPDFView.mm index eff269651a..567487bd7c 100644 --- a/Meta/Lagom/Contrib/MacPDF/LagomPDFView.mm +++ b/Meta/Lagom/Contrib/MacPDF/LagomPDFView.mm @@ -7,8 +7,6 @@ #import "LagomPDFView.h" -// #define USING_AK_GLOBALLY 0 - #include #include #include @@ -70,9 +68,7 @@ static NSBitmapImageRep* ns_from_gfx(NonnullRefPtr bitmap_p) auto source_root = DeprecatedString("/Users/thakis/src/serenity"); Gfx::FontDatabase::set_default_fonts_lookup_path(DeprecatedString::formatted("{}/Base/res/fonts", source_root)); - NSLog(@"before file"); - _file = TRY(Core::MappedFile::map("/Users/thakis/src/hack/sample.pdf"sv)); - NSLog(@"got file"); + _file = TRY(Core::MappedFile::map("/Users/thakis/Downloads/pdf_reference_1-7.pdf"sv)); auto document = TRY(PDF::Document::create(_file->bytes())); TRY(document->initialize()); return document;