diff options
author | Henry Castro <hcastro@collabora.com> | 2017-06-28 10:26:21 -0400 |
---|---|---|
committer | Henry Castro <hcastro@collabora.com> | 2017-06-28 20:49:36 +0200 |
commit | 0ac92837d31c4065be4a41e2a2541811c9f6be00 (patch) | |
tree | 11fdf3511ebd7577eacc4a2a3837ef8195cefa0b /sfx2 | |
parent | 6e02af978d456e078659bc25cf290f5c876d59a9 (diff) |
sc lok: disable Undo/Redo state if conflict with other views
Change-Id: I5bc5be2b17925ec3a203f9704f62a8c80ac5fc9d
Reviewed-on: https://gerrit.libreoffice.org/39363
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Henry Castro <hcastro@collabora.com>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/view/viewfrm.cxx | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index f1754effcf67..1dbcdf6e52a1 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -904,12 +904,34 @@ void SfxViewFrame::StateHistory_Impl( SfxItemSet &rSet ) rSet.DisableItem( SID_CLEARHISTORY ); if ( pShUndoMgr && pShUndoMgr->GetUndoActionCount() ) - rSet.Put( SfxStringItem( SID_UNDO, SvtResId(STR_UNDO)+pShUndoMgr->GetUndoActionComment() ) ); + { + const SfxUndoAction* pAction = pShUndoMgr->GetUndoAction(); + SfxViewShell *pViewSh = GetViewShell(); + if (pViewSh && pAction->GetViewShellId() != pViewSh->GetViewShellId()) + { + rSet.Put(SfxUInt32Item(SID_UNDO, static_cast<sal_uInt32>(SID_REPAIRPACKAGE))); + } + else + { + rSet.Put( SfxStringItem( SID_UNDO, SvtResId(STR_UNDO)+pShUndoMgr->GetUndoActionComment() ) ); + } + } else rSet.DisableItem( SID_UNDO ); if ( pShUndoMgr && pShUndoMgr->GetRedoActionCount() ) - rSet.Put( SfxStringItem( SID_REDO, SvtResId(STR_REDO)+pShUndoMgr->GetRedoActionComment() ) ); + { + const SfxUndoAction* pAction = pShUndoMgr->GetRedoAction(); + SfxViewShell *pViewSh = GetViewShell(); + if (pViewSh && pAction->GetViewShellId() != pViewSh->GetViewShellId()) + { + rSet.Put(SfxUInt32Item(SID_REDO, static_cast<sal_uInt32>(SID_REPAIRPACKAGE))); + } + else + { + rSet.Put( SfxStringItem( SID_REDO, SvtResId(STR_REDO)+pShUndoMgr->GetRedoActionComment() ) ); + } + } else rSet.DisableItem( SID_REDO ); |