diff options
author | Tamás Zolnai <tamas.zolnai@collabora.com> | 2018-04-19 12:10:52 +0200 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2018-04-20 18:49:53 +0200 |
commit | eded8ebec2961de705a0177b7422a4c8d2513ac8 (patch) | |
tree | b0040f13e3d0c7a30a8d8b2e338e821ea60637d1 /sw | |
parent | 6008269b9bcc6e1d6de01a5205e4884a076ff4ee (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>
(cherry picked from commit 67919621cb0b95074c4401bdfced9d87b230cc2f)
Reviewed-on: https://gerrit.libreoffice.org/53180
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/inc/view.hxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/uiview/view2.cxx | 15 | ||||
-rw-r--r-- | sw/source/uibase/uiview/viewstat.cxx | 2 |
3 files changed, 18 insertions, 1 deletions
diff --git a/sw/inc/view.hxx b/sw/inc/view.hxx index a1dc5bcf9359..0e0f57fe10b2 100644 --- a/sw/inc/view.hxx +++ b/sw/inc/view.hxx @@ -501,6 +501,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 4cb021a90f3c..add13e4312c2 100644 --- a/sw/source/uibase/uiview/view2.cxx +++ b/sw/source/uibase/uiview/view2.cxx @@ -116,6 +116,7 @@ #include <dbconfig.hxx> #include <dbmgr.hxx> #include <reffld.hxx> +#include <comphelper/lok.hxx> #include <PostItMgr.hxx> @@ -1216,6 +1217,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 e5387497133d..8fd1b2752fe7 100644 --- a/sw/source/uibase/uiview/viewstat.cxx +++ b/sw/source/uibase/uiview/viewstat.cxx @@ -326,7 +326,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()) { |