diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-09-16 16:05:30 +0200 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2022-09-16 22:14:07 +0200 |
commit | a3bbdfab809609bec3475613a918eda699fbdc29 (patch) | |
tree | cd6b9b434bd9d7e641ff42754ecaf561525c2e37 | |
parent | d87e1859cbd41a623f48a9522507ab0adc8e7324 (diff) |
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>
-rw-r--r-- | toolkit/source/controls/unocontrols.cxx | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/toolkit/source/controls/unocontrols.cxx b/toolkit/source/controls/unocontrols.cxx index 3bc095cf3f03..84fe8ce50774 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 ); |