From 772b8af4792bc5e92644efa5b76edd2eb6321a73 Mon Sep 17 00:00:00 2001 From: Allen Winter Date: Sat, 16 Dec 2006 01:23:12 +0000 Subject: [PATCH] merge SVN commit 600801 by winterz: Custom templates patch from Dmitry: make %CURSOR command really work everywhere. svn path=/branches/KDE/3.5/kdepim/; revision=614030 --- kmcomposewin.cpp | 7 ++++++- kmedit.cpp | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/kmcomposewin.cpp b/kmcomposewin.cpp index e68883da4..42c1b5b91 100644 --- a/kmcomposewin.cpp +++ b/kmcomposewin.cpp @@ -1971,6 +1971,9 @@ void KMComposeWin::setMsg(KMMessage* newMsg, bool mayAutoSign, QTimer::singleShot( 200, this, SLOT(slotAppendSignature()) ); } setModified( isModified ); + + // do this even for new messages + mEditor->setCursorPositionFromStart( (unsigned int) mMsg->getCursorPos() ); } @@ -4014,7 +4017,9 @@ void KMComposeWin::slotAppendSignature() { mEditor->append(mOldSigText); mEditor->setModified(mod); - mEditor->setContentsPos( 0, 0 ); + // interfere with %CURSOR template command + // mEditor->setContentsPos( 0, 0 ); + mEditor->setCursorPositionFromStart( (unsigned int) mMsg->getCursorPos() ); mEditor->sync(); } } diff --git a/kmedit.cpp b/kmedit.cpp index 8a24d0881..8e46f55bb 100644 --- a/kmedit.cpp +++ b/kmedit.cpp @@ -732,7 +732,7 @@ void KMEdit::slotSpellDone() } } -void KMEdit::setCursorPositionFromStart(unsigned int pos) { +void KMEdit::setCursorPositionFromStart( unsigned int pos ) { unsigned int l = 0; unsigned int c = 0; posToRowCol( pos, l, c );