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

New commits:
commit 6e50194af44c3602f34204a213d9ed1f8f2a0c0d
Author:     Vasily Melenchuk <[email protected]>
AuthorDate: Tue Mar 26 15:23:28 2019 +0300
Commit:     Thorsten Behrens <[email protected]>
CommitDate: Wed Apr 3 16:37:52 2019 +0200

    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]>
    (cherry picked from commit 4abb7335529a66346a2a68a089b9c8438faa2e39)
    Reviewed-on: https://gerrit.libreoffice.org/70196
    Tested-by: Thorsten Behrens <[email protected]>

diff --git a/toolkit/source/controls/controlmodelcontainerbase.cxx 
b/toolkit/source/controls/controlmodelcontainerbase.cxx
index cc50dbd31858..87867ab3dafb 100644
--- a/toolkit/source/controls/controlmodelcontainerbase.cxx
+++ b/toolkit/source/controls/controlmodelcontainerbase.cxx
@@ -1751,6 +1751,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
@@ -1767,7 +1770,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