sw/source/ui/dbui/createaddresslistdialog.cxx |   14 +++++++-------
 sw/source/ui/dbui/mmaddressblockpage.cxx      |   22 +++++++++++-----------
 sw/source/ui/index/cnttab.cxx                 |    6 +++---
 sw/source/uibase/inc/swuicnttab.hxx           |    4 ++--
 4 files changed, 23 insertions(+), 23 deletions(-)

New commits:
commit d640f8e81b146d7012ec4b18dc908ad63e078f2b
Author:     Michael Weghorn <[email protected]>
AuthorDate: Mon Dec 16 22:54:44 2024 +0100
Commit:     Michael Weghorn <[email protected]>
CommitDate: Tue Dec 17 22:55:39 2024 +0100

    Port SwTOXWidget subclasses 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: I7d6d23f0d1fec640c1de38c896f3e9b7e06ed70f
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178633
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <[email protected]>

diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx
index cc7432867163..e25cfe0d052d 100644
--- a/sw/source/ui/index/cnttab.cxx
+++ b/sw/source/ui/index/cnttab.cxx
@@ -1581,7 +1581,7 @@ public:
 
     virtual void set_grid_left_attach(int nPos) override
     {
-        m_xEntry->set_grid_left_attach(nPos);
+        m_pParent->get_child_container()->set_child_left_attach(*m_xEntry, 
nPos);
     }
 
     virtual void get_extents_relative_to(weld::Widget& rRelative, int& x, int& 
y, int& width, int& height) override
@@ -1741,7 +1741,7 @@ public:
 
     virtual void set_grid_left_attach(int nPos) override
     {
-        m_xButton->set_grid_left_attach(nPos);
+        m_pParent->get_child_container()->set_child_left_attach(*m_xButton, 
nPos);
     }
 
     void get_extents_relative_to(weld::Widget& rRelative, int& x, int& y, int& 
width, int& height) override
@@ -2782,7 +2782,7 @@ 
SwTokenWindow::SwTokenWindow(std::unique_ptr<weld::Container> xParent)
     , m_xBuilder(Application::CreateBuilder(m_xParentWidget.get(), 
u"modules/swriter/ui/tokenwidget.ui"_ustr))
     , m_xContainer(m_xBuilder->weld_container(u"TokenWidget"_ustr))
     , m_xLeftScrollWin(m_xBuilder->weld_button(u"left"_ustr))
