diff options
Diffstat (limited to 'embeddedobj')
-rw-r--r-- | embeddedobj/source/msole/olevisual.cxx | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/embeddedobj/source/msole/olevisual.cxx b/embeddedobj/source/msole/olevisual.cxx index 0445c09a94dc..891de4459e33 100644 --- a/embeddedobj/source/msole/olevisual.cxx +++ b/embeddedobj/source/msole/olevisual.cxx @@ -203,6 +203,8 @@ awt::Size SAL_CALL OleEmbeddedObject::getVisualAreaSize( sal_Int64 nAspect ) awt::Size aSize; aGuard.clear(); + bool bBackToLoaded = false; + sal_Bool bSuccess = sal_False; if ( getCurrentState() == embed::EmbedStates::LOADED ) { @@ -211,6 +213,9 @@ awt::Size SAL_CALL OleEmbeddedObject::getVisualAreaSize( sal_Int64 nAspect ) // try to switch the object to RUNNING state and request the value again try { changeState( embed::EmbedStates::RUNNING ); + // the links should be switched back to loaded state to avoid too + // many open MathType instances + bBackToLoaded = true; } catch( const uno::Exception& ) { @@ -230,6 +235,17 @@ awt::Size SAL_CALL OleEmbeddedObject::getVisualAreaSize( sal_Int64 nAspect ) { } + if (bBackToLoaded) + { + try + { + changeState(embed::EmbedStates::LOADED); + } + catch( const uno::Exception& ) + { + } + } + if ( !bSuccess ) { try |