diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2024-06-21 10:04:33 +0500 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2024-06-21 12:31:53 +0500 |
commit | ec2d9d7d0ebcaf1aa6666301331b934a448f5d39 (patch) | |
tree | d0e77ba2b71a5bfd1ac463a878ce1843073b0117 | |
parent | 368bc2b821dde56379c9a4c3acfcc3143efbdf6d (diff) |
Make sure to clear the guard around OleEmbeddedObject::changeStatedistro/vector/vector-7.5.9
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
-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 657d27710ca3..41792fede127 100644 --- a/embeddedobj/source/msole/oleembed.cxx +++ b/embeddedobj/source/msole/oleembed.cxx @@ -910,6 +910,7 @@ void SAL_CALL OleEmbeddedObject::doVerb( sal_Int32 nVerbID ) m_bTriedConversion = true; if ( TryToConvertToOOo( m_xObjectStream ) ) { + aGuard.clear(); changeState( embed::EmbedStates::ACTIVE ); return; } @@ -941,6 +942,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 bcbacffe5d64..b5047d1036b6 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; { ClearedMutexArea clearedMutex(aGuard); + if ( m_nObjectState == embed::EmbedStates::LOADED ) + changeState( embed::EmbedStates::RUNNING ); aVisualRepr.Data = m_pOleComponent->getTransferData(aDataFlavor); } aVisualRepr.Flavor = aDataFlavor; |