From db9f6c44cac246250e89ca4e9aa127dee912d7f5 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Mon, 23 Apr 2018 10:50:29 +0100 Subject: set SfxTabPage parent dialog explicitly MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: If7813f9f5e35694312b055cc92868638bc3773d5 Reviewed-on: https://gerrit.libreoffice.org/53326 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- sfx2/source/dialog/tabdlg.cxx | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'sfx2') diff --git a/sfx2/source/dialog/tabdlg.cxx b/sfx2/source/dialog/tabdlg.cxx index ff5c508efdf9..f31e12784316 100644 --- a/sfx2/source/dialog/tabdlg.cxx +++ b/sfx2/source/dialog/tabdlg.cxx @@ -52,6 +52,7 @@ struct TabPageImpl { bool mbStandard; sfx::ItemConnectionArray maItemConn; + VclPtr mxDialog; css::uno::Reference< css::frame::XFrame > mxFrame; TabPageImpl() : mbStandard( false ) {} @@ -307,13 +308,20 @@ void SfxTabPage::AddItemConnection( sfx::ItemConnectionBase* pConnection ) pImpl->maItemConn.AddConnection( pConnection ); } +void SfxTabPage::SetTabDialog(SfxTabDialog* pDialog) +{ + pImpl->mxDialog = pDialog; +} + SfxTabDialog* SfxTabPage::GetTabDialog() const { - return dynamic_cast(GetParentDialog()); + return pImpl->mxDialog; } OString SfxTabPage::GetConfigId() const { + if (m_xContainer) + return m_xContainer->get_help_id(); OString sId(GetHelpId()); if (sId.isEmpty() && isLayoutEnabled(this)) sId = GetWindow(GetWindowType::FirstChild)->GetHelpId(); @@ -1127,12 +1135,12 @@ IMPL_LINK( SfxTabDialog, ActivatePageHdl, TabControl *, pTabCtrl, void ) if ( !pTabPage ) { if ( m_pSet ) - pTabPage = (pDataObject->fnCreatePage)( static_cast(pTabCtrl), m_pSet ); + pTabPage = (pDataObject->fnCreatePage)(static_cast(pTabCtrl), m_pSet); else - pTabPage = (pDataObject->fnCreatePage) - ( pTabCtrl, CreateInputItemSet( nId ) ); + pTabPage = (pDataObject->fnCreatePage)(pTabCtrl, CreateInputItemSet(nId)); DBG_ASSERT( nullptr == pDataObject->pTabPage, "create TabPage more than once" ); pDataObject->pTabPage = pTabPage; + pTabPage->SetTabDialog(this); OUString sConfigId = OStringToOUString(pTabPage->GetConfigId(), RTL_TEXTENCODING_UTF8); if (sConfigId.isEmpty()) -- cgit