cui/source/dialogs/SpellDialog.cxx |    2 +-
 cui/source/inc/optlingu.hxx        |   10 ++--------
 cui/source/options/optlingu.cxx    |   19 +++++++------------
 cui/uiconfig/ui/optlingupage.ui    |    2 +-
 4 files changed, 11 insertions(+), 22 deletions(-)

New commits:
commit a5a3769ebd6eae7154b2e47107df322e122b59a2
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Fri Feb 21 17:52:07 2025 +0100
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Sat Feb 22 10:54:32 2025 +0100

    tdf#130857 cui: Hide whole frame instead of individual widgets
    
    In the spelling options dialog that can be triggered
    in Writer via "Tools" -> "Spelling" -> "Options" dialog,
    don't call weld::Widget::hide separately for the single
    items in the "Available Language Modules" frame, but
    hide the whole frame instead.
    
    Besides being simpler, this also fixes the issue that
    the frame was still visible when opening the dialog
    when using the qt6 VCL plugin and SAL_VCL_QT_USE_WELDED_WIDGETS=1
    (i.e. enabling use of native Qt widgets).
    
    Change-Id: I331ce368b94a9636aa2f4a54c01a3a650f84ef03
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182009
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>

diff --git a/cui/source/inc/optlingu.hxx b/cui/source/inc/optlingu.hxx
index 634c570f2e47..6d1f4352b2cf 100644
--- a/cui/source/inc/optlingu.hxx
+++ b/cui/source/inc/optlingu.hxx
@@ -107,7 +107,7 @@ private:
 
     std::unique_ptr<SvxLinguData_Impl>  pLinguData;
 
-    std::unique_ptr<weld::Label> m_xLinguModulesFT;
+    std::unique_ptr<weld::Container> m_xLinguModulesFrame;
     std::unique_ptr<weld::TreeView> m_xLinguModulesCLB;
     std::unique_ptr<weld::Button> m_xLinguModulesEditPB;
     std::unique_ptr<weld::Label> m_xLinguDicsFT;
