[Libreoffice-commits] core.git: vcl/aqua

Boris Dušek me at dusek.me
Mon Aug 12 01:26:29 PDT 2013


 vcl/aqua/source/a11y/aqua11ytextattributeswrapper.mm |   15 +++++++++++++++
 1 file changed, 15 insertions(+)

New commits:
commit 995c2cd310d04c22701871d1bd02962535619760
Author: Boris Dušek <me at dusek.me>
Date:   Sun Aug 11 19:45:19 2013 +0200

    Make VoiceOver announce paragraph alignment
    
    Change-Id: I7d9d012e0af3b5685421ca2f10d2d8cb3420cc15
    Reviewed-on: https://gerrit.libreoffice.org/5352
    Reviewed-by: Tor Lillqvist <tml at iki.fi>
    Tested-by: Tor Lillqvist <tml at iki.fi>

diff --git a/vcl/aqua/source/a11y/aqua11ytextattributeswrapper.mm b/vcl/aqua/source/a11y/aqua11ytextattributeswrapper.mm
index 41f5c80..67ebca6 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];
             }
         }
     }


More information about the Libreoffice-commits mailing list