summaryrefslogtreecommitdiff
path: root/sd/source/ui/view
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 /sd/source/ui/view
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 'sd/source/ui/view')
-rw-r--r--sd/source/ui/view/drviewse.cxx4
-rw-r--r--sd/source/ui/view/sdview4.cxx15
2 files changed, 12 insertions, 7 deletions
diff --git a/sd/source/ui/view/drviewse.cxx b/sd/source/ui/view/drviewse.cxx
index 150b7c75df17..556b32328400 100644
--- a/sd/source/ui/view/drviewse.cxx
+++ b/sd/source/ui/view/drviewse.cxx
@@ -1559,7 +1559,7 @@ void DrawViewShell::InsertURLButton(const OUString& rURL, const OUString& rText,
xPropSet->setPropertyValue("TargetFrame" , Any( rTarget ) );
xPropSet->setPropertyValue( "ButtonType" , Any( form::FormButtonType_URL ) );
- if ( ::avmedia::MediaWindow::isMediaURL( rURL ) )
+ if ( ::avmedia::MediaWindow::isMediaURL( rURL, ""/*TODO?*/ ) )
{
xPropSet->setPropertyValue( "DispatchURLInternal" , Any( sal_True ) );
}
@@ -1594,7 +1594,7 @@ void DrawViewShell::InsertURLButton(const OUString& rURL, const OUString& rText,
xPropSet->setPropertyValue( "TargetFrame" , Any( rTarget ) );
xPropSet->setPropertyValue( "ButtonType" , Any( form::FormButtonType_URL ) );
- if ( ::avmedia::MediaWindow::isMediaURL( rURL ) )
+ if ( ::avmedia::MediaWindow::isMediaURL( rURL, ""/*TODO?*/ ) )
xPropSet->setPropertyValue( "DispatchURLInternal" , Any( sal_True ) );
Point aPos;
diff --git a/sd/source/ui/view/sdview4.cxx b/sd/source/ui/view/sdview4.cxx
index 16e5f5507114..bd729b51d6e4 100644
--- a/sd/source/ui/view/sdview4.cxx
+++ b/sd/source/ui/view/sdview4.cxx
@@ -301,7 +301,7 @@ SdrMediaObj* View::InsertMediaURL( const OUString& rMediaURL, sal_Int8& rAction,
if( mnAction == DND_ACTION_LINK && pPickObj && pPV && pPickObj->ISA( SdrMediaObj ) )
{
pNewMediaObj = static_cast< SdrMediaObj* >( pPickObj->Clone() );
- pNewMediaObj->setURL( realURL );
+ pNewMediaObj->setURL( realURL, ""/*TODO?*/ );
BegUndo(SD_RESSTR(STR_UNDO_DRAGDROP));
ReplaceObjectAtView(pPickObj, *pPV, pNewMediaObj);
@@ -332,7 +332,12 @@ SdrMediaObj* View::InsertMediaURL( const OUString& rMediaURL, sal_Int8& rAction,
else
InsertObjectAtView( pNewMediaObj, *pPV, SDRINSERT_SETDEFLAYER );
- pNewMediaObj->setURL( realURL );
+ OUString referer;
+ DrawDocShell * sh = GetDocSh();
+ if (sh != 0 && sh->HasName()) {
+ referer = sh->GetMedium()->GetName();
+ }
+ pNewMediaObj->setURL( realURL, referer );
if( pPickObj )
{
@@ -379,7 +384,7 @@ IMPL_LINK_NOARG(View, DropInsertFileHdl)
aCurrentDropFile = aURL.GetMainURL( INetURLObject::NO_DECODE );
- if( !::avmedia::MediaWindow::isMediaURL( aCurrentDropFile ) )
+ if( !::avmedia::MediaWindow::isMediaURL( aCurrentDropFile, ""/*TODO?*/ ) )
{
if( !rGraphicFilter.ImportGraphic( aGraphic, aURL ) )
{
@@ -440,8 +445,8 @@ IMPL_LINK_NOARG(View, DropInsertFileHdl)
{
Size aPrefSize;
- if( ::avmedia::MediaWindow::isMediaURL( aCurrentDropFile ) &&
- ::avmedia::MediaWindow::isMediaURL( aCurrentDropFile, true, &aPrefSize ) )
+ if( ::avmedia::MediaWindow::isMediaURL( aCurrentDropFile, ""/*TODO?*/ ) &&
+ ::avmedia::MediaWindow::isMediaURL( aCurrentDropFile, ""/*TODO?*/, true, &aPrefSize ) )
{
if( aPrefSize.Width() && aPrefSize.Height() )
{