toolkit/source/controls/controlmodelcontainerbase.cxx |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

New commits:
commit 4abb7335529a66346a2a68a089b9c8438faa2e39
Author:     Vasily Melenchuk <[email protected]>
AuthorDate: Tue Mar 26 15:23:28 2019 +0300
Commit:     Thorsten Behrens <[email protected]>
CommitDate: Thu Mar 28 11:52:16 2019 +0100

    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 <[email protected]>

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;
 
_______________________________________________
Libreoffice-commits mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to