summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2013-11-20 14:43:45 +0100
committerStephan Bergmann <sbergman@redhat.com>2013-11-20 14:44:27 +0100
commit5668e73beb30b95abc6520b7432c54972ca3ab2c (patch)
treeb9772e4ab6a6f92d655c0bacbb364ce3b2a4eb18 /sw
parentba1c6c94fce9fd20e224a265475e0b80576a2dd9 (diff)
avmedia: Implement "block untrusted referer links" feature
See f0a9ca24fd4bf79cac908bf0d6fdb8905dc504db "rhbz#887420 Implement 'block untrusted referer links' feature" for details. This adds some further /*TODO?*/ comments, and one known problem (marked /*TODO!*/) is that movies/sounds are not blocked during a slideshow presentation. Change-Id: Ib2d0c7e4f7b02c4bdec0d8a90cee5e7e1bee8325
Diffstat (limited to 'sw')
-rw-r--r--sw/inc/unotxdoc.hxx4
-rw-r--r--sw/source/ui/dochdl/swdtflvr.cxx2
-rw-r--r--sw/source/ui/shells/grfshex.cxx4
-rw-r--r--sw/source/ui/shells/textdrw.cxx2
-rw-r--r--sw/source/ui/uno/unotxdoc.cxx23
5 files changed, 23 insertions, 12 deletions
diff --git a/sw/inc/unotxdoc.hxx b/sw/inc/unotxdoc.hxx
index ccad770c8e83..53f3c52670dc 100644
--- a/sw/inc/unotxdoc.hxx
+++ b/sw/inc/unotxdoc.hxx
@@ -216,6 +216,10 @@ private:
void GetBodyText();
void GetNumberFormatter();
+ css::uno::Reference<css::uno::XInterface> create(
+ OUString const & rServiceName,
+ css::uno::Sequence<css::uno::Any> const * arguments);
+
// used for XRenderable implementation
SfxViewShell * GuessViewShell( /* out */ bool &rbIsSwSrcView, const css::uno::Reference< css::frame::XController > xController = css::uno::Reference< css::frame::XController >() );
SwDoc * GetRenderDoc( SfxViewShell *&rpView, const css::uno::Any& rSelection, bool bIsPDFExport );
diff --git a/sw/source/ui/dochdl/swdtflvr.cxx b/sw/source/ui/dochdl/swdtflvr.cxx
index 3c496c70accb..045cf6c3e4e9 100644
--- a/sw/source/ui/dochdl/swdtflvr.cxx
+++ b/sw/source/ui/dochdl/swdtflvr.cxx
@@ -2478,7 +2478,7 @@ int SwTransferable::_PasteFileName( TransferableDataHelper& rData,
aMediaURL.SetSmartURL( sFile );
const OUString aMediaURLStr( aMediaURL.GetMainURL( INetURLObject::NO_DECODE ) );
- if( ::avmedia::MediaWindow::isMediaURL( aMediaURLStr ) )
+ if( ::avmedia::MediaWindow::isMediaURL( aMediaURLStr, ""/*TODO?*/ ) )
{
const SfxStringItem aMediaURLItem( SID_INSERT_AVMEDIA, aMediaURLStr );
rSh.GetView().GetViewFrame()->GetDispatcher()->Execute(
diff --git a/sw/source/ui/shells/grfshex.cxx b/sw/source/ui/shells/grfshex.cxx
index 1c7ea14300ca..60988bac1736 100644
--- a/sw/source/ui/shells/grfshex.cxx
+++ b/sw/source/ui/shells/grfshex.cxx
@@ -86,7 +86,7 @@ bool SwTextShell::InsertMediaDlg( SfxRequest& rReq )
if( pWindow )
pWindow->EnterWait();
- if( !::avmedia::MediaWindow::isMediaURL( aURL, true, &aPrefSize ) )
+ if( !::avmedia::MediaWindow::isMediaURL( aURL, "", true, &aPrefSize ) )
{
if( pWindow )
pWindow->LeaveWait();
@@ -138,7 +138,7 @@ bool SwTextShell::InsertMediaDlg( SfxRequest& rReq )
SdrMediaObj* pObj = new SdrMediaObj( Rectangle( aPos, aSize ) );
pObj->SetModel(rSh.GetDoc()->GetDrawModel()); // set before setURL
- pObj->setURL( realURL );
+ pObj->setURL( realURL, "" );
rSh.EnterStdMode();
rSh.SwFEShell::InsertDrawObj( *pObj, aPos );
bRet = true;
diff --git a/sw/source/ui/shells/textdrw.cxx b/sw/source/ui/shells/textdrw.cxx
index a85ed464ff0f..5b49b0e4597f 100644
--- a/sw/source/ui/shells/textdrw.cxx
+++ b/sw/source/ui/shells/textdrw.cxx
@@ -104,7 +104,7 @@ void SwBaseShell::InsertURLButton(const OUString& rURL, const OUString& rTarget,
aTmp.setValue( &eButtonType, ::getCppuType((const form::FormButtonType*)0));
xPropSet->setPropertyValue( "ButtonType", aTmp );
- if ( ::avmedia::MediaWindow::isMediaURL( rURL ) )
+ if ( ::avmedia::MediaWindow::isMediaURL( rURL, ""/*TODO?*/ ) )
{
// #105638# OJ
aTmp <<= sal_True;
diff --git a/sw/source/ui/uno/unotxdoc.cxx b/sw/source/ui/uno/unotxdoc.cxx
index d14009bcc271..888109aaff1a 100644
--- a/sw/source/ui/uno/unotxdoc.cxx
+++ b/sw/source/ui/uno/unotxdoc.cxx
@@ -1631,8 +1631,9 @@ void SwXTextDocument::InitNewDoc()
}
#define COM_SUN_STAR__DRAWING_LENGTH 13
-Reference< XInterface > SwXTextDocument::createInstance(const OUString& rServiceName)
- throw( Exception, RuntimeException )
+css::uno::Reference<css::uno::XInterface> SwXTextDocument::create(
+ OUString const & rServiceName,
+ css::uno::Sequence<css::uno::Any> const * arguments)
{
SolarMutexGuard aGuard;
if(!IsValid())
@@ -1715,7 +1716,10 @@ Reference< XInterface > SwXTextDocument::createInstance(const OUString& rServic
aTmpServiceName = "com.sun.star.drawing.OLE2Shape";
}
//here search for the draw service
- Reference< XInterface > xTmp = SvxFmMSFactory::createInstance(aTmpServiceName);
+ Reference< XInterface > xTmp = arguments == 0
+ ? SvxFmMSFactory::createInstance(aTmpServiceName)
+ : SvxFmMSFactory::createInstanceWithArguments(
+ aTmpServiceName, *arguments);
if(bShape)
{
nIndex = COM_SUN_STAR__DRAWING_LENGTH;
@@ -1735,15 +1739,18 @@ Reference< XInterface > SwXTextDocument::createInstance(const OUString& rServic
return xRet;
}
+Reference< XInterface > SwXTextDocument::createInstance(const OUString& rServiceName)
+ throw( Exception, RuntimeException )
+{
+ return create(rServiceName, 0);
+}
+
Reference< XInterface > SwXTextDocument::createInstanceWithArguments(
const OUString& ServiceSpecifier,
- const Sequence< Any >& /*Arguments*/)
+ const Sequence< Any >& Arguments)
throw( Exception, RuntimeException )
{
- Reference< XInterface > xInt = createInstance(ServiceSpecifier);
- // The Any-Sequence is for initializing objects that are dependent
- // on parameters necessarily - so far we have not.
- return xInt;
+ return create(ServiceSpecifier, &Arguments);
}
Sequence< OUString > SwXTextDocument::getAvailableServiceNames(void)