Revision: 16716
          http://sourceforge.net/p/skim-app/code/16716
Author:   hofman
Date:     2026-10-26 17:41:43 +0000 (Mon, 26 Oct 2026)
Log Message:
-----------
don't use setters

Modified Paths:
--------------
    trunk/SKMainWindowController.m
    trunk/SKMainWindowController_FullScreen.m
    trunk/SKSnapshotWindowController.h
    trunk/SKSnapshotWindowController.m

Modified: trunk/SKMainWindowController.m
===================================================================
--- trunk/SKMainWindowController.m      2026-10-26 17:29:06 UTC (rev 16715)
+++ trunk/SKMainWindowController.m      2026-10-26 17:41:43 UTC (rev 16716)
@@ -2439,8 +2439,8 @@
     
     [swc setDelegate:self];
     
-    [swc setPdfDocument:[pdfView document]];
-    [swc goToPage:page rect:rect scaleFactor:scaleFactor autoFits:autoFits];
+    [swc loadPdfDocument:[pdfView document]];
+    [swc displayPage:page rect:rect scaleFactor:scaleFactor autoFits:autoFits];
     
     [swc setForceOnTop:[self interactionMode] == SKFullScreenMode];
     
@@ -2453,8 +2453,8 @@
         
         [swc setDelegate:self];
         
-        [swc setPdfDocument:[pdfView document]];
-        [swc setCurrentSetup:setup];
+        [swc loadPdfDocument:[pdfView document]];
+        [swc displaySetup:setup];
 
         [swc setForceOnTop:[self interactionMode] == SKFullScreenMode];
         

Modified: trunk/SKMainWindowController_FullScreen.m
===================================================================
--- trunk/SKMainWindowController_FullScreen.m   2026-10-26 17:29:06 UTC (rev 
16715)
+++ trunk/SKMainWindowController_FullScreen.m   2026-10-26 17:41:43 UTC (rev 
16716)
@@ -200,7 +200,7 @@
         
         [preview setDelegate:self];
         
-        [preview setPdfDocument:pdfDoc];
+        [preview loadPdfDocument:pdfDoc];
         [preview previewPage:page displayOnScreen:screen];
     
         [[self document] addWindowController:preview];

Modified: trunk/SKSnapshotWindowController.h
===================================================================
--- trunk/SKSnapshotWindowController.h  2026-10-26 17:29:06 UTC (rev 16715)
+++ trunk/SKSnapshotWindowController.h  2026-10-26 17:41:43 UTC (rev 16716)
@@ -73,15 +73,17 @@
 @property (nonatomic, nullable, readonly) NSString *pageLabel;
 @property (nonatomic, nullable, readonly) NSString *string;
 @property (nonatomic, readonly) BOOL hasWindow;
-@property (nonatomic, nullable, strong) PDFDocument *pdfDocument;
-@property (nonatomic, copy) NSDictionary<NSString *, id> *currentSetup;
+@property (nonatomic, readonly) NSDictionary<NSString *, id> *currentSetup;
 @property (nonatomic) BOOL forceOnTop;
 @property (nonatomic, readonly) SKSnapshotConfiguration *currentConfiguration;
 
 @property (nonatomic, readonly) NSAttributedString *thumbnailAttachment, 
*thumbnail512Attachment, *thumbnail256Attachment, *thumbnail128Attachment, 
*thumbnail64Attachment, *thumbnail32Attachment;
 
-- (void)goToPage:(PDFPage *)page rect:(NSRect)rect scaleFactor:(CGFloat)factor 
autoFits:(BOOL)autoFits;
+- (void)loadPdfDocument:(PDFDocument *)pdfDocument;
+
+- (void)displayPage:(PDFPage *)page rect:(NSRect)rect 
scaleFactor:(CGFloat)factor autoFits:(BOOL)autoFits;
 - (void)previewPage:(PDFPage *)page displayOnScreen:(nullable NSScreen 
*)screen;
+- (void)displaySetup:(NSDictionary<NSString *, id> *)currentSetup;
 
 - (BOOL)isPageVisible:(PDFPage *)page;
 - (BOOL)isPageInIndexesVisible:(NSIndexSet *)pageIndexes;

