From d2a0296db073b174b438171785cfaee078fbadf3 Mon Sep 17 00:00:00 2001
From: Jens-Heiner Rechtien
Date: Mon, 2 Feb 2004 17:29:53 +0000
Subject: INTEGRATION: CWS geordi2q14 (1.76.28); FILE MERGED 2004/01/28
16:38:30 hr 1.76.28.1: #111934#: merge CWS vcl7pp1r3
---
vcl/win/source/gdi/winlayout.cxx | 22 +++++++---------------
1 file changed, 7 insertions(+), 15 deletions(-)
(limited to 'vcl')
diff --git a/vcl/win/source/gdi/winlayout.cxx b/vcl/win/source/gdi/winlayout.cxx
index f3398d9b0be1..c74823b57581 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.76 $
+ * $Revision: 1.77 $
*
- * last change: $Author: vg $ $Date: 2004-01-06 14:57:15 $
+ * last change: $Author: hr $ $Date: 2004-02-02 18:29:53 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -830,7 +830,7 @@ int SimpleWinLayout::GetTextBreak( long nMaxWidth, long nCharExtra, int nFactor
void SimpleWinLayout::GetCaretPositions( int nMaxIdx, long* pCaretXArray ) const
{
- long nXPos = 0;
+ long nXPos = mnBaseAdv;
if( !mpGlyphs2Chars )
{
@@ -851,8 +851,9 @@ void SimpleWinLayout::GetCaretPositions( int nMaxIdx, long* pCaretXArray ) const
int nLeftIdx = 0;
for( i = 0; i < mnGlyphCount; ++i )
{
- long nXRight = nXPos + mpGlyphAdvances[ i ];
- int nCurrIdx = 2 * (mpGlyphs2Chars[ i ] - mnMinCharPos);
+ int nCurrIdx = mpGlyphs2Chars[ i ] - mnMinCharPos;
+ long nXRight = nXPos + mpCharWidths[ nCurrIdx ];
+ nCurrIdx *= 2;
if( nLeftIdx <= nCurrIdx )
{
// normal positions for LTR case
@@ -866,16 +867,7 @@ void SimpleWinLayout::GetCaretPositions( int nMaxIdx, long* pCaretXArray ) const
pCaretXArray[ nCurrIdx+1 ] = nXPos;
}
nLeftIdx = nCurrIdx;
- nXPos = nXRight;
- }
-
- // fixup unknown character positions to neighbor
- for( i = 0; i < nMaxIdx; ++i )
- {
- if( pCaretXArray[ i ] >= 0 )
- nXPos = pCaretXArray[ i ];
- else
- pCaretXArray[ i ] = nXPos;
+ nXPos += mpGlyphAdvances[ i ];
}
}
}
--
cgit