Revision: 3795
          http://skim-app.svn.sourceforge.net/skim-app/?rev=3795&view=rev
Author:   hofman
Date:     2008-04-22 15:04:46 -0700 (Tue, 22 Apr 2008)

Log Message:
-----------
Remove visible children attribute, as this is not used for the group role 
anyway.

Modified Paths:
--------------
    trunk/PDFDisplayView_SKExtensions.m
    trunk/SKPDFView.h
    trunk/SKPDFView.m

Modified: trunk/PDFDisplayView_SKExtensions.m
===================================================================
--- trunk/PDFDisplayView_SKExtensions.m 2008-04-22 21:49:11 UTC (rev 3794)
+++ trunk/PDFDisplayView_SKExtensions.m 2008-04-22 22:04:46 UTC (rev 3795)
@@ -71,7 +71,7 @@
 
 - (NSArray *)replacementAccessibilityAttributeNames {
     if ([self skpdfView])
-        return [originalAccessibilityAttributeNames(self, _cmd) 
arrayByAddingObjectsFromArray:[NSArray 
arrayWithObjects:NSAccessibilityChildrenAttribute, 
NSAccessibilityVisibleChildrenAttribute, nil]];
+        return [originalAccessibilityAttributeNames(self, _cmd) 
arrayByAddingObject:NSAccessibilityChildrenAttribute];
     else
         return originalAccessibilityAttributeNames(self, _cmd);
 }
@@ -86,8 +86,6 @@
         return NSAccessibilityRoleDescription(NSAccessibilityGroupRole, nil);
     } else if ([attribute isEqualToString:NSAccessibilityChildrenAttribute]) {
         return NSAccessibilityUnignoredChildren([pdfView 
accessibilityChildren]);
-    } else if ([attribute 
isEqualToString:NSAccessibilityVisibleChildrenAttribute]) {
-        return NSAccessibilityUnignoredChildren([pdfView 
accessibilityVisibleChildren]);
     } else if ([attribute isEqualToString:NSAccessibilityFocusedAttribute]) {
         NSNumber *focused = originalAccessibilityAttributeValue(self, _cmd, 
attribute);
         return [NSNumber numberWithBool:[pdfView activeAnnotation] == nil && 
[focused boolValue]];

Modified: trunk/SKPDFView.h
===================================================================
--- trunk/SKPDFView.h   2008-04-22 21:49:11 UTC (rev 3794)
+++ trunk/SKPDFView.h   2008-04-22 22:04:46 UTC (rev 3795)
@@ -195,7 +195,6 @@
 - (void)removeHoverRects;
 
 - (NSArray *)accessibilityChildren;
-- (NSArray *)accessibilityVisibleChildren;
 
 - (NSUndoManager *)undoManager;
 

Modified: trunk/SKPDFView.m
===================================================================
--- trunk/SKPDFView.m   2008-04-22 21:49:11 UTC (rev 3794)
+++ trunk/SKPDFView.m   2008-04-22 22:04:46 UTC (rev 3795)
@@ -2134,30 +2134,10 @@
     }
 }
 
-- (NSArray *)accessibilityChildrenForPageRange:(NSRange)range 
visible:(BOOL)onlyVisible {
-    NSMutableArray *children = [NSMutableArray array];
-    
-    [children addObject:[[[SKAccessibilityPDFDisplayViewElement alloc] 
initWithParent:[self documentView]] autorelease]];
-    
-    PDFDocument *pdfDoc = [self document];
-    unsigned int i;
-    NSRect visibleRect = onlyVisible ? [self visibleContentRect] : NSZeroRect;
-    for (i = range.location; i < NSMaxRange(range); i++) {
-        PDFPage *page = [pdfDoc pageAtIndex:i];
-        NSEnumerator *annotationEnum = [[page annotations] objectEnumerator];
-        PDFAnnotation *annotation;
-        while (annotation = [annotationEnum nextObject]) {
-            if ([[annotation type] isEqualToString:SKLinkString] || 
[annotation isNoteAnnotation] &&
-                (onlyVisible == NO || NSIntersectsRect([self 
convertRect:[annotation bounds] fromPage:[annotation page]], visibleRect)))
-                [children addObject:[SKAccessibilityPDFAnnotationElement 
elementWithAnnotation:annotation pdfView:self parent:[self documentView]]];
-        }
-    }
-    return children;
-}
-
 - (NSArray *)accessibilityChildren {
     if (accessibilityChildren == nil) {
-        unsigned pageCount = [[self document] pageCount];
+        PDFDocument *pdfDoc = [self document];
+        unsigned pageCount = [pdfDoc pageCount];
         NSRange range = NSMakeRange(0, pageCount);
         if (pageCount && ([self displayMode] == kPDFDisplaySinglePage || [self 
displayMode] == kPDFDisplayTwoUp)) {
             NSRange range = NSMakeRange([[self currentPage] pageIndex], 1);
@@ -2172,18 +2152,28 @@
                 if (NSMaxRange(range) == pageCount)
                     range.length = 1;
             }
-            return [self accessibilityChildrenForPageRange:range visible:NO];
         }
-        accessibilityChildren = [[self accessibilityChildrenForPageRange:range 
visible:NO] mutableCopy];
+        
+        NSMutableArray *children = [NSMutableArray array];
+        
+        [children addObject:[[[SKAccessibilityPDFDisplayViewElement alloc] 
initWithParent:[self documentView]] autorelease]];
+        
+        unsigned int i;
+        for (i = range.location; i < NSMaxRange(range); i++) {
+            PDFPage *page = [pdfDoc pageAtIndex:i];
+            NSEnumerator *annotationEnum = [[page annotations] 
objectEnumerator];
+            PDFAnnotation *annotation;
+            while (annotation = [annotationEnum nextObject]) {
+                if ([[annotation type] isEqualToString:SKLinkString] || 
[annotation isNoteAnnotation])
+                    [children addObject:[SKAccessibilityPDFAnnotationElement 
elementWithAnnotation:annotation pdfView:self parent:[self documentView]]];
+            }
+        }
+        return children;
+        accessibilityChildren = [children mutableCopy];
     }
     return accessibilityChildren;
 }
 
-- (NSArray *)accessibilityVisibleChildren {
-    NSRange range = [self visiblePageIndexRange];
-    return [self accessibilityChildrenForPageRange:range visible:YES];
-}
-
 #pragma mark Snapshots
 
 - (void)takeSnapshot:(id)sender {


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 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to