Kaydet (Commit) d9675f7a authored tarafından jan Iversen's avatar jan Iversen

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
üst 9f89fce1
...@@ -17,6 +17,8 @@ ...@@ -17,6 +17,8 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 . * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/ */
#include <config_features.h>
#include <editeng/eeitem.hxx> #include <editeng/eeitem.hxx>
#include <svx/fmobjfac.hxx> #include <svx/fmobjfac.hxx>
...@@ -187,7 +189,9 @@ void ScDLL::Init() ...@@ -187,7 +189,9 @@ void ScDLL::Init()
CharmapPopup::RegisterControl(SID_CHARMAP_CONTROL, pMod ); CharmapPopup::RegisterControl(SID_CHARMAP_CONTROL, pMod );
// Media Controller // Media Controller
#if HAVE_FEATURE_AVMEDIA
::avmedia::MediaToolBoxControl::RegisterControl( SID_AVMEDIA_TOOLBOX, pMod ); ::avmedia::MediaToolBoxControl::RegisterControl( SID_AVMEDIA_TOOLBOX, pMod );
#endif
// Common SFX Controller // Common SFX Controller
::sfx2::sidebar::SidebarChildWindow::RegisterChildWindow(false, pMod); ::sfx2::sidebar::SidebarChildWindow::RegisterChildWindow(false, pMod);
......
...@@ -17,6 +17,8 @@ ...@@ -17,6 +17,8 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 . * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/ */
#include <config_features.h>
#include <sfx2/opengrf.hxx> #include <sfx2/opengrf.hxx>
#include <svx/svdograf.hxx> #include <svx/svdograf.hxx>
#include <svx/svdomedia.hxx> #include <svx/svdomedia.hxx>
...@@ -207,8 +209,12 @@ static void lcl_InsertMedia( const OUString& rMediaURL, bool bApi, ...@@ -207,8 +209,12 @@ static void lcl_InsertMedia( const OUString& rMediaURL, bool bApi,
{ {
uno::Reference<frame::XModel> const xModel( uno::Reference<frame::XModel> const xModel(
rData.GetDocument()->GetDocumentShell()->GetModel()); rData.GetDocument()->GetDocumentShell()->GetModel());
#if HAVE_FEATURE_AVMEDIA
bool const bRet = ::avmedia::EmbedMedia(xModel, rMediaURL, realURL); bool const bRet = ::avmedia::EmbedMedia(xModel, rMediaURL, realURL);
if (!bRet) { return; } if (!bRet) { return; }
#else
return;
#endif
} }
SdrMediaObj* pObj = new SdrMediaObj( tools::Rectangle( aInsertPos, aSize ) ); SdrMediaObj* pObj = new SdrMediaObj( tools::Rectangle( aInsertPos, aSize ) );
...@@ -312,13 +318,18 @@ FuInsertMedia::FuInsertMedia( ScTabViewShell* pViewSh, ...@@ -312,13 +318,18 @@ FuInsertMedia::FuInsertMedia( ScTabViewShell* pViewSh,
} }
bool bLink(true); 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; Size aPrefSize;
if( pWin ) if( pWin )
pWin->EnterWait(); pWin->EnterWait();
#if HAVE_FEATURE_AVMEDIA
if( !::avmedia::MediaWindow::isMediaURL( aURL, ""/*TODO?*/, true, &aPrefSize ) ) if( !::avmedia::MediaWindow::isMediaURL( aURL, ""/*TODO?*/, true, &aPrefSize ) )
{ {
if( pWin ) if( pWin )
...@@ -328,6 +339,7 @@ FuInsertMedia::FuInsertMedia( ScTabViewShell* pViewSh, ...@@ -328,6 +339,7 @@ FuInsertMedia::FuInsertMedia( ScTabViewShell* pViewSh,
::avmedia::MediaWindow::executeFormatErrorBox( pWindow ); ::avmedia::MediaWindow::executeFormatErrorBox( pWindow );
} }
else else
#endif
{ {
lcl_InsertMedia( aURL, bAPI, pViewSh, pWindow, pView, aPrefSize, lcl_InsertMedia( aURL, bAPI, pViewSh, pWindow, pView, aPrefSize,
bLink ); bLink );
......
...@@ -17,6 +17,8 @@ ...@@ -17,6 +17,8 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 . * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/ */
#include <config_features.h>
#include <tools/urlobj.hxx> #include <tools/urlobj.hxx>
#include <svx/fmglob.hxx> #include <svx/fmglob.hxx>
#include <svx/svdouno.hxx> #include <svx/svdouno.hxx>
...@@ -84,10 +86,12 @@ void ScTabViewShell::InsertURLButton( const OUString& rName, const OUString& rUR ...@@ -84,10 +86,12 @@ void ScTabViewShell::InsertURLButton( const OUString& rName, const OUString& rUR
xPropSet->setPropertyValue("ButtonType", uno::Any(form::FormButtonType_URL) ); xPropSet->setPropertyValue("ButtonType", uno::Any(form::FormButtonType_URL) );
#if HAVE_FEATURE_AVMEDIA
if ( ::avmedia::MediaWindow::isMediaURL( rURL, ""/*TODO?*/ ) ) if ( ::avmedia::MediaWindow::isMediaURL( rURL, ""/*TODO?*/ ) )
{ {
xPropSet->setPropertyValue("DispatchURLInternal", uno::Any(true) ); xPropSet->setPropertyValue("DispatchURLInternal", uno::Any(true) );
} }
#endif
Point aPos; Point aPos;
if (pInsPos) if (pInsPos)
......
...@@ -587,6 +587,7 @@ bool ScViewFunc::PasteFile( const Point& rPos, const OUString& rFile, bool bLink ...@@ -587,6 +587,7 @@ bool ScViewFunc::PasteFile( const Point& rPos, const OUString& rFile, bool bLink
OUString aStrURL = aURL.GetMainURL( INetURLObject::DecodeMechanism::NONE ); OUString aStrURL = aURL.GetMainURL( INetURLObject::DecodeMechanism::NONE );
// is it a media URL? // is it a media URL?
#if HAVE_FEATURE_AVMEDIA
if( ::avmedia::MediaWindow::isMediaURL( aStrURL, ""/*TODO?*/ ) ) if( ::avmedia::MediaWindow::isMediaURL( aStrURL, ""/*TODO?*/ ) )
{ {
const SfxStringItem aMediaURLItem( SID_INSERT_AVMEDIA, aStrURL ); const SfxStringItem aMediaURLItem( SID_INSERT_AVMEDIA, aStrURL );
...@@ -594,6 +595,7 @@ bool ScViewFunc::PasteFile( const Point& rPos, const OUString& rFile, bool bLink ...@@ -594,6 +595,7 @@ bool ScViewFunc::PasteFile( const Point& rPos, const OUString& rFile, bool bLink
SID_INSERT_AVMEDIA, SfxCallMode::SYNCHRON, SID_INSERT_AVMEDIA, SfxCallMode::SYNCHRON,
{ &aMediaURLItem }) ); { &aMediaURLItem }) );
} }
#endif
if (!bLink) // for bLink only graphics or URL if (!bLink) // for bLink only graphics or URL
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment