sw/source/ui/misc/pggrid.cxx |   17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

New commits:
commit 713b19bde2dcd0a65e04bb99681e35cbfd2f25e9
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Wed Oct 5 09:49:17 2022 +0100
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Wed Oct 5 14:04:52 2022 +0200

    tdf#151316 recalc what dependencies should be sensitive
    
    Change-Id: I40f78ec151c3d5901209b8587f6152ab76d04e88
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140960
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>
    (cherry picked from commit 17612ee10f89a6bf5447a324a02eb0a73d7b27e1)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140961

diff --git a/sw/source/ui/misc/pggrid.cxx b/sw/source/ui/misc/pggrid.cxx
index 46f78140a927..e59e4112f439 100644
--- a/sw/source/ui/misc/pggrid.cxx
+++ b/sw/source/ui/misc/pggrid.cxx
@@ -460,15 +460,18 @@ IMPL_LINK(SwTextGridPage, TextSizeChangedHdl, 
weld::MetricSpinButton&, rField, v
 
 IMPL_LINK(SwTextGridPage, GridTypeHdl, weld::Toggleable&, rButton, void)
 {
-    bool bEnable = m_xNoGridRB.get() != &rButton;
-    m_xLayoutFL->set_sensitive(bEnable);
-    m_xDisplayFL->set_sensitive(bEnable);
+    if (!rButton.get_active())
+        return;
+
+    const bool bNoGrid = m_xNoGridRB.get() == &rButton;
+    m_xLayoutFL->set_sensitive(!bNoGrid);
+    m_xDisplayFL->set_sensitive(!bNoGrid);
 
     //one special case
-    if (bEnable)
+    if (!bNoGrid)
         DisplayGridHdl(*m_xDisplayCB);
 
-    bEnable = m_xCharsGridRB.get() == &rButton;
+    bool bEnable = m_xCharsGridRB.get() == &rButton;
     m_xSnapToCharsCB->set_sensitive(bEnable);
 
     bEnable = m_xLinesGridRB.get() == &rButton;
@@ -481,6 +484,10 @@ IMPL_LINK(SwTextGridPage, GridTypeHdl, weld::Toggleable&, 
rButton, void)
         m_xCharWidthMF->set_sensitive(false);
     }
 
+    //recalc which dependencies are sensitive
+    if (!bNoGrid)
+        TextSizeChangedHdl(*m_xTextSizeMF);
+
     GridModifyHdl();
 }
 

Reply via email to