Kaydet (Commit) a7fb039e authored tarafından Tor Lillqvist's avatar Tor Lillqvist Kaydeden (comit) Michael Meeks

SimpleWinLayout::mbDisableGlyphs was always true

Remove dead code. Should have no effect on behaviour.

Possibly originally the intent was that mbDisableGlyphs would have
been false in most cases on NT-based Windows (all versions that we
support now). However, since dadfc608,
in 2005, mbDisableGlyphs was set to always true in the SimpleWinLayout
ctor.

Change-Id: Id929224d5656706762c2f44ee26c76f8b20ee8b8
Signed-off-by: 's avatarMichael Meeks <michael.meeks@collabora.com>
üst eed56f99
......@@ -87,7 +87,6 @@ public:
BYTE GetCharSet() const { return meWinCharSet; }
BYTE GetPitchAndFamily() const { return mnPitchAndFamily; }
bool IsGlyphApiDisabled() const { return mbDisableGlyphApi; }
bool SupportsKorean() const { return mbHasKoreanRange; }
bool SupportsCJK() const { return mbHasCJKSupport; }
bool SupportsArabic() const { return mbHasArabicSupport; }
......@@ -111,7 +110,6 @@ private:
sal_IntPtr mnId;
// some members that are initalized lazily when the font gets selected into a HDC
mutable bool mbDisableGlyphApi;
mutable bool mbHasKoreanRange;
mutable bool mbHasCJKSupport;
#if ENABLE_GRAPHITE
......
......@@ -1086,7 +1086,6 @@ ImplWinFontData::ImplWinFontData( const ImplDevFontAttributes& rDFS,
int nHeight, BYTE eWinCharSet, BYTE nPitchAndFamily )
: PhysicalFontFace( rDFS, 0 ),
mnId( 0 ),
mbDisableGlyphApi( false ),
mbHasKoreanRange( false ),
mbHasCJKSupport( false ),
#if ENABLE_GRAPHITE
......@@ -1186,15 +1185,6 @@ void ImplWinFontData::UpdateFromHDC( HDC hDC ) const
}
}
#endif
// even if the font works some fonts have problems with the glyph API
// => the heuristic below tries to figure out which fonts have the problem
TEXTMETRICA aTextMetric;
if( ::GetTextMetricsA( hDC, &aTextMetric ) )
if( !(aTextMetric.tmPitchAndFamily & TMPF_TRUETYPE)
|| (aTextMetric.tmPitchAndFamily & TMPF_DEVICE) )
mbDisableGlyphApi = true;
}
#if ENABLE_GRAPHITE
......@@ -1291,7 +1281,6 @@ void ImplWinFontData::ReadCmapTable( HDC hDC ) const
if( aRawFontData.get() ) {
CmapResult aResult;
ParseCMAP( aRawFontData.get(), aRawFontData.size(), aResult );
mbDisableGlyphApi |= aResult.mbRecoded;
aResult.mbSymbolic = bIsSymbolFont;
if( aResult.mnRangeCount > 0 )
{
......
......@@ -241,11 +241,9 @@ SimpleWinLayout::SimpleWinLayout(HDC hDC, BYTE nCharSet, const ImplWinFontData&
mpGlyphs2Chars( NULL ),
mpGlyphRTLFlags( NULL ),
mnWidth( 0 ),
mbDisableGlyphs( false ),
mnNotdefWidth( -1 ),
mnCharSet( nCharSet )
{
mbDisableGlyphs = true;
}
SimpleWinLayout::~SimpleWinLayout()
......@@ -264,20 +262,8 @@ bool SimpleWinLayout::LayoutText( ImplLayoutArgs& rArgs )
{
// prepare layout
// TODO: fix case when recyclying old SimpleWinLayout object
mbDisableGlyphs |= bool(rArgs.mnFlags & SalLayoutFlags::DisableGlyphProcessing);
mnCharCount = rArgs.mnEndCharPos - rArgs.mnMinCharPos;
if( !mbDisableGlyphs )
{
// Win32 glyph APIs have serious problems with vertical layout
// => workaround is to use the unicode methods then
if( rArgs.mnFlags & SalLayoutFlags::Vertical )
mbDisableGlyphs = true;
else
// use cached value from font face
mbDisableGlyphs = mrWinFontData.IsGlyphApiDisabled();
}
// TODO: use a cached value for bDisableAsianKern from upper layers
if( rArgs.mnFlags & SalLayoutFlags::KerningAsian )
{
......@@ -435,9 +421,6 @@ bool SimpleWinLayout::LayoutText( ImplLayoutArgs& rArgs )
if( GetTextExtentPoint32W( mhDC, &cNotDef, 1, &aExtent) )
mnNotdefWidth = aExtent.cx;
}
// use a better NotDef glyph
if( !mbDisableGlyphs && !bSurrogate )
mpOutGlyphs[i] = 0;
}
if( bSurrogate && ((i+1) < mnGlyphCount) )
mpOutGlyphs[i+1] = DROPPED_OUTGLYPH;
......@@ -545,8 +528,6 @@ int SimpleWinLayout::GetNextGlyphs( int nLen, sal_GlyphId* pGlyphIds, Point& rPo
{
// update return values {aGlyphId,nCharPos,nGlyphAdvance}
sal_GlyphId aGlyphId = mpOutGlyphs[ nStart ];
if( mbDisableGlyphs )
{
if( mnLayoutFlags & SalLayoutFlags::Vertical )
{
const sal_UCS4 cChar = static_cast<sal_UCS4>(aGlyphId & GF_IDXMASK);
......@@ -561,7 +542,7 @@ int SimpleWinLayout::GetNextGlyphs( int nLen, sal_GlyphId* pGlyphIds, Point& rPo
}
}
aGlyphId |= GF_ISCHAR;
}
++nCount;
*(pGlyphIds++) = aGlyphId;
if( pGlyphAdvances )
......@@ -595,11 +576,6 @@ void SimpleWinLayout::DrawTextImpl(HDC hDC) const
return;
HFONT hOrigFont = DisableFontScaling();
UINT mnDrawOptions = ETO_GLYPH_INDEX;
if( mbDisableGlyphs )
mnDrawOptions = 0;
Point aPos = GetDrawPosition( Point( mnBaseAdv, 0 ) );
// #108267#, break up into glyph portions of a limited size required by Win32 API
......@@ -618,14 +594,14 @@ void SimpleWinLayout::DrawTextImpl(HDC hDC) const
unsigned int i = 0;
for( unsigned int n = 0; n < numGlyphPortions; ++n, i+=maxGlyphCount )
{
ExtTextOutW(hDC, 0, 0, mnDrawOptions, NULL, mpOutGlyphs+i, maxGlyphCount, mpGlyphAdvances+i);
ExtTextOutW(hDC, 0, 0, 0, NULL, mpOutGlyphs+i, maxGlyphCount, mpGlyphAdvances+i);
}
ExtTextOutW(hDC, 0, 0, mnDrawOptions, NULL, mpOutGlyphs+i, remainingGlyphs, mpGlyphAdvances+i);
ExtTextOutW(hDC, 0, 0, 0, NULL, mpOutGlyphs+i, remainingGlyphs, mpGlyphAdvances+i);
MoveToEx(hDC, oldPos.x, oldPos.y, (LPPOINT) NULL);
SetTextAlign(hDC, oldTa);
}
else
ExtTextOutW(hDC, aPos.X(), aPos.Y(), mnDrawOptions, NULL, mpOutGlyphs, mnGlyphCount, mpGlyphAdvances);
ExtTextOutW(hDC, aPos.X(), aPos.Y(), 0, NULL, mpOutGlyphs, mnGlyphCount, mpGlyphAdvances);
if( hOrigFont )
DeleteFont(SelectFont(hDC, hOrigFont));
......
......@@ -103,7 +103,6 @@ private:
int* mpGlyphs2Chars; // map abs glyph pos to abs char pos
bool* mpGlyphRTLFlags; // BiDi status for glyphs: true=>RTL
mutable long mnWidth;
bool mbDisableGlyphs;
int mnNotdefWidth;
BYTE mnCharSet;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment