[Libreoffice-commits] core.git: 4 commits - oox/source sc/source sd/source svx/source

jan Iversen jani at libreoffice.org
Mon Oct 9 17:14:51 UTC 2017


 oox/source/export/drawingml.cxx                           |    6 ++++
 sc/source/ui/app/scdll.cxx                                |    4 ++
 sc/source/ui/drawfunc/fuins1.cxx                          |   14 +++++++++-
 sc/source/ui/view/tabvwshg.cxx                            |    4 ++
 sc/source/ui/view/viewfun4.cxx                            |    2 +
 sd/source/ui/app/sddll.cxx                                |    6 ++++
 sd/source/ui/func/fuinsert.cxx                            |   15 ++++++++++-
 sd/source/ui/func/fusel.cxx                               |    4 ++
 sd/source/ui/slideshow/slideshowimpl.cxx                  |    2 +
 sd/source/ui/view/drviews2.cxx                            |    2 +
 sd/source/ui/view/drviews6.cxx                            |    4 ++
 sd/source/ui/view/drviewse.cxx                            |    6 ++++
 sd/source/ui/view/drvwshrg.cxx                            |    6 ++++
 sd/source/ui/view/sdview4.cxx                             |   16 +++++++++++
 svx/source/sdr/contact/viewobjectcontactofsdrmediaobj.cxx |   12 ++++++++
 svx/source/svdraw/svdomedia.cxx                           |   19 ++++++++++++++
 16 files changed, 119 insertions(+), 3 deletions(-)

New commits:
commit a3a89fc81a47640d0cd63453f72717a8ddb3970d
Author: jan Iversen <jani at libreoffice.org>
Date:   Mon Oct 9 19:10:41 2017 +0200

    svx, implement HAVE_FEATURE_AVMEDIA
    
    iOS does not support avmedia, therefore HAVE_FEATURE_AVMEDIA
    is set, however not all sources test for it.
    
    Change-Id: I351d36769f82289e6b7fa61b3509aa1f34458989

diff --git a/svx/source/sdr/contact/viewobjectcontactofsdrmediaobj.cxx b/svx/source/sdr/contact/viewobjectcontactofsdrmediaobj.cxx
index 46f4378f7f52..8b6915259ada 100644
--- a/svx/source/sdr/contact/viewobjectcontactofsdrmediaobj.cxx
+++ b/svx/source/sdr/contact/viewobjectcontactofsdrmediaobj.cxx
@@ -78,8 +78,12 @@ Size ViewObjectContactOfSdrMediaObj::getPreferredSize() const
 {
     Size aRet;
 
+#if HAVE_FEATURE_AVMEDIA
     if( mpMediaWindow )
         aRet = mpMediaWindow->getPreferredSize();
+#else
+   aRet = Size(0,0);
+#endif
 
     return aRet;
 }
