sc/source/ui/condformat/condformatdlg.cxx      |    4 ++--
 sc/source/ui/condformat/condformatdlgentry.cxx |   25 +++++++++++++++----------
 sc/source/ui/inc/condformatdlg.hxx             |    6 +++---
 sc/source/ui/inc/condformatdlgentry.hxx        |    4 ++--
 sc/source/ui/inc/datafdlg.hxx                  |    2 +-
 sc/source/ui/inc/viewfunc.hxx                  |    2 +-
 sc/source/ui/miscdlgs/datafdlg.cxx             |   12 ++++++------
 7 files changed, 30 insertions(+), 25 deletions(-)

New commits:
commit e23046a56df98b384eb400b631a9d45c2fc996f2
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Mon Dec 16 22:25:32 2024 +0100
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Tue Dec 17 22:55:17 2024 +0100

    Port ScDataFormFragment to new weld::Grid API
    
    See previous commit
    
        Change-Id: I67f5ea16b5108e8359820850f0815e34db439ef1
        Author: Michael Weghorn <m.wegh...@posteo.de>
        Date:   Mon Dec 16 11:02:00 2024 +0100
    
            weld: Add weld::Grid to handle grid child positions
    
    for more background.
    
    Change-Id: I1e0202182dc1f4f3136cfcabdb451ab52ee17294
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178625
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>

diff --git a/sc/source/ui/inc/datafdlg.hxx b/sc/source/ui/inc/datafdlg.hxx
index cb61d0cc3cc5..20be6d271c59 100644
--- a/sc/source/ui/inc/datafdlg.hxx
+++ b/sc/source/ui/inc/datafdlg.hxx
@@ -41,7 +41,7 @@ private:
     std::unique_ptr<weld::Button> m_xBtnNext;
     std::unique_ptr<weld::Button> m_xBtnClose;
     std::unique_ptr<weld::ScrolledWindow> m_xSlider;
-    std::unique_ptr<weld::Container> m_xGrid;
+    std::unique_ptr<weld::Grid> m_xGrid;
     std::unique_ptr<weld::Label> m_xFixedText;
     std::vector<std::unique_ptr<ScDataFormFragment>> m_aEntries;
 
diff --git a/sc/source/ui/inc/viewfunc.hxx b/sc/source/ui/inc/viewfunc.hxx
index 501772c93828..fed6b7fcf592 100644
--- a/sc/source/ui/inc/viewfunc.hxx
+++ b/sc/source/ui/inc/viewfunc.hxx
@@ -64,7 +64,7 @@ struct ScDataFormFragment
     std::unique_ptr<weld::Label> m_xLabel;
     std::unique_ptr<weld::Entry> m_xEdit;
 
-    ScDataFormFragment(weld::Container* pGrid, int nLine);
+    ScDataFormFragment(weld::Grid* pGrid, int nLine);
 };
 
 class ScViewFunc : public ScTabView
diff --git a/sc/source/ui/miscdlgs/datafdlg.cxx 
b/sc/source/ui/miscdlgs/datafdlg.cxx
index 3c6670109446..fb7a95ea1f84 100644
--- a/sc/source/ui/miscdlgs/datafdlg.cxx
+++ b/sc/source/ui/miscdlgs/datafdlg.cxx
@@ -34,7 +34,7 @@ ScDataFormDlg::ScDataFormDlg(weld::Window* pParent, 
ScTabViewShell* pTabViewShel
     , m_xBtnNext(m_xBuilder->weld_button(u"next"_ustr))
     , m_xBtnClose(m_xBuilder->weld_button(u"close"_ustr))
     , m_xSlider(m_xBuilder->weld_scrolled_window(u"scrollbar"_ustr, true))
-    , m_xGrid(m_xBuilder->weld_container(u"grid"_ustr))
+    , m_xGrid(m_xBuilder->weld_grid(u"grid"_ustr))
     , m_xFixedText(m_xBuilder->weld_label(u"label"_ustr))
 {
     sNewRecord = m_xFixedText->get_label();
@@ -340,16 +340,16 @@ void ScDataFormDlg::SetButtonState()
         m_aEntries[0]->m_xEdit->grab_focus();
 }
 
-ScDataFormFragment::ScDataFormFragment(weld::Container* pGrid, int nLine)
+ScDataFormFragment::ScDataFormFragment(weld::Grid* pGrid, int nLine)
     : m_xBuilder(Application::CreateBuilder(pGrid, 
u"modules/scalc/ui/dataformfragment.ui"_ustr))
     , m_xLabel(m_xBuilder->weld_label(u"label"_ustr))
     , m_xEdit(m_xBuilder->weld_entry(u"entry"_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_xEdit->set_grid_left_attach(1);
-    m_xEdit->set_grid_top_attach(nLine);
+    pGrid->set_child_left_attach(*m_xEdit, 1);
+    pGrid->set_child_top_attach(*m_xEdit, nLine);
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 219084b9f3668d5b1012f6a737dde975bc8bf739
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Mon Dec 16 22:18:39 2024 +0100
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Tue Dec 17 22:55:09 2024 +0100

    Port ScIconSetFrmtDataEntry to new weld::Grid API
    
    See previous commit
    
        Change-Id: I67f5ea16b5108e8359820850f0815e34db439ef1
        Author: Michael Weghorn <m.wegh...@posteo.de>
        Date:   Mon Dec 16 11:02:00 2024 +0100
    
            weld: Add weld::Grid to handle grid child positions
    
    for more background.
    
    Change-Id: I310bade49f4732e1da34486dcfb2dc23a3c3ae0f
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178624
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>

diff --git a/sc/source/ui/condformat/condformatdlgentry.cxx 
b/sc/source/ui/condformat/condformatdlgentry.cxx
index 87c43cfc416a..b9594afd9adc 100644
--- a/sc/source/ui/condformat/condformatdlgentry.cxx
+++ b/sc/source/ui/condformat/condformatdlgentry.cxx
@@ -1340,18 +1340,18 @@ private:
     std::unique_ptr<weld::Label> mxFtEntry;
     std::unique_ptr<weld::Entry> mxEdEntry;
     std::unique_ptr<weld::ComboBox> mxLbEntryType;
-    weld::Container* mpContainer;
+    weld::Grid* mpParentGrid;
 
 public:
-    ScIconSetFrmtDataEntry(weld::Container* pParent, ScIconSetType eType, 
const ScDocument& rDoc,
+    ScIconSetFrmtDataEntry(weld::Grid* pParent, ScIconSetType eType, const 
ScDocument& rDoc,
             sal_Int32 i, const ScColorScaleEntry* pEntry = nullptr);
     ~ScIconSetFrmtDataEntry();
     void Show() { mxGrid->show(); }
     void Hide() { mxGrid->hide(); }
     void set_grid_top_attach(int nTop)
     {
-        mxGrid->set_grid_left_attach(0);
-        mxGrid->set_grid_top_attach(nTop);
+        mpParentGrid->set_child_left_attach(*mxGrid, 0);
+        mpParentGrid->set_child_top_attach(*mxGrid, nTop);
     }
 
     ScColorScaleEntry* CreateEntry(ScDocument& rDoc, const ScAddress& rPos) 
const;
@@ -1359,14 +1359,14 @@ public:
     void SetFirstEntry();
 };
 
-ScIconSetFrmtDataEntry::ScIconSetFrmtDataEntry(weld::Container* pParent, 
ScIconSetType eType, const ScDocument& rDoc, sal_Int32 i, const 
ScColorScaleEntry* pEntry)
+ScIconSetFrmtDataEntry::ScIconSetFrmtDataEntry(weld::Grid* pParent, 
ScIconSetType eType, const ScDocument& rDoc, sal_Int32 i, const 
ScColorScaleEntry* pEntry)
     : mxBuilder(Application::CreateBuilder(pParent, 
u"modules/scalc/ui/conditionaliconset.ui"_ustr))
     , mxGrid(mxBuilder->weld_container(u"ConditionalIconSet"_ustr))
     , mxImgIcon(mxBuilder->weld_image(u"icon"_ustr))
     , mxFtEntry(mxBuilder->weld_label("label"))
     , mxEdEntry(mxBuilder->weld_entry(u"entry"_ustr))
     , mxLbEntryType(mxBuilder->weld_combo_box(u"listbox"_ustr))
-    , mpContainer(pParent)
+    , mpParentGrid(pParent)
 {
     mxImgIcon->set_from_icon_name(ScIconSetFormat::getIconName(eType, i));
     if(pEntry)
@@ -1404,7 +1404,7 @@ 
ScIconSetFrmtDataEntry::ScIconSetFrmtDataEntry(weld::Container* pParent, ScIconS
 
 ScIconSetFrmtDataEntry::~ScIconSetFrmtDataEntry()
 {
-    mpContainer->move(mxGrid.get(), nullptr);
+    mpParentGrid->move(mxGrid.get(), nullptr);
 }
 
 ScColorScaleEntry* ScIconSetFrmtDataEntry::CreateEntry(ScDocument& rDoc, const 
ScAddress& rPos) const
@@ -1454,7 +1454,7 @@ ScIconSetFrmtEntry::ScIconSetFrmtEntry(ScCondFormatList* 
pParent, ScDocument& rD
     : ScCondFrmtEntry(pParent, rDoc, rPos)
     , mxLbColorFormat(mxBuilder->weld_combo_box(u"colorformat"_ustr))
     , mxLbIconSetType(mxBuilder->weld_combo_box(u"iconsettype"_ustr))
-    , mxIconParent(mxBuilder->weld_container(u"iconparent"_ustr))
+    , mxIconParent(mxBuilder->weld_grid(u"iconparent"_ustr))
 {
     mxLbColorFormat->set_size_request(CommonWidgetWidth, -1);
     mxLbIconSetType->set_size_request(CommonWidgetWidth, -1);
diff --git a/sc/source/ui/inc/condformatdlgentry.hxx 
b/sc/source/ui/inc/condformatdlgentry.hxx
index 77976c9584e5..d3210b824212 100644
--- a/sc/source/ui/inc/condformatdlgentry.hxx
+++ b/sc/source/ui/inc/condformatdlgentry.hxx
@@ -308,7 +308,7 @@ class ScIconSetFrmtEntry : public ScCondFrmtEntry
     // icon set ui elements
     std::unique_ptr<weld::ComboBox> mxLbIconSetType;
 
-    std::unique_ptr<weld::Container> mxIconParent;
+    std::unique_ptr<weld::Grid> mxIconParent;
 
     typedef std::vector<std::unique_ptr<ScIconSetFrmtDataEntry>> 
ScIconSetFrmtDataEntriesType;
     ScIconSetFrmtDataEntriesType maEntries;
commit 3ff0a96bfa734c841572c756b47bc5730f8b646a
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Mon Dec 16 22:06:50 2024 +0100
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Tue Dec 17 22:55:03 2024 +0100

    Port ScCondFrmtEntry to new weld::Grid API
    
    See previous commit
    
        Change-Id: I67f5ea16b5108e8359820850f0815e34db439ef1
        Author: Michael Weghorn <m.wegh...@posteo.de>
        Date:   Mon Dec 16 11:02:00 2024 +0100
    
            weld: Add weld::Grid to handle grid child positions
    
    for more background.
    
    Change-Id: I0d808c4738e14321c9d0a9b022abd4d215030910
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178623
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>

diff --git a/sc/source/ui/condformat/condformatdlg.cxx 
b/sc/source/ui/condformat/condformatdlg.cxx
index dc65664f4498..c38a8c7e06ea 100644
--- a/sc/source/ui/condformat/condformatdlg.cxx
+++ b/sc/source/ui/condformat/condformatdlg.cxx
@@ -26,7 +26,7 @@
 ScCondFormatList::ScCondFormatList(ScCondFormatDlg* pDialogParent,
                                    ScDocument& rDoc,
                                    std::unique_ptr<weld::ScrolledWindow> 
xWindow,
-                                   std::unique_ptr<weld::Container> xGrid)
+                                   std::unique_ptr<weld::Grid> xGrid)
     : mxScrollWindow(std::move(xWindow))
     , mxGrid(std::move(xGrid))
     , mbFrozen(false)
@@ -441,7 +441,7 @@ ScCondFormatDlg::ScCondFormatDlg(SfxBindings* pB, 
SfxChildWindow* pCW,
     , mxEdRange(new formula::RefEdit(m_xBuilder->weld_entry(u"edassign"_ustr)))
     , mxRbRange(new 
formula::RefButton(m_xBuilder->weld_button(u"rbassign"_ustr)))
     , mxCondFormList(new ScCondFormatList(this, mpViewData->GetDocument(), 
m_xBuilder->weld_scrolled_window(u"listwindow"_ustr),
-                                          
m_xBuilder->weld_container(u"list"_ustr)))
+                                          m_xBuilder->weld_grid(u"list"_ustr)))
 {
     mxEdRange->SetReferences(this, mxFtRange.get());
     mxRbRange->SetReferences(this, mxEdRange.get());
diff --git a/sc/source/ui/condformat/condformatdlgentry.cxx 
b/sc/source/ui/condformat/condformatdlgentry.cxx
index d534227d197b..87c43cfc416a 100644
--- a/sc/source/ui/condformat/condformatdlgentry.cxx
+++ b/sc/source/ui/condformat/condformatdlgentry.cxx
@@ -52,7 +52,7 @@ static bool isLOKMobilePhone()
 
 ScCondFrmtEntry::ScCondFrmtEntry(ScCondFormatList* pParent, ScDocument& rDoc, 
const ScAddress& rPos)
     : mpParent(pParent)
-    , mxBuilder(Application::CreateBuilder(pParent->GetContainer(), 
isLOKMobilePhone()?u"modules/scalc/ui/conditionalentrymobile.ui"_ustr:u"modules/scalc/ui/conditionalentry.ui"_ustr))
+    , mxBuilder(Application::CreateBuilder(pParent->GetGrid(), 
isLOKMobilePhone()?u"modules/scalc/ui/conditionalentrymobile.ui"_ustr:u"modules/scalc/ui/conditionalentry.ui"_ustr))
     , mxBorder(mxBuilder->weld_widget(u"border"_ustr))
     , mxGrid(mxBuilder->weld_container(u"grid"_ustr))
     , mxFtCondNr(mxBuilder->weld_label(u"number"_ustr))
@@ -73,7 +73,7 @@ ScCondFrmtEntry::ScCondFrmtEntry(ScCondFormatList* pParent, 
ScDocument& rDoc, co
 
 ScCondFrmtEntry::~ScCondFrmtEntry()
 {
-    mpParent->GetContainer()->move(mxBorder.get(), nullptr);
+    mpParent->GetGrid()->move(mxBorder.get(), nullptr);
 }
 
 IMPL_LINK_NOARG(ScCondFrmtEntry, EntrySelectHdl, const MouseEvent&, bool)
@@ -82,6 +82,11 @@ IMPL_LINK_NOARG(ScCondFrmtEntry, EntrySelectHdl, const 
MouseEvent&, bool)
     return false;
 }
 
+void ScCondFrmtEntry::set_grid_top_attach(int nAttach)
+{
+    mpParent->GetGrid()->set_child_top_attach(*mxBorder, nAttach);
+}
+
 void ScCondFrmtEntry::SetIndex(sal_Int32 nIndex)
 {
     OUString sLabel = maStrCondition + OUString::number(nIndex);
diff --git a/sc/source/ui/inc/condformatdlg.hxx 
b/sc/source/ui/inc/condformatdlg.hxx
index 19b2322bdcaa..9edd0716d941 100644
--- a/sc/source/ui/inc/condformatdlg.hxx
+++ b/sc/source/ui/inc/condformatdlg.hxx
@@ -30,7 +30,7 @@ class ScCondFormatList
 {
 private:
     std::unique_ptr<weld::ScrolledWindow> mxScrollWindow;
-    std::unique_ptr<weld::Container> mxGrid;
+    std::unique_ptr<weld::Grid> mxGrid;
 
     typedef std::vector<std::unique_ptr<ScCondFrmtEntry>> EntryContainer;
     EntryContainer maEntries;
@@ -47,8 +47,8 @@ public:
     ScCondFormatList(ScCondFormatDlg* pParent,
                      ScDocument& rDoc,
                      std::unique_ptr<weld::ScrolledWindow> xWindow,
-                     std::unique_ptr<weld::Container> xGrid);
-    weld::Container* GetContainer() { return mxGrid.get(); }
+                     std::unique_ptr<weld::Grid> xGrid);
+    weld::Grid* GetGrid() { return mxGrid.get(); }
     ~ScCondFormatList();
 
     void init(const ScConditionalFormat* pFormat,
diff --git a/sc/source/ui/inc/condformatdlgentry.hxx 
b/sc/source/ui/inc/condformatdlgentry.hxx
index 33b218b181e6..77976c9584e5 100644
--- a/sc/source/ui/inc/condformatdlgentry.hxx
+++ b/sc/source/ui/inc/condformatdlgentry.hxx
@@ -75,7 +75,7 @@ public:
 
     void Show() { mxGrid->show(); }
 
-    void set_grid_top_attach(int nAttach) { 
mxBorder->set_grid_top_attach(nAttach); }
+    void set_grid_top_attach(int nAttach);
     int get_preferred_height() const { return 
mxBorder->get_preferred_size().Height(); }
 
     void SetPos(const ScAddress& rPos) { maPos = rPos; };

Reply via email to