summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2022-01-31 17:15:21 +0100
committerAndras Timar <andras.timar@collabora.com>2022-02-20 14:18:35 +0100
commitb2f4d1a3f345bd5439143f5260d7610fa8f32595 (patch)
tree84b8170181c71744bafe9f73be42a8479f83d6cc /sfx2
parent5bf680b30c820d36db1314cdb55ecf1354cf8503 (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.cxx16
1 files changed, 16 insertions, 0 deletions
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index 06602206cfe9..548ce34b1c21 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(...)
{}