@@ -87,6 +91,7 @@ Size ViewObjectContactOfSdrMediaObj::getPreferredSize() const
 
 void ViewObjectContactOfSdrMediaObj::updateMediaItem( ::avmedia::MediaItem& rItem ) const
 {
+#if HAVE_FEATURE_AVMEDIA
     if( mpMediaWindow )
     {
         mpMediaWindow->updateMediaItem( rItem );
@@ -109,11 +114,15 @@ void ViewObjectContactOfSdrMediaObj::updateMediaItem( ::avmedia::MediaItem& rIte
             mpMediaWindow->show();
         }
     }
+#else
+    (void) rItem;
+#endif
 }
 
 
 void ViewObjectContactOfSdrMediaObj::executeMediaItem( const ::avmedia::MediaItem& rItem )
 {
+#if HAVE_FEATURE_AVMEDIA
     if( mpMediaWindow )
     {
         ::avmedia::MediaItem aUpdatedItem;
@@ -124,6 +133,9 @@ void ViewObjectContactOfSdrMediaObj::executeMediaItem( const ::avmedia::MediaIte
         updateMediaItem( aUpdatedItem );
         static_cast< ViewContactOfSdrMediaObj& >( GetViewContact() ).mediaPropertiesChanged( aUpdatedItem );
     }
+#else
+    (void) rItem;
+#endif
 }
 
 
diff --git a/svx/source/svdraw/svdomedia.cxx b/svx/source/svdraw/svdomedia.cxx
index 7dd17c5e7665..94156e43d939 100644
--- a/svx/source/svdraw/svdomedia.cxx
+++ b/svx/source/svdraw/svdomedia.cxx
@@ -170,6 +170,7 @@ SdrMediaObj& SdrMediaObj::operator=(const SdrMediaObj& rObj)
 
 const uno::Reference< graphic::XGraphic > SdrMediaObj::getSnapshot() const
 {
+#if HAVE_FEATURE_AVMEDIA
     if( !m_xImpl->m_xCachedSnapshot.is() )
     {
         OUString aRealURL = m_xImpl->m_MediaProperties.getTempURL();
@@ -177,6 +178,7 @@ const uno::Reference< graphic::XGraphic > SdrMediaObj::getSnapshot() const
             aRealURL = m_xImpl->m_MediaProperties.getURL();
         m_xImpl->m_xCachedSnapshot = avmedia::MediaWindow::grabFrame( aRealURL, m_xImpl->m_MediaProperties.getReferer(), m_xImpl->m_MediaProperties.getMimeType());
     }
+#endif
     return m_xImpl->m_xCachedSnapshot;
 }
 
@@ -229,15 +231,26 @@ void SdrMediaObj::AdjustToMaxRect( const tools::Rectangle& rMaxRect, bool bShrin
 void SdrMediaObj::setURL( const OUString& rURL, const OUString& rReferer, const OUString& rMimeType )
 {
     ::avmedia::MediaItem aURLItem;
+#if HAVE_FEATURE_AVMEDIA
     if( !rMimeType.isEmpty() )
         m_xImpl->m_MediaProperties.setMimeType(rMimeType);
     aURLItem.setURL( rURL, "", rReferer );
+#else
+    (void) rMimeType;
+    (void) rURL;
+    (void) rReferer;
+#endif
     setMediaProperties( aURLItem );
 }
 
 const OUString& SdrMediaObj::getURL() const
 {
+#if HAVE_FEATURE_AVMEDIA
     return m_xImpl->m_MediaProperties.getURL();
+#else
+static OUString ret;
+    return ret;
+#endif
 }
 
 void SdrMediaObj::setMediaProperties( const ::avmedia::MediaItem& rState )
@@ -374,6 +387,7 @@ void SdrMediaObj::SetInputStream(uno::Reference<io::XInputStream> const& xStream
 }
 
 /// copy a stream from XStorage to temp file
+#if HAVE_FEATURE_AVMEDIA
 static bool lcl_HandlePackageURL(
         OUString const & rURL,
         SdrModel const *const pModel,
@@ -406,10 +420,12 @@ static bool lcl_HandlePackageURL(
     }
     return lcl_CopyToTempFile(xInStream, o_rTempFileURL);
 }
+#endif
 
 void SdrMediaObj::mediaPropertiesChanged( const ::avmedia::MediaItem& rNewProperties )
 {
     bool bBroadcastChanged = false;
+#if HAVE_FEATURE_AVMEDIA
     const AVMediaSetMask nMaskSet = rNewProperties.getMaskSet();
 
     // use only a subset of MediaItem properties for own properties
@@ -477,6 +493,9 @@ void SdrMediaObj::mediaPropertiesChanged( const ::avmedia::MediaItem& rNewProper
 
     if( AVMediaSetMask::ZOOM & nMaskSet )
         m_xImpl->m_MediaProperties.setZoom( rNewProperties.getZoom() );
+#else
+    (void) rNewProperties;
+#endif
 
     if( bBroadcastChanged )
     {
commit 64b3b366da326ca4eeb42c8c6195f21e2c563663
Author: jan Iversen <jani at libreoffice.org>
Date:   Mon Oct 9 19:10:13 2017 +0200

    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

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
             {
commit d9675f7a9b99b7d729b3d5318b905aaf5b2aedec
Author: jan Iversen <jani at libreoffice.org>
Date:   Mon Oct 9 19:09:50 2017 +0200

    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

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
     {
commit 9f89fce1fb913339e8f9c24feef1742195c7fa40
Author: jan Iversen <jani at libreoffice.org>
Date:   Mon Oct 9 19:09:11 2017 +0200

    oox, implement HAVE_FEATURE_AVMEDIA
    
    iOS does not support avmedia, therefore HAVE_FEATURE_AVMEDIA
    is set, however not all sources test for it.
    
    Change-Id: Ia58fb8d7ab524b9763fd9fa3a7d3fa111cb85bb4

diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 312da7938d05..64e916e1033f 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -17,6 +17,8 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include <config_features.h>
+
 #include <config_folders.h>
 #include "rtl/bootstrap.hxx"
 #include "oox/core/xmlfilterbase.hxx"
@@ -968,7 +970,11 @@ void DrawingML::WriteMediaNonVisualProperties(const css::uno::Reference<css::dra
     bool bEmbed = rURL.startsWith("vnd.sun.star.Package:");
 
     // mime type
+#if HAVE_FEATURE_AVMEDIA
     OUString aMimeType(pMediaObj->getMediaProperties().getMimeType());
+#else
+    OUString aMimeType("none");
+#endif
     if (aMimeType == "application/vnd.sun.star.media")
     {
         // try to set something better


More information about the Libreoffice-commits mailing list