framework/source/loadenv/loadenv.cxx |    4 ++++
 1 file changed, 4 insertions(+)

New commits:
commit 8c6972a49020e6e09936e6bece1347627a963337
Author:     Caolán McNamara <[email protected]>
AuthorDate: Mon Nov 11 14:20:16 2024 +0000
Commit:     Caolán McNamara <[email protected]>
CommitDate: Mon Nov 11 22:33:36 2024 +0100

    add AbortOnLoadFailure to optionally assert on failure to load
    
    intended for use with crashtesting to detect when we export something we
    can't import
    
    Change-Id: I80c2f5198f8695c00a68cf09d4512d56c5a537a0
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176412
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <[email protected]>

diff --git a/framework/source/loadenv/loadenv.cxx 
b/framework/source/loadenv/loadenv.cxx
index 994d2f7306cd..328152765c93 100644
--- a/framework/source/loadenv/loadenv.cxx
+++ b/framework/source/loadenv/loadenv.cxx
@@ -204,6 +204,10 @@ css::uno::Reference< css::lang::XComponent > 
LoadEnv::loadComponentFromURL(const
         }
     }
 
+    // if AbortOnLoadFailure is set and we couldn't load the document, assert, 
intended for use with crashtesting to
+    // detect when we export something we can't import
+    assert(xComponent.is() || comphelper::NamedValueCollection::get(lArgs, 
u"AbortOnLoadFailure") != uno::Any(true));
+
     return xComponent;
 }
 

Reply via email to