Skip to content

Commit

Permalink
Unreviewed, fix the Mac Catalyst build after 276581@main
Browse files Browse the repository at this point in the history
Explicitly cast to `UIPasteboard`, so that the Catalyst WebCore build (that has declarations for
both `+[NSPasteboard generalPasteboard]` from AppKit as well as `+[UIPasteboard generalPasteboard]`
from UIKit) won't get confused.

* Source/WebCore/platform/ios/PlatformPasteboardIOS.mm:
(WebCore::generalUIPasteboard):
(WebCore::PlatformPasteboard::PlatformPasteboard):

Canonical link: https://commits.webkit.org/276599@main
  • Loading branch information
whsieh committed Mar 23, 2024
1 parent ad8d3e1 commit 3a123fd
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions Source/WebCore/platform/ios/PlatformPasteboardIOS.mm
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,13 @@ @interface UIPasteboard () <AbstractPasteboard>

namespace WebCore {

static UIPasteboard *generalUIPasteboard()
{
return static_cast<UIPasteboard *>([PAL::getUIPasteboardClass() generalPasteboard]);
}

PlatformPasteboard::PlatformPasteboard()
: m_pasteboard([PAL::getUIPasteboardClass() generalPasteboard])
: m_pasteboard(generalUIPasteboard())
{
}

Expand All @@ -70,11 +75,11 @@ @interface UIPasteboard () <AbstractPasteboard>
if (name == Pasteboard::nameOfDragPasteboard())
m_pasteboard = [WebItemProviderPasteboard sharedInstance];
else
m_pasteboard = [PAL::getUIPasteboardClass() generalPasteboard];
m_pasteboard = generalUIPasteboard();
}
#else
PlatformPasteboard::PlatformPasteboard(const String&)
: m_pasteboard([PAL::getUIPasteboardClass() generalPasteboard])
: m_pasteboard(generalUIPasteboard())
{
}
#endif
Expand Down

0 comments on commit 3a123fd

Please sign in to comment.