sw/source/ui/config/optpage.cxx          |   49 ++++++++
 sw/source/uibase/inc/optpage.hxx         |   10 +
 sw/uiconfig/swriter/ui/optfonttabpage.ui |  172 +++++++++++++++++++++++++++----
 3 files changed, 213 insertions(+), 18 deletions(-)

New commits:
commit 4cf54aa70a73b000c6dbf604a2d69f287644756e
Author:     Balazs Varga <balazs.varga.ext...@allotropia.de>
AuthorDate: Mon Nov 13 14:39:42 2023 +0100
Commit:     Balazs Varga <balazs.varga.ext...@allotropia.de>
CommitDate: Tue Nov 14 08:21:54 2023 +0100

    tdf#158010 - UI: Part 25 - Unify lockdown behavior of Options dialog
    
    for Writer - Basic Fonts Page.
    
    Change-Id: I73276c0bf3dc190098781e427cf32c753aae23ff
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159377
    Tested-by: Jenkins
    Reviewed-by: Balazs Varga <balazs.varga.ext...@allotropia.de>

diff --git a/sw/source/ui/config/optpage.cxx b/sw/source/ui/config/optpage.cxx
index 5628f2b1570a..1abc9d46d334 100644
--- a/sw/source/ui/config/optpage.cxx
+++ b/sw/source/ui/config/optpage.cxx
@@ -653,15 +653,25 @@ SwStdFontTabPage::SwStdFontTabPage(weld::Container* 
pPage, weld::DialogControlle
     , m_sScriptComplex(SwResId(ST_SCRIPT_CTL))
     , m_xLabelFT(m_xBuilder->weld_label("label1"))
     , m_xStandardBox(m_xBuilder->weld_combo_box("standardbox"))
+    , m_xStandardBoxImg(m_xBuilder->weld_widget("lockstandardbox"))
     , m_xStandardHeightLB(new 
FontSizeBox(m_xBuilder->weld_combo_box("standardheight")))
+    , m_xStandardHeightImg(m_xBuilder->weld_widget("lockstandardheight"))
     , m_xTitleBox(m_xBuilder->weld_combo_box("titlebox"))
+    , m_xTitleBoxImg(m_xBuilder->weld_widget("locktitlebox"))
     , m_xTitleHeightLB(new 
FontSizeBox(m_xBuilder->weld_combo_box("titleheight")))
+    , m_xTitleHeightImg(m_xBuilder->weld_widget("locktitleheight"))
     , m_xListBox(m_xBuilder->weld_combo_box("listbox"))
+    , m_xListBoxImg(m_xBuilder->weld_widget("locklistbox"))
     , m_xListHeightLB(new 
FontSizeBox(m_xBuilder->weld_combo_box("listheight")))
+    , m_xListHeightImg(m_xBuilder->weld_widget("locklistheight"))
     , m_xLabelBox(m_xBuilder->weld_combo_box("labelbox"))
+    , m_xLabelBoxImg(m_xBuilder->weld_widget("locklabelbox"))
     , m_xLabelHeightLB(new 
FontSizeBox(m_xBuilder->weld_combo_box("labelheight")))
+    , m_xLabelHeightImg(m_xBuilder->weld_widget("locklabelheight"))
     , m_xIdxBox(m_xBuilder->weld_combo_box("idxbox"))
+    , m_xIdxBoxImg(m_xBuilder->weld_widget("lockidxbox"))
     , m_xIndexHeightLB(new 
FontSizeBox(m_xBuilder->weld_combo_box("indexheight")))
+    , m_xIndexHeightImg(m_xBuilder->weld_widget("lockindexheight"))
     , m_xStandardPB(m_xBuilder->weld_button("standard"))
 {
     m_xStandardBox->make_sorted();
@@ -1036,6 +1046,45 @@ void SwStdFontTabPage::Reset( const SfxItemSet* rSet)
     m_xLabelHeightLB->set_value( CalcToPoint( nLabelHeight   , 
MapUnit::MapTwip, 10 ));
     m_xIndexHeightLB->set_value( CalcToPoint( nIndexHeight   , 
MapUnit::MapTwip, 10 ));
 
+
+    if (m_nFontGroup == FONT_GROUP_DEFAULT)
+    {
+        bool bReadonly = 
officecfg::Office::Writer::DefaultFont::Standard::isReadOnly();
+        m_xStandardBox->set_sensitive(!bReadonly);
+        m_xStandardBoxImg->set_visible(bReadonly);
+        bReadonly = 
officecfg::Office::Writer::DefaultFont::StandardHeight::isReadOnly();
+        m_xStandardHeightLB->set_sensitive(!bReadonly);
+        m_xStandardHeightImg->set_visible(bReadonly);
+
+        bReadonly = 
officecfg::Office::Writer::DefaultFont::Heading::isReadOnly();
+        m_xTitleBox->set_sensitive(!bReadonly);
+        m_xTitleBoxImg->set_visible(bReadonly);
+        bReadonly = 
officecfg::Office::Writer::DefaultFont::HeadingHeight::isReadOnly();
+        m_xTitleHeightLB->set_sensitive(!bReadonly);
+        m_xTitleHeightImg->set_visible(bReadonly);
+
+        bReadonly = officecfg::Office::Writer::DefaultFont::List::isReadOnly();
+        m_xListBox->set_sensitive(!bReadonly);
+        m_xListBoxImg->set_visible(bReadonly);
+        bReadonly = 
officecfg::Office::Writer::DefaultFont::ListHeight::isReadOnly();
+        m_xListHeightLB->set_sensitive(!bReadonly);
+        m_xListHeightImg->set_visible(bReadonly);
+
+        bReadonly = 
officecfg::Office::Writer::DefaultFont::Caption::isReadOnly();
+        m_xLabelBox->set_sensitive(!bReadonly);
+        m_xLabelBoxImg->set_visible(bReadonly);
+        bReadonly = 
officecfg::Office::Writer::DefaultFont::CaptionHeight::isReadOnly();
+        m_xLabelHeightLB->set_sensitive(!bReadonly);
+        m_xLabelHeightImg->set_visible(bReadonly);
+
+        bReadonly = 
officecfg::Office::Writer::DefaultFont::Index::isReadOnly();
+        m_xIdxBox->set_sensitive(!bReadonly);
+        m_xIdxBoxImg->set_visible(bReadonly);
+        bReadonly = 
officecfg::Office::Writer::DefaultFont::IndexHeight::isReadOnly();
+        m_xIndexHeightLB->set_sensitive(!bReadonly);
+        m_xIndexHeightImg->set_visible(bReadonly);
+    }
+
     m_xStandardBox->save_value();
     m_xTitleBox->save_value();
     m_xListBox->save_value();
diff --git a/sw/source/uibase/inc/optpage.hxx b/sw/source/uibase/inc/optpage.hxx
index 89a4c150f2e8..6e3a7cbb797b 100644
--- a/sw/source/uibase/inc/optpage.hxx
+++ b/sw/source/uibase/inc/optpage.hxx
@@ -170,15 +170,25 @@ class SwStdFontTabPage final : public SfxTabPage
 
     std::unique_ptr<weld::Label> m_xLabelFT;
     std::unique_ptr<weld::ComboBox> m_xStandardBox;
+    std::unique_ptr<weld::Widget> m_xStandardBoxImg;
     std::unique_ptr<FontSizeBox> m_xStandardHeightLB;
+    std::unique_ptr<weld::Widget> m_xStandardHeightImg;
     std::unique_ptr<weld::ComboBox> m_xTitleBox;
+    std::unique_ptr<weld::Widget> m_xTitleBoxImg;
     std::unique_ptr<FontSizeBox> m_xTitleHeightLB;
+    std::unique_ptr<weld::Widget> m_xTitleHeightImg;
     std::unique_ptr<weld::ComboBox> m_xListBox;
+    std::unique_ptr<weld::Widget> m_xListBoxImg;
     std::unique_ptr<FontSizeBox> m_xListHeightLB;
+    std::unique_ptr<weld::Widget> m_xListHeightImg;
     std::unique_ptr<weld::ComboBox> m_xLabelBox;
+    std::unique_ptr<weld::Widget> m_xLabelBoxImg;
     std::unique_ptr<FontSizeBox> m_xLabelHeightLB;
+    std::unique_ptr<weld::Widget> m_xLabelHeightImg;
     std::unique_ptr<weld::ComboBox> m_xIdxBox;
+    std::unique_ptr<weld::Widget> m_xIdxBoxImg;
     std::unique_ptr<FontSizeBox> m_xIndexHeightLB;
+    std::unique_ptr<weld::Widget> m_xIndexHeightImg;
     std::unique_ptr<weld::Button> m_xStandardPB;
 
     DECL_LINK(StandardHdl, weld::Button&, void );
diff --git a/sw/uiconfig/swriter/ui/optfonttabpage.ui 
b/sw/uiconfig/swriter/ui/optfonttabpage.ui
index f3c8475500a1..a211d741a312 100644
--- a/sw/uiconfig/swriter/ui/optfonttabpage.ui
+++ b/sw/uiconfig/swriter/ui/optfonttabpage.ui
@@ -18,7 +18,7 @@
         <property name="label-xalign">0</property>
         <property name="shadow-type">none</property>
         <child>
-          <!-- n-columns=3 n-rows=6 -->
+          <!-- n-columns=5 n-rows=6 -->
           <object class="GtkGrid" id="grid1">
             <property name="visible">True</property>
             <property name="can-focus">False</property>
@@ -36,7 +36,7 @@
                 <property name="xalign">0</property>
               </object>
               <packing>
-                <property name="left-attach">1</property>
+                <property name="left-attach">2</property>
                 <property name="top-attach">0</property>
               </packing>
             </child>
@@ -50,7 +50,7 @@
                 <property name="xalign">0</property>
               </object>
               <packing>
-                <property name="left-attach">2</property>
+                <property name="left-attach">4</property>
                 <property name="top-attach">0</property>
               </packing>
             </child>
@@ -64,7 +64,7 @@
                 <property name="xalign">0</property>
               </object>
               <packing>
-                <property name="left-attach">0</property>
+                <property name="left-attach">1</property>
                 <property name="top-attach">1</property>
               </packing>
             </child>
@@ -78,7 +78,7 @@
                 <property name="xalign">0</property>
               </object>
               <packing>
-                <property name="left-attach">0</property>
+                <property name="left-attach">1</property>
                 <property name="top-attach">2</property>
               </packing>
             </child>
@@ -92,7 +92,7 @@
                 <property name="xalign">0</property>
               </object>
               <packing>
-                <property name="left-attach">0</property>
+                <property name="left-attach">1</property>
                 <property name="top-attach">3</property>
               </packing>
             </child>
@@ -106,7 +106,7 @@
                 <property name="xalign">0</property>
               </object>
               <packing>
-                <property name="left-attach">0</property>
+                <property name="left-attach">1</property>
                 <property name="top-attach">4</property>
               </packing>
             </child>
@@ -120,7 +120,7 @@
                 <property name="xalign">0</property>
               </object>
               <packing>
-                <property name="left-attach">0</property>
+                <property name="left-attach">1</property>
                 <property name="top-attach">5</property>
               </packing>
             </child>
@@ -144,7 +144,7 @@
                 </child>
               </object>
               <packing>
-                <property name="left-attach">1</property>
+                <property name="left-attach">2</property>
                 <property name="top-attach">1</property>
               </packing>
             </child>
@@ -168,7 +168,7 @@
                 </child>
               </object>
               <packing>
-                <property name="left-attach">1</property>
+                <property name="left-attach">2</property>
                 <property name="top-attach">2</property>
               </packing>
             </child>
@@ -192,7 +192,7 @@
                 </child>
               </object>
               <packing>
-                <property name="left-attach">1</property>
+                <property name="left-attach">2</property>
                 <property name="top-attach">3</property>
               </packing>
             </child>
@@ -216,7 +216,7 @@
                 </child>
               </object>
               <packing>
-                <property name="left-attach">1</property>
+                <property name="left-attach">2</property>
                 <property name="top-attach">4</property>
               </packing>
             </child>
@@ -240,7 +240,7 @@
                 </child>
               </object>
               <packing>
-                <property name="left-attach">1</property>
+                <property name="left-attach">2</property>
                 <property name="top-attach">5</property>
               </packing>
             </child>
@@ -263,7 +263,7 @@
                 </child>
               </object>
               <packing>
-                <property name="left-attach">2</property>
+                <property name="left-attach">4</property>
                 <property name="top-attach">1</property>
               </packing>
             </child>
@@ -286,7 +286,7 @@
                 </child>
               </object>
               <packing>
-                <property name="left-attach">2</property>
+                <property name="left-attach">4</property>
                 <property name="top-attach">2</property>
               </packing>
             </child>
@@ -309,7 +309,7 @@
                 </child>
               </object>
               <packing>
-                <property name="left-attach">2</property>
+                <property name="left-attach">4</property>
                 <property name="top-attach">3</property>
               </packing>
             </child>
@@ -332,7 +332,7 @@
                 </child>
               </object>
               <packing>
-                <property name="left-attach">2</property>
+                <property name="left-attach">4</property>
                 <property name="top-attach">4</property>
               </packing>
             </child>
@@ -355,10 +355,146 @@
                 </child>
               </object>
               <packing>
-                <property name="left-attach">2</property>
+                <property name="left-attach">4</property>
                 <property name="top-attach">5</property>
               </packing>
             </child>
+            <child>
+              <object class="GtkImage" id="lockstandardbox">
+                <property name="can-focus">False</property>
+                <property name="no-show-all">True</property>
+                <property name="halign">center</property>
+                <property name="valign">center</property>
+                <property name="icon-name">res/lock.png</property>
+              </object>
+              <packing>
+                <property name="left-attach">0</property>
+                <property name="top-attach">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkImage" id="locktitlebox">
+                <property name="can-focus">False</property>
+                <property name="no-show-all">True</property>
+                <property name="halign">center</property>
+                <property name="valign">center</property>
+                <property name="icon-name">res/lock.png</property>
+              </object>
+              <packing>
+                <property name="left-attach">0</property>
+                <property name="top-attach">2</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkImage" id="locklistbox">
+                <property name="can-focus">False</property>
+                <property name="no-show-all">True</property>
+                <property name="halign">center</property>
+                <property name="valign">center</property>
+                <property name="icon-name">res/lock.png</property>
+              </object>
+              <packing>
+                <property name="left-attach">0</property>
+                <property name="top-attach">3</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkImage" id="locklabelbox">
+                <property name="can-focus">False</property>
+                <property name="no-show-all">True</property>
+                <property name="halign">center</property>
+                <property name="valign">center</property>
+                <property name="icon-name">res/lock.png</property>
+              </object>
+              <packing>
+                <property name="left-attach">0</property>
+                <property name="top-attach">4</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkImage" id="lockidxbox">
+                <property name="can-focus">False</property>
+                <property name="no-show-all">True</property>
+                <property name="halign">center</property>
+                <property name="valign">center</property>
+                <property name="icon-name">res/lock.png</property>
+              </object>
+              <packing>
+                <property name="left-attach">0</property>
+                <property name="top-attach">5</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkImage" id="lockstandardheight">
+                <property name="can-focus">False</property>
+                <property name="no-show-all">True</property>
+                <property name="halign">center</property>
+                <property name="valign">center</property>
+                <property name="icon-name">res/lock.png</property>
+              </object>
+              <packing>
+                <property name="left-attach">3</property>
+                <property name="top-attach">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkImage" id="locktitleheight">
+                <property name="can-focus">False</property>
+                <property name="no-show-all">True</property>
+                <property name="halign">center</property>
+                <property name="valign">center</property>
+                <property name="icon-name">res/lock.png</property>
+              </object>
+              <packing>
+                <property name="left-attach">3</property>
+                <property name="top-attach">2</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkImage" id="locklistheight">
+                <property name="can-focus">False</property>
+                <property name="no-show-all">True</property>
+                <property name="halign">center</property>
+                <property name="valign">center</property>
+                <property name="icon-name">res/lock.png</property>
+              </object>
+              <packing>
+                <property name="left-attach">3</property>
+                <property name="top-attach">3</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkImage" id="locklabelheight">
+                <property name="can-focus">False</property>
+                <property name="no-show-all">True</property>
+                <property name="halign">center</property>
+                <property name="valign">center</property>
+                <property name="icon-name">res/lock.png</property>
+              </object>
+              <packing>
+                <property name="left-attach">3</property>
+                <property name="top-attach">4</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkImage" id="lockindexheight">
+                <property name="can-focus">False</property>
+                <property name="no-show-all">True</property>
+                <property name="halign">center</property>
+                <property name="valign">center</property>
+                <property name="icon-name">res/lock.png</property>
+              </object>
+              <packing>
+                <property name="left-attach">3</property>
+                <property name="top-attach">5</property>
+              </packing>
+            </child>
+            <child>
+              <placeholder/>
+            </child>
+            <child>
+              <placeholder/>
+            </child>
             <child>
               <placeholder/>
             </child>

Reply via email to