Revision: 2849
          http://skim-app.svn.sourceforge.net/skim-app/?rev=2849&view=rev
Author:   hofman
Date:     2007-09-08 07:25:28 -0700 (Sat, 08 Sep 2007)

Log Message:
-----------
Discard annotations we don't handle from FDF.

Modified Paths:
--------------
    trunk/SKFDFParser.m

Modified: trunk/SKFDFParser.m
===================================================================
--- trunk/SKFDFParser.m 2007-09-08 14:20:39 UTC (rev 2848)
+++ trunk/SKFDFParser.m 2007-09-08 14:25:28 UTC (rev 2849)
@@ -76,6 +76,7 @@
 
 + (NSDictionary *)noteDictionary:(NSDictionary *)dict lookup:(NSDictionary 
*)lookup {
     NSMutableDictionary *dictionary = [NSMutableDictionary dictionary];
+    NSSet *validTypes = [NSSet setWithObjects:@"FreeText", @"Note", @"Circle", 
@"Square", @"Highlight", @"Underline", @"StrikeOut", @"Line", nil];
     NSEnumerator *keyEnum = [dict keyEnumerator];
     NSString *key;
     BOOL success = YES;
@@ -84,10 +85,16 @@
         id value = [dict valueForKey:key];
         
         if ([key isEqualToString:@"Type"]) {
-            if (value = [self value:value ofClass:[NSString class] 
lookup:lookup])
-                [dictionary setObject:value forKey:@"type"];
-            else
+            if (value = [self value:value ofClass:[NSString class] 
lookup:lookup]) {
+                if ([value isEqualtoString:@"Text"])
+                    value = @"Note";
+                if ([validTypes containsObject:value])
+                    [dictionary setObject:value forKey:@"type"];
+                else
+                    success = NO;
+            } else {
                 success = NO;
+            }
         } else if ([key isEqualToString:@"Contents"]) {
             if (value = [self value:value ofClass:[NSString class] 
lookup:lookup])
                 [dictionary setObject:value forKey:@"contents"];


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: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to