diff --git a/harbour/ChangeLog b/harbour/ChangeLog index a579b514f0..2e0b20acc3 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -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 diff --git a/harbour/contrib/hbide/ideedit.prg b/harbour/contrib/hbide/ideedit.prg index 3fd5dac86e..8d9ee584a1 100644 --- a/harbour/contrib/hbide/ideedit.prg +++ b/harbour/contrib/hbide/ideedit.prg @@ -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 ] diff --git a/harbour/contrib/hbide/idefindreplace.prg b/harbour/contrib/hbide/idefindreplace.prg index df1d4167f2..6e14ad52dd 100644 --- a/harbour/contrib/hbide/idefindreplace.prg +++ b/harbour/contrib/hbide/idefindreplace.prg @@ -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() diff --git a/harbour/contrib/hbqt/hbqt_hbqplaintextedit.cpp b/harbour/contrib/hbqt/hbqt_hbqplaintextedit.cpp index 77c54d8b8a..224e829a2f 100644 --- a/harbour/contrib/hbqt/hbqt_hbqplaintextedit.cpp +++ b/harbour/contrib/hbqt/hbqt_hbqplaintextedit.cpp @@ -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; } }