-    , m_xCtrlParentWin(m_xBuilder->weld_container(u"ctrl"_ustr))
+    , m_xCtrlParentWin(m_xBuilder->weld_grid(u"ctrl"_ustr))
     , m_xScrollWin(m_xBuilder->weld_scrolled_window(u"scrollwin"_ustr))
     , m_xRightScrollWin(m_xBuilder->weld_button(u"right"_ustr))
 {
diff --git a/sw/source/uibase/inc/swuicnttab.hxx 
b/sw/source/uibase/inc/swuicnttab.hxx
index 00d24d3c7c27..4c6f225e252e 100644
--- a/sw/source/uibase/inc/swuicnttab.hxx
+++ b/sw/source/uibase/inc/swuicnttab.hxx
@@ -248,7 +248,7 @@ class SwTokenWindow
     std::unique_ptr<weld::Builder> m_xBuilder;
     std::unique_ptr<weld::Container> m_xContainer;
     std::unique_ptr<weld::Button> m_xLeftScrollWin;
-    std::unique_ptr<weld::Container> m_xCtrlParentWin;
+    std::unique_ptr<weld::Grid> m_xCtrlParentWin;
     std::unique_ptr<weld::ScrolledWindow> m_xScrollWin;
     std::unique_ptr<weld::Button> m_xRightScrollWin;
     std::vector<std::unique_ptr<SwTOXWidget>> m_aControlList;
@@ -271,7 +271,7 @@ class SwTokenWindow
 
 public:
     SwTokenWindow(std::unique_ptr<weld::Container> xParent);
-    weld::Container* get_child_container() { return m_xCtrlParentWin.get(); }
+    weld::Grid* get_child_container() { return m_xCtrlParentWin.get(); }
     ~SwTokenWindow();
 
     void SetTabPage(SwTOXEntryTabPage *pParent) { m_pParent = pParent; }
commit c0a3f50bd97c1d3b7c908777e8082efdf1447021
Author:     Michael Weghorn <[email protected]>
AuthorDate: Mon Dec 16 22:45:43 2024 +0100
Commit:     Michael Weghorn <[email protected]>
CommitDate: Tue Dec 17 22:55:32 2024 +0100

    Port SwAssignFragment 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: I6ba9008c4ab9b049d9703c13c15d3df262436e26
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178632
    Reviewed-by: Michael Weghorn <[email protected]>
    Tested-by: Jenkins

diff --git a/sw/source/ui/dbui/mmaddressblockpage.cxx 
b/sw/source/ui/dbui/mmaddressblockpage.cxx
index 9fc7b57c71eb..8c88e5eb9d28 100644
--- a/sw/source/ui/dbui/mmaddressblockpage.cxx
+++ b/sw/source/ui/dbui/mmaddressblockpage.cxx
@@ -777,20 +777,20 @@ struct SwAssignFragment
     std::unique_ptr<weld::ComboBox> m_xComboBox;
     std::unique_ptr<weld::Label> m_xPreview;
 
-    SwAssignFragment(weld::Container* pGrid, int nLine)
+    SwAssignFragment(weld::Grid* pGrid, int nLine)
         : m_xBuilder(Application::CreateBuilder(pGrid, 
u"modules/swriter/ui/assignfragment.ui"_ustr))
         , m_xLabel(m_xBuilder->weld_label(u"label"_ustr))
         , m_xComboBox(m_xBuilder->weld_combo_box(u"combobox"_ustr))
         , m_xPreview(m_xBuilder->weld_label(u"preview"_ustr))
     {
-        m_xLabel->set_grid_left_attach(0);
-        m_xLabel->set_grid_top_attach(nLine);
+        pGrid->set_child_left_attach(*m_xLabel, 0);
+        pGrid->set_child_top_attach(*m_xLabel, nLine);
 
-        m_xComboBox->set_grid_left_attach(1);
-        m_xComboBox->set_grid_top_attach(nLine);
+        pGrid->set_child_left_attach(*m_xComboBox, 1);
+        pGrid->set_child_top_attach(*m_xComboBox, nLine);
 
-        m_xPreview->set_grid_left_attach(2);
-        m_xPreview->set_grid_top_attach(nLine);
+        pGrid->set_child_left_attach(*m_xPreview, 2);
+        pGrid->set_child_top_attach(*m_xPreview, nLine);
     }
 };
 
@@ -800,7 +800,7 @@ class SwAssignFieldsControl
 {
     friend class SwAssignFieldsDialog;
     std::unique_ptr<weld::ScrolledWindow> m_xVScroll;
-    std::unique_ptr<weld::Container> m_xGrid;
+    std::unique_ptr<weld::Grid> m_xGrid;
 
     std::vector<SwAssignFragment> m_aFields;
 
@@ -814,7 +814,7 @@ class SwAssignFieldsControl
     void MakeVisible(const tools::Rectangle & rRect);
 public:
     SwAssignFieldsControl(std::unique_ptr<weld::ScrolledWindow> xWindow,
-                          std::unique_ptr<weld::Container> xGrid);
+                          std::unique_ptr<weld::Grid> xGrid);
 
     void Init(SwAssignFieldsDialog* pDialog, SwMailMergeConfigItem& 
rConfigItem);
     void SetModifyHdl(const Link<LinkParamNone*,void>& rModifyHdl)
@@ -825,7 +825,7 @@ public:
 };
 
 
SwAssignFieldsControl::SwAssignFieldsControl(std::unique_ptr<weld::ScrolledWindow>
 xWindow,
-                                             std::unique_ptr<weld::Container> 
xGrid)
+                                             std::unique_ptr<weld::Grid> xGrid)
     : m_xVScroll(std::move(xWindow))
     , m_xGrid(std::move(xGrid))
     , m_rConfigItem(nullptr)
