Hi there,

I want to insert a field and then jump back, so my cursor is positioned just in front of the inserted field:

aFldMgr.InsertFld(aData);
rSh.Push();
rSh.SwCrsrShell::Left(1, CRSR_SKIP_CHARS, FALSE);
pPostIt = (SwPostItField*)aFldMgr.GetCurFld();
rSh.Pop(FALSE);

This works fine, but not if there is a selection. I changed the code so the selection is not deleted, so the field is inserted at the beginning.

But I am not able to position the cursor now in front of the field, this should work no matter if the actual cursor is at the start or end of the selection.

So I need sth. like

aFldMgr.InsertFld(aData);
rSh.Push();
if (rSh.HasSelection())
   ??????????
else
   rSh.SwCrsrShell::Left(1, CRSR_SKIP_CHARS, FALSE);
pPostIt = (SwPostItField*)aFldMgr.GetCurFld();
rSh.Pop(FALSE);

Can anyone help out?

Best regards
Max

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to