summaryrefslogtreecommitdiff
path: root/vcl/win/source/gdi/winlayout.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/win/source/gdi/winlayout.cxx')
-rwxr-xr-x[-rw-r--r--]vcl/win/source/gdi/winlayout.cxx93
1 files changed, 27 insertions, 66 deletions
diff --git a/vcl/win/source/gdi/winlayout.cxx b/vcl/win/source/gdi/winlayout.cxx
index d90e659d1a5c..14b9fd5a59c2 100644..100755
--- a/vcl/win/source/gdi/winlayout.cxx
+++ b/vcl/win/source/gdi/winlayout.cxx
@@ -244,24 +244,11 @@ HFONT WinLayout::DisableFontScaling() const
if( mfFontScale == 1.0 )
return 0;
- HFONT hHugeFont = 0;
- if( aSalShlData.mbWNT )
- {
- LOGFONTW aLogFont;
- ::GetObjectW( mhFont, sizeof(LOGFONTW), &aLogFont);
- aLogFont.lfHeight = (LONG)(mfFontScale * aLogFont.lfHeight);
- aLogFont.lfWidth = (LONG)(mfFontScale * aLogFont.lfWidth);
- hHugeFont = ::CreateFontIndirectW( &aLogFont);
- }
- else
- {
- LOGFONTA aLogFont;
- ::GetObjectA( mhFont, sizeof(LOGFONTA), &aLogFont);
- aLogFont.lfHeight = (LONG)(mfFontScale * aLogFont.lfHeight);
- aLogFont.lfWidth = (LONG)(mfFontScale * aLogFont.lfWidth);
- hHugeFont = ::CreateFontIndirectA( &aLogFont);
- }
-
+ LOGFONTW aLogFont;
+ ::GetObjectW( mhFont, sizeof(LOGFONTW), &aLogFont);
+ aLogFont.lfHeight = (LONG)(mfFontScale * aLogFont.lfHeight);
+ aLogFont.lfWidth = (LONG)(mfFontScale * aLogFont.lfWidth);
+ HFONT hHugeFont = ::CreateFontIndirectW( &aLogFont);
if( !hHugeFont )
return 0;
@@ -671,57 +658,31 @@ void SimpleWinLayout::DrawText( SalGraphics& rGraphics ) const
Point aPos = GetDrawPosition( Point( mnBaseAdv, 0 ) );
- // #108267#, limit the number of glyphs to avoid paint errors
- UINT limitedGlyphCount = Min( 8192, mnGlyphCount );
- if( mnDrawOptions || aSalShlData.mbWNT )
- {
- // #108267#, break up into glyph portions of a limited size required by Win32 API
- const unsigned int maxGlyphCount = 8192;
- UINT numGlyphPortions = mnGlyphCount / maxGlyphCount;
- UINT remainingGlyphs = mnGlyphCount % maxGlyphCount;
-
- if( numGlyphPortions )
- {
- // #108267#,#109387# break up string into smaller chunks
- // the output positions will be updated by windows (SetTextAlign)
- unsigned int i,n;
- POINT oldPos;
- UINT oldTa = ::GetTextAlign( aHDC );
- ::SetTextAlign( aHDC, (oldTa & ~TA_NOUPDATECP) | TA_UPDATECP );
- ::MoveToEx( aHDC, aPos.X(), aPos.Y(), &oldPos );
- for( i=n=0; n<numGlyphPortions; n++, i+=maxGlyphCount )
- ::ExtTextOutW( aHDC, 0, 0, mnDrawOptions, NULL,
- mpOutGlyphs+i, maxGlyphCount, mpGlyphAdvances+i );
+ // #108267#, break up into glyph portions of a limited size required by Win32 API
+ const unsigned int maxGlyphCount = 8192;
+ UINT numGlyphPortions = mnGlyphCount / maxGlyphCount;
+ UINT remainingGlyphs = mnGlyphCount % maxGlyphCount;
+
+ if( numGlyphPortions )
+ {
+ // #108267#,#109387# break up string into smaller chunks
+ // the output positions will be updated by windows (SetTextAlign)
+ POINT oldPos;
+ UINT oldTa = ::GetTextAlign( aHDC );
+ ::SetTextAlign( aHDC, (oldTa & ~TA_NOUPDATECP) | TA_UPDATECP );
+ ::MoveToEx( aHDC, aPos.X(), aPos.Y(), &oldPos );
+ unsigned int i = 0;
+ for( unsigned int n = 0; n < numGlyphPortions; ++n, i+=maxGlyphCount )
::ExtTextOutW( aHDC, 0, 0, mnDrawOptions, NULL,
- mpOutGlyphs+i, remainingGlyphs, mpGlyphAdvances+i );
- ::MoveToEx( aHDC, oldPos.x, oldPos.y, (LPPOINT) NULL);
- ::SetTextAlign( aHDC, oldTa );
- }
- else
- ::ExtTextOutW( aHDC, aPos.X(), aPos.Y(), mnDrawOptions, NULL,
- mpOutGlyphs, mnGlyphCount, mpGlyphAdvances );
+ mpOutGlyphs+i, maxGlyphCount, mpGlyphAdvances+i );
+ ::ExtTextOutW( aHDC, 0, 0, mnDrawOptions, NULL,
+ mpOutGlyphs+i, remainingGlyphs, mpGlyphAdvances+i );
+ ::MoveToEx( aHDC, oldPos.x, oldPos.y, (LPPOINT) NULL);
+ ::SetTextAlign( aHDC, oldTa );
}
else
- {
- // #108267#, On Win9x, we get paint errors when drawing huge strings, even when
- // split into pieces (see above), seems to be a problem in the internal text clipping
- // so we just cut off the string
- if( !mpGlyphOrigAdvs )
- ::ExtTextOutW( aHDC, aPos.X(), aPos.Y(), 0, NULL,
- mpOutGlyphs, limitedGlyphCount, NULL );
- else
- {
- // workaround for problem in #106259#
- long nXPos = mnBaseAdv;
- for( unsigned int i = 0; i < limitedGlyphCount; ++i )
- {
- ::ExtTextOutW( aHDC, aPos.X(), aPos.Y(), 0, NULL,
- mpOutGlyphs+i, 1, NULL );
- nXPos += mpGlyphAdvances[ i ];
- aPos = GetDrawPosition( Point( nXPos, 0 ) );
- }
- }
- }
+ ::ExtTextOutW( aHDC, aPos.X(), aPos.Y(), mnDrawOptions, NULL,
+ mpOutGlyphs, mnGlyphCount, mpGlyphAdvances );
if( hOrigFont )
DeleteFont( SelectFont( aHDC, hOrigFont ) );