summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2011-12-06 04:36:22 +0100
committerMichael Stahl <mstahl@redhat.com>2011-12-06 04:36:22 +0100
commit431604f9fa603a7acf67985c9e4851f37d9cd580 (patch)
tree2dbbe2e40af935229dbc8f2738dc446ab18a93b8 /sd
parentf3c19f8263f3352ce4efff0965f8000d8347f6a5 (diff)
refactor media embedding completely:
Do the tempfile handling in SdrMediaObj, not in the window; this has the advantage that it works even in the presence of clipboard documents without SfxBaseModels and thus without storage (sc, sw). The SdrMediaObj instances share ownership of a temp file.
Diffstat (limited to 'sd')
-rw-r--r--sd/source/ui/view/sdview4.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/sd/source/ui/view/sdview4.cxx b/sd/source/ui/view/sdview4.cxx
index 4e6218dbeb2e..f42ad34cbc24 100644
--- a/sd/source/ui/view/sdview4.cxx
+++ b/sd/source/ui/view/sdview4.cxx
@@ -287,8 +287,6 @@ SdrMediaObj* View::InsertMediaURL( const rtl::OUString& rMediaURL, sal_Int8& rAc
const Point& rPos, const Size& rSize,
bool const bLink )
{
- uno::Reference<frame::XModel> const xModel(
- GetDoc()->GetObjectShell()->GetModel());
::rtl::OUString realURL;
if (bLink)
{
@@ -296,6 +294,8 @@ SdrMediaObj* View::InsertMediaURL( const rtl::OUString& rMediaURL, sal_Int8& rAc
}
else
{
+ uno::Reference<frame::XModel> const xModel(
+ GetDoc()->GetObjectShell()->GetModel());
bool const bRet = ::avmedia::EmbedMedia(xModel, rMediaURL, realURL);
if (!bRet) { return 0; }
}
@@ -322,7 +322,7 @@ SdrMediaObj* View::InsertMediaURL( const rtl::OUString& rMediaURL, sal_Int8& rAc
if( mnAction == DND_ACTION_LINK && pPickObj && pPV && pPickObj->ISA( SdrMediaObj ) )
{
pNewMediaObj = static_cast< SdrMediaObj* >( pPickObj->Clone() );
- pNewMediaObj->setURL( realURL, (bLink) ? 0 : xModel );
+ pNewMediaObj->setURL( realURL );
BegUndo(String(SdResId(STR_UNDO_DRAGDROP)));
ReplaceObjectAtView(pPickObj, *pPV, pNewMediaObj);
@@ -353,7 +353,7 @@ SdrMediaObj* View::InsertMediaURL( const rtl::OUString& rMediaURL, sal_Int8& rAc
else
InsertObjectAtView( pNewMediaObj, *pPV, SDRINSERT_SETDEFLAYER );
- pNewMediaObj->setURL( realURL, (bLink) ? 0 : xModel );
+ pNewMediaObj->setURL( realURL );
if( pPickObj )
{