include/vcl/weld.hxx                  |   30 +--
 sw/uiconfig/swriter/ui/inserttable.ui |  265 ++++++++++++++++------------------
 vcl/qt5/QtInstanceLabel.cxx           |   31 +++
 vcl/qt5/QtInstanceSpinButton.cxx      |    8 -
 vcl/source/app/salvtables.cxx         |    8 -
 vcl/unx/gtk3/gtkinst.cxx              |    8 -
 6 files changed, 188 insertions(+), 162 deletions(-)

New commits:
commit 663077c0c3c6621a9ed61e880228c15541893ced
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Mon Feb 17 22:09:58 2025 +0100
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Tue Feb 18 09:00:00 2025 +0100

    sw: Resave inserttable.ui with glade 3.40
    
    This is Writer's "Table" -> "Insert Table" dialog.
    
    Change-Id: I232feaa5fd18d313b05588c4c5634d038811845e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181807
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>
    Tested-by: Jenkins

diff --git a/sw/uiconfig/swriter/ui/inserttable.ui 
b/sw/uiconfig/swriter/ui/inserttable.ui
index 5e5f8b20d13d..5811b95f4ab4 100644
--- a/sw/uiconfig/swriter/ui/inserttable.ui
+++ b/sw/uiconfig/swriter/ui/inserttable.ui
@@ -1,27 +1,27 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.36.0 -->
+<!-- Generated with glade 3.40.0 -->
 <interface domain="sw">
   <requires lib="gtk+" version="3.20"/>
   <object class="GtkAdjustment" id="adjustment1">
     <property name="lower">1</property>
     <property name="upper">2000000</property>
     <property name="value">2</property>
-    <property name="step_increment">1</property>
-    <property name="page_increment">10</property>
+    <property name="step-increment">1</property>
+    <property name="page-increment">10</property>
   </object>
   <object class="GtkAdjustment" id="adjustment2">
     <property name="lower">1</property>
     <property name="upper">2000000</property>
     <property name="value">2</property>
-    <property name="step_increment">1</property>
-    <property name="page_increment">10</property>
+    <property name="step-increment">1</property>
+    <property name="page-increment">10</property>
   </object>
   <object class="GtkAdjustment" id="adjustment3">
     <property name="lower">1</property>
     <property name="upper">99</property>
     <property name="value">1</property>
-    <property name="step_increment">1</property>
-    <property name="page_increment">10</property>
+    <property name="step-increment">1</property>
+    <property name="page-increment">10</property>
   </object>
   <object class="GtkTreeStore" id="liststore1">
     <columns>
@@ -32,30 +32,30 @@
     </columns>
   </object>
   <object class="GtkDialog" id="InsertTableDialog">
-    <property name="can_focus">False</property>
-    <property name="border_width">6</property>
+    <property name="can-focus">False</property>
+    <property name="border-width">6</property>
     <property name="title" translatable="yes" 
context="inserttable|InsertTableDialog">Insert Table</property>
     <property name="modal">True</property>
-    <property name="default_width">0</property>
-    <property name="default_height">0</property>
-    <property name="type_hint">dialog</property>
+    <property name="default-width">0</property>
+    <property name="default-height">0</property>
+    <property name="type-hint">dialog</property>
     <child internal-child="vbox">
       <object class="GtkBox" id="dialog-vbox1">
-        <property name="can_focus">False</property>
+        <property name="can-focus">False</property>
         <property name="orientation">vertical</property>
         <property name="spacing">12</property>
         <child internal-child="action_area">
           <object class="GtkButtonBox" id="dialog-action_area1">
-            <property name="can_focus">False</property>
-            <property name="layout_style">end</property>
+            <property name="can-focus">False</property>
+            <property name="layout-style">end</property>
             <child>
               <object class="GtkButton" id="ok">
                 <property name="label" translatable="yes" 
context="inserttable|ok">Insert</property>
                 <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="can_default">True</property>
-                <property name="has_default">True</property>
-                <property name="receives_default">True</property>
+                <property name="can-focus">True</property>
+                <property name="can-default">True</property>
+                <property name="has-default">True</property>
+                <property name="receives-default">True</property>
                 <child internal-child="accessible">
                   <object class="AtkObject" id="ok-atkobject">
                     <property name="AtkObject::accessible-description" 
translatable="yes" context="inserttable|extended_tip|ok">Saves all changes and 
closes dialog.</property>
@@ -72,8 +72,8 @@
               <object class="GtkButton" id="cancel">
                 <property name="label" translatable="yes" 
context="stock">_Cancel</property>
                 <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
+                <property name="can-focus">True</property>
+                <property name="receives-default">True</property>
                 <property name="use-underline">True</property>
                 <child internal-child="accessible">
                   <object class="AtkObject" id="cancel-atkobject">
@@ -91,8 +91,8 @@
               <object class="GtkButton" id="help">
                 <property name="label" translatable="yes" 
context="stock">_Help</property>
                 <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
+                <property name="can-focus">True</property>
+                <property name="receives-default">True</property>
                 <property name="use-underline">True</property>
               </object>
               <packing>
@@ -106,14 +106,14 @@
           <packing>
             <property name="expand">False</property>
             <property name="fill">True</property>
-            <property name="pack_type">end</property>
+            <property name="pack-type">end</property>
             <property name="position">0</property>
           </packing>
         </child>
         <child>
           <object class="GtkBox" id="box3">
             <property name="visible">True</property>
-            <property name="can_focus">False</property>
+            <property name="can-focus">False</property>
             <property name="hexpand">True</property>
             <property name="vexpand">True</property>
             <property name="orientation">vertical</property>
@@ -121,26 +121,26 @@
             <child>
               <object class="GtkFrame" id="frame3">
                 <property name="visible">True</property>
-                <property name="can_focus">False</property>
+                <property name="can-focus">False</property>
                 <property name="hexpand">True</property>
-                <property name="label_xalign">0</property>
-                <property name="shadow_type">none</property>
+                <property name="label-xalign">0</property>
+                <property name="shadow-type">none</property>
                 <child>
-                  <!-- n-columns=1 n-rows=1 -->
+                  <!-- n-columns=4 n-rows=3 -->
                   <object class="GtkGrid" id="grid2">
                     <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="hexpand">True</property>
-                    <property name="row_spacing">6</property>
-                    <property name="column_spacing">12</property>
+                    <property name="can-focus">False</property>
                     <property name="margin-start">12</property>
                     <property name="margin-top">6</property>
+                    <property name="hexpand">True</property>
+                    <property name="row-spacing">6</property>
+                    <property name="column-spacing">12</property>
                     <child>
                       <object class="GtkEntry" id="nameedit">
                         <property name="visible">True</property>
-                        <property name="can_focus">True</property>
+                        <property name="can-focus">True</property>
                         <property name="hexpand">True</property>
-                        <property name="activates_default">True</property>
+                        <property name="activates-default">True</property>
                         <property name="truncate-multiline">True</property>
                         <child internal-child="accessible">
                           <object class="AtkObject" id="nameedit-atkobject">
@@ -149,47 +149,47 @@
                         </child>
                       </object>
                       <packing>
-                        <property name="left_attach">1</property>
-                        <property name="top_attach">0</property>
+                        <property name="left-attach">1</property>
+                        <property name="top-attach">0</property>
                         <property name="width">3</property>
                       </packing>
                     </child>
                     <child>
                       <object class="GtkLabel" id="label3">
                         <property name="visible">True</property>
-                        <property name="can_focus">False</property>
+                        <property name="can-focus">False</property>
                         <property name="label" translatable="yes" 
context="inserttable|label3">_Name:</property>
-                        <property name="use_underline">True</property>
-                        <property name="mnemonic_widget">nameedit</property>
+                        <property name="use-underline">True</property>
+                        <property name="mnemonic-widget">nameedit</property>
                         <property name="xalign">0</property>
                       </object>
                       <packing>
-                        <property name="left_attach">0</property>
-                        <property name="top_attach">0</property>
+                        <property name="left-attach">0</property>
+                        <property name="top-attach">0</property>
                       </packing>
                     </child>
                     <child>
                       <object class="GtkLabel" id="3">
                         <property name="visible">True</property>
-                        <property name="can_focus">False</property>
+                        <property name="can-focus">False</property>
                         <property name="label" translatable="yes" 
context="inserttable|3">_Columns:</property>
-                        <property name="use_underline">True</property>
-                        <property name="mnemonic_widget">colspin</property>
+                        <property name="use-underline">True</property>
+                        <property name="mnemonic-widget">colspin</property>
                         <property name="xalign">0</property>
                       </object>
                       <packing>
-                        <property name="left_attach">0</property>
-                        <property name="top_attach">1</property>
+                        <property name="left-attach">0</property>
+                        <property name="top-attach">1</property>
                       </packing>
                     </child>
                     <child>
                       <object class="GtkSpinButton" id="colspin">
                         <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="activates_default">True</property>
+                        <property name="can-focus">True</property>
+                        <property name="activates-default">True</property>
+                        <property name="truncate-multiline">True</property>
                         <property name="adjustment">adjustment1</property>
                         <property name="value">2</property>
-                        <property name="truncate-multiline">True</property>
                         <child internal-child="accessible">
                           <object class="AtkObject" id="colspin-atkobject">
                             <property name="AtkObject::accessible-description" 
translatable="yes" context="inserttable|extended_tip|colspin">Enter the number 
of columns that you want in the table.</property>
@@ -197,32 +197,32 @@
                         </child>
                       </object>
                       <packing>
-                        <property name="left_attach">1</property>
-                        <property name="top_attach">1</property>
+                        <property name="left-attach">1</property>
+                        <property name="top-attach">1</property>
                       </packing>
                     </child>
                     <child>
                       <object class="GtkLabel" id="4">
                         <property name="visible">True</property>
-                        <property name="can_focus">False</property>
+                        <property name="can-focus">False</property>
                         <property name="label" translatable="yes" 
context="inserttable|4">_Rows:</property>
-                        <property name="use_underline">True</property>
-                        <property name="mnemonic_widget">rowspin</property>
+                        <property name="use-underline">True</property>
+                        <property name="mnemonic-widget">rowspin</property>
                         <property name="xalign">1</property>
                       </object>
                       <packing>
-                        <property name="left_attach">2</property>
-                        <property name="top_attach">1</property>
+                        <property name="left-attach">2</property>
+                        <property name="top-attach">1</property>
                       </packing>
                     </child>
                     <child>
                       <object class="GtkSpinButton" id="rowspin">
                         <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="activates_default">True</property>
+                        <property name="can-focus">True</property>
+                        <property name="activates-default">True</property>
+                        <property name="truncate-multiline">True</property>
                         <property name="adjustment">adjustment2</property>
                         <property name="value">2</property>
-                        <property name="truncate-multiline">True</property>
                         <child internal-child="accessible">
                           <object class="AtkObject" id="rowspin-atkobject">
                             <property name="AtkObject::accessible-description" 
translatable="yes" context="inserttable|extended_tip|rowspin">Enter the number 
of rows that you want in the table.</property>
@@ -230,21 +230,21 @@
                         </child>
                       </object>
                       <packing>
-                        <property name="left_attach">3</property>
-                        <property name="top_attach">1</property>
+                        <property name="left-attach">3</property>
+                        <property name="top-attach">1</property>
                       </packing>
                     </child>
                     <child>
                       <object class="GtkLabel" id="lbwarning">
-                        <property name="can_focus">False</property>
+                        <property name="can-focus">False</property>
                         <property name="label" translatable="yes" 
context="inserttable|lbwarning">Warning : Large tables may adversely affect 
performance and compatibility</property>
                         <attributes>
-                          <attribute name="scale" value="0.9"/>
+                          <attribute name="scale" value="0.90000000000000002"/>
                         </attributes>
                       </object>
                       <packing>
-                        <property name="left_attach">0</property>
-                        <property name="top_attach">2</property>
+                        <property name="left-attach">0</property>
+                        <property name="top-attach">2</property>
                         <property name="width">4</property>
                       </packing>
                     </child>
@@ -253,7 +253,7 @@
                 <child type="label">
                   <object class="GtkLabel" id="label1">
                     <property name="visible">True</property>
-                    <property name="can_focus">False</property>
+                    <property name="can-focus">False</property>
                     <property name="label" translatable="yes" 
context="inserttable|label1">General</property>
                     <attributes>
                       <attribute name="weight" value="bold"/>
@@ -270,29 +270,29 @@
             <child>
               <object class="GtkFrame" id="frame2">
                 <property name="visible">True</property>
-                <property name="can_focus">False</property>
+                <property name="can-focus">False</property>
                 <property name="hexpand">True</property>
                 <property name="vexpand">True</property>
-                <property name="label_xalign">0</property>
-                <property name="shadow_type">none</property>
+                <property name="label-xalign">0</property>
+                <property name="shadow-type">none</property>
                 <child>
