diff options
author | Herbert Duerr <hdu@openoffice.org> | 2002-10-09 11:20:47 +0000 |
---|---|---|
committer | Herbert Duerr <hdu@openoffice.org> | 2002-10-09 11:20:47 +0000 |
commit | 46598d6a3e34b3fd6bc9b9a403bdd6be0b7d1fd2 (patch) | |
tree | b2c87d4259e071d4b91ae5087ef277cdb1f90b3b /vcl/win | |
parent | d0d227e160d635449e095fffd3ff227b27d89b66 (diff) |
#103205# fix SimpleWinLayout::GetNextGlyphs() run length for adjusted text
Diffstat (limited to 'vcl/win')
-rwxr-xr-x | vcl/win/source/gdi/winlayout.cxx | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/vcl/win/source/gdi/winlayout.cxx b/vcl/win/source/gdi/winlayout.cxx index bfe6b2e85b5e..cacb65546632 100755 --- a/vcl/win/source/gdi/winlayout.cxx +++ b/vcl/win/source/gdi/winlayout.cxx @@ -2,9 +2,9 @@ * * $RCSfile: winlayout.cxx,v $ * - * $Revision: 1.50 $ + * $Revision: 1.51 $ * - * last change: $Author: hdu $ $Date: 2002-10-01 15:35:44 $ + * last change: $Author: hdu $ $Date: 2002-10-09 12:20:47 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -518,7 +518,7 @@ int SimpleWinLayout::GetNextGlyphs( int nLen, long* pGlyphs, Point& rPos, int& n int nCharPos = mpGlyphs2Chars ? mpGlyphs2Chars[nStart] : nStart; if( nCharPos >= 0 ) nCharPos += mnMinCharPos; - *(pCharIndexes++) = nCharPos; + *(pCharIndexes++) = nCharPos; } // stop at last glyph @@ -767,19 +767,30 @@ void SimpleWinLayout::Justify( long nNewWidth ) void SimpleWinLayout::ApplyDXArray( const long* pDXArray ) { + // try to avoid disturbance of text flow for LSB rounding case + int i = 0; long nOldWidth = 0; - - int i; - for( i = 0; i < mnGlyphCount; ++i ) + for(; i < mnGlyphCount; ++i ) { - nOldWidth += mpGlyphAdvances[i]; - int nDiff = nOldWidth - pDXArray[i]; - if( nDiff>+1 || nDiff<-1) - break; + int j = !mpChars2Glyphs ? i : mpChars2Glyphs[i]; + if( j >= 0 ) + { + nOldWidth += mpGlyphAdvances[ j ]; + int nDiff = nOldWidth - pDXArray[ i ]; + if( nDiff>+1 || nDiff<-1) + break; + } } if( i >= mnGlyphCount ) return; + if( !mpGlyphOrigAdvs ) + { + mpGlyphOrigAdvs = new int[ mnGlyphCount ]; + for( i = 0; i < mnGlyphCount; ++i ) + mpGlyphOrigAdvs[ i ] = mpGlyphAdvances[ i ]; + } + mnWidth = 0; for( i = 0; i < mnGlyphCount; ++i ) { |