Revision: 4515
          http://skim-app.svn.sourceforge.net/skim-app/?rev=4515&view=rev
Author:   hofman
Date:     2008-09-01 20:23:08 +0000 (Mon, 01 Sep 2008)

Log Message:
-----------
Move static variable for logical page numbering pref to PDFPage class.

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

Modified: trunk/PDFPage_SKExtensions.h
===================================================================
--- trunk/PDFPage_SKExtensions.h        2008-09-01 19:03:08 UTC (rev 4514)
+++ trunk/PDFPage_SKExtensions.h        2008-09-01 20:23:08 UTC (rev 4515)
@@ -51,6 +51,9 @@
 
 @interface PDFPage (SKExtensions)
 
++ (BOOL)usesLogicalPageNumbering;
++ (void)setUsesLogicalPageNumbering:(BOOL)flag;
+
 - (NSRect)foregroundBox;
 - (NSImage *)image;
 - (NSImage *)imageForBox:(PDFDisplayBox)box;

Modified: trunk/PDFPage_SKExtensions.m
===================================================================
--- trunk/PDFPage_SKExtensions.m        2008-09-01 19:03:08 UTC (rev 4514)
+++ trunk/PDFPage_SKExtensions.m        2008-09-01 20:23:08 UTC (rev 4515)
@@ -79,6 +79,16 @@
     bboxCache = CFDictionaryCreateMutable(NULL, 0, NULL, 
&kSKNSRectDictionaryValueCallBacks);
 }
 
+static BOOL usesLogicalPageNumbering = NO;
+
++ (BOOL)usesLogicalPageNumbering {
+    return usesLogicalPageNumbering;
+}
+
++ (void)setUsesLogicalPageNumbering:(BOOL)flag {
+    usesLogicalPageNumbering = flag;
+}
+
 // mainly useful for drawing the box in a PDFView while debugging
 - (NSRect)foregroundBox {
     
@@ -331,7 +341,7 @@
 
 - (NSString *)displayLabel {
     NSString *label = nil;
-    if (SKUsesLogicalPageNumbering == NO)
+    if ([[self class] usesLogicalPageNumbering] == NO)
         label = [self label];
     return label ?: [self logicalLabel];
 }

Modified: trunk/SKMainWindowController.h
===================================================================
--- trunk/SKMainWindowController.h      2008-09-01 19:03:08 UTC (rev 4514)
+++ trunk/SKMainWindowController.h      2008-09-01 20:23:08 UTC (rev 4515)
@@ -83,8 +83,6 @@
 
 extern NSString *SKMainWindowPageColumnIdentifer;
 
-extern BOOL SKUsesLogicalPageNumbering;
-
 @class PDFAnnotation, PDFOutline, PDFSelection, SKThumbnail, 
SKGroupedSearchResult;
 @class SKPDFView, SKSecondaryPDFView, SKTocOutlineView, SKNoteOutlineView, 
SKThumbnailTableView, SKSnapshotTableView, SKSplitView, BDSKCollapsibleView, 
BDSKEdgeView, BDSKGradientView, SKColorSwatch, SKStatusBar;
 @class SKFullScreenWindow, SKNavigationWindow, SKSideWindow, 
SKSnapshotWindowController, SKProgressController, SKPageSheetController, 
SKScaleSheetController, SKPasswordSheetController, SKBookmarkSheetController;

Modified: trunk/SKMainWindowController.m
===================================================================
--- trunk/SKMainWindowController.m      2008-09-01 19:03:08 UTC (rev 4514)
+++ trunk/SKMainWindowController.m      2008-09-01 20:23:08 UTC (rev 4515)
@@ -146,7 +146,6 @@
 static NSString *SKSplitPDFCopiesZoomKey = @"SKSplitPDFCopiesZoom";
 static NSString *SKDisableAnimatedSearchHighlightKey = 
@"SKDisableAnimatedSearchHighlight";
 
-BOOL SKUsesLogicalPageNumbering = NO;
 
 @interface NSResponder (SKExtensions)
 - (BOOL)isDescendantOf:(NSView *)aView;
@@ -216,7 +215,7 @@
         segmentedControlOffset = 0.0;
     }
 
-    SKUsesLogicalPageNumbering = [[NSUserDefaults standardUserDefaults] 
boolForKey:SKLogicalPageNumberingKey];
+    [PDFPage setUsesLogicalPageNumbering:[[NSUserDefaults 
standardUserDefaults] boolForKey:SKLogicalPageNumberingKey]];
 }
 
 + (BOOL)automaticallyNotifiesObserversForKey:(NSString *)key {
@@ -3379,7 +3378,7 @@
             [groupedFindTableView setFont:font];
             [self updatePageColumnWidthForTableView:outlineView];
         } else if ([key isEqualToString:SKLogicalPageNumberingKey]) {
-            SKUsesLogicalPageNumbering = [[NSUserDefaults 
standardUserDefaults] boolForKey:SKLogicalPageNumberingKey];
+            [PDFPage setUsesLogicalPageNumbering:[[NSUserDefaults 
standardUserDefaults] boolForKey:SKLogicalPageNumberingKey]];
             [self updatePageLabelsAndOutline];
         }
         


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

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to