cui/source/dialogs/splitcelldlg.cxx         |    9 +++++----
 cui/source/inc/splitcelldlg.hxx             |    1 +
 cui/uiconfig/ui/splitcellsdialog.ui         |    4 ++--
 include/vcl/customweld.hxx                  |    2 --
 sc/source/ui/inc/scuitphfedit.hxx           |    3 +++
 sc/source/ui/pagedlg/scuitphfedit.cxx       |   21 ++++++++++++---------
 sc/uiconfig/scalc/ui/headerfootercontent.ui |    6 +++---
 7 files changed, 26 insertions(+), 20 deletions(-)

New commits:
commit 92d257cf7d67a6fa4b7ec23016b56bf226ba608b
Author:     Michael Weghorn <[email protected]>
AuthorDate: Mon Dec 16 21:44:20 2024 +0100
Commit:     Michael Weghorn <[email protected]>
CommitDate: Tue Dec 17 22:54:56 2024 +0100

    weld: Drop unused CustomWeld::{g,s}et_grid_left_attach
    
    It's currently unused, so drop it.
    If there's ever a need to adjust grid positions in the future,
    this should instead be done by calling the corresponding methods
    on the weld::Grid, see previous commit
    
        Change-Id: I67f5ea16b5108e8359820850f0815e34db439ef1
        Author: Michael Weghorn <[email protected]>
        Date:   Mon Dec 16 11:02:00 2024 +0100
    
            weld: Add weld::Grid to handle grid child positions
    
    for more background.
    
    Change-Id: Ia573a850d62233a0500b8d3b38f2ddd47c2ce680
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178622
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <[email protected]>

diff --git a/include/vcl/customweld.hxx b/include/vcl/customweld.hxx
index 580542b983f2..92e287231980 100644
--- a/include/vcl/customweld.hxx
+++ b/include/vcl/customweld.hxx
@@ -187,8 +187,6 @@ public:
     bool get_sensitive() const { return m_xDrawingArea->get_sensitive(); }
     bool get_visible() const { return m_xDrawingArea->get_visible(); }
     void set_visible(bool bVisible) { m_xDrawingArea->set_visible(bVisible); }
-    void set_grid_left_attach(int nAttach) { 
m_xDrawingArea->set_grid_left_attach(nAttach); }
-    int get_grid_left_attach() const { return 
m_xDrawingArea->get_grid_left_attach(); }
     void set_help_id(const OUString& rHelpId) { 
m_xDrawingArea->set_help_id(rHelpId); }
     void set_tooltip_text(const OUString& rTip) { 
m_xDrawingArea->set_tooltip_text(rTip); }
 };
commit 0ec855823a9449c9196ab0508470de3b043fea2f
Author:     Michael Weghorn <[email protected]>
AuthorDate: Mon Dec 16 21:28:21 2024 +0100
Commit:     Michael Weghorn <[email protected]>
CommitDate: Tue Dec 17 22:54:48 2024 +0100

    Fix and port ScHFEditPage grid handling to new API
    
    The code was calling weld::Widget::get_grid_left_attach
    and weld::Widget_set_grid_left_attach on the wrong widgets
    that are not direct children of the grid, but children
    of the grid children, triggering these warnings with
    gtk3:
    
        (soffice:1996241): Gtk-WARNING **: 21:10:33.461: 
../../../gtk/gtkcontainer.c:1206: container class 'GtkViewport' has no child 
property named 'left-attach'
    
        (soffice:1996241): Gtk-WARNING **: 21:10:33.461: 
../../../gtk/gtkcontainer.c:1206: container class 'GtkViewport' has no child 
property named 'left-attach'
    
        (soffice:1996241): Gtk-WARNING **: 21:10:33.461: 
../../../gtk/gtkcontainer.c:1348: container class 'GtkViewport' has no child 
property named 'left-attach'
    
        (soffice:1996241): Gtk-WARNING **: 21:10:33.461: 
../../../gtk/gtkcontainer.c:1348: container class 'GtkViewport' has no child 
property named 'left-attach'
    
        (soffice:1996241): Gtk-WARNING **: 21:10:33.472: 
