[Libreoffice-commits] core.git: vcl/aqua
Boris Dušek
me at dusek.me
Wed Aug 7 12:07:53 PDT 2013
vcl/aqua/source/a11y/aqua11ytextattributeswrapper.mm | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
New commits:
commit 58464deee44db80657885e39ead33d7ccc7dda30
Author: Boris Dušek <me at dusek.me>
Date: Fri Aug 2 00:04:35 2013 +0200
Fix accessibility of text attributes on OS X
The applyAttributesFrom:... method takes range parameter that specifies
a range in the 'string' parameter passed to that method, not in the whole
string of the UI element as retrievd in createAttributedStringForElement:...
(the former string is a substring of the latter).
In other words, the 'range' parameter in applyAttributesFrom: is relative
to the string passed to that method, not to the whole string of the UI
element.
This enables proper reading of text attributes in Writer - when moving
cursor through text, VoiceOver now announces e.g. "bold" or "plain" to
indicate changes in text formatting.
Change-Id: I21a633af0bf426759f639435581fcd3bfeafa598
Reviewed-on: https://gerrit.libreoffice.org/5236
Reviewed-by: Norbert Thiebaud <nthiebaud at gmail.com>
Tested-by: Norbert Thiebaud <nthiebaud at gmail.com>
diff --git a/vcl/aqua/source/a11y/aqua11ytextattributeswrapper.mm b/vcl/aqua/source/a11y/aqua11ytextattributeswrapper.mm
index d35a53f..2e4ab40 100644
--- a/vcl/aqua/source/a11y/aqua11ytextattributeswrapper.mm
+++ b/vcl/aqua/source/a11y/aqua11ytextattributeswrapper.mm
@@ -222,12 +222,12 @@ using namespace ::rtl;
[ string beginEditing ];
// add default attributes for whole string
Sequence < PropertyValue > defaultAttributes = [ wrapper accessibleTextAttributes ] -> getDefaultAttributes ( emptySequence );
- [ AquaA11yTextAttributesWrapper applyAttributesFrom: defaultAttributes toString: string forRange: [ origRange rangeValue ] storeDefaultsTo: wrapper getDefaultsFrom: nil ];
+ [ AquaA11yTextAttributesWrapper applyAttributesFrom: defaultAttributes toString: string forRange: NSMakeRange ( 0, len ) storeDefaultsTo: wrapper getDefaultsFrom: nil ];
// add attributes for attribute run(s)
while ( currentIndex < endIndex ) {
TextSegment textSegment = [ wrapper accessibleText ] -> getTextAtIndex ( currentIndex, AccessibleTextType::ATTRIBUTE_RUN );
int endOfRange = endIndex > textSegment.SegmentEnd ? textSegment.SegmentEnd : endIndex;
- NSRange rangeForAttributeRun = NSMakeRange ( currentIndex, endOfRange - currentIndex );
+ NSRange rangeForAttributeRun = NSMakeRange ( currentIndex - loc , endOfRange - currentIndex );
// add run attributes
Sequence < PropertyValue > attributes = [ wrapper accessibleTextAttributes ] -> getRunAttributes ( currentIndex, emptySequence );
[ AquaA11yTextAttributesWrapper applyAttributesFrom: attributes toString: string forRange: rangeForAttributeRun storeDefaultsTo: nil getDefaultsFrom: wrapper ];
More information about the Libreoffice-commits
mailing list