-                  <!-- n-columns=1 n-rows=1 -->
+                  <!-- n-columns=1 n-rows=4 -->
                   <object class="GtkGrid" id="grid4">
                     <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="hexpand">True</property>
-                    <property name="vexpand">True</property>
-                    <property name="row_spacing">6</property>
+                    <property name="can-focus">False</property>
                     <property name="margin-start">12</property>
                     <property name="margin-top">6</property>
+                    <property name="hexpand">True</property>
+                    <property name="vexpand">True</property>
+                    <property name="row-spacing">6</property>
                     <child>
                       <object class="GtkCheckButton" id="headercb">
                         <property name="label" translatable="yes" 
context="inserttable|headercb">Hea_ding</property>
                         <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="receives_default">False</property>
-                        <property name="use_underline">True</property>
-                        <property name="draw_indicator">True</property>
+                        <property name="can-focus">True</property>
+                        <property name="receives-default">False</property>
+                        <property name="use-underline">True</property>
+                        <property name="draw-indicator">True</property>
                         <child internal-child="accessible">
                           <object class="AtkObject" id="headercb-atkobject">
                             <property name="AtkObject::accessible-description" 
translatable="yes" context="inserttable|extended_tip|headercb">Includes a 
heading row in the table.</property>
@@ -300,8 +300,8 @@
                         </child>
                       </object>
                       <packing>
-                        <property name="left_attach">0</property>
-                        <property name="top_attach">0</property>
+                        <property name="left-attach">0</property>
+                        <property name="top-attach">0</property>
                       </packing>
                     </child>
                     <child>
@@ -309,12 +309,12 @@
                         <property name="label" translatable="yes" 
context="inserttable|repeatcb">Repeat heading rows on new _pages</property>
                         <property name="visible">True</property>
                         <property name="sensitive">False</property>
-                        <property name="can_focus">True</property>
-                        <property name="receives_default">False</property>
+                        <property name="can-focus">True</property>
+                        <property name="receives-default">False</property>
                         <property name="margin-start">12</property>
-                        <property name="use_underline">True</property>
+                        <property name="use-underline">True</property>
                         <property name="active">True</property>
-                        <property name="draw_indicator">True</property>
+                        <property name="draw-indicator">True</property>
                         <child internal-child="accessible">
                           <object class="AtkObject" id="repeatcb-atkobject">
                             <property name="AtkObject::accessible-description" 
translatable="yes" context="inserttable|extended_tip|repeatcb">Repeats the 
heading of the table at the top of subsequent page if the table spans more than 
one page.</property>
@@ -322,18 +322,18 @@
                         </child>
                       </object>
                       <packing>
-                        <property name="left_attach">0</property>
-                        <property name="top_attach">1</property>
+                        <property name="left-attach">0</property>
+                        <property name="top-attach">1</property>
                       </packing>
                     </child>
                     <child>
                       <object class="GtkCheckButton" id="dontsplitcb">
                         <property name="label" translatable="yes" 
context="inserttable|dontsplitcb">Don’t _split table over pages</property>
                         <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="receives_default">False</property>
-                        <property name="use_underline">True</property>
-                        <property name="draw_indicator">True</property>
+                        <property name="can-focus">True</property>
+                        <property name="receives-default">False</property>
+                        <property name="use-underline">True</property>
+                        <property name="draw-indicator">True</property>
                         <child internal-child="accessible">
                           <object class="AtkObject" id="dontsplitcb-atkobject">
                             <property name="AtkObject::accessible-description" 
translatable="yes" context="inserttable|extended_tip|dontsplitcb">Prevents the 
table from spanning more than one page.</property>
@@ -341,26 +341,26 @@
                         </child>
                       </object>
                       <packing>
-                        <property name="left_attach">0</property>
-                        <property name="top_attach">3</property>
+                        <property name="left-attach">0</property>
+                        <property name="top-attach">3</property>
                       </packing>
                     </child>
                     <child>
-                      <!-- n-columns=1 n-rows=1 -->
+                      <!-- n-columns=2 n-rows=1 -->
                       <object class="GtkGrid" id="repeatgroup">
                         <property name="visible">True</property>
-                        <property name="can_focus">False</property>
+                        <property name="can-focus">False</property>
                         <property name="valign">start</property>
                         <property name="margin-start">30</property>
