summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorSzymon Kłos <eszkadev@gmail.com>2022-01-31 17:15:21 +0100
committerSzymon Kłos <szymon.klos@collabora.com>2022-02-03 10:06:16 +0100
commitd01b1b174f4e18b8bef23f7409d4e9cf4f07d232 (patch)
tree6c5de28315aeff8d3105b3b55ac6938f157df6d3 /sfx2
parent7ac5b1515e0153a8f1eb5ddb05b588ba33bc3a58 (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 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/doc/objstor.cxx15
1 files changed, 15 insertions, 0 deletions
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index 9b696bdc0bcb..7ccee4f3a970 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;
@@ -2468,6 +2476,13 @@ bool SfxObjectShell::ExportTo( SfxMedium& rMedium )
aArgs[nEnd-1].Value <<= bIsRedactMode;
}
+ if (bIsPreview)
+ {
+ aArgs.realloc( ++nEnd );
+ aArgs[nEnd-1].Name = "IsPreview";
+ aArgs[nEnd-1].Value <<= bIsPreview;
+ }
+
return xFilter->filter( aArgs );
}catch(...)
{}