summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2022-08-29 09:23:22 +0200
committerMiklos Vajna <vmiklos@collabora.com>2022-08-29 16:51:26 +0200
commit3b88c304dce2e9d64b9d19b25ed57df5b581e834 (patch)
tree2dd809e7cd95843a8e3fdcc8261bbe2daf5c5ecb /svx
parent6894da107db06c66356e52844c4a8d263e0a64d8 (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. (cherry picked from commit cbc6e67d3c88fb6ae39c304604a98eaa504f19cc) Conflicts: xmloff/qa/unit/draw.cxx xmloff/source/draw/shapeexport.cxx Change-Id: I6115284c1f4cf342b3296cd0ac3beb70a809fd1b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138970 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/unodraw/unoshap4.cxx25
1 files changed, 25 insertions, 0 deletions
diff --git a/svx/source/unodraw/unoshap4.cxx b/svx/source/unodraw/unoshap4.cxx
index 50a2a7a09a12..a5f2516161ac 100644
--- a/svx/source/unodraw/unoshap4.cxx
+++ b/svx/source/unodraw/unoshap4.cxx
@@ -1064,4 +1064,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: */