summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2021-08-31 17:18:59 +0200
committerMiklos Vajna <vmiklos@collabora.com>2021-09-01 06:58:58 +0200
commit5d0860ed0600904a03459e8bf5a6792c671463a4 (patch)
tree000221baf18e15f7dee5045f91f195736e86b523 /sfx2
parentd5ade739771ddf06cc7ee6d4af15672bfcf09ed6 (diff)
sfx2: allow storeAsURL() on the main thread
This is similar to commit b030e83fccbff8d82a4c84462075baa8442cde54 (sfx2: allow storeToURL() on the main thread, 2019-02-05), just this handles the 'export' case, not the 'save as' one. Note that this already worked in some cases when impl_store() decided to call storeSelf(), but vcl::solarthread::syncExecute() already avoids dispatch when called on a non-main thread, so that is not a problem. Change-Id: Ief09ba6c60923c7f16d86f61625c0faa9a5f829b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121385 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/doc/sfxbasemodel.cxx11
1 files changed, 10 insertions, 1 deletions
diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx
index 8f4eab0b2b17..0632d52cbca4 100644
--- a/sfx2/source/doc/sfxbasemodel.cxx
+++ b/sfx2/source/doc/sfxbasemodel.cxx
@@ -1708,7 +1708,16 @@ void SAL_CALL SfxBaseModel::storeAsURL( const OUString& rURL
SfxSaveGuard aSaveGuard(this, m_pData.get());
- impl_store( rURL, rArgs, false );
+ utl::MediaDescriptor aDescriptor(rArgs);
+ bool bOnMainThread = aDescriptor.getUnpackedValueOrDefault("OnMainThread", false);
+ if (bOnMainThread)
+ {
+ vcl::solarthread::syncExecute([this, rURL, rArgs]() { impl_store(rURL, rArgs, false); });
+ }
+ else
+ {
+ impl_store(rURL, rArgs, false);
+ }
Sequence< beans::PropertyValue > aSequence ;
TransformItems( SID_OPENDOC, *m_pData->m_pObjectShell->GetMedium()->GetItemSet(), aSequence );