-                        <property name="column_spacing">12</property>
+                        <property name="column-spacing">12</property>
                         <child>
                           <object class="GtkSpinButton" id="repeatheaderspin">
                             <property name="visible">True</property>
-                            <property name="can_focus">True</property>
-                            <property name="activates_default">True</property>
+                            <property name="can-focus">True</property>
+                            <property name="activates-default">True</property>
+                            <property name="truncate-multiline">True</property>
                             <property name="adjustment">adjustment3</property>
                             <property name="value">1</property>
-                            <property name="truncate-multiline">True</property>
                             <child internal-child="accessible">
                               <object class="AtkObject" 
id="repeatheaderspin-atkobject">
                                 <property 
name="AtkObject::accessible-description" translatable="yes" 
context="inserttable|extended_tip|repeatheaderspin">Select the number of rows 
that you want to use for the heading.</property>
@@ -368,27 +368,27 @@
                             </child>
                           </object>
                           <packing>
-                            <property name="left_attach">1</property>
-                            <property name="top_attach">0</property>
+                            <property name="left-attach">1</property>
+                            <property name="top-attach">0</property>
                           </packing>
                         </child>
                         <child>
                           <object class="GtkLabel" id="repeatheaderafter">
                             <property name="visible">True</property>
-                            <property name="can_focus">False</property>
+                            <property name="can-focus">False</property>
                             <property name="label" translatable="yes" 
context="inserttable|repeatheaderafter">Heading ro_ws:</property>
-                            <property name="use_underline">True</property>
-                            <property 
name="mnemonic_widget">repeatheaderspin</property>
+                            <property name="use-underline">True</property>
+                            <property 
name="mnemonic-widget">repeatheaderspin</property>
                           </object>
                           <packing>
-                            <property name="left_attach">0</property>
-                            <property name="top_attach">0</property>
+                            <property name="left-attach">0</property>
+                            <property name="top-attach">0</property>
                           </packing>
                         </child>
                       </object>
                       <packing>
-                        <property name="left_attach">0</property>
-                        <property name="top_attach">2</property>
+                        <property name="left-attach">0</property>
+                        <property name="top-attach">2</property>
                       </packing>
                     </child>
                   </object>
@@ -396,7 +396,7 @@
                 <child type="label">
                   <object class="GtkLabel" id="label2">
                     <property name="visible">True</property>
-                    <property name="can_focus">False</property>
+                    <property name="can-focus">False</property>
                     <property name="label" translatable="yes" 
context="inserttable|label2">Options</property>
                     <attributes>
                       <attribute name="weight" value="bold"/>
@@ -413,26 +413,26 @@
             <child>
               <object class="GtkFrame" id="stylesframe">
                 <property name="visible">True</property>
-                <property name="can_focus">False</property>
+                <property name="can-focus">False</property>
                 <property name="hexpand">True</property>
                 <property name="vexpand">True</property>
-                <property name="label_xalign">0</property>
-                <property name="shadow_type">none</property>
+                <property name="label-xalign">0</property>
+                <property name="shadow-type">none</property>
                 <child>
-                  <!-- n-columns=1 n-rows=1 -->
+                  <!-- n-columns=2 n-rows=1 -->
                   <object class="GtkGrid" id="grid1">
                     <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="hexpand">True</property>
-                    <property name="vexpand">True</property>
-                    <property name="row_spacing">6</property>
-                    <property name="column_spacing">6</property>
+                    <property name="can-focus">False</property>
                     <property name="margin-start">12</property>
                     <property name="margin-top">6</property>
+                    <property name="hexpand">True</property>
+                    <property name="vexpand">True</property>
+                    <property name="row-spacing">6</property>
+                    <property name="column-spacing">6</property>
                     <child>
                       <object class="GtkDrawingArea" id="previewinstable">
                         <property name="visible">True</property>
-                        <property name="can_focus">False</property>
+                        <property name="can-focus">False</property>
                         <property name="hexpand">True</property>
                         <property name="vexpand">True</property>
                         <child internal-child="accessible">
@@ -442,28 +442,28 @@
                         </child>
                       </object>
                       <packing>
-                        <property name="left_attach">1</property>
-                        <property name="top_attach">0</property>
+                        <property name="left-attach">1</property>
+                        <property name="top-attach">0</property>
                       </packing>
                     </child>
                     <child>
                       <object class="GtkScrolledWindow">
                         <property name="visible">True</property>
