Revision: 4670
http://skim-app.svn.sourceforge.net/skim-app/?rev=4670&view=rev
Author: hofman
Date: 2008-09-22 13:10:25 +0000 (Mon, 22 Sep 2008)
Log Message:
-----------
Use a different attribute to force the accessibility table to be generated, as
the number of characters does not immediately trigger it.
Modified Paths:
--------------
trunk/PDFDisplayView_SKExtensions.m
Modified: trunk/PDFDisplayView_SKExtensions.m
===================================================================
--- trunk/PDFDisplayView_SKExtensions.m 2008-09-22 12:37:59 UTC (rev 4669)
+++ trunk/PDFDisplayView_SKExtensions.m 2008-09-22 13:10:25 UTC (rev 4670)
@@ -128,7 +128,7 @@
NSAttributedString *attributedString = nil;
if ([pdfDisplayView
respondsToSelector:@selector(selectionForAccessibilityRange:)]) {
// make sure the accessibility table is generated
- [pdfDisplayView
accessibilityAttributeValue:NSAccessibilityNumberOfCharactersAttribute];
+ [pdfDisplayView
accessibilityAttributeValue:NSAccessibilityVisibleCharacterRangeAttribute];
PDFSelection *selection = [pdfDisplayView
selectionForAccessibilityRange:range];
if ([selection respondsToSelector:@selector(attributedString)])
attributedString = [selection attributedString];
@@ -145,7 +145,7 @@
int i = [page characterIndexAtPoint:[pdfView convertPoint:point
toPage:page]];
if (i != -1) {
// make sure the accessibility table is generated
- [self
accessibilityAttributeValue:NSAccessibilityNumberOfCharactersAttribute];
+ [self
accessibilityAttributeValue:NSAccessibilityVisibleCharacterRangeAttribute];
return [NSValue valueWithRange:[self
accessibilityRangeForSelection:[page selectionForRange:NSMakeRange(i, 1)]]];
}
}
@@ -173,6 +173,8 @@
static id replacementAccessibilityStyleRangeForIndexAttributeForParameter(id
self, SEL _cmd, id parameter) {
id pdfView = SKGetPDFView(self);
if (pdfView) {
+ // make sure the accessibility table is generated
+ [self
accessibilityAttributeValue:NSAccessibilityVisibleCharacterRangeAttribute];
int i = [parameter unsignedIntValue];
int n = [[self
accessibilityAttributeValue:NSAccessibilityNumberOfCharactersAttribute]
intValue];
int start = MAX(0, i - 25), end = MIN(n, i + 25);
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