diff options
author | Tor Lillqvist <tml@collabora.com> | 2014-10-16 10:13:46 +0300 |
---|---|---|
committer | Tor Lillqvist <tml@collabora.com> | 2014-10-16 11:22:12 +0300 |
commit | b02e958fa0bf7d062a5b8aff03d22325e3068feb (patch) | |
tree | e76ec94b574b2f371cbcfe88611dda27d8c80467 /vcl/quartz | |
parent | f9aa686432c0ba62c6f440302d5a35856496a786 (diff) |
MAC_OS_X_VERSION_MAX_ALLOWED is always >= 1080 now
Change-Id: Ieae67cbf917cdf4bca2b0d6c1697eddc6137dbe2
Diffstat (limited to 'vcl/quartz')
-rw-r--r-- | vcl/quartz/ctfonts.cxx | 6 | ||||
-rw-r--r-- | vcl/quartz/ctlayout.cxx | 20 | ||||
-rw-r--r-- | vcl/quartz/salgdi.cxx | 16 |
3 files changed, 2 insertions, 40 deletions
diff --git a/vcl/quartz/ctfonts.cxx b/vcl/quartz/ctfonts.cxx index 8a06d3b7dd10..a11453cc6d98 100644 --- a/vcl/quartz/ctfonts.cxx +++ b/vcl/quartz/ctfonts.cxx @@ -83,13 +83,9 @@ CoreTextStyle::CoreTextStyle( const FontSelectPattern& rFSD ) ((mpFontData->GetWeight() < WEIGHT_SEMIBOLD) && (mpFontData->GetWeight() != WEIGHT_DONTKNOW)) ) { -#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1060 int nStroke = -10.0; CFNumberRef rStroke = CFNumberCreate(NULL, kCFNumberSInt32Type, &nStroke); CFDictionarySetValue(mpStyleDict, kCTStrokeWidthAttributeName, rStroke); -#else /* kCTStrokeWidthAttributeName is not available */ - /* do we really need "fake" bold? */ -#endif } // fake italic @@ -319,10 +315,8 @@ ImplDevFontAttributes DevFontFromCTFontDescriptor( CTFontDescriptorRef pFD, bool // get font-enabled status if( bFontEnabled ) { int bEnabled = TRUE; // by default (and when we're on OS X < 10.6) it's "enabled" -#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1060 CFNumberRef pEnabled = (CFNumberRef)CTFontDescriptorCopyAttribute( pFD, kCTFontEnabledAttribute ); CFNumberGetValue( pEnabled, kCFNumberIntType, &bEnabled ); -#endif *bFontEnabled = bEnabled; } diff --git a/vcl/quartz/ctlayout.cxx b/vcl/quartz/ctlayout.cxx index cd9771a072e5..a0bcd243799f 100644 --- a/vcl/quartz/ctlayout.cxx +++ b/vcl/quartz/ctlayout.cxx @@ -267,11 +267,6 @@ void CTLayout::AdjustLayout( ImplLayoutArgs& rArgs ) // - CoreText handles spaces specially (in particular at the text end) if( mnTrailingSpaceCount ) { -#if MAC_OS_X_VERSION_MAX_ALLOWED <= 1060 - // don't recreate line layout here, because this can lead to problems - // (looks like internal issues inside early CoreText versions) - mfTrailingSpaceWidth = CTLineGetTrailingWhitespaceWidth( mpCTLine ); -#else if(mfTrailingSpaceWidth <= 0.0) { mfTrailingSpaceWidth = CTLineGetTrailingWhitespaceWidth( mpCTLine ); @@ -296,7 +291,7 @@ void CTLayout::AdjustLayout( ImplLayoutArgs& rArgs ) SAL_INFO( "vcl.ct", "CTLineCreateWithAttributedString(\"" << GetOUString(aCFText) << "\") = " << mpCTLine ); CFRelease( pAttrStr ); CFRelease( aCFText ); -#endif + // in RTL-layouts trailing spaces are leftmost // TODO: use BiDi-algorithm to thoroughly check this assumption if( rArgs.mnFlags & SAL_LAYOUT_BIDI_RTL) @@ -304,12 +299,9 @@ void CTLayout::AdjustLayout( ImplLayoutArgs& rArgs ) mfBaseAdv = mfTrailingSpaceWidth; } } -#if MAC_OS_X_VERSION_MAX_ALLOWED <= 1060 - CTLineRef pNewCTLine = CTLineCreateJustifiedLine( mpCTLine, 1.0, nPixelWidth - mfTrailingSpaceWidth ); -#else CTLineRef pNewCTLine = CTLineCreateJustifiedLine( mpCTLine, 1.0, nPixelWidth); SAL_INFO( "vcl.ct", "CTLineCreateJustifiedLine(" << mpCTLine << ",1.0," << nPixelWidth << ") = " << pNewCTLine ); -#endif + if( !pNewCTLine ) { // CTLineCreateJustifiedLine can and does fail @@ -323,11 +315,7 @@ void CTLayout::AdjustLayout( ImplLayoutArgs& rArgs ) SAL_INFO( "vcl.ct", "CFRelease(" << mpCTLine << ")" ); CFRelease( mpCTLine ); mpCTLine = pNewCTLine; -#if MAC_OS_X_VERSION_MAX_ALLOWED <= 1060 - mfCachedWidth = nPixelWidth; -#else mfCachedWidth = nPixelWidth + mfTrailingSpaceWidth; -#endif } } @@ -382,13 +370,9 @@ bool CTLayout::DrawTextSpecial( SalGraphics& rGraphics, sal_uInt32 flags ) const CFDictionaryGetCount(mpTextStyle->GetStyleDict()), mpTextStyle->GetStyleDict()); -#if MAC_OS_X_VERSION_MAX_ALLOWED < 1060 - /* just don't do 'kCTStrokeWidthAttributeName' */ -#else int nStroke = 2; CFNumberRef rStroke = CFNumberCreate(NULL, kCFNumberSInt32Type, &nStroke); CFDictionarySetValue(styledict, kCTStrokeWidthAttributeName, rStroke); -#endif CFAttributedStringRef pAttrStr = CFAttributedStringCreate( NULL, diff --git a/vcl/quartz/salgdi.cxx b/vcl/quartz/salgdi.cxx index d33e570d564e..2462ec00ecb4 100644 --- a/vcl/quartz/salgdi.cxx +++ b/vcl/quartz/salgdi.cxx @@ -339,28 +339,12 @@ static bool AddTempDevFont(const OUString& rFontFileURL) bool success = false; -#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1060 CFErrorRef error; success = CTFontManagerRegisterFontsForURL(rFontURL, kCTFontManagerScopeProcess, &error); if (!success) { CFRelease(error); } -#else /* CTFontManagerRegisterFontsForURL is not available on OS X <10.6 */ - CGDataProviderRef dataProvider = CGDataProviderCreateWithURL(rFontURL); - CGFontRef graphicsFont = CGFontCreateWithDataProvider(dataProvider); - if (graphicsFont) - { - CTFontRef coreTextFont = CTFontCreateWithGraphicsFont(graphicsFont, /*fontSize*/ 0, /*matrix*/ NULL, /*attributes*/ NULL); - if (coreTextFont) - { - success = true; - CFRelease(coreTextFont); - } - CGFontRelease(graphicsFont); - } - CGDataProviderRelease(dataProvider); -#endif return success; } |