-                        <property name="can_focus">True</property>
+                        <property name="can-focus">True</property>
                         <property name="hexpand">True</property>
                         <property name="vexpand">True</property>
-                        <property name="shadow_type">in</property>
+                        <property name="shadow-type">in</property>
                         <child>
                           <object class="GtkTreeView" id="formatlbinstable">
                             <property name="visible">True</property>
-                            <property name="can_focus">True</property>
+                            <property name="can-focus">True</property>
                             <property name="hexpand">True</property>
                             <property name="vexpand">True</property>
                             <property name="model">liststore1</property>
-                            <property name="headers_visible">False</property>
-                            <property name="headers_clickable">False</property>
-                            <property name="search_column">0</property>
-                            <property name="show_expanders">False</property>
+                            <property name="headers-visible">False</property>
+                            <property name="headers-clickable">False</property>
+                            <property name="search-column">0</property>
+                            <property name="show-expanders">False</property>
                             <child internal-child="selection">
                               <object class="GtkTreeSelection"/>
                             </child>
@@ -486,8 +486,8 @@
                         </child>
                       </object>
                       <packing>
-                        <property name="left_attach">0</property>
-                        <property name="top_attach">0</property>
+                        <property name="left-attach">0</property>
+                        <property name="top-attach">0</property>
                       </packing>
                     </child>
                   </object>
@@ -495,7 +495,7 @@
                 <child type="label">
                   <object class="GtkLabel" id="lbTableStyle">
                     <property name="visible">True</property>
-                    <property name="can_focus">False</property>
+                    <property name="can-focus">False</property>
                     <property name="label" translatable="yes" 
context="inserttable|lbTableStyle">Styles</property>
                     <attributes>
                       <attribute name="weight" value="bold"/>
@@ -523,9 +523,6 @@
       <action-widget response="-6">cancel</action-widget>
       <action-widget response="-11">help</action-widget>
     </action-widgets>
-    <child type="titlebar">
-      <placeholder/>
-    </child>
     <child internal-child="accessible">
       <object class="AtkObject" id="InsertTableDialog-atkobject">
         <property name="AtkObject::accessible-description" translatable="yes" 
context="inserttable|extended_tip|InsertTableDialog">Inserts a table into the 
document. You can also click the arrow, drag to select the number of rows and 
columns to include in the table, and then click in the last cell.</property>
commit 4a1a26e2a29f1c501cc61c23cb7ac556c1034b96
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Mon Feb 17 22:05:05 2025 +0100
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Tue Feb 18 08:59:53 2025 +0100

    tdf#130857 qt weld: Implement QtInstanceLabel::set_label_type
    
    This is e.g. used by Writer's "Table" -> "Insert Table"
    dialog (for which support will be declared in an upcoming
    commit) to show a warning when a large number is set for
    rows or columns.
    
    Implement similar to GtkInstanceLabel::set_label_type by
    setting specific font and background colors.
    
    Change-Id: I1e4c1863261cfd7f37f0bf80803fd97062c5604c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181806
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>
    Tested-by: Jenkins

