diff options
author | Henry Castro <hcastro@collabora.com> | 2017-06-28 10:26:21 -0400 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2017-07-26 18:30:56 +0200 |
commit | 61396c713fcce8b4c6d6fd159753c58b53a55449 (patch) | |
tree | 25ada288cf9419987cae6355428279e0840c004b /sfx2 | |
parent | 0892238c635009a7b078a0778dbd6138e06e0ac0 (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>
Reviewed-on: https://gerrit.libreoffice.org/39402
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/view/viewfrm.cxx | 30 |
1 files changed, 24 insertions, 6 deletions
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index 551cb94ae14a..840ba418e3e7 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -933,18 +933,36 @@ void SfxViewFrame::StateHistory_Impl( SfxItemSet &rSet ) if ( pShUndoMgr && pShUndoMgr->GetUndoActionCount() ) { - OUString aTmp(SvtResId(STR_UNDO).toString()); - aTmp+= pShUndoMgr->GetUndoActionComment(); - rSet.Put( SfxStringItem( SID_UNDO, aTmp ) ); + const SfxUndoAction* pAction = pShUndoMgr->GetUndoAction(); + SfxViewShell *pViewSh = GetViewShell(); + if (pViewSh && pAction->GetViewShellId() != static_cast<sal_Int32>(pViewSh->GetViewShellId())) + { + rSet.Put(SfxUInt32Item(SID_UNDO, static_cast<sal_uInt32>(SID_REPAIRPACKAGE))); + } + else + { + OUString aTmp(SvtResId(STR_UNDO).toString()); + aTmp+= pShUndoMgr->GetUndoActionComment(); + rSet.Put( SfxStringItem( SID_UNDO, aTmp ) ); + } } else rSet.DisableItem( SID_UNDO ); if ( pShUndoMgr && pShUndoMgr->GetRedoActionCount() ) { - OUString aTmp(SvtResId(STR_REDO).toString()); - aTmp += pShUndoMgr->GetRedoActionComment(); - rSet.Put( SfxStringItem( SID_REDO, aTmp ) ); + const SfxUndoAction* pAction = pShUndoMgr->GetRedoAction(); + SfxViewShell *pViewSh = GetViewShell(); + if (pViewSh && pAction->GetViewShellId() != static_cast<sal_Int32>(pViewSh->GetViewShellId())) + { + rSet.Put(SfxUInt32Item(SID_REDO, static_cast<sal_uInt32>(SID_REPAIRPACKAGE))); + } + else + { + OUString aTmp(SvtResId(STR_REDO).toString()); + aTmp += pShUndoMgr->GetRedoActionComment(); + rSet.Put( SfxStringItem( SID_REDO, aTmp ) ); + } } else rSet.DisableItem( SID_REDO ); |