summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-04-23 10:50:29 +0100
committerCaolán McNamara <caolanm@redhat.com>2018-04-23 21:44:24 +0200
commitdb9f6c44cac246250e89ca4e9aa127dee912d7f5 (patch)
treec1b9c65bfe4e6f5ebf3b288b8a28ea6886f5c3b9
parenttype mismatch at 1st parameter ('vcl::Window *const' vs 'const vcl::Window *') (diff)
downloadcore-db9f6c44cac246250e89ca4e9aa127dee912d7f5.tar.gz
core-db9f6c44cac246250e89ca4e9aa127dee912d7f5.zip
set SfxTabPage parent dialog explicitly
Change-Id: If7813f9f5e35694312b055cc92868638bc3773d5 Reviewed-on: https://gerrit.libreoffice.org/53326 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--include/sfx2/tabdlg.hxx1
-rw-r--r--sfx2/source/dialog/tabdlg.cxx16
-rw-r--r--sw/source/ui/envelp/labprt.hxx2
-rw-r--r--sw/source/ui/envelp/swuilabimp.hxx2
4 files changed, 15 insertions, 6 deletions
diff --git a/include/sfx2/tabdlg.hxx b/include/sfx2/tabdlg.hxx
index e288e07cd8f7..9b0aa249c668 100644
--- a/include/sfx2/tabdlg.hxx
+++ b/include/sfx2/tabdlg.hxx
@@ -266,6 +266,7 @@ protected:
return static_cast<const T*>(GetOldItem(rSet, sal_uInt16(nSlot), bDeep));
}
SfxTabDialog* GetTabDialog() const;
+ void SetTabDialog(SfxTabDialog* pDialog);
void AddItemConnection( sfx::ItemConnectionBase* pConnection );
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<SfxTabDialog> 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<SfxTabDialog*>(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<vcl::Window*>(pTabCtrl), m_pSet );
+ pTabPage = (pDataObject->fnCreatePage)(static_cast<vcl::Window*>(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())
diff --git a/sw/source/ui/envelp/labprt.hxx b/sw/source/ui/envelp/labprt.hxx
index e36ab980e1f4..500f2c40332c 100644
--- a/sw/source/ui/envelp/labprt.hxx
+++ b/sw/source/ui/envelp/labprt.hxx
@@ -45,7 +45,7 @@ class SwLabPrtPage : public SfxTabPage
DECL_LINK( CountHdl, Button *, void );
- SwLabDlg* GetParentSwLabDlg() {return static_cast<SwLabDlg*>(GetParentDialog());}
+ SwLabDlg* GetParentSwLabDlg() {return static_cast<SwLabDlg*>(GetTabDialog());}
using TabPage::ActivatePage;
using TabPage::DeactivatePage;
diff --git a/sw/source/ui/envelp/swuilabimp.hxx b/sw/source/ui/envelp/swuilabimp.hxx
index 09e4dcc96b12..b63c30df324f 100644
--- a/sw/source/ui/envelp/swuilabimp.hxx
+++ b/sw/source/ui/envelp/swuilabimp.hxx
@@ -72,7 +72,7 @@ public:
virtual bool FillItemSet(SfxItemSet* rSet) override;
virtual void Reset(const SfxItemSet* rSet) override;
- SwLabDlg* GetParentSwLabDlg() {return static_cast<SwLabDlg*>(GetParentDialog());}
+ SwLabDlg* GetParentSwLabDlg() {return static_cast<SwLabDlg*>(GetTabDialog());}
void SetToBusinessCard();