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 @@
* 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);
......
......@@ -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 );
......
......@@ -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)
......
......@@ -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
{
......
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