diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2021-05-07 12:31:24 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2021-05-07 14:21:40 +0200 |
commit | d5cd62164d32273a25913c93aa04be9f7f3a4073 (patch) | |
tree | cd5136b2c652071225721ac16c933033eb8a4662 /svtools | |
parent | 5ed1e84ce2acbcc8700a49549b68fe7be19f94d0 (diff) |
embeddedobj: handle getting the visible area on a thread
The Windows OLE2 implementation of the embedded object interface assumes
that the same thread is used for loading and saving the embedded
objects.
This means that in case the main thread is used for loading (e.g. from
remote UNO, but with OnMainThead=true), but a
thread is used for storing (without an explicit OnMainThead=true), then
the underlying win32 API call failed and we returned a fixed size in
EmbeddedObjectRef::GetSize().
Fix the problem by explicitly checking for RPC_E_WRONG_THREAD and adding
error handling for that case.
Change-Id: Icf1e7722d33a809fa671d1505b2a0155af040c71
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115236
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/source/misc/embedhlp.cxx | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/svtools/source/misc/embedhlp.cxx b/svtools/source/misc/embedhlp.cxx index 2fb3954ef722..b37209e891de 100644 --- a/svtools/source/misc/embedhlp.cxx +++ b/svtools/source/misc/embedhlp.cxx @@ -488,6 +488,7 @@ Size EmbeddedObjectRef::GetSize( MapMode const * pTargetMapMode ) const } catch(const embed::NoVisualAreaSizeException&) { + SAL_WARN("svtools.misc", "EmbeddedObjectRef::GetSize: no visual area size"); } catch (const uno::Exception&) { @@ -506,6 +507,7 @@ Size EmbeddedObjectRef::GetSize( MapMode const * pTargetMapMode ) const if ( !aSize.Height && !aSize.Width ) { + SAL_WARN("svtools.misc", "EmbeddedObjectRef::GetSize: empty size, defaulting to 5x5cm"); aSize.Width = 5000; aSize.Height = 5000; } |