diff options
author | Herbert Duerr [hdu] <herbert.duerr@oracle.com> | 2010-09-06 13:57:55 +0200 |
---|---|---|
committer | Herbert Duerr [hdu] <herbert.duerr@oracle.com> | 2010-09-06 13:57:55 +0200 |
commit | 7cbe790e00d911a0565fa8ce9dac4dbec2858b59 (patch) | |
tree | b1c06db01565c00367452c2220fb1ce397d00ada /vcl | |
parent | vcl115: #i89397# SetWindowState now maximizes again on the correct screen (diff) | |
download | core-7cbe790e00d911a0565fa8ce9dac4dbec2858b59.tar.gz core-7cbe790e00d911a0565fa8ce9dac4dbec2858b59.zip |
#i114222# fix UniscribeLayout::GetCaretPositions() for glyph fallback (thanks kstribley)
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/win/source/gdi/winlayout.cxx | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/vcl/win/source/gdi/winlayout.cxx b/vcl/win/source/gdi/winlayout.cxx index 806d3b420b33..30d49dff9d05 100644 --- a/vcl/win/source/gdi/winlayout.cxx +++ b/vcl/win/source/gdi/winlayout.cxx @@ -2076,6 +2076,13 @@ void UniscribeLayout::MoveGlyph( int nStartx8, long nNewXPos ) // move the visual item by having an offset pVI->mnXOffset += nDelta; } + // move subsequent items - this often isn't necessary because subsequent + // moves will correct subsequent items. However, if there is a contiguous + // range not involving fallback which spans items, this will be needed + while (++pVI - mpVisualItems < mnItemCount) + { + pVI->mnXOffset += nDelta; + } } // ----------------------------------------------------------------------- @@ -2362,6 +2369,10 @@ void UniscribeLayout::GetCaretPositions( int nMaxIdx, long* pCaretXArray ) const if( rVisualItem.IsEmpty() ) continue; + if (mnLayoutFlags & SAL_LAYOUT_FOR_FALLBACK) + { + nXPos = rVisualItem.mnXOffset; + } // get glyph positions // TODO: handle when rVisualItem's glyph range is only partially used for( i = rVisualItem.mnMinGlyphPos; i < rVisualItem.mnEndGlyphPos; ++i ) @@ -2395,13 +2406,17 @@ void UniscribeLayout::GetCaretPositions( int nMaxIdx, long* pCaretXArray ) const } } - // fixup unknown character positions to neighbor - for( i = 0; i < nMaxIdx; ++i ) + if (!(mnLayoutFlags & SAL_LAYOUT_FOR_FALLBACK)) { - if( pCaretXArray[ i ] >= 0 ) - nXPos = pCaretXArray[ i ]; - else - pCaretXArray[ i ] = nXPos; + nXPos = 0; + // fixup unknown character positions to neighbor + for( i = 0; i < nMaxIdx; ++i ) + { + if( pCaretXArray[ i ] >= 0 ) + nXPos = pCaretXArray[ i ]; + else + pCaretXArray[ i ] = nXPos; + } } } |