diff options
Diffstat (limited to 'vbahelper')
-rw-r--r-- | vbahelper/source/vbahelper/vbahelper.cxx | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/vbahelper/source/vbahelper/vbahelper.cxx b/vbahelper/source/vbahelper/vbahelper.cxx index c34559b769f6..187e88d5713b 100644 --- a/vbahelper/source/vbahelper/vbahelper.cxx +++ b/vbahelper/source/vbahelper/vbahelper.cxx @@ -1,4 +1,4 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column:100 -*- */ /* * This file is part of the LibreOffice project. * @@ -39,6 +39,7 @@ #include <ooo/vba/msforms/XShape.hpp> +#include <comphelper/automationinvokedzone.hxx> #include <comphelper/processfactory.hxx> #include <sfx2/objsh.hxx> @@ -1122,6 +1123,12 @@ uno::Reference< XHelperInterface > getUnoDocModule( const OUString& aModName, Sf if ( pShell ) { OUString sProj( "Standard" ); + // GetBasicManager() causes a SolarMutex assertion failure in some use cases from + // Automation, at least when opening a Calc Document through ooo::vba::excel:: + // XWorkbooks::Open(). Let's see if this check is a good way around that. It does seem that + // callers are prepared for this to return null? + if (comphelper::Automation::AutomationInvokedZone::isActive()) + return xIf; BasicManager* pBasMgr = pShell->GetBasicManager(); if ( pBasMgr && !pBasMgr->GetName().isEmpty() ) sProj = pBasMgr->GetName(); |