diff --git a/vcl/qt5/QtInstanceLabel.cxx b/vcl/qt5/QtInstanceLabel.cxx
index ec6775ea6106..47f4dbfe4a68 100644
--- a/vcl/qt5/QtInstanceLabel.cxx
+++ b/vcl/qt5/QtInstanceLabel.cxx
@@ -48,7 +48,36 @@ void QtInstanceLabel::set_mnemonic_widget(Widget* pTarget)
 
 void QtInstanceLabel::set_font(const vcl::Font&) { assert(false && "Not 
implemented yet"); }
 
-void QtInstanceLabel::set_label_type(weld::LabelType) { assert(false && "Not 
implemented yet"); }
+void QtInstanceLabel::set_label_type(weld::LabelType eType)
+{
+    SolarMutexGuard g;
+
+    GetQtInstance().RunInMainThread([&] {
+        switch (eType)
+        {
+            case weld::LabelType::Normal:
+            {
+                // reset to default QLabel colors
+                QLabel aLabel;
+                QPalette aPalette = aLabel.palette();
+                
set_background(toColor(aPalette.color(getQWidget()->backgroundRole())));
+                setFontColor(toColor(aPalette.color(aLabel.backgroundRole())));
+                break;
+            }
+            case weld::LabelType::Warning:
+                
set_background(Application::GetSettings().GetStyleSettings().GetWarningColor());
+                
setFontColor(Application::GetSettings().GetStyleSettings().GetWarningTextColor());
+                break;
+            case weld::LabelType::Error:
+                
set_background(Application::GetSettings().GetStyleSettings().GetErrorColor());
+                
setFontColor(Application::GetSettings().GetStyleSettings().GetErrorTextColor());
+                break;
+            case weld::LabelType::Title:
+                
setFontColor(Application::GetSettings().GetStyleSettings().GetLightColor());
+                break;
+        }
+    });
+}
 
 void QtInstanceLabel::set_font_color(const Color& rColor) { 
setFontColor(rColor); }
 
commit ef38373275008740d1090fa1a1a59e1832ea40a9
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Mon Feb 17 18:55:31 2025 +0100
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Tue Feb 18 08:59:46 2025 +0100

    weld: Switch SpinButton::{format_text,parse_value} to double
    
    In line with the earlier commit
    
        Change-Id: I31bc2b95b46bae8174388cddc9a383ed61e6763e
        Author: Michael Weghorn <m.wegh...@posteo.de>
        Date:   Mon Feb 17 13:10:16 2025 +0100
    
            tdf#130857 Pass double values to/from weld::SpinButton subclasses
    
    , switch also the params/return values for
    weld::SpinButton::format_value and
    weld::SpinButton::parse_text from sal_Int64
    to double, because those methods are called
    from the subclasses that otherwise use floating
    point values (double) and don't need to deal
    with conversion between sal_Int64 and floating
    point values, depending on the number of decimals
    that are set for the SpinButton.
    Instead do the conversion in those methods now.
    
    Rename weld::SpinButton::format_value to
    weld::SpinButton::format_floating_point_value
    for clarity.
    
    Make weld::SpinButton::convert_double_to_value
    and weld::SpinButton::convert_value_to_double
    private, as the subclasses no longer need them
    any more, the weld::SpinButton base class takes
    care of all conversion between sal_Int64 and
    double now.
    
    Change-Id: I3ff01295799e3ead8b1fbec8c3b9ad3afdea993a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181805
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>
    Tested-by: Jenkins

diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx
index 98b23e092ce9..638d5d5e3f70 100644
--- a/include/vcl/weld.hxx
+++ b/include/vcl/weld.hxx
@@ -1859,6 +1859,17 @@ class VCL_DLLPUBLIC SpinButton : virtual public Entry
     Link<sal_Int64, OUString> m_aFormatValueHdl;
     Link<const OUString&, std::optional<int>> m_aParseTextHdl;
 
+    // helper methods to convert between sal_Int64 value and
+    // floating point number it represents (depending on get_digits())
+    double convert_value_to_double(sal_Int64 nValue) const
+    {
+        return static_cast<double>(nValue) / Power10(get_digits());
+    }
+    sal_Int64 convert_double_to_value(double fDouble) const
+    {
+        return basegfx::fround64(fDouble * Power10(get_digits()));
+    }
+
 protected:
     void signal_value_changed() { m_aValueChangedHdl.Call(*this); }
 
@@ -1867,11 +1878,11 @@ protected:
      *  and that one gets returned.
      *  Otherwise, an empty std::optional is returned.
      */
-    std::optional<OUString> format_value(sal_Int64 nValue)
+    std::optional<OUString> format_floating_point_value(double fValue)
     {
         if (!m_aFormatValueHdl.IsSet())
             return {};
-        const OUString sText = m_aFormatValueHdl.Call(nValue);
+        const OUString sText = 
m_aFormatValueHdl.Call(convert_double_to_value(fValue));
         return sText;
     }
 
@@ -1882,7 +1893,7 @@ protected:
      *  cannot be parsed.
      *  Returns <a>TRISTATE_INDET</a> if no custom input handler is set.
      */
-    TriState parse_text(const OUString& rText, int* result)
+    TriState parse_text(const OUString& rText, double* pResult)
     {
         if (!m_aParseTextHdl.IsSet())
             return TRISTATE_INDET;
@@ -1890,21 +1901,10 @@ protected:
         if (!aValue.has_value())
             return TRISTATE_FALSE;
 
-        *result = aValue.value();
+        *pResult = convert_value_to_double(aValue.value());
         return TRISTATE_TRUE;
     }
 
-    // helper methods to convert between sal_Int64 value and
-    // floating point number it represents (depending on get_digits())
-    double convert_value_to_double(sal_Int64 nValue) const
-    {
-        return static_cast<double>(nValue) / Power10(get_digits());
-    }
-    sal_Int64 convert_double_to_value(double fDouble) const
-    {
-        return basegfx::fround64(fDouble * Power10(get_digits()));
-    }
-
     // methods to implement in subclasses which use floating point values 
directly;
     // public methods using sal_Int64 values whose floating point value 
depends on get_digits()
     // take care of conversion
diff --git a/vcl/qt5/QtInstanceSpinButton.cxx b/vcl/qt5/QtInstanceSpinButton.cxx
index fc35b30ebff2..98cc11262c30 100644
--- a/vcl/qt5/QtInstanceSpinButton.cxx
+++ b/vcl/qt5/QtInstanceSpinButton.cxx
@@ -36,7 +36,7 @@ QtInstanceSpinButton::QtInstanceSpinButton(QtDoubleSpinBox* 
pSpinBox)
 
     // set functions to convert between value and formatted text
     m_pSpinBox->setFormatValueFunction(
-        [this](double fValue) { return 
format_value(convert_double_to_value(fValue)); });
+        [this](double fValue) { return format_floating_point_value(fValue); });
     m_pSpinBox->setParseTextFunction(
         [this](const QString& rText) { return convertTextToDouble(rText); });
 }
@@ -109,10 +109,10 @@ unsigned int QtInstanceSpinButton::get_digits() const
 
 std::optional<double> QtInstanceSpinButton::convertTextToDouble(const QString& 
rText)
 {
-    int nValue = 0;
-    TriState eState = parse_text(toOUString(rText), &nValue);
+    double fValue = 0;
+    TriState eState = parse_text(toOUString(rText), &fValue);
     if (eState == TRISTATE_TRUE)
-        return std::optional<double>(convert_value_to_double(nValue));
+        return std::optional<double>(fValue);
 
     return {};
 }
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index e997a64ea8d2..926274d38a30 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -5933,7 +5933,7 @@ IMPL_LINK_NOARG(SalInstanceSpinButton, LoseFocusHdl, 
Control&, void) { signal_va
 
 IMPL_LINK_NOARG(SalInstanceSpinButton, OutputHdl, LinkParamNone*, bool)
 {
-    std::optional<OUString> aText = format_value(get_value());
+    std::optional<OUString> aText = 
format_floating_point_value(get_floating_point_value());
     if (!aText.has_value())
         return false;
 
@@ -5943,10 +5943,10 @@ IMPL_LINK_NOARG(SalInstanceSpinButton, OutputHdl, 
LinkParamNone*, bool)
 
 IMPL_LINK(SalInstanceSpinButton, InputHdl, double*, pResult, TriState)
 {
-    int nResult;
-    TriState eRet = parse_text(get_text(), &nResult);
+    double fResult;
+    TriState eRet = parse_text(get_text(), &fResult);
     if (eRet == TRISTATE_TRUE)
-        *pResult = convert_value_to_double(nResult);
+        *pResult = fResult;
     return eRet;
 }
 
diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx
index 7edf22c210fd..a95f3888abe7 100644
--- a/vcl/unx/gtk3/gtkinst.cxx
+++ b/vcl/unx/gtk3/gtkinst.cxx
@@ -17657,7 +17657,7 @@ private:
         if (m_bBlockOutput)
             return true;
         m_bFormatting = true;
-        std::optional<OUString> aText = format_value(get_value());
+        std::optional<OUString> aText = 
format_floating_point_value(get_floating_point_value());
         if (aText.has_value())
             set_text(aText.value());
         m_bFormatting = false;
@@ -17675,13 +17675,13 @@ private:
     {
         GtkInstanceSpinButton* pThis = 
static_cast<GtkInstanceSpinButton*>(widget);
         SolarMutexGuard aGuard;
-        int result;
-        TriState eHandled = pThis->parse_text(pThis->get_text(), &result);
+        double fResult;
+        TriState eHandled = pThis->parse_text(pThis->get_text(), &fResult);
         if (eHandled == TRISTATE_INDET)
             return 0;
         if (eHandled == TRISTATE_TRUE)
         {
-            *new_value = pThis->convert_value_to_double(result);
+            *new_value = fResult;
             return 1;
         }
         return GTK_INPUT_ERROR;

Reply via email to