summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorTamás Zolnai <tamas.zolnai@collabora.com>2018-04-19 12:10:52 +0200
committerTamás Zolnai <tamas.zolnai@collabora.com>2018-04-19 14:05:21 +0200
commit67919621cb0b95074c4401bdfced9d87b230cc2f (patch)
treeb7364b38de39a3a260cbe956e8daba78fac3affd /sw
parent4ec8afafea320f40806abc7bdc9149a9b26b3d4c (diff)
sw lok: Accept / reject change is always enabled in the context menu
Use conditional fastcall for allow executing these two uno commands even if there is no tracked changes at the cursor position instead of enable the menu slots unconditionally. See also: b6011f07254f8003929320ad842d8d09daca0e09 Change-Id: Iaf8a8082961cd174c038fc021d2c41fb7cb97bff Reviewed-on: https://gerrit.libreoffice.org/53148 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/inc/view.hxx2
-rw-r--r--sw/source/uibase/uiview/view2.cxx15
-rw-r--r--sw/source/uibase/uiview/viewstat.cxx2
3 files changed, 18 insertions, 1 deletions
diff --git a/sw/inc/view.hxx b/sw/inc/view.hxx
index a5307014b9c9..700ae7511f1e 100644
--- a/sw/inc/view.hxx
+++ b/sw/inc/view.hxx
@@ -488,6 +488,8 @@ public:
void ExecSearch(SfxRequest&);
void ExecViewOptions(SfxRequest &);
+ virtual bool IsConditionalFastCall( const SfxRequest &rReq ) override;
+
void StateViewOptions(SfxItemSet &);
void StateSearch(SfxItemSet &);
void GetState(SfxItemSet&);
diff --git a/sw/source/uibase/uiview/view2.cxx b/sw/source/uibase/uiview/view2.cxx
index 119f1761d2e2..4ef8b57ab786 100644
--- a/sw/source/uibase/uiview/view2.cxx
+++ b/sw/source/uibase/uiview/view2.cxx
@@ -115,6 +115,7 @@
#include <dbconfig.hxx>
#include <dbmgr.hxx>
#include <reffld.hxx>
+#include <comphelper/lok.hxx>
#include <PostItMgr.hxx>
@@ -1217,6 +1218,20 @@ void SwView::Execute(SfxRequest &rReq)
rReq.Done();
}
+bool SwView::IsConditionalFastCall( const SfxRequest &rReq )
+{
+ sal_uInt16 nId = rReq.GetSlot();
+ bool bRet = false;
+
+ if (nId == FN_REDLINE_ACCEPT_DIRECT || nId == FN_REDLINE_REJECT_DIRECT)
+ {
+ if (comphelper::LibreOfficeKit::isActive())
+ bRet = true;
+ }
+ return bRet || SfxShell::IsConditionalFastCall(rReq);
+
+}
+
/// invalidate page numbering field
void SwView::UpdatePageNums(sal_uInt16 nPhyNum, sal_uInt16 nVirtNum, const OUString& rPgStr)
{
diff --git a/sw/source/uibase/uiview/viewstat.cxx b/sw/source/uibase/uiview/viewstat.cxx
index 6a7723cc33e4..73661dca0b1b 100644
--- a/sw/source/uibase/uiview/viewstat.cxx
+++ b/sw/source/uibase/uiview/viewstat.cxx
@@ -329,7 +329,7 @@ void SwView::GetState(SfxItemSet &rSet)
}
// LibreOfficeKit wants to handle changes by index, so always allow here.
- if (bDisable && !comphelper::LibreOfficeKit::isActive())
+ if (bDisable)
rSet.DisableItem(nWhich);
if (comphelper::LibreOfficeKit::isActive())
{