Revision: 7636
          http://skim-app.svn.sourceforge.net/skim-app/?rev=7636&view=rev
Author:   hofman
Date:     2012-02-12 16:58:23 +0000 (Sun, 12 Feb 2012)
Log Message:
-----------
Set null for missing document info key when scripting, so asking for the 
property does not raise an error

Modified Paths:
--------------
    trunk/NSDocument_SKExtensions.m
    trunk/SKInfoWindowController.h
    trunk/SKInfoWindowController.m
    trunk/Skim.sdef

Modified: trunk/NSDocument_SKExtensions.m
===================================================================
--- trunk/NSDocument_SKExtensions.m     2012-02-12 16:09:51 UTC (rev 7635)
+++ trunk/NSDocument_SKExtensions.m     2012-02-12 16:58:23 UTC (rev 7636)
@@ -280,6 +280,14 @@
     return [[SKInfoWindowController sharedInstance] infoForDocument:self];
 }
 
+- (NSDictionary *)scriptingInfo {
+    NSMutableDictionary *info = [NSMutableDictionary dictionary];
+    for (NSString *key in [[SKInfoWindowController sharedInstance] keys])
+        [info setObject:[NSNull null] forKey:key];
+    [info addEntriesFromDictionary:[self documentAttributes]];
+    return info;
+}
+
 - (BOOL)isPDFDocument { return NO; }
 
 - (void)handleRevertScriptCommand:(NSScriptCommand *)command {

Modified: trunk/SKInfoWindowController.h
===================================================================
--- trunk/SKInfoWindowController.h      2012-02-12 16:09:51 UTC (rev 7635)
+++ trunk/SKInfoWindowController.h      2012-02-12 16:58:23 UTC (rev 7636)
@@ -52,6 +52,7 @@
 @property (nonatomic, retain) IBOutlet NSTableView *summaryTableView, 
*attributesTableView;
 @property (nonatomic, retain) IBOutlet NSTabView *tabView;
 @property (nonatomic, copy) NSDictionary *info;
+@property (nonatomic, copy) NSArray *keys;
 
 + (id)sharedInstance;
 

Modified: trunk/SKInfoWindowController.m
===================================================================
--- trunk/SKInfoWindowController.m      2012-02-12 16:09:51 UTC (rev 7635)
+++ trunk/SKInfoWindowController.m      2012-02-12 16:58:23 UTC (rev 7636)
@@ -73,7 +73,7 @@
 
 @implementation SKInfoWindowController
 
-@synthesize summaryTableView, attributesTableView, tabView, info;
+@synthesize summaryTableView, attributesTableView, tabView, info, keys;
 
 + (void)initialize {
     SKINITIALIZE;
@@ -300,6 +300,10 @@
     return dictionary;
 }
 
+- (NSArray *)keys {
+    return [attributesKeys arrayByAddingObjectsFromArray:summaryKeys];
+}
+
 - (void)handleViewFrameDidChangeNotification:(NSNotification *)notification {
     [attributesTableView noteHeightOfRowsWithIndexesChanged:[NSIndexSet 
indexSetWithIndex:[attributesKeys count] - 1]];
 }

Modified: trunk/Skim.sdef
===================================================================
--- trunk/Skim.sdef     2012-02-12 16:09:51 UTC (rev 7635)
+++ trunk/Skim.sdef     2012-02-12 16:58:23 UTC (rev 7636)
@@ -933,7 +933,7 @@
             </property>
             <property name="info" type="document attributes" code="DInf" 
access="r"
                 description="The attributes of the PDF document.">
-                <cocoa key="documentAttributes"/>
+                <cocoa key="scriptingInfo"/>
             </property>
             <property name="tool" type="tool type" code="Tool"
                 description="The tool mode for the document.">

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


------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Skim-app-commit mailing list
Skim-app-commit@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to