Modified: trunk/SKSnapshotWindowController.m
===================================================================
--- trunk/SKSnapshotWindowController.m  2026-10-26 17:29:06 UTC (rev 16715)
+++ trunk/SKSnapshotWindowController.m  2026-10-26 17:41:43 UTC (rev 16716)
@@ -92,7 +92,7 @@
 @implementation SKSnapshotWindowController
 
 @synthesize pdfView, delegate, thumbnail, updateDate, pageLabel, string, 
hasWindow, forceOnTop;
-@dynamic bounds, pageIndex, pdfDocument, currentSetup, currentConfiguration, 
thumbnailAttachment, thumbnail512Attachment, thumbnail256Attachment, 
thumbnail128Attachment, thumbnail64Attachment, thumbnail32Attachment;
+@dynamic bounds, pageIndex, currentSetup, currentConfiguration, 
thumbnailAttachment, thumbnail512Attachment, thumbnail256Attachment, 
thumbnail128Attachment, thumbnail64Attachment, thumbnail32Attachment;
 
 - (NSString *)windowNibName {
     return @"SnapshotWindow";
@@ -289,6 +289,11 @@
     }
 }
 
+- (void)loadPdfDocument:(PDFDocument *)pdfDocument {
+    [self window];
+    [pdfView setDocument:pdfDocument];
+}
+
 - (void)goToPage:(PDFPage *)page rect:(NSRect)rect scaleFactor:(CGFloat)factor 
autoFits:(BOOL)autoFits screen:(NSScreen *)screen 
openType:(SKSnapshotOpenType)openType {
     NSWindow *window = [self window];
     
@@ -338,7 +343,7 @@
     }
 }
 
-- (void)goToPage:(PDFPage *)page rect:(NSRect)rect scaleFactor:(CGFloat)factor 
autoFits:(BOOL)autoFits {
+- (void)displayPage:(PDFPage *)page rect:(NSRect)rect 
scaleFactor:(CGFloat)factor autoFits:(BOOL)autoFits {
     [self goToPage:page
               rect:rect
        scaleFactor:factor
@@ -356,7 +361,7 @@
           openType:SKSnapshotOpenPreview];
 }
 
-- (void)setCurrentSetup:(NSDictionary *)setup {
+- (void)displaySetup:(NSDictionary *)setup {
     [self goToPage:[[pdfView document] pageAtIndex:[[setup 
objectForKey:PAGE_KEY] unsignedIntegerValue]]
               rect:NSRectFromString([setup objectForKey:RECT_KEY])
        scaleFactor:[[setup objectForKey:SCALEFACTOR_KEY] doubleValue]
@@ -400,15 +405,6 @@
         [self updateWindowLevel];
 }
 
-- (PDFDocument *)pdfDocument {
-    return [pdfView document];
-}
-
-- (void)setPdfDocument:(PDFDocument *)pdfDocument {
-    [self window];
-    [pdfView setDocument:pdfDocument];
-}
-
 - (NSDictionary *)currentSetup {
     return @{PAGE_KEY:[NSNumber numberWithUnsignedInteger:[self pageIndex]], 
RECT_KEY:NSStringFromRect([self bounds]), SCALEFACTOR_KEY:[NSNumber 
numberWithDouble:[pdfView scaleFactor]], AUTOFITS_KEY:[NSNumber 
numberWithBool:[pdfView autoFits]], HASWINDOW_KEY:[NSNumber 
numberWithBool:[[self window] isVisible]], 
WINDOWFRAME_KEY:NSStringFromRect([[self window] frame])};
 }

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

Reply via email to