diff options
author | Henry Castro <hcastro@collabora.com> | 2017-06-17 13:52:15 -0400 |
---|---|---|
committer | Henry Castro <hcastro@collabora.com> | 2017-12-07 19:14:18 +0100 |
commit | 6fd6e3c1d36d67002967f56e47255e360f4b08c1 (patch) | |
tree | 3d733efd3b054513590b211e209972f5328fd292 /sfx2 | |
parent | ed50a0a2ce51584fa3a8fba0094220a4bf25c650 (diff) |
lokit: add .uno:DocumentRepair command
Change-Id: I5b13ea6f4785bc91c29111fa63c4a1b0ea9b2660
Reviewed-on: https://gerrit.libreoffice.org/38908
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Henry Castro <hcastro@collabora.com>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/sdi/docslots.sdi | 4 | ||||
-rw-r--r-- | sfx2/sdi/sfx.sdi | 19 | ||||
-rw-r--r-- | sfx2/source/control/unoctitm.cxx | 3 | ||||
-rw-r--r-- | sfx2/source/doc/objserv.cxx | 9 | ||||
-rw-r--r-- | sfx2/source/view/viewfrm.cxx | 6 |
5 files changed, 40 insertions, 1 deletions
diff --git a/sfx2/sdi/docslots.sdi b/sfx2/sdi/docslots.sdi index a6da56c2488d..811467cd94be 100644 --- a/sfx2/sdi/docslots.sdi +++ b/sfx2/sdi/docslots.sdi @@ -202,6 +202,10 @@ interface OfficeDocument : Document ExecMethod = ExecFile_Impl; StateMethod = GetState_Impl; ] + SID_DOC_REPAIR + [ + StateMethod = GetState_Impl; + ] } diff --git a/sfx2/sdi/sfx.sdi b/sfx2/sdi/sfx.sdi index e00cd9aece28..659e3763bfd1 100644 --- a/sfx2/sdi/sfx.sdi +++ b/sfx2/sdi/sfx.sdi @@ -3335,6 +3335,25 @@ SfxStringItem Redo SID_REDO GroupId = SfxGroupId::Edit; ] +SfxBoolItem DocumentRepair SID_DOC_REPAIR + +[ + AutoUpdate = FALSE, + FastCall = FALSE, + ReadOnlyDoc = FALSE, + Toggle = FALSE, + Container = FALSE, + RecordAbsolute = FALSE, + RecordPerSet; + Asynchron; + + + AccelConfig = FALSE, + MenuConfig = FALSE, + ToolBoxConfig = FALSE, + GroupId = ; +] + SfxBoolItem Reload SID_RELOAD () [ diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx index 9fd42581036f..d5adabbaa598 100644 --- a/sfx2/source/control/unoctitm.cxx +++ b/sfx2/source/control/unoctitm.cxx @@ -1018,7 +1018,8 @@ static void InterceptLOKStateChangeEvent(const SfxViewFrame* pViewFrame, const c aEvent.FeatureURL.Path == "PreviousTrackedChange" || aEvent.FeatureURL.Path == "AlignLeft" || aEvent.FeatureURL.Path == "AlignHorizontalCenter" || - aEvent.FeatureURL.Path == "AlignRight") + aEvent.FeatureURL.Path == "AlignRight" || + aEvent.FeatureURL.Path == "DocumentRepair") { bool bTemp = false; aEvent.State >>= bTemp; diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx index 62f2f003016b..e104116f1d17 100644 --- a/sfx2/source/doc/objserv.cxx +++ b/sfx2/source/doc/objserv.cxx @@ -1069,6 +1069,15 @@ void SfxObjectShell::GetState_Impl(SfxItemSet &rSet) rSet.DisableItem( nWhich ); break; } + case SID_DOC_REPAIR: + { + svl::IUndoManager* pIUndoMgr = GetUndoManager(); + if (pIUndoMgr) + rSet.Put( SfxBoolItem(nWhich, pIUndoMgr->IsEmptyActions()) ); + else + rSet.DisableItem( nWhich ); + break; + } } } } diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index 816a0aafbca3..e6db9e2d4fee 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -1247,6 +1247,12 @@ void SfxViewFrame::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint ) break; } + case SfxHintId::DocumentRepair: + { + GetBindings().Invalidate( SID_DOC_REPAIR ); + break; + } + case SfxHintId::Deinitializing: GetFrame().DoClose(); break; |