summaryrefslogtreecommitdiff
path: root/vcl/quartz/ctlayout.cxx
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2013-12-12 10:51:08 +0200
committerTor Lillqvist <tml@collabora.com>2013-12-12 11:08:42 +0200
commitfec3f8a8bab77ffb5345a401739114e0afaafcb2 (patch)
tree7e0f9f71be0e6da4e056260ba6cf881b78942e20 /vcl/quartz/ctlayout.cxx
parent62ea355b2679073b8ee326df5793231996136da9 (diff)
Much better fix for the iOS text colour problem
Just use the same simple trick as for OS X in OutputDevice::ImplLayout(). Thanks to Khaled Hosny for pointing out this. This reverts commit 9aba69e8cc034526c53f6135a41fc62dc3c5dce3. Change-Id: I27ba92ef8ebd1ebdb9eb74f670d8170649078881
Diffstat (limited to 'vcl/quartz/ctlayout.cxx')
-rw-r--r--vcl/quartz/ctlayout.cxx33
1 files changed, 0 insertions, 33 deletions
diff --git a/vcl/quartz/ctlayout.cxx b/vcl/quartz/ctlayout.cxx
index b1ce5fb6ff59..56d86967aa53 100644
--- a/vcl/quartz/ctlayout.cxx
+++ b/vcl/quartz/ctlayout.cxx
@@ -64,8 +64,6 @@ private:
// mutable members since these details are all lazy initialized
mutable double mfCachedWidth; // cached value of resulting typographical width
- mutable float mfAdjustedLineLength;
-
// x-offset relative to layout origin
// currently only used in RTL-layouts
mutable double mfBaseAdv;
@@ -77,7 +75,6 @@ CTLayout::CTLayout( const CoreTextStyle* pTextStyle )
, mpCTLine( NULL )
, mnCharCount( 0 )
, mfCachedWidth( -1 )
-, mfAdjustedLineLength( 0 )
, mfBaseAdv( 0 )
{
}
@@ -162,7 +159,6 @@ void CTLayout::AdjustLayout( ImplLayoutArgs& rArgs )
CFRelease( mpCTLine );
mpCTLine = pNewCTLine;
mfCachedWidth = nPixelWidth;
- mfAdjustedLineLength = nPixelWidth - fTrailingSpace;
}
// When drawing right aligned text, rounding errors in the position returned by
@@ -225,36 +221,7 @@ void CTLayout::DrawText( SalGraphics& rGraphics ) const
}
CGContextSetTextPosition( rAquaGraphics.mrContext, aTextPos.x, aTextPos.y );
-#ifdef MACOSX
- // For some reason on OS X the problem with text colour being out of sync
- // does not seem to occur.
CTLineDraw( mpCTLine, rAquaGraphics.mrContext );
-#else
- if( CFDictionaryGetValue( mpTextStyle->GetStyleDict(), kCTFontAttributeName) )
- {
- // We did likely not know the correct intended colour of the
- // text in LayoutText(), so have to redo layout and justify.
- CFStringRef aCFText = CFAttributedStringGetString( mpAttrString );
- CFAttributedStringRef pAttrString = CFAttributedStringCreate( NULL, aCFText, mpTextStyle->GetStyleDict() );
- CTLineRef pCTLine = CTLineCreateWithAttributedString( pAttrString );
- CFRelease( pAttrString );
- if( mfAdjustedLineLength > 0 )
- {
- CTLineRef pNewCTLine = CTLineCreateJustifiedLine( pCTLine, 1.0, mfAdjustedLineLength );
- CFRelease( pCTLine );
- pCTLine = pNewCTLine;
- }
- CTLineDraw( pCTLine, rAquaGraphics.mrContext );
- CFRelease( pCTLine );
- }
- else
- {
- // FIXME: can the colour be wrong also the other way around:
- // some leftover wrong colour was used in LayoutText(), but
- // then here the style does not actually contain any colour?
- CTLineDraw( mpCTLine, rAquaGraphics.mrContext );
- }
-#endif
#ifndef IOS
// request an update of the changed window area
if( rAquaGraphics.IsWindowGraphics() )