Revision: 15418
          http://sourceforge.net/p/skim-app/code/15418
Author:   hofman
Date:     2025-06-09 09:20:49 +0000 (Mon, 09 Jun 2025)
Log Message:
-----------
use newSkimNoteWithProperties instead of initalizer

Modified Paths:
--------------
    trunk/PDFPage_SKExtensions.m
    trunk/SKMainDocument.m
    trunk/SKMainWindowController.h
    trunk/SKMainWindowController.m

Modified: trunk/PDFPage_SKExtensions.m
===================================================================
--- trunk/PDFPage_SKExtensions.m        2025-06-08 22:09:37 UTC (rev 15417)
+++ trunk/PDFPage_SKExtensions.m        2025-06-09 09:20:49 UTC (rev 15418)
@@ -772,7 +772,7 @@
         NSMutableArray *copiedValue = [[NSMutableArray alloc] init];
         for (PDFAnnotation *annotation in value) {
             if ([annotation isMovable]) {
-                PDFAnnotation *copiedAnnotation = [[PDFAnnotation alloc] 
initSkimNoteWithProperties:[annotation SkimNoteProperties]];
+                PDFAnnotation *copiedAnnotation = [PDFAnnotation 
newSkimNoteWithProperties:[annotation SkimNoteProperties]];
                 [copiedAnnotation registerUserName];
                 if ([properties count])
                     [copiedAnnotation setScriptingProperties:[copiedAnnotation 
coerceValue:properties forKey:@"scriptingProperties"]];

Modified: trunk/SKMainDocument.m
===================================================================
--- trunk/SKMainDocument.m      2025-06-08 22:09:37 UTC (rev 15417)
+++ trunk/SKMainDocument.m      2025-06-09 09:20:49 UTC (rev 15418)
@@ -195,7 +195,7 @@
     
     [[self undoManager] disableUndoRegistration];
     
-    [[self mainWindowController] setPdfDocument:pdfDoc 
addAnnotationsFromDictionaries:[tmpData noteDicts]];
+    [[self mainWindowController] setPdfDocument:pdfDoc 
addAnnotationsWithProperties:[tmpData noteDicts]];
     
     [self setPresentationOptions:[tmpData presentationOptions]];
     
@@ -1104,7 +1104,7 @@
     }
     
     if (array) {
-        [[self mainWindowController] addAnnotationsFromDictionaries:array 
replacing:replace];
+        [[self mainWindowController] addAnnotationsWithProperties:array 
replacing:replace];
         [[self undoManager] setActionName:replace ? 
NSLocalizedString(@"Replace Notes", @"Undo action name") : 
NSLocalizedString(@"Add Notes", @"Undo action name")];
     } else
         NSBeep();
@@ -1202,7 +1202,7 @@
             
             dispatch_async(dispatch_get_main_queue(), ^{
                 
-                [[self mainWindowController] 
addConvertedAnnotationsFromDictionaries:noteDicts 
removeAnnotations:annotations];
+                [[self mainWindowController] 
addConvertedAnnotationsWithProperties:noteDicts removeAnnotations:annotations];
                 
                 [self setPDFData:data pageOffsets:offsets];
                 

Modified: trunk/SKMainWindowController.h
===================================================================
--- trunk/SKMainWindowController.h      2025-06-08 22:09:37 UTC (rev 15417)
+++ trunk/SKMainWindowController.h      2025-06-09 09:20:49 UTC (rev 15418)
@@ -316,9 +316,9 @@
 - (void)snapshotNeedsUpdate:(SKSnapshotWindowController *)dirstySnapshot 
lowPriority:(BOOL)lowPriority;
 - (void)allSnapshotsNeedUpdate;
 
-- (void)setPdfDocument:(nullable PDFDocument *)pdfDocument 
addAnnotationsFromDictionaries:(nullable NSArray<NSDictionary<NSString *, id> 
*> *)noteDicts;
-- (void)addAnnotationsFromDictionaries:(NSArray<NSDictionary<NSString *, id> 
*> *)noteDicts replacing:(BOOL)replacing;
-- (void)addConvertedAnnotationsFromDictionaries:(NSArray<NSDictionary<NSString 
*, id> *> *)noteDicts removeAnnotations:(nullable NSArray<PDFAnnotation *> 
*)notesToRemove;
+- (void)setPdfDocument:(nullable PDFDocument *)pdfDocument 
addAnnotationsWithProperties:(nullable NSArray<NSDictionary<NSString *, id> *> 
*)noteDicts;
+- (void)addAnnotationsWithProperties:(NSArray<NSDictionary<NSString *, id> *> 
*)noteDicts replacing:(BOOL)replacing;
+- (void)addConvertedAnnotationsWithProperties:(NSArray<NSDictionary<NSString 
*, id> *> *)noteDicts removeAnnotations:(nullable NSArray<PDFAnnotation *> 
*)notesToRemove;
 
 - (void)applySetup:(NSDictionary<NSString *, id> *)setup;
 - (NSDictionary<NSString *, id> *)currentSetup;

Modified: trunk/SKMainWindowController.m
===================================================================
--- trunk/SKMainWindowController.m      2025-06-08 22:09:37 UTC (rev 15417)
+++ trunk/SKMainWindowController.m      2025-06-09 09:20:49 UTC (rev 15418)
@@ -1012,7 +1012,7 @@
     [pdfView resetPDFToolTipRects];
 }
 
-- (NSArray *)annotationsAndPagesFromDictionaries:(NSArray *)noteDicts 
forDocument:(PDFDocument *)pdfDoc autoUpdate:(BOOL)autoUpdate 
widgetDictionaries:(NSMutableArray *)widgetDicts {
+- (NSArray *)annotationsAndPagesWithProperties:(NSArray *)noteDicts 
forDocument:(PDFDocument *)pdfDoc autoUpdate:(BOOL)autoUpdate 
widgetProperties:(NSMutableArray *)widgetDicts {
     NSMutableArray *notesAndPagesToAdd = [NSMutableArray array];
     
     // create new annotations from the dictionary and get the page to add to
@@ -1040,9 +1040,9 @@
     return notesAndPagesToAdd;
 }
 
-- (void)addAnnotationsFromDictionaries:(NSArray *)noteDicts 
replacing:(BOOL)replacing {
+- (void)addAnnotationsWithProperties:(NSArray *)noteDicts 
replacing:(BOOL)replacing {
     NSMutableArray *widgetDicts = [NSMutableArray array];
-    NSArray *notesAndPagesToAdd = [self 
annotationsAndPagesFromDictionaries:noteDicts forDocument:[pdfView document] 
autoUpdate:NO widgetDictionaries:widgetDicts];
+    NSArray *notesAndPagesToAdd = [self 
annotationsAndPagesWithProperties:noteDicts forDocument:[pdfView document] 
autoUpdate:NO widgetProperties:widgetDicts];
     
     if (replacing && [notes count]) {
         [pdfView removePDFToolTipRects];
@@ -1063,14 +1063,14 @@
     [self addAnnotations:notesAndPagesToAdd removeAnnotations:replacing ? 
[self notes] : nil];
 }
 
-- (void)addConvertedAnnotationsFromDictionaries:(NSArray *)noteDicts 
removeAnnotations:(NSArray *)notesToRemove {
+- (void)addConvertedAnnotationsWithProperties:(NSArray *)noteDicts 
removeAnnotations:(NSArray *)notesToRemove {
     BOOL autoUpdate = NO == [[NSUserDefaults standardUserDefaults] 
boolForKey:SKDisableUpdateContentsFromEnclosedTextKey];
-    NSArray *notesAndPagesToAdd = [self 
annotationsAndPagesFromDictionaries:noteDicts forDocument:[pdfView document] 
autoUpdate:autoUpdate widgetDictionaries:nil];
+    NSArray *notesAndPagesToAdd = [self 
annotationsAndPagesWithProperties:noteDicts forDocument:[pdfView document] 
autoUpdate:autoUpdate widgetProperties:nil];
     
     [self addAnnotations:notesAndPagesToAdd removeAnnotations:notesToRemove];
 }
 
-- (void)setPdfDocument:(PDFDocument *)pdfDocument 
addAnnotationsFromDictionaries:(NSArray *)noteDicts {
+- (void)setPdfDocument:(PDFDocument *)pdfDocument 
addAnnotationsWithProperties:(NSArray *)noteDicts {
     PDFDocument *pdfDoc = pdfDocument;
     NSMutableArray *widgetProperties = nil;
     PDFDocument *oldPdfDoc = [pdfView document];
@@ -1147,7 +1147,7 @@
     
     if ([noteDicts count]) {
         widgetProperties = [NSMutableArray array];
-        NSArray *notesAndPagesToAdd = [self 
annotationsAndPagesFromDictionaries:noteDicts forDocument:pdfDoc autoUpdate:NO 
widgetDictionaries:widgetProperties];
+        NSArray *notesAndPagesToAdd = [self 
annotationsAndPagesWithProperties:noteDicts forDocument:pdfDoc autoUpdate:NO 
widgetProperties:widgetProperties];
         
         if ([notesAndPagesToAdd count]) {
             NSMutableArray *addedNotes = [NSMutableArray array];

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.



_______________________________________________
Skim-app-commit mailing list
Skim-app-commit@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to