2010-06-22 18:14 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com)

* contrib/hbqt/hbqt_hbqplaintextedit.cpp
    % Fixed: crash at fast text selection.

  * contrib/hbide/ideedit.prg
  * contrib/hbide/idefindreplace.prg
    % Fixed: slowness caused in selection process when many 
      lines were being selected. Now there is no overhead.
      Thanks to Itamar for reporting.
This commit is contained in:
Pritpal Bedi
2010-06-23 01:16:32 +00:00
parent 6ff29efe36
commit 3f698ba7bd
4 changed files with 26 additions and 5 deletions

View File

@@ -16,6 +16,16 @@
The license applies to all entries newer than 2009-04-28.
*/
2010-06-22 18:14 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com)
* contrib/hbqt/hbqt_hbqplaintextedit.cpp
% Fixed: crash at fast text selection.
* contrib/hbide/ideedit.prg
* contrib/hbide/idefindreplace.prg
% Fixed: slowness caused in selection process when many
lines were being selected. Now there is no overhead.
Thanks to Itamar for reporting.
2010-06-23 00:07 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
* harbour-win-spec
* harbour-wce-spec

View File

@@ -486,7 +486,12 @@ METHOD IdeEdit:execEvent( nMode, oEdit, p, p1 )
::toggleHorzRuler()
::dispStatusInfo()
::oDK:setStatusText( SB_PNL_SELECTEDCHARS, len( ::getSelectedText() ) )
::qEdit:hbGetSelectionInfo()
IF ::aSelectionInfo[ 1 ] > -1 .AND. ::aSelectionInfo[ 1 ] == ::aSelectionInfo[ 3 ]
::oDK:setStatusText( SB_PNL_SELECTEDCHARS, len( ::getSelectedText() ) )
ELSE
::oDK:setStatusText( SB_PNL_SELECTEDCHARS, 0 )
ENDIF
::oUpDn:show()
::unHighlight()
@@ -788,6 +793,8 @@ METHOD IdeEdit:copyBlockContents( aCord )
LOCAL nT, nL, nB, nR, nW, i, cLine, nMode, qClip, oLine
LOCAL cClip := ""
HB_TRACE( HB_TR_DEBUG, "IdeEdit:copyBlockContents( aCord )" )
hbide_normalizeRect( aCord, @nT, @nL, @nB, @nR )
nMode := aCord[ 5 ]
@@ -1219,6 +1226,8 @@ METHOD IdeEdit:blockConvert( cMode )
METHOD IdeEdit:getSelectedText()
LOCAL nT, nL, nB, nR, nW, i, cLine, nMode, cClip := "", aCord
HB_TRACE( HB_TR_DEBUG, "IdeEdit:getSelectedText()", ProcName( 1 ), procName( 2 ) )
::qEdit:hbGetSelectionInfo(); aCord := ::aSelectionInfo
hbide_normalizeRect( aCord, @nT, @nL, @nB, @nR )
nMode := aCord[ 5 ]

View File

@@ -117,7 +117,8 @@ METHOD IdeUpDown:show()
IF !empty( oEdit := ::oEM:getEditObjectCurrent() )
::position()
IF !empty( oEdit:getSelectedText() )
oEdit:qEdit:hbGetSelectionInfo()
IF oEdit:aSelectionInfo[ 1 ] > -1
::oUI:show()
ELSE
::oUI:hide()

View File

@@ -1241,7 +1241,7 @@ void HBQPlainTextEdit::keyPressEvent( QKeyEvent * event )
//HB_TRACE( HB_TR_ALWAYS, ( "keyPressEvent %i 000", event->key() ) );
if( hbKeyPressSelection( event ) )
{
QApplication::processEvents();
// QApplication::processEvents();
return;
}
//HB_TRACE( HB_TR_ALWAYS, ( "keyPressEvent %i", event->key() ) );
@@ -1614,6 +1614,7 @@ void HBQPlainTextEdit::hbPaintSelection( QPaintEvent * event )
int top = ( ( rb <= t ) ? 0 : ( ( rb - t ) * fontHeight ) );
int btm = ( ( re - t + 1 ) * fontHeight ) - top;
btm = btm > viewport()->height() ? viewport()->height() : btm;
QBrush br( m_selectionColor );
if( selectionMode == selectionMode_column )
{
@@ -1621,7 +1622,7 @@ void HBQPlainTextEdit::hbPaintSelection( QPaintEvent * event )
int w = ( cb == ce ? 1 : ( ( ce - cb ) * fontWidth ) );
QRect r( x, top, w, btm );
p.fillRect( r, QBrush( m_selectionColor ) );
p.fillRect( r, br );
}
else if( selectionMode == selectionMode_stream )
{
@@ -1683,7 +1684,7 @@ void HBQPlainTextEdit::hbPaintSelection( QPaintEvent * event )
r = QRect( 0, top, width, fontHeight );
}
}
p.fillRect( r, QBrush( m_selectionColor ) );
p.fillRect( r, br );
top += fontHeight;
}
}