Fix the cursor position for templates.

Now %CURSOR works again, this was somehow lost in porting.
Additionally, it is now possible again to set the cursor to the first line.

BUG: 140917
CCBUG: 141459

svn path=/trunk/KDE/kdepim/; revision=700430
wilder-work
Thomas McGuire 19 years ago
parent 75a9ba7ae3
commit cd3fa71145
  1. 5
      kmcomposewin.cpp
  2. 8
      kmedit.cpp
  3. 4
      kmedit.h

@ -4635,9 +4635,8 @@ void KMComposeWin::slotEditKeys()
void KMComposeWin::setReplyFocus( bool hasMessage )
{
mEditor->setFocus();
if ( hasMessage ) {
mEditor->setCursorPosition( 1, 0 );
}
if ( hasMessage )
mEditor->setCursorPositionFromStart( (unsigned int) mMsg->getCursorPos() );
}
void KMComposeWin::setFocusToSubject()

@ -759,4 +759,12 @@ void KMEdit::slotSpellDone()
}
}
void KMEdit::setCursorPositionFromStart( unsigned int pos ) {
unsigned int l = 0;
unsigned int c = 0;
posToRowCol( pos, l, c );
setCursorPosition( l, c );
ensureCursorVisible();
}
#include "kmedit.moc"

@ -91,6 +91,10 @@ public:
unsigned int lineBreakColumn() const;
/** set cursor to absolute position pos */
void setCursorPositionFromStart(unsigned int pos);
signals:
void spellcheck_done( int result );
void attachPNGImageData( const QByteArray &image );

Loading…
Cancel
Save