Revision: 13640
http://sourceforge.net/p/skim-app/code/13640
Author: hofman
Date: 2023-09-05 08:56:43 +0000 (Tue, 05 Sep 2023)
Log Message:
-----------
Set shouldDisplay and shouldPrint on newly added annotations from dictionaries.
Don't changes these properties for non skim notes.
Modified Paths:
--------------
trunk/SKMainWindowController.m
trunk/SKPDFView.m
Modified: trunk/SKMainWindowController.m
===================================================================
--- trunk/SKMainWindowController.m 2023-09-04 15:55:23 UTC (rev 13639)
+++ trunk/SKMainWindowController.m 2023-09-05 08:56:43 UTC (rev 13640)
@@ -1027,6 +1027,7 @@
- (void)addAnnotationsFromDictionaries:(NSArray *)noteDicts
toDocument:(PDFDocument *)pdfDoc pageIndexes:(NSMutableIndexSet *)pageIndexes
autoUpdate:(BOOL)autoUpdate {
NSMutableArray *notesToAdd = [NSMutableArray array];
+ BOOL shouldDisplay = [pdfView hideNotes] == NO;
// disable automatic add/remove from the notification handlers
// we want to do this in bulk as binding can be very slow and there are
potentially many notes
@@ -1047,6 +1048,8 @@
else if (pageIndex >= [pdfDoc pageCount])
pageIndex = [pdfDoc pageCount] - 1;
[pageIndexes addIndex:pageIndex];
+ [annotation setShouldDisplay:shouldDisplay];
+ [annotation setShouldPrint:shouldDisplay];
[pdfDoc addAnnotation:annotation toPage:[pdfDoc
pageAtIndex:pageIndex]];
if (autoUpdate && [[annotation contents] length] == 0)
[annotation autoUpdateString];
Modified: trunk/SKPDFView.m
===================================================================
--- trunk/SKPDFView.m 2023-09-04 15:55:23 UTC (rev 13639)
+++ trunk/SKPDFView.m 2023-09-05 08:56:43 UTC (rev 13640)
@@ -3243,8 +3243,10 @@
PDFAnnotation *annotation = [userInfo
objectForKey:SKPDFDocumentAnnotationKey];
PDFPage *page = [userInfo objectForKey:SKPDFDocumentPageKey];
- [annotation setShouldDisplay:pdfvFlags.hideNotes == NO || [annotation
isSkimNote] == NO || interactionMode == SKPresentationMode];
- [annotation setShouldPrint:(pdfvFlags.hideNotes == NO || [annotation
isSkimNote] == NO) && interactionMode != SKPresentationMode];
+ if ([annotation isSkimNote]) {
+ [annotation setShouldDisplay:pdfvFlags.hideNotes == NO ||
interactionMode == SKPresentationMode];
+ [annotation setShouldPrint:pdfvFlags.hideNotes == NO &&
interactionMode != SKPresentationMode];
+ }
[self setNeedsDisplayForAnnotation:annotation];
[self annotationsChangedOnPage:page];
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit