diff options
author | jan Iversen <jani@libreoffice.org> | 2018-01-07 13:16:25 +0100 |
---|---|---|
committer | jan Iversen <jani@libreoffice.org> | 2018-01-07 14:20:06 +0100 |
commit | 54982d5fea21d9e81e1561a74fd341ddb0570c91 (patch) | |
tree | 00d26967ef77aaf78a28368957af62861ef090c4 | |
parent | 8fad35be9fe598c447fb0a76c086b59a15045c8b (diff) |
svx, check HAVE_FEATURE_AVMEDIA
unoshap4.cxx did not obey HAVE_FEATURE_AVMEDIA.
Change-Id: Id41cddd0a74c43819adc0b64c0dd84ae9d4f54ed
-rw-r--r-- | svx/source/svdraw/svdomedia.cxx | 10 | ||||
-rw-r--r-- | svx/source/unodraw/unoshap4.cxx | 30 |
2 files changed, 40 insertions, 0 deletions
diff --git a/svx/source/svdraw/svdomedia.cxx b/svx/source/svdraw/svdomedia.cxx index 974cf3b56300..bece1c68cece 100644 --- a/svx/source/svdraw/svdomedia.cxx +++ b/svx/source/svdraw/svdomedia.cxx @@ -308,8 +308,10 @@ void SdrMediaObj::SetInputStream(uno::Reference<io::XInputStream> const& xStream if (bSuccess) { m_xImpl->m_pTempFile.reset(new MediaTempFile(tempFileURL)); +#if HAVE_FEATURE_AVMEDIA m_xImpl->m_MediaProperties.setURL( m_xImpl->m_LastFailedPkgURL, tempFileURL, ""); +#endif } m_xImpl->m_LastFailedPkgURL.clear(); // once only } @@ -378,12 +380,16 @@ void SdrMediaObj::mediaPropertiesChanged( const ::avmedia::MediaItem& rNewProper { m_xImpl->m_pTempFile.reset( new MediaTempFile(tempFileURL)); +#if HAVE_FEATURE_AVMEDIA m_xImpl->m_MediaProperties.setURL(url, tempFileURL, ""); +#endif } else // this case is for Clone via operator= { m_xImpl->m_pTempFile.reset(); +#if HAVE_FEATURE_AVMEDIA m_xImpl->m_MediaProperties.setURL("", "", ""); +#endif // UGLY: oox import also gets here, because unlike ODF // getDocumentStorage() is not the imported file... m_xImpl->m_LastFailedPkgURL = url; @@ -391,14 +397,18 @@ void SdrMediaObj::mediaPropertiesChanged( const ::avmedia::MediaItem& rNewProper } else { +#if HAVE_FEATURE_AVMEDIA m_xImpl->m_MediaProperties.setURL(url, rNewProperties.getTempURL(), ""); +#endif } } else { m_xImpl->m_pTempFile.reset(); +#if HAVE_FEATURE_AVMEDIA m_xImpl->m_MediaProperties.setURL(url, "", rNewProperties.getReferer()); +#endif } bBroadcastChanged = true; } diff --git a/svx/source/unodraw/unoshap4.cxx b/svx/source/unodraw/unoshap4.cxx index 080a2cb154c9..5a0de83053eb 100644 --- a/svx/source/unodraw/unoshap4.cxx +++ b/svx/source/unodraw/unoshap4.cxx @@ -54,6 +54,8 @@ #include <vcl/wmf.hxx> #include <svtools/embedhlp.hxx> +#include <config_features.h> + using namespace ::cppu; using namespace ::com::sun::star; @@ -797,6 +799,7 @@ bool SvxMediaShape::setPropertyValueImpl( const OUString& rName, const SfxItemPr switch( pProperty->nWID ) { case OWN_ATTR_MEDIA_URL: +#if HAVE_FEATURE_AVMEDIA { OUString aURL; if( rValue >>= aURL ) @@ -805,9 +808,11 @@ bool SvxMediaShape::setPropertyValueImpl( const OUString& rName, const SfxItemPr aItem.setURL( aURL, "", referer_ ); } } +#endif break; case OWN_ATTR_MEDIA_LOOP: +#if HAVE_FEATURE_AVMEDIA { bool bLoop; @@ -817,9 +822,11 @@ bool SvxMediaShape::setPropertyValueImpl( const OUString& rName, const SfxItemPr aItem.setLoop( bLoop ); } } +#endif break; case OWN_ATTR_MEDIA_MUTE: +#if HAVE_FEATURE_AVMEDIA { bool bMute; @@ -829,9 +836,11 @@ bool SvxMediaShape::setPropertyValueImpl( const OUString& rName, const SfxItemPr aItem.setMute( bMute ); } } +#endif break; case OWN_ATTR_MEDIA_VOLUMEDB: +#if HAVE_FEATURE_AVMEDIA { sal_Int16 nVolumeDB = sal_Int16(); @@ -841,9 +850,11 @@ bool SvxMediaShape::setPropertyValueImpl( const OUString& rName, const SfxItemPr aItem.setVolumeDB( nVolumeDB ); } } +#endif break; case OWN_ATTR_MEDIA_ZOOM: +#if HAVE_FEATURE_AVMEDIA { css::media::ZoomLevel eLevel; @@ -853,9 +864,11 @@ bool SvxMediaShape::setPropertyValueImpl( const OUString& rName, const SfxItemPr aItem.setZoom( eLevel ); } } +#endif break; case OWN_ATTR_MEDIA_MIMETYPE: +#if HAVE_FEATURE_AVMEDIA { OUString sMimeType; if( rValue >>= sMimeType ) @@ -864,9 +877,11 @@ bool SvxMediaShape::setPropertyValueImpl( const OUString& rName, const SfxItemPr aItem.setMimeType( sMimeType ); } } +#endif break; case OWN_ATTR_MEDIA_STREAM: +#if HAVE_FEATURE_AVMEDIA try { uno::Reference<io::XInputStream> xStream; @@ -889,6 +904,7 @@ bool SvxMediaShape::setPropertyValueImpl( const OUString& rName, const SfxItemPr static_cast<OWeakObject *>(this), makeAny(e)); } +#endif break; default: @@ -925,23 +941,33 @@ bool SvxMediaShape::getPropertyValueImpl( const OUString& rName, const SfxItemPr switch( pProperty->nWID ) { case OWN_ATTR_MEDIA_URL: +#if HAVE_FEATURE_AVMEDIA rValue <<= aItem.getURL(); +#endif break; case OWN_ATTR_MEDIA_LOOP: +#if HAVE_FEATURE_AVMEDIA rValue <<= aItem.isLoop(); +#endif break; case OWN_ATTR_MEDIA_MUTE: +#if HAVE_FEATURE_AVMEDIA rValue <<= aItem.isMute(); +#endif break; case OWN_ATTR_MEDIA_VOLUMEDB: +#if HAVE_FEATURE_AVMEDIA rValue <<= aItem.getVolumeDB(); +#endif break; case OWN_ATTR_MEDIA_ZOOM: +#if HAVE_FEATURE_AVMEDIA rValue <<= aItem.getZoom(); +#endif break; case OWN_ATTR_MEDIA_STREAM: @@ -967,11 +993,15 @@ bool SvxMediaShape::getPropertyValueImpl( const OUString& rName, const SfxItemPr break; case OWN_ATTR_MEDIA_TEMPFILEURL: +#if HAVE_FEATURE_AVMEDIA rValue <<= aItem.getTempURL(); +#endif break; case OWN_ATTR_MEDIA_MIMETYPE: +#if HAVE_FEATURE_AVMEDIA rValue <<= aItem.getMimeType(); +#endif break; case OWN_ATTR_FALLBACK_GRAPHIC: |