@@ -984,7 +984,7 @@ SwAssignFieldsDialog::SwAssignFieldsDialog(
     , m_xOK(m_xBuilder->weld_button(u"ok"_ustr))
     , m_xPreviewWin(new weld::CustomWeld(*m_xBuilder, u"PREVIEW"_ustr, 
*m_xPreview))
     , m_xFieldsControl(new 
SwAssignFieldsControl(m_xBuilder->weld_scrolled_window(u"scroll"_ustr),
-                                                 
m_xBuilder->weld_container(u"FIELDS"_ustr)))
+                                                 
m_xBuilder->weld_grid(u"FIELDS"_ustr)))
 {
     
m_xPreviewWin->set_size_request(m_xMatchingFI->get_approximate_digit_width() * 
45,
                                     m_xMatchingFI->get_text_height() * 5);
commit c29f7a7ab36b762c60199e1e9fa55c80f88b3f7a
Author:     Michael Weghorn <[email protected]>
AuthorDate: Mon Dec 16 22:30:04 2024 +0100
Commit:     Michael Weghorn <[email protected]>
CommitDate: Tue Dec 17 22:55:24 2024 +0100

    Port SwAddressFragment 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: I1ee227fbf9eaa4048e1a9c86ae0280ef473d6af7
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178631
    Reviewed-by: Michael Weghorn <[email protected]>
    Tested-by: Jenkins

diff --git a/sw/source/ui/dbui/createaddresslistdialog.cxx 
b/sw/source/ui/dbui/createaddresslistdialog.cxx
index 26c538c9a667..2fb50dc90121 100644
--- a/sw/source/ui/dbui/createaddresslistdialog.cxx
+++ b/sw/source/ui/dbui/createaddresslistdialog.cxx
@@ -50,17 +50,17 @@ struct SwAddressFragment
     std::unique_ptr<weld::Entry> m_xEntry;
     weld::Container* m_pGrid;
 
-    SwAddressFragment(weld::Container* pGrid, int nLine)
+    SwAddressFragment(weld::Grid* pGrid, int nLine)
         : m_xBuilder(Application::CreateBuilder(pGrid, 
u"modules/swriter/ui/addressfragment.ui"_ustr))
         , m_xLabel(m_xBuilder->weld_label(u"label"_ustr))
         , m_xEntry(m_xBuilder->weld_entry(u"entry"_ustr))
         , m_pGrid(pGrid)
     {
-        m_xLabel->set_grid_left_attach(0);
-        m_xLabel->set_grid_top_attach(nLine);
+        pGrid->set_child_left_attach(*m_xLabel, 0);
+        pGrid->set_child_top_attach(*m_xLabel, nLine);
 
-        m_xEntry->set_grid_left_attach(1);
-        m_xEntry->set_grid_top_attach(nLine);
+        pGrid->set_child_left_attach(*m_xEntry, 1);
+        pGrid->set_child_top_attach(*m_xEntry, nLine);
     }
 
     ~SwAddressFragment()
@@ -82,7 +82,7 @@ class SwAddressControl_Impl
     bool                            m_bNoDataSet;
 
     std::unique_ptr<weld::ScrolledWindow> m_xScrollBar;
-    std::unique_ptr<weld::Container> m_xWindow;
+    std::unique_ptr<weld::Grid> m_xWindow;
     std::vector<std::unique_ptr<SwAddressFragment>> m_aLines;
 
     DECL_LINK(GotFocusHdl_Impl, weld::Widget&, void);
@@ -106,7 +106,7 @@ SwAddressControl_Impl::SwAddressControl_Impl(weld::Builder& 
rBuilder)
     , m_nCurrentDataSet(0)
     , m_bNoDataSet(true)
     , m_xScrollBar(rBuilder.weld_scrolled_window(u"scrollwin"_ustr))
-    , m_xWindow(rBuilder.weld_container(u"CONTAINER"_ustr))
+    , m_xWindow(rBuilder.weld_grid(u"CONTAINER"_ustr))
 {
 }
 

Reply via email to