Kaydet (Commit) c43ee00e authored tarafından Herbert Duerr's avatar Herbert Duerr

#91025# reduce flicker in charmap dialog

üst 2affcdd4
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: charmap.cxx,v $ * $RCSfile: charmap.cxx,v $
* *
* $Revision: 1.20 $ * $Revision: 1.21 $
* *
* last change: $Author: hdu $ $Date: 2001-08-14 17:30:17 $ * last change: $Author: hdu $ $Date: 2001-08-15 14:20:51 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -600,33 +600,42 @@ void SvxShowCharSet::SelectIndex( int nNewIndex, BOOL bFocus ) ...@@ -600,33 +600,42 @@ void SvxShowCharSet::SelectIndex( int nNewIndex, BOOL bFocus )
if( nNewIndex < 0 ) if( nNewIndex < 0 )
{ {
// need to scroll see closest unicode // need to scroll see closest unicode
int nNewPos = aVscrollSB.GetThumbPos();
sal_Unicode cPrev = maFontCharMap.GetPrevChar( cSelectedChar ); sal_Unicode cPrev = maFontCharMap.GetPrevChar( cSelectedChar );
int nMapIndex = UnicodeToMapIndex( maFontCharMap, cPrev ); int nMapIndex = UnicodeToMapIndex( maFontCharMap, cPrev );
nNewPos = nMapIndex / COLUMN_COUNT; int nNewPos = nMapIndex / COLUMN_COUNT;
aVscrollSB.SetThumbPos( nNewPos ); aVscrollSB.SetThumbPos( nNewPos );
nSelectedIndex = bFocus ? nMapIndex+1 : -1; nSelectedIndex = bFocus ? nMapIndex+1 : -1;
Invalidate(); Invalidate();
Update();
} }
else if( nNewIndex < FirstInView() ) else if( nNewIndex < FirstInView() )
{ {
// need to scroll up to see selected item // need to scroll up to see selected item
int nNewPos = aVscrollSB.GetThumbPos(); int nOldPos = aVscrollSB.GetThumbPos();
nNewPos -= (FirstInView() - nNewIndex + COLUMN_COUNT-1) / COLUMN_COUNT; int nDelta = (FirstInView() - nNewIndex + COLUMN_COUNT-1) / COLUMN_COUNT;
aVscrollSB.SetThumbPos( nNewPos ); aVscrollSB.SetThumbPos( nOldPos - nDelta );
nSelectedIndex = nNewIndex; nSelectedIndex = nNewIndex;
Invalidate(); Invalidate();
if( nDelta )
Update();
} }
else if( nNewIndex > LastInView() ) else if( nNewIndex > LastInView() )
{ {
// need to scroll down to see selected item // need to scroll down to see selected item
int nNewPos = aVscrollSB.GetThumbPos(); int nOldPos = aVscrollSB.GetThumbPos();
nNewPos += (nNewIndex - LastInView() + COLUMN_COUNT) / COLUMN_COUNT; int nDelta = (nNewIndex - LastInView() + COLUMN_COUNT) / COLUMN_COUNT;
aVscrollSB.SetThumbPos( nNewPos ); aVscrollSB.SetThumbPos( nOldPos + nDelta );
if( nNewIndex < maFontCharMap.GetCharCount() ) if( nNewIndex < maFontCharMap.GetCharCount() )
{
nSelectedIndex = nNewIndex; nSelectedIndex = nNewIndex;
Invalidate(); Invalidate();
} }
if( nOldPos != aVscrollSB.GetThumbPos() )
{
Invalidate();
Update();
}
}
else else
{ {
// remove highlighted view // remove highlighted view
......
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