diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2024-06-21 10:04:33 +0500 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2024-06-21 12:52:42 +0200 |
commit | 9bc6237723a488ad758410f4821cd36363cc16b8 (patch) | |
tree | 2f41fb8fc06ab9ef5b593b26135ec6b18846b32d /embeddedobj | |
parent | 4c4f8a0743765c7971f299a98946a21f28b12f9f (diff) |
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 e2bfc34d146806a8f96be0cd2323d716f12cba4e (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
(cherry picked from commit d32153d3217350b6646227d9239e3fd191e2b4c3)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169293
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'embeddedobj')
-rw-r--r-- | embeddedobj/source/msole/oleembed.cxx | 2 | ||||
-rw-r--r-- | embeddedobj/source/msole/olevisual.cxx | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/embeddedobj/source/msole/oleembed.cxx b/embeddedobj/source/msole/oleembed.cxx index a1e12ed5e3e8..835ef9cd4885 100644 --- a/embeddedobj/source/msole/oleembed.cxx +++ b/embeddedobj/source/msole/oleembed.cxx @@ -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; } diff --git a/embeddedobj/source/msole/olevisual.cxx b/embeddedobj/source/msole/olevisual.cxx index 492541b00df2..83dc0903e0bb 100644 --- a/embeddedobj/source/msole/olevisual.cxx +++ b/embeddedobj/source/msole/olevisual.cxx @@ -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; |