summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2019-07-13 15:45:22 +0100
committerMichael Meeks <michael.meeks@collabora.com>2019-10-11 21:34:05 +0200
commite04fb52e8cdc8811c90f7c3492caa87c03ea6c67 (patch)
tree502f73a63afcd3a08cc2375c8a04817fcbf4e79a
parent702b199db825599222514c8716da575032f1b346 (diff)
lok: Disable autocorrect dialog from native context menu.
Change-Id: I973057c91be6704b5db7d9054679e0ddc8abf429 Reviewed-on: https://gerrit.libreoffice.org/80658 Tested-by: Jenkins Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
-rw-r--r--sfx2/sdi/appslots.sdi1
-rw-r--r--sfx2/source/appl/appserv.cxx4
-rw-r--r--sw/sdi/_docsh.sdi1
-rw-r--r--sw/source/uibase/app/docsh.cxx5
-rw-r--r--sw/source/uibase/lingu/olmenu.cxx6
5 files changed, 16 insertions, 1 deletions
diff --git a/sfx2/sdi/appslots.sdi b/sfx2/sdi/appslots.sdi
index ee5a731d2063..6bd28f73b37f 100644
--- a/sfx2/sdi/appslots.sdi
+++ b/sfx2/sdi/appslots.sdi
@@ -291,6 +291,7 @@ shell SfxApplication
SID_AUTO_CORRECT_DLG
[
ExecMethod = OfaExec_Impl ;
+ StateMethod = OfaState_Impl;
]
SID_OPTIONS_TREEDIALOG
[
diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx
index a7ede6f37492..64977135ba3a 100644
--- a/sfx2/source/appl/appserv.cxx
+++ b/sfx2/source/appl/appserv.cxx
@@ -46,6 +46,7 @@
#include <com/sun/star/util/CloseVetoException.hpp>
#include <org/freedesktop/PackageKit/SyncDbusSessionHelper.hpp>
+#include <comphelper/lok.hxx>
#include <comphelper/namedvaluecollection.hxx>
#include <comphelper/processfactory.hxx>
#include <comphelper/propertysequence.hxx>
@@ -1689,7 +1690,8 @@ void SfxApplication::OfaState_Impl(SfxItemSet &rSet)
rSet.DisableItem( FN_BUSINESS_CARD );
rSet.DisableItem( FN_XFORMS_INIT );
}
-
+ if ( comphelper::LibreOfficeKit::isActive() )
+ rSet.DisableItem( SID_AUTO_CORRECT_DLG );
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/sdi/_docsh.sdi b/sw/sdi/_docsh.sdi
index f85f95f51edb..ec7814d2ceeb 100644
--- a/sw/sdi/_docsh.sdi
+++ b/sw/sdi/_docsh.sdi
@@ -27,6 +27,7 @@ interface BaseTextDocument
SID_AUTO_CORRECT_DLG
[
ExecMethod = Execute ;
+ StateMethod = GetState ;
]
SID_STYLE_NEW
diff --git a/sw/source/uibase/app/docsh.cxx b/sw/source/uibase/app/docsh.cxx
index f641ad98508f..a373ec9e3a71 100644
--- a/sw/source/uibase/app/docsh.cxx
+++ b/sw/source/uibase/app/docsh.cxx
@@ -47,6 +47,7 @@
#include <editeng/flstitem.hxx>
#include <sfx2/htmlmode.hxx>
#include <svtools/soerr.hxx>
+#include <comphelper/lok.hxx>
#include <comphelper/classids.hxx>
#include <basic/basmgr.hxx>
#include <basic/sbmod.hxx>
@@ -1041,6 +1042,10 @@ void SwDocShell::GetState(SfxItemSet& rSet)
}
}
break;
+ case SID_AUTO_CORRECT_DLG:
+ if ( comphelper::LibreOfficeKit::isActive() )
+ rSet.DisableItem( SID_AUTO_CORRECT_DLG );
+ break;
case SID_SOURCEVIEW:
{
SfxViewShell* pCurrView = GetView() ? static_cast<SfxViewShell*>(GetView())
diff --git a/sw/source/uibase/lingu/olmenu.cxx b/sw/source/uibase/lingu/olmenu.cxx
index e6777811f099..8cc000318df0 100644
--- a/sw/source/uibase/lingu/olmenu.cxx
+++ b/sw/source/uibase/lingu/olmenu.cxx
@@ -41,6 +41,7 @@
#include <wview.hxx>
#include <textsh.hxx>
+#include <comphelper/lok.hxx>
#include <comphelper/anytostring.hxx>
#include <comphelper/processfactory.hxx>
#include <cppuhelper/exc_hlp.hxx>
@@ -296,6 +297,11 @@ SwSpellPopup::SwSpellPopup(
vcl::CommandInfoProvider::GetPopupLabelForCommand(".uno:SpellingAndGrammarDialog", aModuleName));
m_xPopupMenu->SetItemText(m_nCorrectDialogId,
vcl::CommandInfoProvider::GetPopupLabelForCommand(".uno:AutoCorrectDlg", aModuleName));
+ if (comphelper::LibreOfficeKit::isActive())
+ {
+ m_xPopupMenu->HideItem(m_nCorrectDialogId);
+ m_xPopupMenu->HideItem(m_nAddId);
+ }
sal_uInt16 nItemPos = m_xPopupMenu->GetItemPos(m_nIgnoreWordId);
m_xPopupMenu->InsertItem(MN_IGNORE_SELECTION, aIgnoreSelection, MenuItemBits::NONE, OString(), nItemPos);
m_xPopupMenu->SetHelpId(MN_IGNORE_SELECTION, HID_LINGU_IGNORE_SELECTION);