summaryrefslogtreecommitdiff
path: root/sfx2/source
diff options
context:
space:
mode:
authorHenry Castro <hcastro@collabora.com>2017-06-17 13:52:15 -0400
committerJan Holesovsky <kendy@collabora.com>2018-01-18 13:34:53 +0100
commite3c1713807499fdbe63fad0944d0ce3b91b28637 (patch)
tree011c8706d89611714b8583c8acc7221cc26f17a1 /sfx2/source
parentba5556e62ed3fda9f02aaf7d3ba23c19af7dbdfc (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> Reviewed-on: https://gerrit.libreoffice.org/47915 Reviewed-by: Jan Holesovsky <kendy@collabora.com> Tested-by: Jan Holesovsky <kendy@collabora.com>
Diffstat (limited to 'sfx2/source')
-rw-r--r--sfx2/source/control/unoctitm.cxx3
-rw-r--r--sfx2/source/doc/objserv.cxx10
-rw-r--r--sfx2/source/view/viewfrm.cxx6
3 files changed, 18 insertions, 1 deletions
diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx
index 263f9d2111c9..60c55bdeb3d6 100644
--- a/sfx2/source/control/unoctitm.cxx
+++ b/sfx2/source/control/unoctitm.cxx
@@ -1005,7 +1005,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 6547aff74b5d..728dd05d9273 100644
--- a/sfx2/source/doc/objserv.cxx
+++ b/sfx2/source/doc/objserv.cxx
@@ -51,6 +51,7 @@
#include <vcl/layout.hxx>
#include <svl/intitem.hxx>
#include <svl/eitem.hxx>
+#include <svl/undo.hxx>
#include <svl/visitem.hxx>
#include <vcl/wrkwin.hxx>
#include <svtools/sfxecode.hxx>
@@ -1064,6 +1065,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 cbe1947b37f8..751891d3cf0a 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -1312,6 +1312,12 @@ void SfxViewFrame::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
break;
}
+ case SFX_HINT_DOCREPAIR:
+ {
+ GetBindings().Invalidate( SID_DOC_REPAIR );
+ break;
+ }
+
case SFX_HINT_DEINITIALIZING:
GetFrame().DoClose();
break;