summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2021-05-07 12:31:24 +0200
committerMiklos Vajna <vmiklos@collabora.com>2021-05-12 14:04:53 +0200
commit082bef47ce0be2e51fefb7cf71300c13b2a29eae (patch)
tree3b8609a8fa0afb16a103609c4be2237e73a33d51 /svtools
parentd3ab4fc0ba8e62d4f25caf5d759eb54d3f7ecd94 (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. (cherry picked from commit d5cd62164d32273a25913c93aa04be9f7f3a4073) Change-Id: Icf1e7722d33a809fa671d1505b2a0155af040c71
Diffstat (limited to 'svtools')
-rw-r--r--svtools/source/misc/embedhlp.cxx2
1 files changed, 2 insertions, 0 deletions
diff --git a/svtools/source/misc/embedhlp.cxx b/svtools/source/misc/embedhlp.cxx
index 2319485a65bd..f8dcf1356621 100644
--- a/svtools/source/misc/embedhlp.cxx
+++ b/svtools/source/misc/embedhlp.cxx
@@ -486,6 +486,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&)
{
@@ -504,6 +505,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;
}