diff options
author | jan Iversen <jani@libreoffice.org> | 2017-10-09 19:09:50 +0200 |
---|---|---|
committer | jan Iversen <jani@libreoffice.org> | 2017-10-09 19:13:54 +0200 |
commit | d9675f7a9b99b7d729b3d5318b905aaf5b2aedec (patch) | |
tree | 4f4373d419f6d6492ac9889a6483fa2cf3019c96 /sc | |
parent | 9f89fce1fb913339e8f9c24feef1742195c7fa40 (diff) |
sc, implement HAVE_FEATURE_AVMEDIA
iOS does not support avmedia, therefore HAVE_FEATURE_AVMEDIA
is set, however not all sources test for it.
Change-Id: I627d1a45420d4af093c57bc53d716d48bf3a4b00
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/app/scdll.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/drawfunc/fuins1.cxx | 14 | ||||
-rw-r--r-- | sc/source/ui/view/tabvwshg.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/view/viewfun4.cxx | 2 |
4 files changed, 23 insertions, 1 deletions
diff --git a/sc/source/ui/app/scdll.cxx b/sc/source/ui/app/scdll.cxx index 6d557f7a2d0b..b619404a4842 100644 --- a/sc/source/ui/app/scdll.cxx +++ b/sc/source/ui/app/scdll.cxx @@ -17,6 +17,8 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <config_features.h> + #include <editeng/eeitem.hxx> #include <svx/fmobjfac.hxx> @@ -187,7 +189,9 @@ void ScDLL::Init() CharmapPopup::RegisterControl(SID_CHARMAP_CONTROL, pMod ); // Media Controller +#if HAVE_FEATURE_AVMEDIA ::avmedia::MediaToolBoxControl::RegisterControl( SID_AVMEDIA_TOOLBOX, pMod ); +#endif // Common SFX Controller ::sfx2::sidebar::SidebarChildWindow::RegisterChildWindow(false, pMod); diff --git a/sc/source/ui/drawfunc/fuins1.cxx b/sc/source/ui/drawfunc/fuins1.cxx index 37aa583be912..09f0cead255b 100644 --- a/sc/source/ui/drawfunc/fuins1.cxx +++ b/sc/source/ui/drawfunc/fuins1.cxx @@ -17,6 +17,8 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <config_features.h> + #include <sfx2/opengrf.hxx> #include <svx/svdograf.hxx> #include <svx/svdomedia.hxx> @@ -207,8 +209,12 @@ static void lcl_InsertMedia( const OUString& rMediaURL, bool bApi, { uno::Reference<frame::XModel> const xModel( rData.GetDocument()->GetDocumentShell()->GetModel()); +#if HAVE_FEATURE_AVMEDIA bool const bRet = ::avmedia::EmbedMedia(xModel, rMediaURL, realURL); if (!bRet) { return; } +#else + return; +#endif } SdrMediaObj* pObj = new SdrMediaObj( tools::Rectangle( aInsertPos, aSize ) ); @@ -312,13 +318,18 @@ FuInsertMedia::FuInsertMedia( ScTabViewShell* pViewSh, } bool bLink(true); - if (bAPI || ::avmedia::MediaWindow::executeMediaURLDialog(pWin, aURL, &bLink)) + if (bAPI +#if HAVE_FEATURE_AVMEDIA + || ::avmedia::MediaWindow::executeMediaURLDialog(pWin, aURL, &bLink) +#endif + ) { Size aPrefSize; if( pWin ) pWin->EnterWait(); +#if HAVE_FEATURE_AVMEDIA if( !::avmedia::MediaWindow::isMediaURL( aURL, ""/*TODO?*/, true, &aPrefSize ) ) { if( pWin ) @@ -328,6 +339,7 @@ FuInsertMedia::FuInsertMedia( ScTabViewShell* pViewSh, ::avmedia::MediaWindow::executeFormatErrorBox( pWindow ); } else +#endif { lcl_InsertMedia( aURL, bAPI, pViewSh, pWindow, pView, aPrefSize, bLink ); diff --git a/sc/source/ui/view/tabvwshg.cxx b/sc/source/ui/view/tabvwshg.cxx index 596d0e94e2ee..4c8ef350625a 100644 --- a/sc/source/ui/view/tabvwshg.cxx +++ b/sc/source/ui/view/tabvwshg.cxx @@ -17,6 +17,8 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <config_features.h> + #include <tools/urlobj.hxx> #include <svx/fmglob.hxx> #include <svx/svdouno.hxx> @@ -84,10 +86,12 @@ void ScTabViewShell::InsertURLButton( const OUString& rName, const OUString& rUR xPropSet->setPropertyValue("ButtonType", uno::Any(form::FormButtonType_URL) ); +#if HAVE_FEATURE_AVMEDIA if ( ::avmedia::MediaWindow::isMediaURL( rURL, ""/*TODO?*/ ) ) { xPropSet->setPropertyValue("DispatchURLInternal", uno::Any(true) ); } +#endif Point aPos; if (pInsPos) diff --git a/sc/source/ui/view/viewfun4.cxx b/sc/source/ui/view/viewfun4.cxx index 6439efb19fa5..641bd4421325 100644 --- a/sc/source/ui/view/viewfun4.cxx +++ b/sc/source/ui/view/viewfun4.cxx @@ -587,6 +587,7 @@ bool ScViewFunc::PasteFile( const Point& rPos, const OUString& rFile, bool bLink OUString aStrURL = aURL.GetMainURL( INetURLObject::DecodeMechanism::NONE ); // is it a media URL? +#if HAVE_FEATURE_AVMEDIA if( ::avmedia::MediaWindow::isMediaURL( aStrURL, ""/*TODO?*/ ) ) { const SfxStringItem aMediaURLItem( SID_INSERT_AVMEDIA, aStrURL ); @@ -594,6 +595,7 @@ bool ScViewFunc::PasteFile( const Point& rPos, const OUString& rFile, bool bLink SID_INSERT_AVMEDIA, SfxCallMode::SYNCHRON, { &aMediaURLItem }) ); } +#endif if (!bLink) // for bLink only graphics or URL { |