[Libreoffice-commits] core.git: Branch 'distro/vector/vector-7.0' - sfx2/source
Miklos Vajna (via logerrit)
logerrit at kemper.freedesktop.org
Wed Sep 1 12:28:26 UTC 2021
sfx2/source/doc/sfxbasemodel.cxx | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
New commits:
commit 1e7a4b148a384a408662015da7fc701a24917a2f
Author: Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Tue Aug 31 17:18:59 2021 +0200
Commit: Miklos Vajna <vmiklos at collabora.com>
CommitDate: Wed Sep 1 14:27:53 2021 +0200
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 at collabora.com>
Tested-by: Jenkins
(cherry picked from commit 5d0860ed0600904a03459e8bf5a6792c671463a4)
diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx
index 533650751d75..adcea5aaf752 100644
--- a/sfx2/source/doc/sfxbasemodel.cxx
+++ b/sfx2/source/doc/sfxbasemodel.cxx
@@ -1680,7 +1680,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 );
More information about the Libreoffice-commits
mailing list