Revision: 7614
http://skim-app.svn.sourceforge.net/skim-app/?rev=7614&view=rev
Author: hofman
Date: 2011-12-30 12:27:20 +0000 (Fri, 30 Dec 2011)
Log Message:
-----------
different notification for changes to media box through applescript because it
should be handled differently
Modified Paths:
--------------
trunk/PDFPage_SKExtensions.h
trunk/PDFPage_SKExtensions.m
trunk/SKMainWindowController.m
Modified: trunk/PDFPage_SKExtensions.h
===================================================================
--- trunk/PDFPage_SKExtensions.h 2011-12-29 18:38:06 UTC (rev 7613)
+++ trunk/PDFPage_SKExtensions.h 2011-12-30 12:27:20 UTC (rev 7614)
@@ -45,6 +45,7 @@
extern NSString *SKPDFPagePageKey;
extern NSString *SKPDFPageActionKey;
extern NSString *SKPDFPageActionCrop;
+extern NSString *SKPDFPageActionResize;
extern NSString *SKPDFPageActionRotate;
@class SKMainDocument;
Modified: trunk/PDFPage_SKExtensions.m
===================================================================
--- trunk/PDFPage_SKExtensions.m 2011-12-29 18:38:06 UTC (rev 7613)
+++ trunk/PDFPage_SKExtensions.m 2011-12-30 12:27:20 UTC (rev 7614)
@@ -61,6 +61,7 @@
NSString *SKPDFPagePageKey = @"page";
NSString *SKPDFPageActionKey = @"action";
NSString *SKPDFPageActionCrop = @"crop";
+NSString *SKPDFPageActionResize = @"resize";
NSString *SKPDFPageActionRotate = @"rotate";
@implementation PDFPage (SKExtensions)
@@ -416,7 +417,7 @@
[self setBounds:newBounds forBox:kPDFDisplayBoxMediaBox];
[[NSNotificationCenter defaultCenter]
postNotificationName:SKPDFPageBoundsDidChangeNotification
- object:[self document] userInfo:[NSDictionary
dictionaryWithObjectsAndKeys:SKPDFPageActionCrop, SKPDFPageActionKey, self,
SKPDFPagePageKey, nil]];
+ object:[self document] userInfo:[NSDictionary
dictionaryWithObjectsAndKeys:SKPDFPageActionResize, SKPDFPageActionKey, self,
SKPDFPagePageKey, nil]];
}
}
Modified: trunk/SKMainWindowController.m
===================================================================
--- trunk/SKMainWindowController.m 2011-12-29 18:38:06 UTC (rev 7613)
+++ trunk/SKMainWindowController.m 2011-12-30 12:27:20 UTC (rev 7614)
@@ -1908,8 +1908,14 @@
- (void)handlePageBoundsDidChangeNotification:(NSNotification *)notification {
NSDictionary *info = [notification userInfo];
PDFPage *page = [info objectForKey:SKPDFPagePageKey];
- BOOL displayChanged = [[info objectForKey:SKPDFPageActionKey]
isEqualToString:SKPDFPageActionRotate] || [pdfView displayBox] ==
kPDFDisplayBoxCropBox;
+ NSString *action = [info objectForKey:SKPDFPageActionKey];
+ BOOL displayChanged = YES;
+ if ([action isEqualToString:SKPDFPageActionCrop])
+ displayChanged = ([pdfView displayBox] == kPDFDisplayBoxCropBox);
+ else if ([action isEqualToString:SKPDFPageActionResize])
+ displayChanged = ([pdfView displayBox] == kPDFDisplayBoxMediaBox);
+
if (displayChanged)
[pdfView layoutDocumentView];
if (page) {
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual
desktops for less than the cost of PCs and save 60% on VDI infrastructure
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit