Avoid a SolarMutex assertion failure in some use cases from Automation
For instance when opening a Calc Document through ooo::vba::excel:: XWorkbooks::Open(). Instead just let the function return null. It does seem that callers are prepared for that. Change-Id: I7136133155f95a696b5ed3e661a9adb98396c9c5
This commit is contained in:
@@ -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.
|
* This file is part of the LibreOffice project.
|
||||||
*
|
*
|
||||||
@@ -39,6 +39,7 @@
|
|||||||
|
|
||||||
#include <ooo/vba/msforms/XShape.hpp>
|
#include <ooo/vba/msforms/XShape.hpp>
|
||||||
|
|
||||||
|
#include <comphelper/automationinvokedzone.hxx>
|
||||||
#include <comphelper/processfactory.hxx>
|
#include <comphelper/processfactory.hxx>
|
||||||
|
|
||||||
#include <sfx2/objsh.hxx>
|
#include <sfx2/objsh.hxx>
|
||||||
@@ -1122,6 +1123,12 @@ uno::Reference< XHelperInterface > getUnoDocModule( const OUString& aModName, Sf
|
|||||||
if ( pShell )
|
if ( pShell )
|
||||||
{
|
{
|
||||||
OUString sProj( "Standard" );
|
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();
|
BasicManager* pBasMgr = pShell->GetBasicManager();
|
||||||
if ( pBasMgr && !pBasMgr->GetName().isEmpty() )
|
if ( pBasMgr && !pBasMgr->GetName().isEmpty() )
|
||||||
sProj = pBasMgr->GetName();
|
sProj = pBasMgr->GetName();
|
||||||
|
Reference in New Issue
Block a user