[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - sfx2/sdi sfx2/source sw/sdi sw/source

Michael Meeks (via logerrit) logerrit at kemper.freedesktop.org
Fri Oct 11 16:55:31 UTC 2019


 sfx2/sdi/appslots.sdi             |    1 +
 sfx2/source/appl/appserv.cxx      |    4 +++-
 sw/sdi/_docsh.sdi                 |    1 +
 sw/source/uibase/app/docsh.cxx    |    5 +++++
 sw/source/uibase/lingu/olmenu.cxx |    6 ++++++
 5 files changed, 16 insertions(+), 1 deletion(-)

New commits:
commit 5d0e5a20475be057b2ed99460fd534f174c36069
Author:     Michael Meeks <michael.meeks at collabora.com>
AuthorDate: Sat Jul 13 15:45:22 2019 +0100
Commit:     Michael Meeks <michael.meeks at collabora.com>
CommitDate: Fri Oct 11 18:54:39 2019 +0200

    lok: Disable autocorrect dialog from native context menu.
    
    Change-Id: I973057c91be6704b5db7d9054679e0ddc8abf429
    Reviewed-on: https://gerrit.libreoffice.org/80662
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Michael Meeks <michael.meeks at collabora.com>

diff --git a/sfx2/sdi/appslots.sdi b/sfx2/sdi/appslots.sdi
index e46e29741243..ef93d3da05e8 100644
--- a/sfx2/sdi/appslots.sdi
+++ b/sfx2/sdi/appslots.sdi
@@ -288,6 +288,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 e6fd447cae64..1b2f2a3b346d 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>
@@ -1725,7 +1726,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 3559a500fba6..c6ba76e6fa2f 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 ae5ed25e97c2..250b4cc69c42 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);


More information about the Libreoffice-commits mailing list