Make sure to clear the guard around OleEmbeddedObject::changeState

The method itself clears its own guard; the caller still holding the
guard results in hangs seen in some Java code.

See also commit e2bfc34d14 (Reimplement
OleComponentNative_Impl to use IGlobalInterfaceTablem 2024-03-11).

Change-Id: Ib22e71e7500ccceb946f7b1d6606f8f61ae2afe8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169315
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
This commit is contained in:
Mike Kaganski 2024-06-21 10:04:33 +05:00
parent 6958d226e6
commit d32153d321
2 changed files with 4 additions and 3 deletions

View file

@ -913,6 +913,7 @@ void SAL_CALL OleEmbeddedObject::doVerb( sal_Int32 nVerbID )
m_bTriedConversion = true;
if ( TryToConvertToOOo( m_xObjectStream ) )
{
aGuard.clear();
changeState( embed::EmbedStates::ACTIVE );
return;
}
@ -944,6 +945,7 @@ void SAL_CALL OleEmbeddedObject::doVerb( sal_Int32 nVerbID )
if ( TryToConvertToOOo( xStream ) )
{
aGuard.clear();
changeState( embed::EmbedStates::ACTIVE );
return;
}

View file

@ -355,9 +355,6 @@ embed::VisualRepresentation SAL_CALL OleEmbeddedObject::getPreferredVisualRepres
{
try
{
if ( m_nObjectState == embed::EmbedStates::LOADED )
changeState( embed::EmbedStates::RUNNING );
datatransfer::DataFlavor aDataFlavor(
"application/x-openoffice-wmf;windows_formatname=\"Image WMF\"",
"Windows Metafile",
@ -366,6 +363,8 @@ embed::VisualRepresentation SAL_CALL OleEmbeddedObject::getPreferredVisualRepres
embed::VisualRepresentation aVisualRepr;
{
osl::ResettableMutexGuardScopedReleaser clearedMutex(aGuard);
if ( m_nObjectState == embed::EmbedStates::LOADED )
changeState( embed::EmbedStates::RUNNING );
aVisualRepr.Data = m_pOleComponent->getTransferData(aDataFlavor);
}
aVisualRepr.Flavor = aDataFlavor;