diff options
author | Boris Dušek <me@dusek.me> | 2013-08-11 19:45:19 +0200 |
---|---|---|
committer | Tor Lillqvist <tml@iki.fi> | 2013-08-12 08:26:07 +0000 |
commit | 995c2cd310d04c22701871d1bd02962535619760 (patch) | |
tree | acd9a20de1152922a8cb60c0507481e5668a1c53 /vcl/aqua | |
parent | 3a1bc7da8275bf32804b5c468a60d9d556e89267 (diff) |
Make VoiceOver announce paragraph alignment
Change-Id: I7d9d012e0af3b5685421ca2f10d2d8cb3420cc15
Reviewed-on: https://gerrit.libreoffice.org/5352
Reviewed-by: Tor Lillqvist <tml@iki.fi>
Tested-by: Tor Lillqvist <tml@iki.fi>
Diffstat (limited to 'vcl/aqua')
-rw-r--r-- | vcl/aqua/source/a11y/aqua11ytextattributeswrapper.mm | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/vcl/aqua/source/a11y/aqua11ytextattributeswrapper.mm b/vcl/aqua/source/a11y/aqua11ytextattributeswrapper.mm index 41f5c8008c68..67ebca6f71c6 100644 --- a/vcl/aqua/source/a11y/aqua11ytextattributeswrapper.mm +++ b/vcl/aqua/source/a11y/aqua11ytextattributeswrapper.mm @@ -29,6 +29,7 @@ #include <com/sun/star/awt/FontWeight.hpp> #include <com/sun/star/awt/FontStrikeout.hpp> #include <com/sun/star/text/TextMarkupType.hpp> +#include <com/sun/star/style/ParagraphAdjust.hpp> namespace css_awt = ::com::sun::star::awt; using namespace ::com::sun::star::accessibility; @@ -205,6 +206,7 @@ using namespace ::rtl; static const OUString attrForegroundColor("CharColor"); static const OUString attrBackgroundColor("CharBackColor"); static const OUString attrSuperscript("CharEscapement"); + static const OUString attrTextAlignment("ParaAdjust"); // vars sal_Int32 underlineColor = 0; BOOL underlineHasColor = NO; @@ -255,6 +257,19 @@ using namespace ::rtl; if ( [ number shortValue ] != 0 ) { [ string addAttribute: NSAccessibilitySuperscriptTextAttribute value: number range: range ]; } + } else if ( property.Name.equals ( attrTextAlignment ) ) { + sal_Int32 alignment; + property.Value >>= alignment; + NSNumber *textAlignment = nil; + switch(alignment) { + case ::com::sun::star::style::ParagraphAdjust_RIGHT : textAlignment = [NSNumber numberWithInteger:NSRightTextAlignment] ; break; + case ::com::sun::star::style::ParagraphAdjust_CENTER: textAlignment = [NSNumber numberWithInteger:NSCenterTextAlignment] ; break; + case ::com::sun::star::style::ParagraphAdjust_BLOCK : textAlignment = [NSNumber numberWithInteger:NSJustifiedTextAlignment]; break; + case ::com::sun::star::style::ParagraphAdjust_LEFT : + default : textAlignment = [NSNumber numberWithInteger:NSLeftTextAlignment] ; break; + } + NSDictionary *paragraphStyle = [NSDictionary dictionaryWithObjectsAndKeys:textAlignment, @"AXTextAlignment", textAlignment, @"AXVisualTextAlignment", nil]; + [string addAttribute:@"AXParagraphStyle" value:paragraphStyle range:range]; } } } |