Skip to content

Commit

Permalink
Add more rich text pasteboard type exclusions.
Browse files Browse the repository at this point in the history
  • Loading branch information
mattDavo committed Jan 18, 2021
1 parent 3afa01e commit 2413efa
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 11 deletions.
20 changes: 10 additions & 10 deletions Yippy.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1332,7 +1332,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 0;
DEVELOPMENT_TEAM = HY8YZ2D6M7;
ENABLE_HARDENED_RUNTIME = NO;
INFOPLIST_FILE = "Yippy/Supporting Files/Info.plist";
Expand All @@ -1341,7 +1341,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.13;
MARKETING_VERSION = 2.4.2;
MARKETING_VERSION = 2.5.0;
PRODUCT_BUNDLE_IDENTIFIER = MatthewDavidson.Yippy;
PRODUCT_MODULE_NAME = "$(PRODUCT_NAME:c99extidentifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -1358,7 +1358,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 0;
DEVELOPMENT_TEAM = HY8YZ2D6M7;
ENABLE_HARDENED_RUNTIME = NO;
INFOPLIST_FILE = "Yippy/Supporting Files/Info.plist";
Expand All @@ -1367,7 +1367,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.13;
MARKETING_VERSION = 2.4.2;
MARKETING_VERSION = 2.5.0;
PRODUCT_BUNDLE_IDENTIFIER = MatthewDavidson.Yippy;
PRODUCT_MODULE_NAME = "$(PRODUCT_NAME:c99extidentifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down Expand Up @@ -1532,7 +1532,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 0;
DEVELOPMENT_TEAM = HY8YZ2D6M7;
ENABLE_HARDENED_RUNTIME = NO;
INFOPLIST_FILE = "Yippy/Supporting Files/Info.plist";
Expand All @@ -1541,7 +1541,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.13;
MARKETING_VERSION = 2.4.2;
MARKETING_VERSION = 2.5.0;
PRODUCT_BUNDLE_IDENTIFIER = MatthewDavidson.YippyBeta;
PRODUCT_MODULE_NAME = "$(PRODUCT_NAME:c99extidentifier)";
PRODUCT_NAME = "$(TARGET_NAME) Beta";
Expand Down Expand Up @@ -1657,7 +1657,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 0;
DEVELOPMENT_TEAM = HY8YZ2D6M7;
ENABLE_HARDENED_RUNTIME = NO;
INFOPLIST_FILE = "Yippy/Supporting Files/Info.plist";
Expand All @@ -1666,7 +1666,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.13;
MARKETING_VERSION = 2.4.2;
MARKETING_VERSION = 2.5.0;
PRODUCT_BUNDLE_IDENTIFIER = MatthewDavidson.YippyBeta;
PRODUCT_MODULE_NAME = "$(PRODUCT_NAME:c99extidentifier)";
PRODUCT_NAME = "$(TARGET_NAME) Beta";
Expand Down Expand Up @@ -1789,7 +1789,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 0;
DEVELOPMENT_TEAM = HY8YZ2D6M7;
ENABLE_HARDENED_RUNTIME = NO;
INFOPLIST_FILE = "Yippy/Supporting Files/Info.plist";
Expand All @@ -1798,7 +1798,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.13;
MARKETING_VERSION = 2.4.2;
MARKETING_VERSION = 2.5.0;
PRODUCT_BUNDLE_IDENTIFIER = MatthewDavidson.YippyXCTest;
PRODUCT_MODULE_NAME = "$(PRODUCT_NAME:c99extidentifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down
10 changes: 9 additions & 1 deletion Yippy/Sources/Models/History/HistoryItem.swift
Original file line number Diff line number Diff line change
Expand Up @@ -222,12 +222,20 @@ class HistoryItem: NSObject {
}
return false
}

private let richTextPasteboardTypes = [
NSPasteboard.PasteboardType.rtf.rawValue,
NSPasteboard.PasteboardType.html.rawValue,
"public.utf16-external-plain-text",
]
}

// MARK: - HistoryItem+NSPasteboardWriting
extension HistoryItem: NSPasteboardWriting {
func writableTypes(for pasteboard: NSPasteboard) -> [NSPasteboard.PasteboardType] {
return types.filter{ HistoryItem.pastesRichText || $0 != .rtf } + [Self.historyItemIdType]
return types.filter{
HistoryItem.pastesRichText || !richTextPasteboardTypes.contains($0.rawValue)
} + [Self.historyItemIdType]
}

func pasteboardPropertyList(forType type: NSPasteboard.PasteboardType) -> Any? {
Expand Down

0 comments on commit 2413efa

Please sign in to comment.