sw/source/ui/index/cnttab.cxx | 26 ++++++++++++++------------ sw/source/uibase/inc/swuicnttab.hxx | 2 +- sw/uiconfig/swriter/ui/tokenwidget.ui | 4 ++-- 3 files changed, 17 insertions(+), 15 deletions(-)
New commits: commit 94be1e3ea7c53721a166528a1b667dd77765a6ff Author: Michael Weghorn <[email protected]> AuthorDate: Mon Feb 23 12:24:49 2026 +0100 Commit: Michael Weghorn <[email protected]> CommitDate: Mon Feb 23 16:24:47 2026 +0100 sw: Reduce const_cast in SwTokenWindow::InsertAtSelection Don't use const pointer variables in the first place if non-const ones are needed. Change-Id: I9c4a2c4a716c093930db21923d95e71d0ccb4f9f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200047 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 c41d24e02821..4b0bb3a842d3 100644 --- a/sw/source/ui/index/cnttab.cxx +++ b/sw/source/ui/index/cnttab.cxx @@ -3011,8 +3011,8 @@ void SwTokenWindow::InsertAtSelection(const SwFormToken& rToken) bool bPreStartLinkFound = false; bool bPreEndLinkFound = false; - const SwTOXWidget* pControl = nullptr; - const SwTOXWidget* pExchange = nullptr; + SwTOXWidget* pControl = nullptr; + SwTOXWidget* pExchange = nullptr; auto it = m_aControlList.cbegin(); for( ; it != m_aControlList.cend() && m_pActiveCtrl != it->get(); ++it ) @@ -3087,8 +3087,8 @@ void SwTokenWindow::InsertAtSelection(const SwFormToken& rToken) OSL_ENSURE(pExchange, "no control to exchange?"); if(pExchange) { - const_cast<SwTOXButton*>(static_cast<const SwTOXButton*>(pExchange))->SetLinkEnd(); - const_cast<SwTOXButton*>(static_cast<const SwTOXButton*>(pExchange))->SetText(m_aButtonTexts[TOKEN_LINK_END]); + static_cast<SwTOXButton*>(pExchange)->SetLinkEnd(); + static_cast<SwTOXButton*>(pExchange)->SetText(m_aButtonTexts[TOKEN_LINK_END]); } } @@ -3098,8 +3098,8 @@ void SwTokenWindow::InsertAtSelection(const SwFormToken& rToken) if(pExchange) { - const_cast<SwTOXButton*>(static_cast<const SwTOXButton*>(pExchange))->SetLinkStart(); - const_cast<SwTOXButton*>(static_cast<const SwTOXButton*>(pExchange))->SetText(m_aButtonTexts[TOKEN_LINK_START]); + static_cast<SwTOXButton*>(pExchange)->SetLinkStart(); + static_cast<SwTOXButton*>(pExchange)->SetText(m_aButtonTexts[TOKEN_LINK_START]); } } } commit b1cf9e81b6968028d41a5cdf24e8ef731035c0f1 Author: Michael Weghorn <[email protected]> AuthorDate: Mon Feb 23 11:32:19 2026 +0100 Commit: Michael Weghorn <[email protected]> CommitDate: Mon Feb 23 16:24:39 2026 +0100 sw: Return ref in SwTokenWindow::get_child_container Change-Id: I07ea9630506c936d0a9ac68cb97dd5fee847f6f6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200046 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 6d40952946cc..c41d24e02821 100644 --- a/sw/source/ui/index/cnttab.cxx +++ b/sw/source/ui/index/cnttab.cxx @@ -1552,7 +1552,8 @@ class SwTOXEdit : public SwTOXWidget DECL_LINK(ModifyHdl, weld::Entry&, void); public: SwTOXEdit(SwTokenWindow* pTokenWin, const SwFormToken& rToken) - : m_xBuilder(Application::CreateBuilder(pTokenWin->get_child_container(), u"modules/swriter/ui/toxentrywidget.ui"_ustr)) + : m_xBuilder(Application::CreateBuilder(&pTokenWin->get_child_container(), + u"modules/swriter/ui/toxentrywidget.ui"_ustr)) , m_aFormToken(rToken) , m_bNextControl(false) , m_pParent(pTokenWin) @@ -1566,7 +1567,7 @@ public: virtual ~SwTOXEdit() override { - m_pParent->get_child_container()->move(m_xEntry.get(), nullptr); + m_pParent->get_child_container().move(m_xEntry.get(), nullptr); } virtual WindowType GetType() const override @@ -1596,7 +1597,7 @@ public: virtual void set_grid_left_attach(int nPos) override { - m_pParent->get_child_container()->set_child_left_attach(*m_xEntry, 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 @@ -1713,7 +1714,8 @@ class SwTOXButton : public SwTOXWidget std::unique_ptr<weld::ToggleButton> m_xButton; public: SwTOXButton(SwTokenWindow* pTokenWin, const SwFormToken& rToken) - : m_xBuilder(Application::CreateBuilder(pTokenWin->get_child_container(), u"modules/swriter/ui/toxbuttonwidget.ui"_ustr)) + : m_xBuilder(Application::CreateBuilder(&pTokenWin->get_child_container(), + u"modules/swriter/ui/toxbuttonwidget.ui"_ustr)) , m_aFormToken(rToken) , m_bNextControl(false) , m_pParent(pTokenWin) @@ -1726,7 +1728,7 @@ public: virtual ~SwTOXButton() override { - m_pParent->get_child_container()->move(m_xButton.get(), nullptr); + m_pParent->get_child_container().move(m_xButton.get(), nullptr); } virtual WindowType GetType() const override @@ -1756,7 +1758,7 @@ public: virtual void set_grid_left_attach(int nPos) override { - m_pParent->get_child_container()->set_child_left_attach(*m_xButton, 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 diff --git a/sw/source/uibase/inc/swuicnttab.hxx b/sw/source/uibase/inc/swuicnttab.hxx index fb2c0d39ce8f..ffa5a74b03dc 100644 --- a/sw/source/uibase/inc/swuicnttab.hxx +++ b/sw/source/uibase/inc/swuicnttab.hxx @@ -274,7 +274,7 @@ class SwTokenWindow public: SwTokenWindow(std::unique_ptr<weld::Container> xParent); - weld::Grid* get_child_container() { return m_xCtrlParentWin.get(); } + weld::Grid& get_child_container() { return *m_xCtrlParentWin; } ~SwTokenWindow(); void SetTabPage(SwTOXEntryTabPage *pParent) { m_pParent = pParent; } commit 83f4d110e4ded0236a8789b4a1bb8538dc5f6542 Author: Michael Weghorn <[email protected]> AuthorDate: Mon Feb 23 11:29:48 2026 +0100 Commit: Michael Weghorn <[email protected]> CommitDate: Mon Feb 23 16:24:33 2026 +0100 sw: Resave tokenwidget.ui with glade 3.40 Change-Id: If6c606ca3e0a93c7ef5b00d01f6d955640156610 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200045 Reviewed-by: Michael Weghorn <[email protected]> Tested-by: Jenkins diff --git a/sw/uiconfig/swriter/ui/tokenwidget.ui b/sw/uiconfig/swriter/ui/tokenwidget.ui index fd48c789e1f0..c1376d826964 100644 --- a/sw/uiconfig/swriter/ui/tokenwidget.ui +++ b/sw/uiconfig/swriter/ui/tokenwidget.ui @@ -22,7 +22,7 @@ <property name="visible">True</property> <property name="can-focus">True</property> <property name="receives-default">True</property> - <property name="tooltip_text" translatable="yes" context="tokenwidget|left|tooltip_text">Scroll left</property> + <property name="tooltip-text" translatable="yes" context="tokenwidget|left|tooltip_text">Scroll left</property> <property name="image">image1</property> <property name="always-show-image">True</property> <child internal-child="accessible"> @@ -90,7 +90,7 @@ <property name="visible">True</property> <property name="can-focus">True</property> <property name="receives-default">True</property> - <property name="tooltip_text" translatable="yes" context="tokenwidget|right|tooltip_text">Scroll right</property> + <property name="tooltip-text" translatable="yes" context="tokenwidget|right|tooltip_text">Scroll right</property> <property name="image">image2</property> <property name="always-show-image">True</property> <child internal-child="accessible">