../../../gtk/gtkcontainer.c:1206: container class 'GtkViewport' has no child 
property named 'left-attach'
    
        (soffice:1996241): Gtk-WARNING **: 21:10:33.472: 
../../../gtk/gtkcontainer.c:1206: container class 'GtkViewport' has no child 
property named 'left-attach'
    
        (soffice:1996241): Gtk-WARNING **: 21:10:33.472: 
../../../gtk/gtkcontainer.c:1348: container class 'GtkViewport' has no child 
property named 'left-attach'
    
        (soffice:1996241): Gtk-WARNING **: 21:10:33.472: 
../../../gtk/gtkcontainer.c:1348: container class 'GtkViewport' has no child 
property named 'left-attach'
    
    To trigger:
    
    * start Calc with the gtk3 VCL plugin and SAL_RTL_ENABLED=1
    * "Format" -> "Page Style"
    * select the "Header" tab page
    * click on the "Edit" button
    
    Fix this by assigning IDs for the GtkScrolledWindows that
    are actually the direct children of the grid and using these
    instead.
    
    Port to the new weld::Grid API instead of calling the
    methods directly on the weld::Widget children,
    see previous commit
    
        Change-Id: I67f5ea16b5108e8359820850f0815e34db439ef1
        Author: Michael Weghorn <[email protected]>
        Date:   Mon Dec 16 11:02:00 2024 +0100
    
            weld: Add weld::Grid to handle grid child positions
    
    for more background.
    
    Change-Id: I22c31a2f6b5eade56f6061023f5b914b615f4ba4
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178615
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <[email protected]>

diff --git a/sc/source/ui/inc/scuitphfedit.hxx 
b/sc/source/ui/inc/scuitphfedit.hxx
index 18c4f97f8caa..246f2bd49d95 100644
--- a/sc/source/ui/inc/scuitphfedit.hxx
+++ b/sc/source/ui/inc/scuitphfedit.hxx
@@ -84,7 +84,10 @@ private:
     std::unique_ptr<weld::Label> m_xFtCreatedBy;
     std::unique_ptr<weld::Label> m_xFtCustomized;
 
+    std::unique_ptr<weld::Grid> m_xAreaGrid;
+    std::unique_ptr<weld::Widget> m_xLeftScrolledWindow;
     std::unique_ptr<weld::Widget> m_xLeft;
+    std::unique_ptr<weld::Widget> m_xRightScrolledWindow;
     std::unique_ptr<weld::Widget> m_xRight;
 
     std::unique_ptr<ScEditWindow> m_xWndLeft;
