diff options
author | Vasily Melenchuk <vasily.melenchuk@cib.de> | 2019-03-26 15:23:28 +0300 |
---|---|---|
committer | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2019-03-28 11:52:16 +0100 |
commit | 4abb7335529a66346a2a68a089b9c8438faa2e39 (patch) | |
tree | 4fe4010c4da653e68738a79bde434dc743ee66d3 /toolkit | |
parent | de6f36cc2fb359332205ba836f8396a1cdbe44c2 (diff) |
tdf#124385: toolkit: do not fail if ResourceListener is not defined
If current control (for example TabPageContainer) is missing
resource listener property we should not fail script with
exception. Just behave as with empty ResourceListener.
Change-Id: I260feec775a5d197bebc9414b652dd6f89e35035
Reviewed-on: https://gerrit.libreoffice.org/69740
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Diffstat (limited to 'toolkit')
-rw-r--r-- | toolkit/source/controls/controlmodelcontainerbase.cxx | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/toolkit/source/controls/controlmodelcontainerbase.cxx b/toolkit/source/controls/controlmodelcontainerbase.cxx index a7721a72146a..10da911540e2 100644 --- a/toolkit/source/controls/controlmodelcontainerbase.cxx +++ b/toolkit/source/controls/controlmodelcontainerbase.cxx @@ -1741,6 +1741,9 @@ void ControlContainerBase::ImplStartListingForResourceEvents() { Reference< resource::XStringResourceResolver > xStringResourceResolver; + if ( !ImplHasProperty(PROPERTY_RESOURCERESOLVER) ) + return; + ImplGetPropertyValue( PROPERTY_RESOURCERESOLVER ) >>= xStringResourceResolver; // Add our helper as listener to retrieve notifications about changes @@ -1757,7 +1760,11 @@ void ControlContainerBase::ImplUpdateResourceResolver() { Reference< resource::XStringResourceResolver > xStringResourceResolver; - ImplGetPropertyValue( PROPERTY_RESOURCERESOLVER ) >>= xStringResourceResolver; + if ( !ImplHasProperty(PROPERTY_RESOURCERESOLVER) ) + return; + + ImplGetPropertyValue(PROPERTY_RESOURCERESOLVER) >>= xStringResourceResolver; + if ( !xStringResourceResolver.is() ) return; |