diff options
author | Caolán McNamara <caolanm@redhat.com> | 2016-09-23 17:10:18 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2016-09-27 09:14:57 +0000 |
commit | e6fc195ae8a59d665395149ea5f06749c4c6a596 (patch) | |
tree | 6303584da1438b39de7a8af8ce7e95c023a4df3e /embeddedobj | |
parent | d378cd2f766eeb1fd1c98f62c9ae6b5b59fd00f1 (diff) |
Resolves: tdf#98946 too many running MathTypes...
causes mathtype to display a warning dialog, so
try restoring them back to loaded after loading
them in order to get their preferred size
Change-Id: Idff714efa228a739f380dbae429d852a8f8c5298
Reviewed-on: https://gerrit.libreoffice.org/29234
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
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 |