summaryrefslogtreecommitdiff
path: root/vcl/osx
diff options
context:
space:
mode:
authorrbuj <robert.buj@gmail.com>2014-06-11 19:56:21 +0200
committerCaolán McNamara <caolanm@redhat.com>2014-06-12 13:07:06 +0000
commitf3c81c8352185079670e90f85094bdbcce069b5f (patch)
treeac820f96aa5f60aa76ba0ca0610593e33bc182cc /vcl/osx
parent540eb29d08729a853d7405b3eb826e02c42c65b9 (diff)
'NSNoUnderlineStyle' & ‘NSSingleUnderlineStyle’: Deprecated in OS X 10.9
Change-Id: Id25d27f77c43c5fa11ff03aa38edcaec762caf61 Reviewed-on: https://gerrit.libreoffice.org/9739 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl/osx')
-rw-r--r--vcl/osx/a11ytextattributeswrapper.mm12
1 files changed, 12 insertions, 0 deletions
diff --git a/vcl/osx/a11ytextattributeswrapper.mm b/vcl/osx/a11ytextattributeswrapper.mm
index e129ac927f4e..12497bb9a775 100644
--- a/vcl/osx/a11ytextattributeswrapper.mm
+++ b/vcl/osx/a11ytextattributeswrapper.mm
@@ -107,12 +107,20 @@ using namespace ::rtl;
@implementation AquaA11yTextAttributesWrapper : NSObject
+(int)convertUnderlineStyle:(PropertyValue)property {
+#if MACOSX_SDK_VERSION >= 1090
+ int underlineStyle = NSUnderlineStyleNone;
+#else
int underlineStyle = NSNoUnderlineStyle;
+#endif
sal_Int16 value = 0;
property.Value >>= value;
if ( value != ::css_awt::FontUnderline::NONE
&& value != ::css_awt::FontUnderline::DONTKNOW) {
+#if MACOSX_SDK_VERSION >= 1090
+ underlineStyle = NSUnderlineStyleSingle;
+#else
underlineStyle = NSSingleUnderlineStyle;
+#endif
}
return underlineStyle;
}
@@ -218,7 +226,11 @@ using namespace ::rtl;
if ( property.Value.hasValue() ) {
if ( property.Name.equals ( attrUnderline ) ) {
int style = [ AquaA11yTextAttributesWrapper convertUnderlineStyle: property ];
+#if MACOSX_SDK_VERSION >= 1090
+ if ( style != NSUnderlineStyleNone ) {
+#else
if ( style != NSNoUnderlineStyle ) {
+#endif
[ string addAttribute: NSAccessibilityUnderlineTextAttribute value: [ NSNumber numberWithInt: style ] range: range ];
}
} else if ( property.Name.equals ( attrFontname ) ) {