diff --git a/sc/source/ui/pagedlg/scuitphfedit.cxx 
b/sc/source/ui/pagedlg/scuitphfedit.cxx
index 1178594b4092..ee9f21cbd9f6 100644
--- a/sc/source/ui/pagedlg/scuitphfedit.cxx
+++ b/sc/source/ui/pagedlg/scuitphfedit.cxx
@@ -63,7 +63,10 @@ ScHFEditPage::ScHFEditPage(weld::Container* pPage, 
weld::DialogController* pCont
     , m_xFtNone(m_xBuilder->weld_label(u"labelSTR_HF_NONE_IN_BRACKETS"_ustr))
     , m_xFtCreatedBy(m_xBuilder->weld_label(u"labelSTR_HF_CREATED_BY"_ustr))
     , m_xFtCustomized(m_xBuilder->weld_label(u"labelSTR_HF_CUSTOMIZED"_ustr))
+    , m_xAreaGrid(m_xBuilder->weld_grid(u"areagrid"_ustr))
+    , 
m_xLeftScrolledWindow(m_xBuilder->weld_widget(u"scrolledwindow_LEFT"_ustr))
     , m_xLeft(m_xBuilder->weld_widget(u"labelFT_LEFT"_ustr))
+    , 
m_xRightScrolledWindow(m_xBuilder->weld_widget(u"scrolledwindow_RIGHT"_ustr))
     , m_xRight(m_xBuilder->weld_widget(u"labelFT_RIGHT"_ustr))
     , m_xWndLeft(new ScEditWindow(Left, pController->getDialog()))
     , m_xWndCenter(new ScEditWindow(Center, pController->getDialog()))
@@ -99,15 +102,15 @@ ScHFEditPage::ScHFEditPage(weld::Container* pPage, 
weld::DialogController* pCont
     //swap left/right areas and their labels in RTL mode
     if( AllSettings::GetLayoutRTL() )
     {
-        sal_Int32 nOldLeftAttach = m_xLeft->get_grid_left_attach();
-        sal_Int32 nOldRightAttach = m_xRight->get_grid_left_attach();
-        m_xLeft->set_grid_left_attach(nOldRightAttach);
-        m_xRight->set_grid_left_attach(nOldLeftAttach);
-
-        nOldLeftAttach = m_xWndLeftWnd->get_grid_left_attach();
-        nOldRightAttach = m_xWndRightWnd->get_grid_left_attach();
-        m_xWndLeftWnd->set_grid_left_attach(nOldRightAttach);
-        m_xWndRightWnd->set_grid_left_attach(nOldLeftAttach);
+        sal_Int32 nOldLeftAttach = 
m_xAreaGrid->get_child_left_attach(*m_xLeft);
+        sal_Int32 nOldRightAttach = 
m_xAreaGrid->get_child_left_attach(*m_xRight);
+        m_xAreaGrid->set_child_left_attach(*m_xLeft, nOldRightAttach);
+        m_xAreaGrid->set_child_left_attach(*m_xRight, nOldLeftAttach);
+
+        nOldLeftAttach = 
m_xAreaGrid->get_child_left_attach(*m_xLeftScrolledWindow);
+        nOldRightAttach = 
m_xAreaGrid->get_child_left_attach(*m_xRightScrolledWindow);
+        m_xAreaGrid->set_child_left_attach(*m_xLeftScrolledWindow, 
nOldRightAttach);
+        m_xAreaGrid->set_child_left_attach(*m_xRightScrolledWindow, 
nOldLeftAttach);
     }
     m_xWndLeft->SetFont( rDefaultCellAttribute );
     m_xWndCenter->SetFont( rDefaultCellAttribute );
diff --git a/sc/uiconfig/scalc/ui/headerfootercontent.ui 
b/sc/uiconfig/scalc/ui/headerfootercontent.ui
index 7ee0baa4a6ac..cad629a5aecb 100644
--- a/sc/uiconfig/scalc/ui/headerfootercontent.ui
+++ b/sc/uiconfig/scalc/ui/headerfootercontent.ui
@@ -73,7 +73,7 @@
     <property name="spacing">6</property>
     <child>
       <!-- n-columns=3 n-rows=2 -->
-      <object class="GtkGrid" id="grid1">
+      <object class="GtkGrid" id="areagrid">
         <property name="visible">True</property>
         <property name="can-focus">False</property>
         <property name="row-spacing">12</property>
@@ -122,7 +122,7 @@
           </packing>
         </child>
         <child>
-          <object class="GtkScrolledWindow">
+          <object class="GtkScrolledWindow" id="scrolledwindow_LEFT">
             <property name="visible">True</property>
             <property name="can-focus">True</property>
             <property name="border-width">0</property>
@@ -182,7 +182,7 @@
           </packing>
         </child>
         <child>
-          <object class="GtkScrolledWindow">
+          <object class="GtkScrolledWindow" id="scrolledwindow_RIGHT">
             <property name="visible">True</property>
             <property name="can-focus">True</property>
             <property name="border-width">0</property>
commit 33d56b1cd6ee033fbb63501c799715ac0eebdfc4
Author:     Michael Weghorn <[email protected]>
AuthorDate: Mon Dec 16 20:58:25 2024 +0100
Commit:     Michael Weghorn <[email protected]>
CommitDate: Tue Dec 17 22:54:41 2024 +0100

    Port SvxSplitTableDlg to new weld::Grid API
    
    See previous commit
    
        Change-Id: I67f5ea16b5108e8359820850f0815e34db439ef1
        Author: Michael Weghorn <[email protected]>
        Date:   Mon Dec 16 11:02:00 2024 +0100
    
            weld: Add weld::Grid to handle grid child positions
    
    for more background.
    
    Change-Id: I82b5d9c6ac3577cf247c64b88466fb0b0ba3f877
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178614
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <[email protected]>

diff --git a/cui/source/dialogs/splitcelldlg.cxx 
b/cui/source/dialogs/splitcelldlg.cxx
index a734b69e732a..0d44106cc457 100644
--- a/cui/source/dialogs/splitcelldlg.cxx
+++ b/cui/source/dialogs/splitcelldlg.cxx
@@ -22,6 +22,7 @@
 SvxSplitTableDlg::SvxSplitTableDlg(weld::Window *pParent, bool 
bIsTableVertical, tools::Long nMaxVertical, tools::Long nMaxHorizontal)
     : GenericDialogController(pParent, u"cui/ui/splitcellsdialog.ui"_ustr, 
u"SplitCellsDialog"_ustr)
     , m_xCountEdit(m_xBuilder->weld_spin_button(u"countnf"_ustr))
+    , m_xGrid(m_xBuilder->weld_grid("directiongrid"))
     , m_xHorzBox(!bIsTableVertical ? 
m_xBuilder->weld_radio_button(u"hori"_ustr) : 
m_xBuilder->weld_radio_button(u"vert"_ustr))
     , m_xVertBox(!bIsTableVertical ? 
m_xBuilder->weld_radio_button(u"vert"_ustr) : 
m_xBuilder->weld_radio_button(u"hori"_ustr))
     , m_xPropCB(m_xBuilder->weld_check_button(u"prop"_ustr))
@@ -42,10 +43,10 @@ SvxSplitTableDlg::SvxSplitTableDlg(weld::Window *pParent, 
bool bIsTableVertical,
     //exchange the meaning of horizontal and vertical for vertical text
     if (bIsTableVertical)
     {
-        int nHorzTopAttach = m_xHorzBox->get_grid_top_attach();
-        int nVertTopAttach = m_xVertBox->get_grid_top_attach();
-        m_xHorzBox->set_grid_top_attach(nVertTopAttach);
-        m_xVertBox->set_grid_top_attach(nHorzTopAttach);
+        int nHorzTopAttach = m_xGrid->get_child_top_attach(*m_xHorzBox);
+        int nVertTopAttach = m_xGrid->get_child_top_attach(*m_xVertBox);
+        m_xGrid->set_child_top_attach(*m_xHorzBox, nVertTopAttach);
+        m_xGrid->set_child_top_attach(*m_xVertBox, nHorzTopAttach);
         m_xHorzBox->set_active(m_xVertBox->get_active());
     }
 }
diff --git a/cui/source/inc/splitcelldlg.hxx b/cui/source/inc/splitcelldlg.hxx
index ce14e0714a3e..1f7abe5b4ac7 100644
--- a/cui/source/inc/splitcelldlg.hxx
+++ b/cui/source/inc/splitcelldlg.hxx
@@ -25,6 +25,7 @@ class SvxSplitTableDlg : public weld::GenericDialogController
 {
 private:
     std::unique_ptr<weld::SpinButton> m_xCountEdit;
+    std::unique_ptr<weld::Grid> m_xGrid;
     std::unique_ptr<weld::RadioButton> m_xHorzBox;
     std::unique_ptr<weld::RadioButton> m_xVertBox;
     std::unique_ptr<weld::CheckButton> m_xPropCB;
diff --git a/cui/uiconfig/ui/splitcellsdialog.ui 
b/cui/uiconfig/ui/splitcellsdialog.ui
index a95e0613d977..07c7a650a9da 100644
--- a/cui/uiconfig/ui/splitcellsdialog.ui
+++ b/cui/uiconfig/ui/splitcellsdialog.ui
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.38.2 -->
+<!-- Generated with glade 3.40.0 -->
 <interface domain="cui">
   <requires lib="gtk+" version="3.20"/>
   <object class="GtkAdjustment" id="adjustment1">
@@ -153,7 +153,7 @@
                 <property name="shadow-type">none</property>
                 <child>
                   <!-- n-columns=2 n-rows=3 -->
-                  <object class="GtkGrid" id="grid2">
+                  <object class="GtkGrid" id="directiongrid">
                     <property name="visible">True</property>
                     <property name="can-focus">False</property>
                     <property name="margin-start">12</property>

Reply via email to