diff options
author | Szymon Kłos <szymon.klos@collabora.com> | 2022-01-31 17:15:21 +0100 |
---|---|---|
committer | Szymon Kłos <szymon.klos@collabora.com> | 2022-02-05 12:15:28 +0100 |
commit | f609a16a52f1ac37f1edd297cf1d9e5f2a294724 (patch) | |
tree | a5a8efb46646538283b5ad9c3a7ee178b5c2e170 /sfx2 | |
parent | c59f37b9735a0ca122f29606508c50d25bbaa985 (diff) |
lok: render image preview with lower resolution
renderShapeSelection callback is used to render
image previews which are later used during
eg. rotation.
Do not render preview with original size which
slows down app a lot. Use 1280x720 max.
Change-Id: Ia8365a67d87cea869ef74cb70ce4830439a523b6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129376
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129497
Tested-by: Jenkins
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/doc/objstor.cxx | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx index d07d406ec271..c5ad72f500ae 100644 --- a/sfx2/source/doc/objstor.cxx +++ b/sfx2/source/doc/objstor.cxx @@ -2411,6 +2411,7 @@ bool SfxObjectShell::ExportTo( SfxMedium& rMedium ) bool bHasBaseURL = false; bool bHasFilterName = false; bool bIsRedactMode = false; + bool bIsPreview = false; sal_Int32 nEnd = aOldArgs.getLength(); for ( sal_Int32 i = 0; i < nEnd; i++ ) @@ -2428,6 +2429,13 @@ bool SfxObjectShell::ExportTo( SfxMedium& rMedium ) bHasFilterName = true; } + const css::uno::Sequence<css::beans::PropertyValue>& rMediumArgs = rMedium.GetArgs(); + for ( sal_Int32 i = 0; i < rMediumArgs.getLength(); i++ ) + { + if( rMediumArgs[i].Name == "IsPreview" ) + rMediumArgs[i].Value >>= bIsPreview; + } + // FIXME: Handle this inside TransformItems() if (pItems->GetItemState(SID_IS_REDACT_MODE) == SfxItemState::SET) bIsRedactMode = true; @@ -2473,6 +2481,14 @@ bool SfxObjectShell::ExportTo( SfxMedium& rMedium ) pArgs[nEnd-1].Value <<= bIsRedactMode; } + if (bIsPreview) + { + aArgs.realloc( ++nEnd ); + auto pArgs = aArgs.getArray(); + pArgs[nEnd-1].Name = "IsPreview"; + pArgs[nEnd-1].Value <<= bIsPreview; + } + return xFilter->filter( aArgs ); }catch(...) {} |