tdf#150974 Writer crashes when starting with WollMux installed
regression from
commit b2aa646ef09dc8434d3ca8a5bba53a8d8ff3f910
Author: Caolán McNamara <caolanm@redhat.com>
Date: Wed Dec 15 11:43:32 2021 +0000
use more OInterfaceContainerHelper3 in toolkit
Change-Id: I26532ea79b7c5f750b4bf693881cbf41aeb82266
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140077
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
diff --git a/toolkit/source/controls/unocontrols.cxx b/toolkit/source/controls/unocontrols.cxx
index 3bc095c..84fe8ce 100644
--- a/toolkit/source/controls/unocontrols.cxx
+++ b/toolkit/source/controls/unocontrols.cxx
@@ -270,11 +270,23 @@ void UnoEditControl::textChanged(const awt::TextEvent& e)
void UnoEditControl::addTextListener(const uno::Reference< awt::XTextListener > & l)
{
// tdf#150974 some extensions pass null
if (!l)
{
SAL_WARN("toolkit", "null XTextListener");
return;
}
maTextListeners.addInterface( l );
}
void UnoEditControl::removeTextListener(const uno::Reference< awt::XTextListener > & l)
{
// tdf#150974 some extensions pass null
if (!l)
{
SAL_WARN("toolkit", "null XTextListener");
return;
}
maTextListeners.removeInterface( l );
}
@@ -767,6 +779,13 @@ void UnoButtonControl::createPeer( const uno::Reference< awt::XToolkit > & rxToo
void UnoButtonControl::addActionListener(const uno::Reference< awt::XActionListener > & l)
{
// tdf#150974 some extensions pass null
if (!l)
{
SAL_WARN("toolkit", "null XActionListener");
return;
}
maActionListeners.addInterface( l );
if( getPeer().is() && maActionListeners.getLength() == 1 )
{
@@ -777,6 +796,13 @@ void UnoButtonControl::addActionListener(const uno::Reference< awt::XActionListe
void UnoButtonControl::removeActionListener(const uno::Reference< awt::XActionListener > & l)
{
// tdf#150974 some extensions pass null
if (!l)
{
SAL_WARN("toolkit", "null XActionListener");
return;
}
if( getPeer().is() && maActionListeners.getLength() == 1 )
{
uno::Reference < awt::XButton > xButton( getPeer(), uno::UNO_QUERY );