diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2022-08-29 09:23:22 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2022-08-29 10:40:41 +0200 |
commit | cbc6e67d3c88fb6ae39c304604a98eaa504f19cc (patch) | |
tree | 55e366d8db3c238634c1c4f63e954073c0172639 /svx | |
parent | 690458889fd875a7885b692d3204c45c5016b925 (diff) |
avmedia: implement video crop support in the ODP filter
And also import/export the video preview as well. The naming follows the
style used for table shape previews.
The preview is important, since the cropping is relative to the bitmap's
preferred logic size.
Change-Id: I6115284c1f4cf342b3296cd0ac3beb70a809fd1b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138959
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/unodraw/unoshap4.cxx | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/svx/source/unodraw/unoshap4.cxx b/svx/source/unodraw/unoshap4.cxx index 482efb826117..ae26aaabeca6 100644 --- a/svx/source/unodraw/unoshap4.cxx +++ b/svx/source/unodraw/unoshap4.cxx @@ -1071,4 +1071,29 @@ bool SvxMediaShape::getPropertyValueImpl( const OUString& rName, const SfxItemPr } } +bool SvxMediaShape::getPropertyStateImpl(const SfxItemPropertyMapEntry* pProperty, + css::beans::PropertyState& rState) +{ +#if HAVE_FEATURE_AVMEDIA + if (pProperty->nWID == SDRATTR_GRAFCROP) + { + auto pMedia = static_cast<SdrMediaObj*>(GetSdrObject()); + const avmedia::MediaItem& rItem = pMedia->getMediaProperties(); + const text::GraphicCrop& rCrop = rItem.getCrop(); + if (rCrop.Bottom > 0 || rCrop.Left > 0 || rCrop.Right > 0 || rCrop.Top > 0) + { + // The media has a crop, expose it to UNO-based export filters. + rState = beans::PropertyState_DIRECT_VALUE; + } + else + { + rState = beans::PropertyState_AMBIGUOUS_VALUE; + } + return true; + } +#endif + + return SvxShape::getPropertyStateImpl(pProperty, rState); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |