diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-10-02 16:33:46 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-10-02 16:56:18 +0100 |
commit | 1f18b3b07832fee769e7a36c4f3503effde26f1e (patch) | |
tree | baeb8f6a57c719c3a35e89443f28137bb08611cb /sw | |
parent | 4a04a456d6cfd730429f45d25fe7d5d8131987fa (diff) |
Related: fdo#58277 only DelRight after a successful GotoField
otherwise you're just deleting a char right after whereever
the cursor used to be.
It can be possible to not GotoField if the field in question
is in a redline-deleted portion and show changes is not on. i.e.
its actually already deleted
Change-Id: Ic4833d82c5c33e556f3e159e9732a6db071f5622
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/uibase/docvw/AnnotationWin.cxx | 12 | ||||
-rw-r--r-- | sw/source/uibase/docvw/PostItMgr.cxx | 8 |
2 files changed, 11 insertions, 9 deletions
diff --git a/sw/source/uibase/docvw/AnnotationWin.cxx b/sw/source/uibase/docvw/AnnotationWin.cxx index 2c58a9b927da..f5e1f0c50bd4 100644 --- a/sw/source/uibase/docvw/AnnotationWin.cxx +++ b/sw/source/uibase/docvw/AnnotationWin.cxx @@ -143,11 +143,13 @@ void SwAnnotationWin::UpdateData() void SwAnnotationWin::Delete() { - SwSidebarWin::Delete(); - // we delete the field directly, the Mgr cleans up the PostIt by listening - DocView().GetWrtShellPtr()->GotoField(*mpFmtFld); - GrabFocusToDocument(); - DocView().GetWrtShellPtr()->DelRight(); + if (DocView().GetWrtShellPtr()->GotoField(*mpFmtFld)) + { + SwSidebarWin::Delete(); + // we delete the field directly, the Mgr cleans up the PostIt by listening + GrabFocusToDocument(); + DocView().GetWrtShellPtr()->DelRight(); + } } void SwAnnotationWin::GotoPos() diff --git a/sw/source/uibase/docvw/PostItMgr.cxx b/sw/source/uibase/docvw/PostItMgr.cxx index a2ed8dbfa248..a75a70fdd38e 100644 --- a/sw/source/uibase/docvw/PostItMgr.cxx +++ b/sw/source/uibase/docvw/PostItMgr.cxx @@ -1209,8 +1209,8 @@ void SwPostItMgr::Delete(const OUString& aAuthor) } for(std::vector<const SwFmtFld*>::iterator i = aTmp.begin(); i != aTmp.end() ; ++i) { - mpWrtShell->GotoField( *(*i) ); - mpWrtShell->DelRight(); + if (mpWrtShell->GotoField(*(*i))) + mpWrtShell->DelRight(); } mpWrtShell->EndUndo(); PrepareView(); @@ -1236,8 +1236,8 @@ void SwPostItMgr::Delete() } for(std::vector<const SwFmtFld*>::iterator i = aTmp.begin(); i != aTmp.end() ; ++i) { - mpWrtShell->GotoField( *(*i) ); - mpWrtShell->DelRight(); + if (mpWrtShell->GotoField(*(*i))) + mpWrtShell->DelRight(); } mpWrtShell->EndUndo(); |