cui/source/inc/optlingu.hxx     |    1 +
 cui/source/options/optlingu.cxx |   17 ++++++++++++++---
 cui/uiconfig/ui/optlingupage.ui |    4 ++--
 3 files changed, 17 insertions(+), 5 deletions(-)

New commits:
commit 5e7327e9313e2d9fe2f0defb30d3e7dc28c0b2ce
Author:     Aron Budea <aron.bu...@collabora.com>
AuthorDate: Sun Apr 30 01:40:55 2023 +0200
Commit:     Aron Budea <aron.bu...@collabora.com>
CommitDate: Fri May 5 05:51:20 2023 +0200

    cui, lok: Hide options irrelevant for online in Spelling Options dialog
    
    User-defined Dictionaries part and
    Get more dictionaries URL + icon.
    
    Change-Id: I73825a481e1981145abbf36b44485fb1628fbe13
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151212
    Tested-by: Jenkins
    Reviewed-by: Aron Budea <aron.bu...@collabora.com>

diff --git a/cui/source/inc/optlingu.hxx b/cui/source/inc/optlingu.hxx
index 29adee861417..d0933e4ac831 100644
--- a/cui/source/inc/optlingu.hxx
+++ b/cui/source/inc/optlingu.hxx
@@ -120,6 +120,7 @@ private:
     std::unique_ptr<weld::Button> m_xLinguDicsDelPB;
     std::unique_ptr<weld::TreeView> m_xLinguOptionsCLB;
     std::unique_ptr<weld::Button> m_xLinguOptionsEditPB;
+    std::unique_ptr<weld::Box> m_xMoreDictsBox;
     std::unique_ptr<weld::LinkButton> m_xMoreDictsLink;
 
     void    AddDicBoxEntry( const css::uno::Reference< 
css::linguistic2::XDictionary > &rxDic, sal_uInt16 nIdx );
diff --git a/cui/source/options/optlingu.cxx b/cui/source/options/optlingu.cxx
index b80343657f22..3530d20f8750 100644
--- a/cui/source/options/optlingu.cxx
+++ b/cui/source/options/optlingu.cxx
@@ -33,6 +33,7 @@
 #include <tools/urlobj.hxx>
 #include <comphelper/diagnose_ex.hxx>
 #include <comphelper/dispatchcommand.hxx>
+#include <comphelper/lok.hxx>
 #include <comphelper/processfactory.hxx>
 #include <com/sun/star/linguistic2/LinguServiceManager.hpp>
 #include <com/sun/star/linguistic2/XSearchableDictionaryList.hpp>
@@ -853,6 +854,7 @@ SvxLinguTabPage::SvxLinguTabPage(weld::Container* pPage, 
weld::DialogController*
     , m_xLinguDicsDelPB(m_xBuilder->weld_button("lingudictsdelete"))
     , m_xLinguOptionsCLB(m_xBuilder->weld_tree_view("linguoptions"))
     , m_xLinguOptionsEditPB(m_xBuilder->weld_button("linguoptionsedit"))
+    , m_xMoreDictsBox(m_xBuilder->weld_box("moredictsbox"))
     , m_xMoreDictsLink(m_xBuilder->weld_link_button("moredictslink"))
 {
     m_xLinguModulesCLB->enable_toggle_buttons(weld::ColumnToggleType::Check);
@@ -878,7 +880,15 @@ SvxLinguTabPage::SvxLinguTabPage(weld::Container* pPage, 
weld::DialogController*
 
     m_xMoreDictsLink->connect_activate_link(LINK(this, SvxLinguTabPage, 
OnLinkClick));
     if (officecfg::Office::Security::Hyperlinks::Open::get() == 
SvtExtendedSecurityOptions::OPEN_NEVER)
-        m_xMoreDictsLink->hide();
+        m_xMoreDictsBox->hide();
+
+    if (comphelper::LibreOfficeKit::isActive())
+    {
+        // hide User-defined Dictionaries part
+        m_xBuilder->weld_frame("dictsframe")->hide();
+        // hide Get more dictionaries URL + icon
+        m_xMoreDictsBox->hide();
+    }
 
     xProp = LinguMgr::GetLinguPropertySet();
     xDicList.set( LinguMgr::GetDictionaryList() );
@@ -1550,9 +1560,10 @@ void SvxLinguTabPage::HideGroups( sal_uInt16 nGrp )
         m_xLinguModulesCLB->hide();
         m_xLinguModulesEditPB->hide();
 
-        if (officecfg::Office::Security::Hyperlinks::Open::get() != 
SvtExtendedSecurityOptions::OPEN_NEVER)
+        if (officecfg::Office::Security::Hyperlinks::Open::get() != 
SvtExtendedSecurityOptions::OPEN_NEVER &&
+            !comphelper::LibreOfficeKit::isActive())
         {
-            m_xMoreDictsLink->show();
+            m_xMoreDictsBox->show();
         }
     }
 }
diff --git a/cui/uiconfig/ui/optlingupage.ui b/cui/uiconfig/ui/optlingupage.ui
index 5ae94f81c0b6..13d9b3d059f9 100644
--- a/cui/uiconfig/ui/optlingupage.ui
+++ b/cui/uiconfig/ui/optlingupage.ui
@@ -231,7 +231,7 @@
       </packing>
     </child>
     <child>
-      <object class="GtkFrame">
+      <object class="GtkFrame" id="dictsframe">
         <property name="visible">True</property>
         <property name="can-focus">False</property>
         <property name="label-xalign">0</property>
@@ -516,7 +516,7 @@
               </packing>
             </child>
             <child>
-              <object class="GtkBox">
+              <object class="GtkBox" id="moredictsbox">
                 <property name="visible">True</property>
                 <property name="can-focus">False</property>
                 <child>

Reply via email to