diff options
author | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2019-05-03 16:16:33 +0200 |
---|---|---|
committer | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2019-05-06 07:30:57 +0200 |
commit | 0e86f0c79e29bde4a29ef77046621398b6bede63 (patch) | |
tree | bc32c6e0e9b4a9ae1c0882ac2d6af61bd8be4d10 /toolkit | |
parent | 668de126d9217636ff8592928bb581ecd59db66f (diff) |
Throw exception when peer for tabpage container is missing
To give extension developers a clue what is missing
Change-Id: I4a4727bdbf0522f8dd398c7aa877e49235efeb86
Reviewed-on: https://gerrit.libreoffice.org/71751
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Diffstat (limited to 'toolkit')
-rw-r--r-- | toolkit/source/awt/vclxtabpagecontainer.cxx | 2 | ||||
-rw-r--r-- | toolkit/source/controls/tabpagecontainer.cxx | 4 |
2 files changed, 6 insertions, 0 deletions
diff --git a/toolkit/source/awt/vclxtabpagecontainer.cxx b/toolkit/source/awt/vclxtabpagecontainer.cxx index da6ed54f8941..56e492ea8069 100644 --- a/toolkit/source/awt/vclxtabpagecontainer.cxx +++ b/toolkit/source/awt/vclxtabpagecontainer.cxx @@ -179,6 +179,8 @@ void SAL_CALL VCLXTabPageContainer::elementInserted( const css::container::Conta Reference< awt::tab::XTabPageModel > xP( xControl->getModel(), UNO_QUERY ); sal_Int16 nPageID = xP->getTabPageID(); + if (!xControl->getPeer().is()) + throw RuntimeException("No peer for tabpage container!"); VclPtr<vcl::Window> pWindow = VCLUnoHelper::GetWindow(xControl->getPeer()); TabPage* pPage = static_cast<TabPage*>(pWindow.get()); pTabCtrl->InsertPage(nPageID,pPage->GetText()); diff --git a/toolkit/source/controls/tabpagecontainer.cxx b/toolkit/source/controls/tabpagecontainer.cxx index f7084896db19..18bda42e9e11 100644 --- a/toolkit/source/controls/tabpagecontainer.cxx +++ b/toolkit/source/controls/tabpagecontainer.cxx @@ -301,6 +301,8 @@ void SAL_CALL UnoControlTabPageContainer::removeTabPageContainerListener( const void UnoControlTabPageContainer::updateFromModel() { UnoControlTabPageContainer_Base::updateFromModel(); + if (!getPeer().is()) + throw RuntimeException("No peer for tabpage container!"); Reference< XContainerListener > xContainerListener( getPeer(), UNO_QUERY ); ENSURE_OR_RETURN_VOID( xContainerListener.is(), "UnoListBoxControl::updateFromModel: a peer which is no ItemListListener?!" ); @@ -320,6 +322,8 @@ void SAL_CALL UnoControlTabPageContainer::addControl( const OUString& Name, cons { SolarMutexGuard aSolarGuard; ControlContainerBase::addControl(Name,Control); + if (!getPeer().is()) + throw RuntimeException("No peer for tabpage container!"); Reference< XContainerListener > xContainerListener( getPeer(), UNO_QUERY ); ContainerEvent aEvent; aEvent.Source = getModel(); |