summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorHenry Castro <hcastro@collabora.com>2017-06-17 13:52:15 -0400
committerAndras Timar <andras.timar@collabora.com>2018-03-19 14:56:10 +0100
commitc6a03045fbe0481344b1e3ae5c8a758a9b5e9a14 (patch)
tree3e930184c3b42b7e7779e5b82eef8b50198a39a0 /sfx2
parentdafb3855306dd86480d029bfc9eb81efe036721a (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> (cherry picked from commit 6fd6e3c1d36d67002967f56e47255e360f4b08c1)
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/sdi/docslots.sdi4
-rw-r--r--sfx2/sdi/sfx.sdi19
-rw-r--r--sfx2/source/control/unoctitm.cxx3
-rw-r--r--sfx2/source/doc/objserv.cxx9
-rw-r--r--sfx2/source/view/viewfrm.cxx6
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 a477f64597dd..063aca8a8d78 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;