diff options
author | jan Iversen <jani@libreoffice.org> | 2017-10-09 19:10:13 +0200 |
---|---|---|
committer | jan Iversen <jani@libreoffice.org> | 2017-10-09 19:13:55 +0200 |
commit | 64b3b366da326ca4eeb42c8c6195f21e2c563663 (patch) | |
tree | 1c0a9267227009dadb6abb76eb9557608912c239 /sd | |
parent | d9675f7a9b99b7d729b3d5318b905aaf5b2aedec (diff) |
sd, implement HAVE_FEATURE_AVMEDIA
iOS does not support avmedia, therefore HAVE_FEATURE_AVMEDIA
is set, however not all sources test for it.
Change-Id: I7315dce08fef6e18c026d628c87d29ca201b1f8a
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/ui/app/sddll.cxx | 6 | ||||
-rw-r--r-- | sd/source/ui/func/fuinsert.cxx | 15 | ||||
-rw-r--r-- | sd/source/ui/func/fusel.cxx | 4 | ||||
-rw-r--r-- | sd/source/ui/slideshow/slideshowimpl.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/view/drviews2.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/view/drviews6.cxx | 4 | ||||
-rw-r--r-- | sd/source/ui/view/drviewse.cxx | 6 | ||||
-rw-r--r-- | sd/source/ui/view/drvwshrg.cxx | 6 | ||||
-rw-r--r-- | sd/source/ui/view/sdview4.cxx | 16 |
9 files changed, 59 insertions, 2 deletions
diff --git a/sd/source/ui/app/sddll.cxx b/sd/source/ui/app/sddll.cxx index 4e2c083d27d8..34c64345caf5 100644 --- a/sd/source/ui/app/sddll.cxx +++ b/sd/source/ui/app/sddll.cxx @@ -17,6 +17,8 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <config_features.h> + #include <avmedia/mediaplayer.hxx> #include <avmedia/mediatoolbox.hxx> #include <editeng/eeitem.hxx> @@ -173,7 +175,9 @@ void SdDLL::RegisterControllers(SdModule* pMod) SvxIMapDlgChildWindow::RegisterChildWindow(false, pMod); SvxHlinkDlgWrapper::RegisterChildWindow(false, pMod); ::sd::SpellDialogChildWindow::RegisterChildWindow(false, pMod); +#if HAVE_FEATURE_AVMEDIA ::avmedia::MediaPlayer::RegisterChildWindow(false, pMod); +#endif ::sd::LeftPaneImpressChildWindow::RegisterChildWindow(false, pMod); ::sd::LeftPaneDrawChildWindow::RegisterChildWindow(false, pMod); ::sfx2::sidebar::SidebarChildWindow::RegisterChildWindow(false, pMod); @@ -221,7 +225,9 @@ void SdDLL::RegisterControllers(SdModule* pMod) svx::TextCharacterSpacingPopup::RegisterControl(SID_ATTR_CHAR_KERNING, pMod); svx::TextUnderlinePopup::RegisterControl(SID_ATTR_CHAR_UNDERLINE, pMod); +#if HAVE_FEATURE_AVMEDIA ::avmedia::MediaToolBoxControl::RegisterControl( SID_AVMEDIA_TOOLBOX, pMod ); +#endif XmlSecStatusBarControl::RegisterControl( SID_SIGNATURE, pMod ); SdTemplateControl::RegisterControl( SID_STATUS_LAYOUT, pMod ); SvxTableToolBoxControl::RegisterControl(SID_INSERT_TABLE, pMod ); diff --git a/sd/source/ui/func/fuinsert.cxx b/sd/source/ui/func/fuinsert.cxx index 99b653e283c5..9eff165c67b8 100644 --- a/sd/source/ui/func/fuinsert.cxx +++ b/sd/source/ui/func/fuinsert.cxx @@ -17,6 +17,8 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <config_features.h> + #include "fuinsert.hxx" #include <comphelper/storagehelper.hxx> @@ -708,13 +710,18 @@ void FuInsertAVMedia::DoExecute( SfxRequest& rReq ) } bool bLink(true); - if (bAPI || ::avmedia::MediaWindow::executeMediaURLDialog(mpWindow, aURL, & bLink)) + if (bAPI +#if HAVE_FEATURE_AVMEDIA + || ::avmedia::MediaWindow::executeMediaURLDialog(mpWindow, aURL, & bLink) +#endif + ) { Size aPrefSize; if( mpWindow ) mpWindow->EnterWait(); +#if HAVE_FEATURE_AVMEDIA if( !::avmedia::MediaWindow::isMediaURL( aURL, "", true, &aPrefSize ) ) { if( mpWindow ) @@ -751,6 +758,12 @@ void FuInsertAVMedia::DoExecute( SfxRequest& rReq ) if( mpWindow ) mpWindow->LeaveWait(); } +#else + if( mpWindow ) + mpWindow->LeaveWait(); + (void) aPrefSize; + (void) bLink; +#endif } } diff --git a/sd/source/ui/func/fusel.cxx b/sd/source/ui/func/fusel.cxx index 9c130112d2ed..cbec9b552f2a 100644 --- a/sd/source/ui/func/fusel.cxx +++ b/sd/source/ui/func/fusel.cxx @@ -17,6 +17,8 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <config_features.h> + #include "fusel.hxx" #include <basic/sbstar.hxx> #include <svx/svddrgmt.hxx> @@ -1338,6 +1340,7 @@ bool FuSelection::AnimateObj(SdrObject* pObj, const Point& rPos) case presentation::ClickAction_SOUND: { +#if HAVE_FEATURE_AVMEDIA try { mxPlayer.set( avmedia::MediaWindow::createPlayer( pInfo->GetBookmark(), ""/*TODO?*/), uno::UNO_QUERY_THROW ); @@ -1346,6 +1349,7 @@ bool FuSelection::AnimateObj(SdrObject* pObj, const Point& rPos) catch( uno::Exception& ) { } +#endif bAnimated = true; } break; diff --git a/sd/source/ui/slideshow/slideshowimpl.cxx b/sd/source/ui/slideshow/slideshowimpl.cxx index 358b603f7c86..fa65f795fefe 100644 --- a/sd/source/ui/slideshow/slideshowimpl.cxx +++ b/sd/source/ui/slideshow/slideshowimpl.cxx @@ -1444,6 +1444,7 @@ void SlideshowImpl::click( const Reference< XShape >& xShape ) break; case ClickAction_SOUND: { +#if HAVE_FEATURE_AVMEDIA try { mxPlayer.set(avmedia::MediaWindow::createPlayer(pEvent->maStrBookmark, ""/*TODO?*/), uno::UNO_QUERY_THROW ); @@ -1453,6 +1454,7 @@ void SlideshowImpl::click( const Reference< XShape >& xShape ) { OSL_FAIL("sd::SlideshowImpl::click(), exception caught!" ); } +#endif } break; diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx index 9804ef62fc33..34091ac6af99 100644 --- a/sd/source/ui/view/drviews2.cxx +++ b/sd/source/ui/view/drviews2.cxx @@ -2856,6 +2856,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) } break; +#if HAVE_FEATURE_AVMEDIA case SID_AVMEDIA_PLAYER: { GetViewFrame()->ToggleChildWindow( ::avmedia::MediaPlayer::GetChildWindowId() ); @@ -2864,6 +2865,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) rReq.Ignore (); } break; +#endif case SID_PRESENTATION_MINIMIZER: { diff --git a/sd/source/ui/view/drviews6.cxx b/sd/source/ui/view/drviews6.cxx index dc144d3429e3..7232e772deb3 100644 --- a/sd/source/ui/view/drviews6.cxx +++ b/sd/source/ui/view/drviews6.cxx @@ -17,6 +17,8 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <config_features.h> + #include "DrawViewShell.hxx" #include <vcl/metaact.hxx> #include <sfx2/request.hxx> @@ -242,11 +244,13 @@ void DrawViewShell::SetChildWindowState( SfxItemSet& rSet ) sal_uInt16 nId = Svx3DChildWindow::GetChildWindowId(); rSet.Put( SfxBoolItem( SID_3D_WIN, GetViewFrame()->HasChildWindow( nId ) ) ); } +#if HAVE_FEATURE_AVMEDIA if( SfxItemState::DEFAULT == rSet.GetItemState( SID_AVMEDIA_PLAYER ) ) { sal_uInt16 nId = ::avmedia::MediaPlayer::GetChildWindowId(); rSet.Put( SfxBoolItem( SID_AVMEDIA_PLAYER, GetViewFrame()->HasChildWindow( nId ) ) ); } +#endif } /** diff --git a/sd/source/ui/view/drviewse.cxx b/sd/source/ui/view/drviewse.cxx index 0c26b58e1c75..e47d943cbb10 100644 --- a/sd/source/ui/view/drviewse.cxx +++ b/sd/source/ui/view/drviewse.cxx @@ -17,6 +17,8 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <config_features.h> + #include <com/sun/star/presentation/XPresentation2.hpp> #include <com/sun/star/form/FormButtonType.hpp> #include <com/sun/star/beans/XPropertySet.hpp> @@ -1497,10 +1499,12 @@ void DrawViewShell::InsertURLButton(const OUString& rURL, const OUString& rText, xPropSet->setPropertyValue("TargetFrame" , Any( rTarget ) ); xPropSet->setPropertyValue( "ButtonType" , Any( form::FormButtonType_URL ) ); +#if HAVE_FEATURE_AVMEDIA if ( ::avmedia::MediaWindow::isMediaURL( rURL, ""/*TODO?*/ ) ) { xPropSet->setPropertyValue( "DispatchURLInternal" , Any( true ) ); } +#endif } else { @@ -1532,8 +1536,10 @@ void DrawViewShell::InsertURLButton(const OUString& rURL, const OUString& rText, xPropSet->setPropertyValue( "TargetFrame" , Any( rTarget ) ); xPropSet->setPropertyValue( "ButtonType" , Any( form::FormButtonType_URL ) ); +#if HAVE_FEATURE_AVMEDIA if ( ::avmedia::MediaWindow::isMediaURL( rURL, ""/*TODO?*/ ) ) xPropSet->setPropertyValue( "DispatchURLInternal" , Any( true ) ); +#endif Point aPos; diff --git a/sd/source/ui/view/drvwshrg.cxx b/sd/source/ui/view/drvwshrg.cxx index 934e4ef6283f..289360759599 100644 --- a/sd/source/ui/view/drvwshrg.cxx +++ b/sd/source/ui/view/drvwshrg.cxx @@ -17,6 +17,8 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <config_features.h> + #include "DrawViewShell.hxx" #include <sfx2/request.hxx> #include <sfx2/templdlg.hxx> @@ -75,7 +77,9 @@ void DrawViewShell::InitInterface_Impl() GetStaticInterface()->RegisterChildWindow(SvxHlinkDlgWrapper::GetChildWindowId()); GetStaticInterface()->RegisterChildWindow(::sd::SpellDialogChildWindow::GetChildWindowId()); GetStaticInterface()->RegisterChildWindow(SID_SEARCH_DLG); +#if HAVE_FEATURE_AVMEDIA GetStaticInterface()->RegisterChildWindow(::avmedia::MediaPlayer::GetChildWindowId()); +#endif GetStaticInterface()->RegisterChildWindow(::sfx2::sidebar::SidebarChildWindow::GetChildWindowId()); } @@ -98,7 +102,9 @@ void GraphicViewShell::InitInterface_Impl() GetStaticInterface()->RegisterChildWindow(SvxHlinkDlgWrapper::GetChildWindowId()); GetStaticInterface()->RegisterChildWindow(::sd::SpellDialogChildWindow::GetChildWindowId()); GetStaticInterface()->RegisterChildWindow(SID_SEARCH_DLG); +#if HAVE_FEATURE_AVMEDIA GetStaticInterface()->RegisterChildWindow(::avmedia::MediaPlayer::GetChildWindowId()); +#endif GetStaticInterface()->RegisterChildWindow(::sfx2::sidebar::SidebarChildWindow::GetChildWindowId()); } diff --git a/sd/source/ui/view/sdview4.cxx b/sd/source/ui/view/sdview4.cxx index 2435a576972d..ee87d4bb83e7 100644 --- a/sd/source/ui/view/sdview4.cxx +++ b/sd/source/ui/view/sdview4.cxx @@ -17,6 +17,8 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <config_features.h> + #include "View.hxx" #include <osl/file.hxx> #include <sfx2/bindings.hxx> @@ -285,8 +287,12 @@ void View::InsertMediaURL( const OUString& rMediaURL, sal_Int8& rAction, { uno::Reference<frame::XModel> const xModel( GetDoc().GetObjectShell()->GetModel()); +#if HAVE_FEATURE_AVMEDIA bool const bRet = ::avmedia::EmbedMedia(xModel, rMediaURL, realURL); if (!bRet) { return; } +#else + return; +#endif } InsertMediaObj( realURL, "application/vnd.sun.star.media", rAction, rPos, rSize ); @@ -300,8 +306,10 @@ void View::Insert3DModelURL( OUString sRealURL; uno::Reference<frame::XModel> const xModel( GetDoc().GetObjectShell()->GetModel()); +#if HAVE_FEATURE_AVMEDIA bool const bRet = ::avmedia::Embed3DModel(xModel, rModelURL, sRealURL); if (!bRet) +#endif return; SdrMediaObj* pRetObject = InsertMediaObj( sRealURL, "model/vnd.gltf+json", rAction, rPos, rSize ); @@ -417,7 +425,10 @@ IMPL_LINK_NOARG(View, DropInsertFileHdl, Timer *, void) aCurrentDropFile = aURL.GetMainURL( INetURLObject::DecodeMechanism::NONE ); +#if HAVE_FEATURE_AVMEDIA if( !::avmedia::MediaWindow::isMediaURL( aCurrentDropFile, ""/*TODO?*/ ) ) +#else +#endif { if( !rGraphicFilter.ImportGraphic( aGraphic, aURL ) ) { @@ -476,6 +487,7 @@ IMPL_LINK_NOARG(View, DropInsertFileHdl, Timer *, void) if( !bOK ) { +#if HAVE_FEATURE_AVMEDIA Size aPrefSize; if( ::avmedia::MediaWindow::isMediaURL( aCurrentDropFile, ""/*TODO?*/ ) && @@ -495,7 +507,9 @@ IMPL_LINK_NOARG(View, DropInsertFileHdl, Timer *, void) InsertMediaURL( aCurrentDropFile, mnAction, maDropPos, aPrefSize, true ) ; } - else if( mnAction & DND_ACTION_LINK ) + else +#endif + if( mnAction & DND_ACTION_LINK ) static_cast< DrawViewShell* >( mpViewSh )->InsertURLButton( aCurrentDropFile, aCurrentDropFile, OUString(), &maDropPos ); else { |