cui/source/dialogs/cuihyperdlg.cxx | 15 +++------------ cui/source/dialogs/hltpbase.cxx | 18 ++++-------------- 2 files changed, 7 insertions(+), 26 deletions(-)
New commits: commit a41d9e0d7f2709f71e02d47cb3f43dfd3b7b5337 Author: Maya Stephens <[email protected]> AuthorDate: Tue Sep 2 14:35:22 2025 +0000 Commit: Michael Stahl <[email protected]> CommitDate: Tue Sep 9 17:07:18 2025 +0200 Use set_visible in hyperlink dialog Use set_visible(bool) instead of if(bool) {show()} else {hide()}. This way is shorter, and acts the same, as set_visible calls either show or hide based of the parameter. Change-Id: I6a6a6964bd373c7592baaa1ebd63b3c9359ed750 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190529 Reviewed-by: Michael Stahl <[email protected]> Tested-by: Jenkins CollaboraOffice <[email protected]> diff --git a/cui/source/dialogs/cuihyperdlg.cxx b/cui/source/dialogs/cuihyperdlg.cxx index e0f7f6acccdc..be8cd6f47a4a 100644 --- a/cui/source/dialogs/cuihyperdlg.cxx +++ b/cui/source/dialogs/cuihyperdlg.cxx @@ -111,18 +111,9 @@ SvxHpLinkDlg::SvxHpLinkDlg(SfxBindings* pBindings, SfxChildWindow* pChild, weld: m_xOKBtn->show(); m_xCancelBtn->show(); - if (comphelper::LibreOfficeKit::isActive()) - { - m_xApplyBtn->hide(); - m_xHelpBtn->hide(); - m_xResetBtn->hide(); - } - else - { - m_xApplyBtn->show(); - m_xHelpBtn->show(); - m_xResetBtn->show(); - } + m_xApplyBtn->set_visible(!comphelper::LibreOfficeKit::isActive()); + m_xHelpBtn->set_visible(!comphelper::LibreOfficeKit::isActive()); + m_xResetBtn->set_visible(!comphelper::LibreOfficeKit::isActive()); mbGrabFocus = true; diff --git a/cui/source/dialogs/hltpbase.cxx b/cui/source/dialogs/hltpbase.cxx index bd9743dc1945..829a04c29c02 100644 --- a/cui/source/dialogs/hltpbase.cxx +++ b/cui/source/dialogs/hltpbase.cxx @@ -279,21 +279,11 @@ void SvxHyperlinkTabPageBase::FillStandardDlgFields ( const SvxHyperlinkItem* pH mxLbForm->append_text( aStrFormButton ); mxLbForm->set_active( pHyperlinkItem->GetInsertMode() == HLINK_BUTTON ? 1 : 0 ); - if (pHyperlinkItem->GetShowName()) { - mxNameLabel->show(); - mxEdText->show(); - } else { - mxNameLabel->hide(); - mxEdText->hide(); - } + mxNameLabel->set_visible(m_showName); + mxEdText->set_visible(m_showName); - if (pHyperlinkItem->GetShowText()) { - mxEdIndication->show(); - mxIndicationLabel->show(); - } else { - mxEdIndication->hide(); - mxIndicationLabel->hide(); - } + mxEdIndication->set_visible(m_showText); + mxIndicationLabel->set_visible(m_showText); } // Text