diff --git a/cui/source/options/optlingu.cxx b/cui/source/options/optlingu.cxx
index 5c1f1a42977d..d08bee0fde3d 100644
--- a/cui/source/options/optlingu.cxx
+++ b/cui/source/options/optlingu.cxx
@@ -798,7 +798,7 @@ SvxLinguTabPage::SvxLinguTabPage(weld::Container* pPage, 
weld::DialogController*
     , nUPN_HYPH_MIN_LEADING(-1)
     , nUPN_HYPH_MIN_TRAILING(-1)
     , m_nDlbClickEventId(nullptr)
-    , m_xLinguModulesFT(m_xBuilder->weld_label(u"lingumodulesft"_ustr))
+    , 
m_xLinguModulesFrame(m_xBuilder->weld_container(u"lingumodulesframe"_ustr))
     , m_xLinguModulesCLB(m_xBuilder->weld_tree_view(u"lingumodules"_ustr))
     , m_xLinguModulesEditPB(m_xBuilder->weld_button(u"lingumodulesedit"_ustr))
     , m_xLinguDicsFT(m_xBuilder->weld_label(u"lingudictsft"_ustr))
@@ -1537,9 +1537,7 @@ IMPL_LINK(SvxLinguTabPage, SelectHdl_Impl, 
weld::TreeView&, rBox, void)
 
 void SvxLinguTabPage::HideModulesGroup()
 {
-    m_xLinguModulesFT->hide();
-    m_xLinguModulesCLB->hide();
-    m_xLinguModulesEditPB->hide();
+    m_xLinguModulesFrame->hide();
 
     if (officecfg::Office::Security::Hyperlinks::Open::get() != 
SvtExtendedSecurityOptions::OPEN_NEVER &&
         !comphelper::LibreOfficeKit::isActive())
diff --git a/cui/uiconfig/ui/optlingupage.ui b/cui/uiconfig/ui/optlingupage.ui
index e1b1868e0f90..48e3f1a4ca6a 100644
--- a/cui/uiconfig/ui/optlingupage.ui
+++ b/cui/uiconfig/ui/optlingupage.ui
@@ -59,7 +59,7 @@
     <property name="border-width">6</property>
     <property name="row-spacing">12</property>
     <child>
-      <object class="GtkFrame" id="frame1">
+      <object class="GtkFrame" id="lingumodulesframe">
         <property name="visible">True</property>
         <property name="can-focus">False</property>
         <property name="hexpand">True</property>
commit 7cc0abf8c4517ee6cf7beb0da0c6e27c56f314c4
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Fri Feb 21 17:42:54 2025 +0100
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Sat Feb 22 10:54:24 2025 +0100

    cui: Simplify and rename SvxLinguTabPage::HideGroups
    
    It only ever gets called with param GROUP_MODULES,
    so rename to SvxLinguTabPage::HideModulesGroup,
    drop the param and the corresponding
    GROUP_MODULES define altogether.
    
    Change-Id: I9324e85d2c13dac6a58ae0b0440eacb2b661e0aa
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182008
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>
    Tested-by: Jenkins

diff --git a/cui/source/dialogs/SpellDialog.cxx 
b/cui/source/dialogs/SpellDialog.cxx
index 7ee6de654530..bd30f650adad 100644
--- a/cui/source/dialogs/SpellDialog.cxx
+++ b/cui/source/dialogs/SpellDialog.cxx
@@ -463,7 +463,7 @@ void SpellDialog::StartSpellOptDlg_Impl()
         m_xDialog.get(), xSet.get(), "content", 
"cui/ui/spelloptionsdialog.ui", "SpellOptionsDialog");
 
     std::unique_ptr<SfxTabPage> xPage = 
SvxLinguTabPage::Create(m_xOptionsDlg->get_content_area(), m_xOptionsDlg.get(), 
xSet.get());
-    static_cast<SvxLinguTabPage*>(xPage.get())->HideGroups( GROUP_MODULES );
+    static_cast<SvxLinguTabPage*>(xPage.get())->HideModulesGroup();
     m_xOptionsDlg->SetTabPage(std::move(xPage));
     weld::GenericDialogController::runAsync(m_xOptionsDlg, [this, 
xSet=std::move(xSet)] (sal_uInt32 nResult) {
         if (RET_OK == nResult)
diff --git a/cui/source/inc/optlingu.hxx b/cui/source/inc/optlingu.hxx
index 6c5657acf7bd..634c570f2e47 100644
--- a/cui/source/inc/optlingu.hxx
+++ b/cui/source/inc/optlingu.hxx
@@ -37,12 +37,6 @@ namespace com::sun::star{
 
 class SvxLinguData_Impl;
 
-// define ----------------------------------------------------------------
-
-#define GROUP_MODULES   (sal_uInt16(0x0008))
-
-// forward ---------------------------------------------------------------
-
 class SvxEditModulesDlg : public weld::GenericDialogController
 {
     OUString            sSpell;
@@ -150,7 +144,7 @@ public:
     virtual bool        FillItemSet( SfxItemSet* rSet ) override;
     virtual void        Reset( const SfxItemSet* rSet ) override;
 
-    void                HideGroups( sal_uInt16 nGrp );
+    void                HideModulesGroup();
 };
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cui/source/options/optlingu.cxx b/cui/source/options/optlingu.cxx
index 2d6e77ffed07..5c1f1a42977d 100644
--- a/cui/source/options/optlingu.cxx
+++ b/cui/source/options/optlingu.cxx
@@ -1535,19 +1535,16 @@ IMPL_LINK(SvxLinguTabPage, SelectHdl_Impl, 
weld::TreeView&, rBox, void)
     }
 }
 
-void SvxLinguTabPage::HideGroups( sal_uInt16 nGrp )
+void SvxLinguTabPage::HideModulesGroup()
 {
-    if ( 0 != ( GROUP_MODULES & nGrp ) )
-    {
-        m_xLinguModulesFT->hide();
-        m_xLinguModulesCLB->hide();
-        m_xLinguModulesEditPB->hide();
+    m_xLinguModulesFT->hide();
+    m_xLinguModulesCLB->hide();
+    m_xLinguModulesEditPB->hide();
 
-        if (officecfg::Office::Security::Hyperlinks::Open::get() != 
SvtExtendedSecurityOptions::OPEN_NEVER &&
-            !comphelper::LibreOfficeKit::isActive())
-        {
-            m_xMoreDictsBox->show();
-        }
+    if (officecfg::Office::Security::Hyperlinks::Open::get() != 
SvtExtendedSecurityOptions::OPEN_NEVER &&
+        !comphelper::LibreOfficeKit::isActive())
+    {
+        m_xMoreDictsBox->show();
     }
 }
 

Reply via email to